]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/wxp.i
- Moved the header in the .i files out of the code that gets put into
[wxWidgets.git] / utils / wxPython / src / wxp.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 wxp
14
15
16 %{
17
18 #ifdef __WXMSW__
19 #include <windows.h>
20 #undef FindWindow
21 #undef GetCharWidth
22 #undef LoadAccelerators
23 #endif
24
25
26 #include "helpers.h"
27 %}
28
29 //----------------------------------------------------------------------
30 // This is where we include the other wrapper definition files for SWIG
31 //----------------------------------------------------------------------
32
33 %include typemaps.i
34 %include my_typemaps.i
35 %include _defs.i
36
37 %import misc.i
38 %import windows.i
39 %import events.i
40 %import gdi.i
41 %import mdi.i
42 %import controls.i
43 %import controls2.i
44 %import windows2.i
45 %import cmndlgs.i
46
47
48
49 %native(_wxStart) __wxStart;
50 %native(_wxSetDictionary) __wxSetDictionary;
51
52 //---------------------------------------------------------------------------
53
54 #define __version__ "0.3.1"
55
56 wxPoint wxPyDefaultPosition;
57 wxSize wxPyDefaultSize;
58
59 //---------------------------------------------------------------------------
60 //---------------------------------------------------------------------------
61
62 class wxPyApp : public wxEvtHandler {
63 public:
64 %addmethods {
65 wxPyApp() {
66 wxPythonApp = new wxPyApp();
67 return wxPythonApp;
68 }
69 }
70
71
72 wxString GetAppName();
73 #ifdef __WXMSW__
74 bool GetAuto3D();
75 #endif
76 wxString GetClassName();
77 bool GetExitOnFrameDelete();
78 int GetPrintMode();
79 wxWindow * GetTopWindow();
80 wxString GetVendorName();
81
82 void Dispatch();
83 void ExitMainLoop();
84 bool Initialized();
85 int MainLoop();
86 bool Pending();
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 // This one is wxPython specific. If you override MainLoop,
99 // call this when done.
100 void AfterMainLoop();
101 };
102
103
104 //---------------------------------------------------------------------------
105 //---------------------------------------------------------------------------
106
107
108 %{
109 #ifdef __WXMSW__ // If building for win32...
110 extern HINSTANCE wxhInstance;
111
112 BOOL WINAPI DllMain(
113 HINSTANCE hinstDLL, // handle to DLL module
114 DWORD fdwReason, // reason for calling function
115 LPVOID lpvReserved // reserved
116 )
117 {
118 wxhInstance = hinstDLL;
119 return 1;
120 }
121 #endif
122
123 %}
124
125
126
127
128 //----------------------------------------------------------------------
129 // This code gets added to the module initialization function
130 //----------------------------------------------------------------------
131
132 %{
133 extern "C" SWIGEXPORT(void,initwindowsc)();
134 extern "C" SWIGEXPORT(void,initwindows2c)();
135 extern "C" SWIGEXPORT(void,initeventsc)();
136 extern "C" SWIGEXPORT(void,initmiscc)();
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
143 %}
144
145 %init %{
146 // We don't want to run the wxEntry or OnInit yet, so we just do the
147 // beginings of what it would have done... See __wxStart() for the
148 // rest.
149 #ifdef __WXMSW__
150 wxApp::Initialize((WXHINSTANCE)wxhInstance);
151 #endif
152 #ifdef __WXGTK__
153 wxApp::CommonInit();
154 #endif
155
156
157 // wxPyWindows = new wxHashTable(wxKEY_INTEGER, 100);
158
159 // Since these modules are all linked together, initialize them now
160 // because python won't be able to find their shared library files,
161 // (since there isn't any.)
162 initwindowsc();
163 initwindows2c();
164 initeventsc();
165 initmiscc();
166 initgdic();
167 initmdic();
168 initcontrolsc();
169 initcontrols2c();
170 initcmndlgsc();
171 %}
172
173 //----------------------------------------------------------------------
174 // And this gets appended to the shadow class file.
175 //----------------------------------------------------------------------
176
177 %pragma(python) include="_extras.py";
178
179
180 /////////////////////////////////////////////////////////////////////////////
181 //
182 // $Log$
183 // Revision 1.3 1998/08/15 07:36:53 RD
184 // - Moved the header in the .i files out of the code that gets put into
185 // the .cpp files. It caused CVS conflicts because of the RCS ID being
186 // different each time.
187 //
188 // - A few minor fixes.
189 //
190 // Revision 1.2 1998/08/14 23:36:49 RD
191 // Beginings of wxGTK compatibility
192 //
193 // Revision 1.1 1998/08/09 08:25:53 RD
194 // Initial version
195 //
196 //
197
198