]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/wx.i
Fixed wxImage GetData and SetData to properly use String objects for
[wxWidgets.git] / utils / wxPython / src / wx.i
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 //----------------------------------------------------------------------
21 // This is where we include the other wrapper definition files for SWIG
22 //----------------------------------------------------------------------
23
24 %include typemaps.i
25 %include my_typemaps.i
26 %include _defs.i
27
28 %include pointer.i
29
30 %import misc.i
31 %import misc2.i
32 %import windows.i
33 %import events.i
34 %import gdi.i
35 %import mdi.i
36 %import controls.i
37 %import controls2.i
38 %import windows2.i
39 %import cmndlgs.i
40 %import stattool.i
41 %import frames.i
42 %import windows3.i
43 %import image.i
44 %import printfw.i
45
46
47 %native(_wxStart) __wxStart;
48 %native(_wxSetDictionary) __wxSetDictionary;
49
50 //---------------------------------------------------------------------------
51
52 #define __version__ "2.1b2"
53
54 wxPoint wxPyDefaultPosition;
55 wxSize wxPyDefaultSize;
56
57 //---------------------------------------------------------------------------
58 //---------------------------------------------------------------------------
59
60 class wxPyApp : public wxEvtHandler {
61 public:
62 %addmethods {
63 wxPyApp() {
64 wxPythonApp = new wxPyApp();
65 return wxPythonApp;
66 }
67 }
68
69 ~wxPyApp();
70
71 wxString GetAppName();
72 #ifdef __WXMSW__
73 bool GetAuto3D();
74 #endif
75 wxString GetClassName();
76 bool GetExitOnFrameDelete();
77 int GetPrintMode();
78 wxWindow * GetTopWindow();
79 wxString GetVendorName();
80
81 void Dispatch();
82 void ExitMainLoop();
83 bool Initialized();
84 int MainLoop();
85 bool Pending();
86 bool ProcessIdle();
87
88 void SetAppName(const wxString& name);
89 #ifdef __WXMSW__
90 void SetAuto3D(bool auto3D);
91 #endif
92 void SetClassName(const wxString& name);
93 void SetExitOnFrameDelete(bool flag);
94 void SetPrintMode(int mode);
95 void SetTopWindow(wxWindow* window);
96 void SetVendorName(const wxString& name);
97
98 wxIcon GetStdIcon(int which);
99
100
101 };
102
103
104 //----------------------------------------------------------------------
105 // An instance of this object is created in the main wx module. As long
106 // as there are no extra references to it then when the wx module is being
107 // unloaded from memory then this object's destructor will be called. When
108 // it is then we'll use that as a signal to clean up wxWindows
109
110 %{
111 class __wxPyCleanup {
112 public:
113 __wxPyCleanup() { }
114 ~__wxPyCleanup() { wxApp::CleanUp(); }
115 };
116 %}
117
118 // now to swigify it...
119 class __wxPyCleanup {
120 public:
121 __wxPyCleanup();
122 ~__wxPyCleanup();
123 };
124
125
126
127 //----------------------------------------------------------------------
128 // This code gets added to the module initialization function
129 //----------------------------------------------------------------------
130
131 %{
132 extern "C" SWIGEXPORT(void,initwindowsc)();
133 extern "C" SWIGEXPORT(void,initwindows2c)();
134 extern "C" SWIGEXPORT(void,initeventsc)();
135 extern "C" SWIGEXPORT(void,initmiscc)();
136 extern "C" SWIGEXPORT(void,initmisc2c)();
137 extern "C" SWIGEXPORT(void,initgdic)();
138 extern "C" SWIGEXPORT(void,initmdic)();
139 extern "C" SWIGEXPORT(void,initcontrolsc)();
140 extern "C" SWIGEXPORT(void,initcontrols2c)();
141 extern "C" SWIGEXPORT(void,initcmndlgsc)();
142 extern "C" SWIGEXPORT(void,initstattoolc)();
143 extern "C" SWIGEXPORT(void,initframesc)();
144 extern "C" SWIGEXPORT(void,initwindows3c)();
145 extern "C" SWIGEXPORT(void,initimagec)();
146 extern "C" SWIGEXPORT(void,initprintfwc)();
147 #ifndef SEPARATE
148 extern "C" SWIGEXPORT(void,initutilsc)();
149 //extern "C" SWIGEXPORT(void,initoglc)();
150 extern "C" SWIGEXPORT(void,initglcanvasc)();
151 #endif
152 %}
153
154
155
156 %init %{
157
158 __wxPreStart(); // initialize the GUI toolkit, if needed.
159
160
161 // Since these modules are all linked together, initialize them now
162 // because python won't be able to find their shared library files,
163 // (since there isn't any.)
164 initwindowsc();
165 initwindows2c();
166 initeventsc();
167 initmiscc();
168 initmisc2c();
169 initgdic();
170 initmdic();
171 initcontrolsc();
172 initcontrols2c();
173 initcmndlgsc();
174 initstattoolc();
175 initframesc();
176 initwindows3c();
177 initimagec();
178 initprintfwc();
179 #ifndef SEPARATE
180 initutilsc();
181 // initoglc();
182 #ifdef WITH_GLCANVAS
183 initglcanvasc();
184 #endif
185 #endif
186 %}
187
188 //----------------------------------------------------------------------
189 // And this gets appended to the shadow class file.
190 //----------------------------------------------------------------------
191
192 %pragma(python) include="_extras.py";
193
194