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 #define __version__ "0.0.0" // The real value is now in setup.py...
61 wxPoint wxDefaultPosition;
65 //---------------------------------------------------------------------------
66 //---------------------------------------------------------------------------
69 wxPYAPP_ASSERT_SUPPRESS = 1,
70 wxPYAPP_ASSERT_EXCEPTION = 2,
71 wxPYAPP_ASSERT_DIALOG = 4,
72 wxPYAPP_ASSERT_LOG = 8
76 class wxPyApp : public wxEvtHandler {
80 wxPythonApp = new wxPyApp();
87 void _setCallbackInfo(PyObject* self, PyObject* _class);
88 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyApp)"
89 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
92 wxString GetAppName();
96 wxString GetClassName();
97 bool GetExitOnFrameDelete();
99 wxWindow * GetTopWindow();
100 wxString GetVendorName();
101 bool GetUseBestVisual();
109 bool Yield(bool onlyIfNeeded = FALSE);
111 void SetAppName(const wxString& name);
113 void SetAuto3D(bool auto3D);
115 void SetClassName(const wxString& name);
116 void SetExitOnFrameDelete(bool flag);
117 void SetPrintMode(int mode);
118 void SetTopWindow(wxWindow* window);
119 void SetVendorName(const wxString& name);
120 void SetUseBestVisual(bool flag);
123 void SetAssertMode(int mode);
126 static bool GetMacDefaultEncodingIsPC();
127 static bool GetMacSupportPCMenuShortcuts();
128 static long GetMacAboutMenuItemId();
129 static long GetMacPreferencesMenuItemId();
130 static long GetMacExitMenuItemId();
131 static wxString GetMacHelpMenuTitleName();
133 static void SetMacDefaultEncodingIsPC(bool val);
134 static void SetMacSupportPCMenuShortcuts(bool val);
135 static void SetMacAboutMenuItemId(long val);
136 static void SetMacPreferencesMenuItemId(long val);
137 static void SetMacExitMenuItemId(long val);
138 static void SetMacHelpMenuTitleName(const wxString& val);
142 wxPyApp* wxGetApp() {
143 //return wxPythonApp;
144 return (wxPyApp*)wxTheApp;
149 //----------------------------------------------------------------------
150 // this is used to cleanup after wxWindows when Python shuts down.
153 void wxApp_CleanUp() {
158 //----------------------------------------------------------------------
159 // This code gets added to the module initialization function
160 //----------------------------------------------------------------------
165 extern "C" SWIGEXPORT(void) initwindowsc();
166 extern "C" SWIGEXPORT(void) initwindows2c();
167 extern "C" SWIGEXPORT(void) initeventsc();
168 extern "C" SWIGEXPORT(void) initmiscc();
169 extern "C" SWIGEXPORT(void) initmisc2c();
170 extern "C" SWIGEXPORT(void) initgdic();
171 extern "C" SWIGEXPORT(void) initmdic();
172 extern "C" SWIGEXPORT(void) initcontrolsc();
173 extern "C" SWIGEXPORT(void) initcontrols2c();
174 extern "C" SWIGEXPORT(void) initcmndlgsc();
175 extern "C" SWIGEXPORT(void) initstattoolc();
176 extern "C" SWIGEXPORT(void) initframesc();
177 extern "C" SWIGEXPORT(void) initwindows3c();
178 extern "C" SWIGEXPORT(void) initimagec();
179 extern "C" SWIGEXPORT(void) initprintfwc();
180 extern "C" SWIGEXPORT(void) initsizersc();
181 extern "C" SWIGEXPORT(void) initclip_dndc();
182 extern "C" SWIGEXPORT(void) initstreamsc();
183 extern "C" SWIGEXPORT(void) initfilesysc();
184 extern "C" SWIGEXPORT(void) initutilsc();
185 extern "C" SWIGEXPORT(void) initfontsc();
189 // Export a C API in a struct. Other modules will be able to load this from
190 // the wxc module and will then have safe access to these functions, even if
191 // in another shared library.
192 static wxPyCoreAPI API = {
193 (p_SWIG_MakePtr_t)SWIG_MakePtr,
194 (p_SWIG_GetPtr_t)SWIG_GetPtr,
195 (p_SWIG_GetPtrObj_t)SWIG_GetPtrObj,
196 (p_SWIG_RegisterMapping_t)SWIG_RegisterMapping,
197 (p_SWIG_addvarlink_t)SWIG_addvarlink,
198 (p_SWIG_newvarlink_t)SWIG_newvarlink,
200 wxPyBeginAllowThreads,
202 wxPyBeginBlockThreads,
217 wxBitmap_LIST_helper,
218 wxString_LIST_helper,
219 wxAcceleratorEntry_LIST_helper,
226 wxPoint2DDouble_helper,
228 wxPyCBH_setCallbackInfo,
229 wxPyCBH_findCallback,
230 wxPyCBH_callCallback,
231 wxPyCBH_callCallbackObj,
238 wxArrayString2PyList_helper,
239 wxArrayInt2PyList_helper,
243 wxPyOORClientData_dtor,
245 wxPyCBInputStream_create
254 // Make our API structure a CObject so other modules can import it
256 PyObject* v = PyCObject_FromVoidPtr(&API, NULL);
257 PyDict_SetItemString(d,"wxPyCoreAPI", v);
261 __wxPreStart(d); // initialize the GUI toolkit, if needed.
264 // Since these modules are all linked together, initialize them now
265 // because Python won't be able to find their shared library files,
266 // (since there isn't any.)
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_NUMBER", PyInt_FromLong((long)wxRELEASE_NUMBER ));
293 PyDict_SetItemString(d,"wxVERSION_NUMBER", PyInt_FromLong((long)wxVERSION_NUMBER ));
295 wxString tempStr(wxVERSION_STRING);
296 PyDict_SetItemString(d,"wxVERSION_STRING", PyUnicode_FromWideChar(tempStr.c_str(), tempStr.Len()));
298 PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString(wxVERSION_STRING));
304 //----------------------------------------------------------------------
305 // And this gets appended to the shadow class file.
306 //----------------------------------------------------------------------
308 %pragma(python) include="_extras.py";