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();
90 wxString GetClassName();
91 bool GetExitOnFrameDelete();
93 wxWindow * GetTopWindow();
94 wxString GetVendorName();
95 bool GetUseBestVisual();
103 bool Yield(bool onlyIfNeeded = FALSE);
105 void SetAppName(const wxString& name);
106 void SetClassName(const wxString& name);
107 void SetExitOnFrameDelete(bool flag);
108 void SetPrintMode(int mode);
109 void SetTopWindow(wxWindow* window);
110 void SetVendorName(const wxString& name);
111 void SetUseBestVisual(bool flag);
114 void SetAssertMode(int mode);
117 static bool GetMacSupportPCMenuShortcuts();
118 static long GetMacAboutMenuItemId();
119 static long GetMacPreferencesMenuItemId();
120 static long GetMacExitMenuItemId();
121 static wxString GetMacHelpMenuTitleName();
123 static void SetMacSupportPCMenuShortcuts(bool val);
124 static void SetMacAboutMenuItemId(long val);
125 static void SetMacPreferencesMenuItemId(long val);
126 static void SetMacExitMenuItemId(long val);
127 static void SetMacHelpMenuTitleName(const wxString& val);
131 wxPyApp* wxGetApp() {
132 //return wxPythonApp;
133 return (wxPyApp*)wxTheApp;
138 //----------------------------------------------------------------------
139 // this is used to cleanup after wxWindows when Python shuts down.
142 void wxApp_CleanUp() {
147 //----------------------------------------------------------------------
148 // This code gets added to the module initialization function
149 //----------------------------------------------------------------------
154 extern "C" SWIGEXPORT(void) initwindowsc();
155 extern "C" SWIGEXPORT(void) initwindows2c();
156 extern "C" SWIGEXPORT(void) initeventsc();
157 extern "C" SWIGEXPORT(void) initmiscc();
158 extern "C" SWIGEXPORT(void) initmisc2c();
159 extern "C" SWIGEXPORT(void) initgdic();
160 extern "C" SWIGEXPORT(void) initmdic();
161 extern "C" SWIGEXPORT(void) initcontrolsc();
162 extern "C" SWIGEXPORT(void) initcontrols2c();
163 extern "C" SWIGEXPORT(void) initcmndlgsc();
164 extern "C" SWIGEXPORT(void) initstattoolc();
165 extern "C" SWIGEXPORT(void) initframesc();
166 extern "C" SWIGEXPORT(void) initwindows3c();
167 extern "C" SWIGEXPORT(void) initimagec();
168 extern "C" SWIGEXPORT(void) initprintfwc();
169 extern "C" SWIGEXPORT(void) initsizersc();
170 extern "C" SWIGEXPORT(void) initclip_dndc();
171 extern "C" SWIGEXPORT(void) initstreamsc();
172 extern "C" SWIGEXPORT(void) initfilesysc();
173 extern "C" SWIGEXPORT(void) initutilsc();
174 extern "C" SWIGEXPORT(void) initfontsc();
178 // Export a C API in a struct. Other modules will be able to load this from
179 // the wxc module and will then have safe access to these functions, even if
180 // in another shared library.
181 static wxPyCoreAPI API = {
182 (p_SWIG_MakePtr_t)SWIG_MakePtr,
183 (p_SWIG_GetPtr_t)SWIG_GetPtr,
184 (p_SWIG_GetPtrObj_t)SWIG_GetPtrObj,
185 (p_SWIG_RegisterMapping_t)SWIG_RegisterMapping,
186 (p_SWIG_addvarlink_t)SWIG_addvarlink,
187 (p_SWIG_newvarlink_t)SWIG_newvarlink,
189 wxPyBeginAllowThreads,
191 wxPyBeginBlockThreads,
206 wxBitmap_LIST_helper,
207 wxString_LIST_helper,
208 wxAcceleratorEntry_LIST_helper,
215 wxPoint2DDouble_helper,
217 wxPyCBH_setCallbackInfo,
218 wxPyCBH_findCallback,
219 wxPyCBH_callCallback,
220 wxPyCBH_callCallbackObj,
227 wxArrayString2PyList_helper,
228 wxArrayInt2PyList_helper,
232 wxPyOORClientData_dtor,
234 wxPyCBInputStream_create
243 // Make our API structure a CObject so other modules can import it
245 PyObject* v = PyCObject_FromVoidPtr(&API, NULL);
246 PyDict_SetItemString(d,"wxPyCoreAPI", v);
250 __wxPreStart(d); // initialize the GUI toolkit, if needed.
253 // Since these modules are all linked together, initialize them now
254 // because Python won't be able to find their shared library files,
255 // (since there isn't any.)
279 // Although these are redfined in __version__ they need to be here too so
280 // that an assert can be done to ensure that the wxPython and the wxWindows
282 PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION ));
283 PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION ));
284 PyDict_SetItemString(d,"wxRELEASE_VERSION", PyInt_FromLong((long)wxRELEASE_NUMBER ));
288 //----------------------------------------------------------------------
289 // And this gets appended to the shadow class file.
290 //----------------------------------------------------------------------
292 %pragma(python) include="_extras.py";