]>
Commit | Line | Data |
---|---|---|
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 | %import sizers.i | |
46 | ||
47 | ||
48 | %native(_wxStart) __wxStart; | |
49 | %native(_wxSetDictionary) __wxSetDictionary; | |
50 | ||
51 | //--------------------------------------------------------------------------- | |
52 | ||
53 | ||
54 | #define __version__ "0.0.0" // The real value is in build.py... | |
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 | ~wxPyApp(); | |
72 | ||
73 | wxString GetAppName(); | |
74 | #ifdef __WXMSW__ | |
75 | bool GetAuto3D(); | |
76 | #endif | |
77 | wxString GetClassName(); | |
78 | bool GetExitOnFrameDelete(); | |
79 | int GetPrintMode(); | |
80 | wxWindow * GetTopWindow(); | |
81 | wxString GetVendorName(); | |
82 | ||
83 | void Dispatch(); | |
84 | void ExitMainLoop(); | |
85 | bool Initialized(); | |
86 | int MainLoop(); | |
87 | bool Pending(); | |
88 | bool ProcessIdle(); | |
89 | ||
90 | void SetAppName(const wxString& name); | |
91 | #ifdef __WXMSW__ | |
92 | void SetAuto3D(bool auto3D); | |
93 | #endif | |
94 | void SetClassName(const wxString& name); | |
95 | void SetExitOnFrameDelete(bool flag); | |
96 | void SetPrintMode(int mode); | |
97 | void SetTopWindow(wxWindow* window); | |
98 | void SetVendorName(const wxString& name); | |
99 | ||
100 | wxIcon GetStdIcon(int which); | |
101 | ||
102 | ||
103 | }; | |
104 | ||
105 | ||
106 | //---------------------------------------------------------------------- | |
107 | // An instance of this object is created in the main wx module. As long | |
108 | // as there are no extra references to it then when the wx module is being | |
109 | // unloaded from memory then this object's destructor will be called. When | |
110 | // it is then we'll use that as a signal to clean up wxWindows | |
111 | ||
112 | %{ | |
113 | class __wxPyCleanup { | |
114 | public: | |
115 | __wxPyCleanup() { } | |
116 | ~__wxPyCleanup() { wxApp::CleanUp(); } | |
117 | }; | |
118 | %} | |
119 | ||
120 | // now to swigify it... | |
121 | class __wxPyCleanup { | |
122 | public: | |
123 | __wxPyCleanup(); | |
124 | ~__wxPyCleanup(); | |
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) initmisc2c(); | |
138 | extern "C" SWIGEXPORT(void) initgdic(); | |
139 | extern "C" SWIGEXPORT(void) initmdic(); | |
140 | extern "C" SWIGEXPORT(void) initcontrolsc(); | |
141 | extern "C" SWIGEXPORT(void) initcontrols2c(); | |
142 | extern "C" SWIGEXPORT(void) initcmndlgsc(); | |
143 | extern "C" SWIGEXPORT(void) initstattoolc(); | |
144 | extern "C" SWIGEXPORT(void) initframesc(); | |
145 | extern "C" SWIGEXPORT(void) initwindows3c(); | |
146 | extern "C" SWIGEXPORT(void) initimagec(); | |
147 | extern "C" SWIGEXPORT(void) initprintfwc(); | |
148 | extern "C" SWIGEXPORT(void) initsizersc(); | |
149 | %} | |
150 | ||
151 | ||
152 | ||
153 | %init %{ | |
154 | ||
155 | __wxPreStart(); // initialize the GUI toolkit, if needed. | |
156 | ||
157 | ||
158 | // Since these modules are all linked together, initialize them now | |
159 | // because python won't be able to find their shared library files, | |
160 | // (since there isn't any.) | |
161 | initwindowsc(); | |
162 | initwindows2c(); | |
163 | initeventsc(); | |
164 | initmiscc(); | |
165 | initmisc2c(); | |
166 | initgdic(); | |
167 | initmdic(); | |
168 | initcontrolsc(); | |
169 | initcontrols2c(); | |
170 | initcmndlgsc(); | |
171 | initstattoolc(); | |
172 | initframesc(); | |
173 | initwindows3c(); | |
174 | initimagec(); | |
175 | initprintfwc(); | |
176 | initsizersc(); | |
177 | %} | |
178 | ||
179 | //---------------------------------------------------------------------- | |
180 | // And this gets appended to the shadow class file. | |
181 | //---------------------------------------------------------------------- | |
182 | ||
183 | %pragma(python) include="_extras.py"; | |
184 | ||
185 |