]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/wx.i
8aa1b43abfa9130267b0eb8386ba73cfe1bb177e
[wxWidgets.git] / 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 %import sizers.i
46 %import streams.i
47 %import filesys.i
48
49 %native(_wxStart) __wxStart;
50 %native(_wxSetDictionary) __wxSetDictionary;
51
52 //---------------------------------------------------------------------------
53
54
55 #define __version__ "0.0.0" // The real value is now in setup.py...
56
57 wxPoint wxDefaultPosition;
58 wxSize wxDefaultSize;
59
60 //---------------------------------------------------------------------------
61 //---------------------------------------------------------------------------
62
63 class wxPyApp : public wxEvtHandler {
64 public:
65 %addmethods {
66 wxPyApp() {
67 wxPythonApp = new wxPyApp();
68 return wxPythonApp;
69 }
70 }
71
72 ~wxPyApp();
73
74 wxString GetAppName();
75 #ifdef __WXMSW__
76 bool GetAuto3D();
77 #endif
78 wxString GetClassName();
79 bool GetExitOnFrameDelete();
80 int GetPrintMode();
81 wxWindow * GetTopWindow();
82 wxString GetVendorName();
83 bool GetUseBestVisual();
84
85 void Dispatch();
86 void ExitMainLoop();
87 bool Initialized();
88 int MainLoop();
89 bool Pending();
90 bool ProcessIdle();
91
92 void SetAppName(const wxString& name);
93 #ifdef __WXMSW__
94 void SetAuto3D(bool auto3D);
95 #endif
96 void SetClassName(const wxString& name);
97 void SetExitOnFrameDelete(bool flag);
98 void SetPrintMode(int mode);
99 void SetTopWindow(wxWindow* window);
100 void SetVendorName(const wxString& name);
101 void SetUseBestVisual(bool flag);
102 wxIcon GetStdIcon(int which);
103
104
105 };
106
107 %inline %{
108 wxPyApp* wxGetApp() {
109 return wxPythonApp;
110 }
111 %}
112
113 //----------------------------------------------------------------------
114 // this is used to cleanup after wxWindows when Python shuts down.
115
116 %inline %{
117 void wxApp_CleanUp() {
118 __wxCleanup();
119 }
120 %}
121
122 //----------------------------------------------------------------------
123 // This code gets added to the module initialization function
124 //----------------------------------------------------------------------
125
126 %{
127
128
129 extern "C" SWIGEXPORT(void) initwindowsc();
130 extern "C" SWIGEXPORT(void) initwindows2c();
131 extern "C" SWIGEXPORT(void) initeventsc();
132 extern "C" SWIGEXPORT(void) initmiscc();
133 extern "C" SWIGEXPORT(void) initmisc2c();
134 extern "C" SWIGEXPORT(void) initgdic();
135 extern "C" SWIGEXPORT(void) initmdic();
136 extern "C" SWIGEXPORT(void) initcontrolsc();
137 extern "C" SWIGEXPORT(void) initcontrols2c();
138 extern "C" SWIGEXPORT(void) initcmndlgsc();
139 extern "C" SWIGEXPORT(void) initstattoolc();
140 extern "C" SWIGEXPORT(void) initframesc();
141 extern "C" SWIGEXPORT(void) initwindows3c();
142 extern "C" SWIGEXPORT(void) initimagec();
143 extern "C" SWIGEXPORT(void) initprintfwc();
144 extern "C" SWIGEXPORT(void) initsizersc();
145 extern "C" SWIGEXPORT(void) initclip_dndc();
146 extern "C" SWIGEXPORT(void) initstreamsc();
147 extern "C" SWIGEXPORT(void) initfilesysc();
148
149
150
151 // Export a C API in a struct. Other modules will be able to load this from
152 // the wxc module and will then have safe access to these functions, even if
153 // in another shared library.
154 static wxPyCoreAPI API = {
155 SWIG_MakePtr,
156 SWIG_GetPtr,
157 SWIG_GetPtrObj,
158 SWIG_RegisterMapping,
159 SWIG_addvarlink,
160 SWIG_newvarlink,
161
162 wxPySaveThread,
163 wxPyRestoreThread,
164 wxPyConstructObject,
165 wxPy_ConvertList,
166
167 byte_LIST_helper,
168 int_LIST_helper,
169 long_LIST_helper,
170 string_LIST_helper,
171 wxPoint_LIST_helper,
172 wxBitmap_LIST_helper,
173 wxString_LIST_helper,
174 wxAcceleratorEntry_LIST_helper,
175
176 wxSize_helper,
177 wxPoint_helper,
178 wxRealPoint_helper,
179 wxRect_helper,
180 wxColour_helper,
181
182 wxPyCBH_setSelf,
183 wxPyCBH_findCallback,
184 wxPyCBH_callCallback,
185 wxPyCBH_callCallbackObj,
186 wxPyCBH_delete,
187 };
188
189 %}
190
191
192
193 %init %{
194 // Make our API structure a CObject so other modules can import it
195 // from this module.
196 PyObject* v = PyCObject_FromVoidPtr(&API, NULL);
197 PyDict_SetItemString(d,"wxPyCoreAPI", v);
198 Py_XDECREF(v);
199
200
201 __wxPreStart(); // initialize the GUI toolkit, if needed.
202
203
204 // Since these modules are all linked together, initialize them now
205 // because Python won't be able to find their shared library files,
206 // (since there isn't any.)
207 initwindowsc();
208 initwindows2c();
209 initeventsc();
210 initmiscc();
211 initmisc2c();
212 initgdic();
213 initmdic();
214 initcontrolsc();
215 initcontrols2c();
216 initcmndlgsc();
217 initstattoolc();
218 initframesc();
219 initwindows3c();
220 initimagec();
221 initprintfwc();
222 initsizersc();
223 initclip_dndc();
224 initstreamsc();
225 initfilesysc();
226
227 %}
228
229 //----------------------------------------------------------------------
230 // And this gets appended to the shadow class file.
231 //----------------------------------------------------------------------
232
233 %pragma(python) include="_extras.py";
234
235