1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for various functions and such
7 // Created: 3-July-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
18 MAKE_CONST_WXSTRING(FileSelectorPromptStr);
19 MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr);
20 MAKE_CONST_WXSTRING(DirSelectorPromptStr);
22 //---------------------------------------------------------------------------
27 void wxRegisterId(long id);
28 long wxGetCurrentId();
33 MustHaveApp(wxEndBusyCursor);
34 void wxEndBusyCursor();
36 long wxGetElapsedTime(bool resetTimer = True);
38 MustHaveApp(wxGetMousePosition);
40 void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
41 "GetMousePosition() -> (x,y)");
45 bool wxShell(const wxString& command = wxPyEmptyString);
49 int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
50 "GetOsVersion() -> (platform, major, minor)");
52 wxString wxGetOsDescription();
55 // // Parses the wildCard, returning the number of filters.
56 // // Returns 0 if none or if there's a problem,
57 // // The arrays will contain an equal number of items found before the error.
58 // // wildCard is in the form:
59 // // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
60 // int wxParseCommonDialogsFilter(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
62 #if defined(__WXMSW__) || defined(__WXMAC__)
63 long wxGetFreeMemory();
66 long wxGetFreeMemory()
67 { wxPyRaiseNotImplemented(); return 0; }
73 wxSHUTDOWN_POWEROFF, // power off the computer
74 wxSHUTDOWN_REBOOT // shutdown and reboot
77 // Shutdown or reboot the PC
78 MustHaveApp(wxShutdown);
79 bool wxShutdown(wxShutdownFlags wFlags);
82 void wxSleep(int secs);
83 void wxMilliSleep(unsigned long milliseconds);
84 void wxMicroSleep(unsigned long microseconds);
85 %pythoncode { Usleep = MilliSleep }
87 void wxEnableTopLevelWindows(bool enable);
89 wxString wxStripMenuCodes(const wxString& in);
92 wxString wxGetEmailAddress();
93 wxString wxGetHostName();
94 wxString wxGetFullHostName();
95 wxString wxGetUserId();
96 wxString wxGetUserName();
97 wxString wxGetHomeDir();
98 wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
100 unsigned long wxGetProcessId();
107 MustHaveApp(wxFileSelector);
108 wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
109 const wxString& default_path = wxPyEmptyString,
110 const wxString& default_filename = wxPyEmptyString,
111 const wxString& default_extension = wxPyEmptyString,
112 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
114 wxWindow *parent = NULL,
115 int x = -1, int y = -1);
117 // TODO: wxFileSelectorEx
120 // Ask for filename to load
121 MustHaveApp(wxLoadFileSelector);
122 wxString wxLoadFileSelector(const wxString& what,
123 const wxString& extension,
124 const wxString& default_name = wxPyEmptyString,
125 wxWindow *parent = NULL);
127 // Ask for filename to save
128 MustHaveApp(wxSaveFileSelector);
129 wxString wxSaveFileSelector(const wxString& what,
130 const wxString& extension,
131 const wxString& default_name = wxPyEmptyString,
132 wxWindow *parent = NULL);
135 MustHaveApp(wxDirSelector);
136 wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
137 const wxString& defaultPath = wxPyEmptyString,
138 long style = wxDD_DEFAULT_STYLE,
139 const wxPoint& pos = wxDefaultPosition,
140 wxWindow *parent = NULL);
142 MustHaveApp(wxGetTextFromUser);
143 wxString wxGetTextFromUser(const wxString& message,
144 const wxString& caption = wxPyEmptyString,
145 const wxString& default_value = wxPyEmptyString,
146 wxWindow *parent = NULL,
147 int x = -1, int y = -1,
150 MustHaveApp(wxGetPasswordFromUser);
151 wxString wxGetPasswordFromUser(const wxString& message,
152 const wxString& caption = wxPyEmptyString,
153 const wxString& default_value = wxPyEmptyString,
154 wxWindow *parent = NULL);
157 // TODO: Need to custom wrap this one...
158 // int wxGetMultipleChoice(char* message, char* caption,
159 // int LCOUNT, char** choices,
160 // int nsel, int *selection,
161 // wxWindow *parent = NULL, int x = -1, int y = -1,
162 // bool centre = True, int width=150, int height=200);
165 MustHaveApp(wxGetSingleChoice);
166 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
167 int choices, wxString* choices_array,
168 wxWindow *parent = NULL,
169 int x = -1, int y = -1,
171 int width=150, int height=200);
173 MustHaveApp(wxGetSingleChoiceIndex);
174 int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
175 int choices, wxString* choices_array,
176 wxWindow *parent = NULL,
177 int x = -1, int y = -1,
179 int width=150, int height=200);
182 MustHaveApp(wxMessageBox);
183 int wxMessageBox(const wxString& message,
184 const wxString& caption = wxPyEmptyString,
185 int style = wxOK | wxCENTRE,
186 wxWindow *parent = NULL,
187 int x = -1, int y = -1);
189 MustHaveApp(wxGetNumberFromUser);
190 long wxGetNumberFromUser(const wxString& message,
191 const wxString& prompt,
192 const wxString& caption,
194 long min = 0, long max = 100,
195 wxWindow *parent = NULL,
196 const wxPoint& pos = wxDefaultPosition);
200 MustHaveApp(wxColourDisplay);
201 bool wxColourDisplay();
203 MustHaveApp(wxDisplayDepth);
204 int wxDisplayDepth();
206 MustHaveApp(wxGetDisplayDepth);
207 int wxGetDisplayDepth();
209 MustHaveApp(wxDisplaySize);
211 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
212 "DisplaySize() -> (width, height)");
214 MustHaveApp(wxGetDisplaySize);
215 wxSize wxGetDisplaySize();
217 MustHaveApp(wxDisplaySizeMM);
219 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
220 "DisplaySizeMM() -> (width, height)");
222 MustHaveApp(wxGetDisplaySizeMM);
223 wxSize wxGetDisplaySizeMM();
225 MustHaveApp(wxClientDisplayRect);
227 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
228 "ClientDisplayRect() -> (x, y, width, height)");
230 MustHaveApp(wxGetClientDisplayRect);
231 wxRect wxGetClientDisplayRect();
234 MustHaveApp(wxSetCursor);
235 void wxSetCursor(wxCursor& cursor);
239 // Miscellaneous functions
241 MustHaveApp(wxBeginBusyCursor);
242 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
244 MustHaveApp(wxGetActiveWindow);
245 wxWindow * wxGetActiveWindow();
247 MustHaveApp(wxGenericFindWindowAtPoint);
248 wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
250 MustHaveApp(wxFindWindowAtPoint);
251 wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
253 MustHaveApp(wxGetTopLevelParent);
254 wxWindow* wxGetTopLevelParent(wxWindow *win);
256 //bool wxSpawnBrowser(wxWindow *parent, wxString href);
261 MustHaveApp(wxGetKeyState);
263 bool , wxGetKeyState(wxKeyCode key),
264 "Get the state of a key (true if pressed or toggled on, false if not.)
265 This is generally most useful getting the state of the modifier or
266 toggle keys. On some platforms those may be the only keys that work.
271 //---------------------------------------------------------------------------
273 MustHaveApp(wxWakeUpMainThread);
275 #if defined(__WXMSW__) || defined(__WXMAC__)
276 void wxWakeUpMainThread();
279 void wxWakeUpMainThread() {}
284 MustHaveApp(wxMutexGuiEnter);
285 void wxMutexGuiEnter();
287 MustHaveApp(wxMutexGuiLeave);
288 void wxMutexGuiLeave();
291 MustHaveApp(wxMutexGuiLocker);
292 class wxMutexGuiLocker {
299 MustHaveApp(wxThread);
301 bool wxThread_IsMain() {
302 #ifdef WXP_WITH_THREAD
303 return wxThread::IsMain();
310 //---------------------------------------------------------------------------
311 //---------------------------------------------------------------------------