]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/wx.i
Some tweaks and updates
[wxWidgets.git] / utils / wxPython / src / wx.i
CommitLineData
7bf85405
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: wxp.i
3// Purpose: SWIG interface file for a python wxWindows module
4//
5// Author: Robin Dunn
6//
7// Created: 5/22/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
b8b8dda7 13%module wx
03e9bead
RD
14
15
16%{
7bf85405
RD
17#include "helpers.h"
18%}
19
20//----------------------------------------------------------------------
21// This is where we include the other wrapper definition files for SWIG
22//----------------------------------------------------------------------
23
24%include typemaps.i
25%include my_typemaps.i
26%include _defs.i
27
8bf5d46e
RD
28%include pointer.i
29
7bf85405 30%import misc.i
bb0054cd 31%import misc2.i
7bf85405
RD
32%import windows.i
33%import events.i
34%import gdi.i
35%import mdi.i
36%import controls.i
37%import controls2.i
38%import windows2.i
39%import cmndlgs.i
9c039d08
RD
40%import stattool.i
41%import frames.i
08127323 42%import windows3.i
cf694132 43%import image.i
bb0054cd 44%import printfw.i
7bf85405
RD
45
46
47%native(_wxStart) __wxStart;
48%native(_wxSetDictionary) __wxSetDictionary;
49
50//---------------------------------------------------------------------------
51
1afc06c2 52#define __version__ "2.1b4"
7bf85405 53
853b255a
RD
54wxPoint wxPyDefaultPosition;
55wxSize wxPyDefaultSize;
7bf85405
RD
56
57//---------------------------------------------------------------------------
58//---------------------------------------------------------------------------
59
60class wxPyApp : public wxEvtHandler {
61public:
62 %addmethods {
63 wxPyApp() {
64 wxPythonApp = new wxPyApp();
65 return wxPythonApp;
66 }
67 }
68
8bf5d46e 69 ~wxPyApp();
7bf85405
RD
70
71 wxString GetAppName();
853b255a 72#ifdef __WXMSW__
7bf85405 73 bool GetAuto3D();
853b255a 74#endif
7bf85405
RD
75 wxString GetClassName();
76 bool GetExitOnFrameDelete();
77 int GetPrintMode();
78 wxWindow * GetTopWindow();
79 wxString GetVendorName();
80
81 void Dispatch();
82 void ExitMainLoop();
83 bool Initialized();
84 int MainLoop();
85 bool Pending();
8bf5d46e 86 bool ProcessIdle();
7bf85405
RD
87
88 void SetAppName(const wxString& name);
853b255a 89#ifdef __WXMSW__
7bf85405 90 void SetAuto3D(bool auto3D);
853b255a 91#endif
7bf85405
RD
92 void SetClassName(const wxString& name);
93 void SetExitOnFrameDelete(bool flag);
94 void SetPrintMode(int mode);
95 void SetTopWindow(wxWindow* window);
96 void SetVendorName(const wxString& name);
97
8bf5d46e
RD
98 wxIcon GetStdIcon(int which);
99
100
101};
102
103
104//----------------------------------------------------------------------
105// An instance of this object is created in the main wx module. As long
106// as there are no extra references to it then when the wx module is being
107// unloaded from memory then this object's destructor will be called. When
108// it is then we'll use that as a signal to clean up wxWindows
109
110%{
111class __wxPyCleanup {
112public:
113 __wxPyCleanup() { }
114 ~__wxPyCleanup() { wxApp::CleanUp(); }
115};
116%}
117
118// now to swigify it...
119class __wxPyCleanup {
120public:
121 __wxPyCleanup();
122 ~__wxPyCleanup();
7bf85405
RD
123};
124
125
7bf85405
RD
126
127//----------------------------------------------------------------------
128// This code gets added to the module initialization function
129//----------------------------------------------------------------------
130
131%{
1d99702e
RD
132extern "C" SWIGEXPORT(void) initwindowsc();
133extern "C" SWIGEXPORT(void) initwindows2c();
134extern "C" SWIGEXPORT(void) initeventsc();
135extern "C" SWIGEXPORT(void) initmiscc();
136extern "C" SWIGEXPORT(void) initmisc2c();
137extern "C" SWIGEXPORT(void) initgdic();
138extern "C" SWIGEXPORT(void) initmdic();
139extern "C" SWIGEXPORT(void) initcontrolsc();
140extern "C" SWIGEXPORT(void) initcontrols2c();
141extern "C" SWIGEXPORT(void) initcmndlgsc();
142extern "C" SWIGEXPORT(void) initstattoolc();
143extern "C" SWIGEXPORT(void) initframesc();
144extern "C" SWIGEXPORT(void) initwindows3c();
145extern "C" SWIGEXPORT(void) initimagec();
146extern "C" SWIGEXPORT(void) initprintfwc();
0699c864 147%}
08127323 148
7bf85405 149
7bf85405
RD
150
151%init %{
7bf85405 152
0d6f9504 153 __wxPreStart(); // initialize the GUI toolkit, if needed.
7bf85405 154
7bf85405
RD
155
156 // Since these modules are all linked together, initialize them now
157 // because python won't be able to find their shared library files,
158 // (since there isn't any.)
159 initwindowsc();
160 initwindows2c();
161 initeventsc();
162 initmiscc();
bb0054cd 163 initmisc2c();
7bf85405
RD
164 initgdic();
165 initmdic();
166 initcontrolsc();
167 initcontrols2c();
168 initcmndlgsc();
9c039d08
RD
169 initstattoolc();
170 initframesc();
08127323 171 initwindows3c();
cf694132 172 initimagec();
bb0054cd 173 initprintfwc();
7bf85405
RD
174%}
175
176//----------------------------------------------------------------------
177// And this gets appended to the shadow class file.
178//----------------------------------------------------------------------
179
180%pragma(python) include="_extras.py";
181
182