]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/wx.i
New build system for wxPython. (Still needs some polish but is stable
[wxWidgets.git] / utils / wxPython / src / wx.i
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
13 %module wx
14
15
16 %{
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
28 %include pointer.i
29
30 %import misc.i
31 %import misc2.i
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
40 %import stattool.i
41 %import frames.i
42 %import windows3.i
43 %import image.i
44 %import printfw.i
45
46
47 %native(_wxStart) __wxStart;
48 %native(_wxSetDictionary) __wxSetDictionary;
49
50 //---------------------------------------------------------------------------
51
52 #define __version__ "2.1b3"
53
54 wxPoint wxPyDefaultPosition;
55 wxSize wxPyDefaultSize;
56
57 //---------------------------------------------------------------------------
58 //---------------------------------------------------------------------------
59
60 class wxPyApp : public wxEvtHandler {
61 public:
62 %addmethods {
63 wxPyApp() {
64 wxPythonApp = new wxPyApp();
65 return wxPythonApp;
66 }
67 }
68
69 ~wxPyApp();
70
71 wxString GetAppName();
72 #ifdef __WXMSW__
73 bool GetAuto3D();
74 #endif
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();
86 bool ProcessIdle();
87
88 void SetAppName(const wxString& name);
89 #ifdef __WXMSW__
90 void SetAuto3D(bool auto3D);
91 #endif
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
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 %{
111 class __wxPyCleanup {
112 public:
113 __wxPyCleanup() { }
114 ~__wxPyCleanup() { wxApp::CleanUp(); }
115 };
116 %}
117
118 // now to swigify it...
119 class __wxPyCleanup {
120 public:
121 __wxPyCleanup();
122 ~__wxPyCleanup();
123 };
124
125
126
127 //----------------------------------------------------------------------
128 // This code gets added to the module initialization function
129 //----------------------------------------------------------------------
130
131 %{
132 extern "C" SWIGEXPORT(void) initwindowsc();
133 extern "C" SWIGEXPORT(void) initwindows2c();
134 extern "C" SWIGEXPORT(void) initeventsc();
135 extern "C" SWIGEXPORT(void) initmiscc();
136 extern "C" SWIGEXPORT(void) initmisc2c();
137 extern "C" SWIGEXPORT(void) initgdic();
138 extern "C" SWIGEXPORT(void) initmdic();
139 extern "C" SWIGEXPORT(void) initcontrolsc();
140 extern "C" SWIGEXPORT(void) initcontrols2c();
141 extern "C" SWIGEXPORT(void) initcmndlgsc();
142 extern "C" SWIGEXPORT(void) initstattoolc();
143 extern "C" SWIGEXPORT(void) initframesc();
144 extern "C" SWIGEXPORT(void) initwindows3c();
145 extern "C" SWIGEXPORT(void) initimagec();
146 extern "C" SWIGEXPORT(void) initprintfwc();
147 %}
148
149
150
151 %init %{
152
153 __wxPreStart(); // initialize the GUI toolkit, if needed.
154
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();
163 initmisc2c();
164 initgdic();
165 initmdic();
166 initcontrolsc();
167 initcontrols2c();
168 initcmndlgsc();
169 initstattoolc();
170 initframesc();
171 initwindows3c();
172 initimagec();
173 initprintfwc();
174 %}
175
176 //----------------------------------------------------------------------
177 // And this gets appended to the shadow class file.
178 //----------------------------------------------------------------------
179
180 %pragma(python) include="_extras.py";
181
182