1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface file for a python wxWindows module
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
20 //----------------------------------------------------------------------
21 // This is where we include the other wrapper definition files for SWIG
22 //----------------------------------------------------------------------
25 %include my_typemaps.i
52 %native(_wxStart) __wxStart;
53 %native(_wxSetDictionary) __wxSetDictionary;
55 //---------------------------------------------------------------------------
58 wxPoint wxDefaultPosition;
62 //---------------------------------------------------------------------------
63 //---------------------------------------------------------------------------
66 wxPYAPP_ASSERT_SUPPRESS = 1,
67 wxPYAPP_ASSERT_EXCEPTION = 2,
68 wxPYAPP_ASSERT_DIALOG = 4,
69 wxPYAPP_ASSERT_LOG = 8
73 class wxPyApp : public wxEvtHandler {
77 wxPythonApp = new wxPyApp();
84 void _setCallbackInfo(PyObject* self, PyObject* _class);
85 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyApp)"
86 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
89 wxString GetAppName();
93 wxString GetClassName();
94 bool GetExitOnFrameDelete();
96 wxWindow * GetTopWindow();
97 wxString GetVendorName();
98 bool GetUseBestVisual();
106 bool Yield(bool onlyIfNeeded = FALSE);
108 void SetAppName(const wxString& name);
110 void SetAuto3D(bool auto3D);
112 void SetClassName(const wxString& name);
113 void SetExitOnFrameDelete(bool flag);
114 void SetPrintMode(int mode);
115 void SetTopWindow(wxWindow* window);
116 void SetVendorName(const wxString& name);
117 void SetUseBestVisual(bool flag);
120 void SetAssertMode(int mode);
123 static bool GetMacDefaultEncodingIsPC();
124 static bool GetMacSupportPCMenuShortcuts();
125 static long GetMacAboutMenuItemId();
126 static long GetMacPreferencesMenuItemId();
127 static long GetMacExitMenuItemId();
128 static wxString GetMacHelpMenuTitleName();
130 static void SetMacDefaultEncodingIsPC(bool val);
131 static void SetMacSupportPCMenuShortcuts(bool val);
132 static void SetMacAboutMenuItemId(long val);
133 static void SetMacPreferencesMenuItemId(long val);
134 static void SetMacExitMenuItemId(long val);
135 static void SetMacHelpMenuTitleName(const wxString& val);
139 wxPyApp* wxGetApp() {
140 //return wxPythonApp;
141 return (wxPyApp*)wxTheApp;
146 //----------------------------------------------------------------------
147 // this is used to cleanup after wxWindows when Python shuts down.
150 void wxApp_CleanUp() {
155 //----------------------------------------------------------------------
156 // This code gets added to the module initialization function
157 //----------------------------------------------------------------------
162 extern "C" SWIGEXPORT(void) initwindowsc();
163 extern "C" SWIGEXPORT(void) initwindows2c();
164 extern "C" SWIGEXPORT(void) initeventsc();
165 extern "C" SWIGEXPORT(void) initmiscc();
166 extern "C" SWIGEXPORT(void) initmisc2c();
167 extern "C" SWIGEXPORT(void) initgdic();
168 extern "C" SWIGEXPORT(void) initmdic();
169 extern "C" SWIGEXPORT(void) initcontrolsc();
170 extern "C" SWIGEXPORT(void) initcontrols2c();
171 extern "C" SWIGEXPORT(void) initcmndlgsc();
172 extern "C" SWIGEXPORT(void) initstattoolc();
173 extern "C" SWIGEXPORT(void) initframesc();
174 extern "C" SWIGEXPORT(void) initwindows3c();
175 extern "C" SWIGEXPORT(void) initimagec();
176 extern "C" SWIGEXPORT(void) initprintfwc();
177 extern "C" SWIGEXPORT(void) initsizersc();
178 extern "C" SWIGEXPORT(void) initclip_dndc();
179 extern "C" SWIGEXPORT(void) initstreamsc();
180 extern "C" SWIGEXPORT(void) initfilesysc();
181 extern "C" SWIGEXPORT(void) initutilsc();
182 extern "C" SWIGEXPORT(void) initfontsc();
186 // Export a C API in a struct. Other modules will be able to load this from
187 // the wxc module and will then have safe access to these functions, even if
188 // in another shared library.
189 static wxPyCoreAPI API = {
190 (p_SWIG_MakePtr_t)SWIG_MakePtr,
191 (p_SWIG_GetPtr_t)SWIG_GetPtr,
192 (p_SWIG_GetPtrObj_t)SWIG_GetPtrObj,
193 (p_SWIG_RegisterMapping_t)SWIG_RegisterMapping,
194 (p_SWIG_addvarlink_t)SWIG_addvarlink,
195 (p_SWIG_newvarlink_t)SWIG_newvarlink,
197 wxPyBeginAllowThreads,
199 wxPyBeginBlockThreads,
214 wxBitmap_LIST_helper,
215 wxString_LIST_helper,
216 wxAcceleratorEntry_LIST_helper,
223 wxPoint2DDouble_helper,
225 wxPyCBH_setCallbackInfo,
226 wxPyCBH_findCallback,
227 wxPyCBH_callCallback,
228 wxPyCBH_callCallbackObj,
235 wxArrayString2PyList_helper,
236 wxArrayInt2PyList_helper,
240 wxPyOORClientData_dtor,
242 wxPyCBInputStream_create
251 // Make our API structure a CObject so other modules can import it
253 PyObject* v = PyCObject_FromVoidPtr(&API, NULL);
254 PyDict_SetItemString(d,"wxPyCoreAPI", v);
258 __wxPreStart(d); // initialize the GUI toolkit, if needed.
261 // Since these modules are all linked together, initialize them now
262 // because Python won't be able to find their shared library files,
263 // (since there isn't any.)
287 // Although these are redfined in __version__ they need to be here too so
288 // that an assert can be done to ensure that the wxPython and the wxWindows
290 PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION ));
291 PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION ));
292 PyDict_SetItemString(d,"wxRELEASE_VERSION", PyInt_FromLong((long)wxRELEASE_NUMBER ));
296 //----------------------------------------------------------------------
297 // And this gets appended to the shadow class file.
298 //----------------------------------------------------------------------
300 %pragma(python) include="_extras.py";