]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/wxp.i
Beginings of wxGTK compatibility
[wxWidgets.git] / utils / wxPython / src / wxp.i
CommitLineData
7bf85405
RD
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
853b255a 52#define __version__ "0.3.1"
7bf85405 53
853b255a
RD
54wxPoint wxPyDefaultPosition;
55wxSize wxPyDefaultSize;
7bf85405
RD
56
57//---------------------------------------------------------------------------
58//---------------------------------------------------------------------------
59
60class wxPyApp : public wxEvtHandler {
61public:
62 %addmethods {
63 wxPyApp() {
64 wxPythonApp = new wxPyApp();
65 return wxPythonApp;
66 }
67 }
68
69
70 wxString GetAppName();
853b255a 71#ifdef __WXMSW__
7bf85405 72 bool GetAuto3D();
853b255a 73#endif
7bf85405
RD
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);
853b255a 87#ifdef __WXMSW__
7bf85405 88 void SetAuto3D(bool auto3D);
853b255a 89#endif
7bf85405
RD
90 void SetClassName(const wxString& name);
91 void SetExitOnFrameDelete(bool flag);
92 void SetPrintMode(int mode);
93 void SetTopWindow(wxWindow* window);
94 void SetVendorName(const wxString& name);
95
96 // This one is wxPython specific. If you override MainLoop,
97 // call this when done.
98 void AfterMainLoop();
99};
100
101
102//---------------------------------------------------------------------------
103//---------------------------------------------------------------------------
104
105
106%{
107#ifdef __WXMSW__ // If building for win32...
108extern HINSTANCE wxhInstance;
109
110BOOL WINAPI DllMain(
111 HINSTANCE hinstDLL, // handle to DLL module
112 DWORD fdwReason, // reason for calling function
113 LPVOID lpvReserved // reserved
114 )
115{
116 wxhInstance = hinstDLL;
117 return 1;
118}
119#endif
120
121%}
122
123
124
125
126//----------------------------------------------------------------------
127// This code gets added to the module initialization function
128//----------------------------------------------------------------------
129
130%{
131extern "C" SWIGEXPORT(void,initwindowsc)();
132extern "C" SWIGEXPORT(void,initwindows2c)();
133extern "C" SWIGEXPORT(void,initeventsc)();
134extern "C" SWIGEXPORT(void,initmiscc)();
135extern "C" SWIGEXPORT(void,initgdic)();
136extern "C" SWIGEXPORT(void,initmdic)();
137extern "C" SWIGEXPORT(void,initcontrolsc)();
138extern "C" SWIGEXPORT(void,initcontrols2c)();
139extern "C" SWIGEXPORT(void,initcmndlgsc)();
140
141%}
142
143%init %{
144 // We don't want to run the wxEntry or OnInit yet, so we just do the
145 // beginings of what it would have done... See __wxStart() for the
146 // rest.
147#ifdef __WXMSW__
148 wxApp::Initialize((WXHINSTANCE)wxhInstance);
149#endif
150#ifdef __WXGTK__
151 wxApp::CommonInit();
152#endif
153
154
155// wxPyWindows = new wxHashTable(wxKEY_INTEGER, 100);
156
157 // Since these modules are all linked together, initialize them now
158 // because python won't be able to find their shared library files,
159 // (since there isn't any.)
160 initwindowsc();
161 initwindows2c();
162 initeventsc();
163 initmiscc();
164 initgdic();
165 initmdic();
166 initcontrolsc();
167 initcontrols2c();
168 initcmndlgsc();
169%}
170
171//----------------------------------------------------------------------
172// And this gets appended to the shadow class file.
173//----------------------------------------------------------------------
174
175%pragma(python) include="_extras.py";
176
177
178/////////////////////////////////////////////////////////////////////////////
179//
180// $Log$
853b255a
RD
181// Revision 1.2 1998/08/14 23:36:49 RD
182// Beginings of wxGTK compatibility
183//
7bf85405
RD
184// Revision 1.1 1998/08/09 08:25:53 RD
185// Initial version
186//
187//
188
189