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