]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/src/wx.i
Updated the build docs a bit, added wxMetafileDataObject, and some
[wxWidgets.git] / wxPython / src / wx.i
... / ...
CommitLineData
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// %pragma(python) code="
21// # This gives this module's dictionary to the C++ extension code...
22// wxc._wxSetDictionary(vars())
23// "
24
25//----------------------------------------------------------------------
26// This is where we include the other wrapper definition files for SWIG
27//----------------------------------------------------------------------
28
29%include typemaps.i
30%include my_typemaps.i
31%include _defs.i
32
33%include pointer.i
34
35%import misc.i
36%import misc2.i
37%import windows.i
38%import events.i
39%import gdi.i
40%import mdi.i
41%import controls.i
42%import controls2.i
43%import windows2.i
44%import cmndlgs.i
45%import stattool.i
46%import frames.i
47%import windows3.i
48%import image.i
49%import printfw.i
50%import sizers.i
51%import streams.i
52%import filesys.i
53
54%native(_wxStart) __wxStart;
55%native(_wxSetDictionary) __wxSetDictionary;
56
57//---------------------------------------------------------------------------
58
59
60#define __version__ "0.0.0" // The real value is now in setup.py...
61
62%readonly
63wxPoint wxDefaultPosition;
64wxSize wxDefaultSize;
65%readwrite
66
67//---------------------------------------------------------------------------
68//---------------------------------------------------------------------------
69
70class wxPyApp : public wxEvtHandler {
71public:
72 %addmethods {
73 wxPyApp() {
74 wxPythonApp = new wxPyApp();
75 return wxPythonApp;
76 }
77 }
78
79 ~wxPyApp();
80
81 wxString GetAppName();
82#ifdef __WXMSW__
83 bool GetAuto3D();
84#endif
85 wxString GetClassName();
86 bool GetExitOnFrameDelete();
87 int GetPrintMode();
88 wxWindow * GetTopWindow();
89 wxString GetVendorName();
90 bool GetUseBestVisual();
91
92 void Dispatch();
93 void ExitMainLoop();
94 bool Initialized();
95 int MainLoop();
96 bool Pending();
97 bool ProcessIdle();
98
99 void SetAppName(const wxString& name);
100#ifdef __WXMSW__
101 void SetAuto3D(bool auto3D);
102#endif
103 void SetClassName(const wxString& name);
104 void SetExitOnFrameDelete(bool flag);
105 void SetPrintMode(int mode);
106 void SetTopWindow(wxWindow* window);
107 void SetVendorName(const wxString& name);
108 void SetUseBestVisual(bool flag);
109 wxIcon GetStdIcon(int which);
110};
111
112%inline %{
113 wxPyApp* wxGetApp() {
114 return wxPythonApp;
115 }
116%}
117
118
119
120//----------------------------------------------------------------------
121// this is used to cleanup after wxWindows when Python shuts down.
122
123%inline %{
124 void wxApp_CleanUp() {
125 __wxCleanup();
126 }
127%}
128
129//----------------------------------------------------------------------
130// This code gets added to the module initialization function
131//----------------------------------------------------------------------
132
133%{
134
135
136extern "C" SWIGEXPORT(void) initwindowsc();
137extern "C" SWIGEXPORT(void) initwindows2c();
138extern "C" SWIGEXPORT(void) initeventsc();
139extern "C" SWIGEXPORT(void) initmiscc();
140extern "C" SWIGEXPORT(void) initmisc2c();
141extern "C" SWIGEXPORT(void) initgdic();
142extern "C" SWIGEXPORT(void) initmdic();
143extern "C" SWIGEXPORT(void) initcontrolsc();
144extern "C" SWIGEXPORT(void) initcontrols2c();
145extern "C" SWIGEXPORT(void) initcmndlgsc();
146extern "C" SWIGEXPORT(void) initstattoolc();
147extern "C" SWIGEXPORT(void) initframesc();
148extern "C" SWIGEXPORT(void) initwindows3c();
149extern "C" SWIGEXPORT(void) initimagec();
150extern "C" SWIGEXPORT(void) initprintfwc();
151extern "C" SWIGEXPORT(void) initsizersc();
152extern "C" SWIGEXPORT(void) initclip_dndc();
153extern "C" SWIGEXPORT(void) initstreamsc();
154extern "C" SWIGEXPORT(void) initfilesysc();
155
156
157
158// Export a C API in a struct. Other modules will be able to load this from
159// the wxc module and will then have safe access to these functions, even if
160// in another shared library.
161static wxPyCoreAPI API = {
162 SWIG_MakePtr,
163 SWIG_GetPtr,
164 SWIG_GetPtrObj,
165 SWIG_RegisterMapping,
166 SWIG_addvarlink,
167 SWIG_newvarlink,
168
169 wxPyBeginAllowThreads,
170 wxPyEndAllowThreads,
171 wxPyBeginBlockThreads,
172 wxPyEndBlockThreads,
173
174 wxPyConstructObject,
175 wxPy_ConvertList,
176
177 byte_LIST_helper,
178 int_LIST_helper,
179 long_LIST_helper,
180 string_LIST_helper,
181 wxPoint_LIST_helper,
182 wxBitmap_LIST_helper,
183 wxString_LIST_helper,
184 wxAcceleratorEntry_LIST_helper,
185
186 wxSize_helper,
187 wxPoint_helper,
188 wxRealPoint_helper,
189 wxRect_helper,
190 wxColour_helper,
191
192 wxPyCBH_setCallbackInfo,
193 wxPyCBH_findCallback,
194 wxPyCBH_callCallback,
195 wxPyCBH_callCallbackObj,
196 wxPyCBH_delete,
197
198 wxPyClassExists,
199 wxPyMake_wxObject,
200 wxPyMake_wxSizer,
201 wxPyPtrTypeMap_Add,
202 wxArrayString2PyList_helper,
203 wxArrayInt2PyList_helper
204};
205
206
207%}
208
209
210
211%init %{
212 // Make our API structure a CObject so other modules can import it
213 // from this module.
214 PyObject* v = PyCObject_FromVoidPtr(&API, NULL);
215 PyDict_SetItemString(d,"wxPyCoreAPI", v);
216 Py_XDECREF(v);
217
218
219 __wxPreStart(); // initialize the GUI toolkit, if needed.
220
221
222 // Since these modules are all linked together, initialize them now
223 // because Python won't be able to find their shared library files,
224 // (since there isn't any.)
225 initwindowsc();
226 initwindows2c();
227 initeventsc();
228 initmiscc();
229 initmisc2c();
230 initgdic();
231 initmdic();
232 initcontrolsc();
233 initcontrols2c();
234 initcmndlgsc();
235 initstattoolc();
236 initframesc();
237 initwindows3c();
238 initimagec();
239 initprintfwc();
240 initsizersc();
241 initclip_dndc();
242 initstreamsc();
243 initfilesysc();
244
245
246 PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION ));
247 PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION ));
248 PyDict_SetItemString(d,"wxRELEASE_NUMBER", PyInt_FromLong((long)wxRELEASE_NUMBER ));
249 PyDict_SetItemString(d,"wxVERSION_NUMBER", PyInt_FromLong((long)wxVERSION_NUMBER ));
250 PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString(wxVERSION_STRING));
251
252
253%}
254
255//----------------------------------------------------------------------
256// And this gets appended to the shadow class file.
257//----------------------------------------------------------------------
258
259%pragma(python) include="_extras.py";
260
261