]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/wxp.i
Initial version
[wxWidgets.git] / utils / wxPython / src / wxp.i
1 %module wxp
2 %{
3 /////////////////////////////////////////////////////////////////////////////
4 // Name: wxp.i
5 // Purpose: SWIG interface file for a python wxWindows module
6 //
7 // Author: Robin Dunn
8 //
9 // Created: 5/22/98
10 // RCS-ID: $Id$
11 // Copyright: (c) 1998 by Total Control Software
12 // Licence: wxWindows license
13 /////////////////////////////////////////////////////////////////////////////
14
15
16 #ifdef __WXMSW__
17 #include <windows.h>
18 #undef FindWindow
19 #undef GetCharWidth
20 #undef LoadAccelerators
21 #endif
22
23
24 #include "helpers.h"
25 %}
26
27 //----------------------------------------------------------------------
28 // This is where we include the other wrapper definition files for SWIG
29 //----------------------------------------------------------------------
30
31 %include typemaps.i
32 %include my_typemaps.i
33 %include _defs.i
34
35 %import misc.i
36 %import windows.i
37 %import events.i
38 %import gdi.i
39 %import mdi.i
40 %import controls.i
41 %import controls2.i
42 %import windows2.i
43 %import cmndlgs.i
44
45
46
47 %native(_wxStart) __wxStart;
48 %native(_wxSetDictionary) __wxSetDictionary;
49
50 //---------------------------------------------------------------------------
51
52 #define __version__ "0.3.0"
53
54 //%readonly
55 wxPoint wxPyDefaultPosition;
56 wxSize wxPyDefaultSize;
57 //%readwrite
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 bool GetAuto3D();
74 wxString GetClassName();
75 bool GetExitOnFrameDelete();
76 int GetPrintMode();
77 wxWindow * GetTopWindow();
78 wxString GetVendorName();
79
80 void Dispatch();
81 void ExitMainLoop();
82 bool Initialized();
83 int MainLoop();
84 bool Pending();
85
86 void SetAppName(const wxString& name);
87 void SetAuto3D(bool auto3D);
88 void SetClassName(const wxString& name);
89 void SetExitOnFrameDelete(bool flag);
90 void SetPrintMode(int mode);
91 void SetTopWindow(wxWindow* window);
92 void SetVendorName(const wxString& name);
93
94 // This one is wxPython specific. If you override MainLoop,
95 // call this when done.
96 void AfterMainLoop();
97 };
98
99
100 //---------------------------------------------------------------------------
101 //---------------------------------------------------------------------------
102
103
104 %{
105 #ifdef __WXMSW__ // If building for win32...
106 extern HINSTANCE wxhInstance;
107
108 BOOL WINAPI DllMain(
109 HINSTANCE hinstDLL, // handle to DLL module
110 DWORD fdwReason, // reason for calling function
111 LPVOID lpvReserved // reserved
112 )
113 {
114 wxhInstance = hinstDLL;
115 return 1;
116 }
117 #endif
118
119 %}
120
121
122
123
124 //----------------------------------------------------------------------
125 // This code gets added to the module initialization function
126 //----------------------------------------------------------------------
127
128 %{
129 extern "C" SWIGEXPORT(void,initwindowsc)();
130 extern "C" SWIGEXPORT(void,initwindows2c)();
131 extern "C" SWIGEXPORT(void,initeventsc)();
132 extern "C" SWIGEXPORT(void,initmiscc)();
133 extern "C" SWIGEXPORT(void,initgdic)();
134 extern "C" SWIGEXPORT(void,initmdic)();
135 extern "C" SWIGEXPORT(void,initcontrolsc)();
136 extern "C" SWIGEXPORT(void,initcontrols2c)();
137 extern "C" SWIGEXPORT(void,initcmndlgsc)();
138
139 %}
140
141 %init %{
142 // We don't want to run the wxEntry or OnInit yet, so we just do the
143 // beginings of what it would have done... See __wxStart() for the
144 // rest.
145 #ifdef __WXMSW__
146 wxApp::Initialize((WXHINSTANCE)wxhInstance);
147 #endif
148 #ifdef __WXGTK__
149 wxApp::CommonInit();
150 #endif
151
152
153 // wxPyWindows = new wxHashTable(wxKEY_INTEGER, 100);
154
155 // Since these modules are all linked together, initialize them now
156 // because python won't be able to find their shared library files,
157 // (since there isn't any.)
158 initwindowsc();
159 initwindows2c();
160 initeventsc();
161 initmiscc();
162 initgdic();
163 initmdic();
164 initcontrolsc();
165 initcontrols2c();
166 initcmndlgsc();
167 %}
168
169 //----------------------------------------------------------------------
170 // And this gets appended to the shadow class file.
171 //----------------------------------------------------------------------
172
173 %pragma(python) include="_extras.py";
174
175
176 /////////////////////////////////////////////////////////////////////////////
177 //
178 // $Log$
179 // Revision 1.1 1998/08/09 08:25:53 RD
180 // Initial version
181 //
182 //
183
184