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 wxUsleep(unsigned long milliseconds);
84 void wxEnableTopLevelWindows(bool enable);
86 wxString wxStripMenuCodes(const wxString& in);
89 wxString wxGetEmailAddress();
90 wxString wxGetHostName();
91 wxString wxGetFullHostName();
92 wxString wxGetUserId();
93 wxString wxGetUserName();
94 wxString wxGetHomeDir();
95 wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
97 unsigned long wxGetProcessId();
104 MustHaveApp(wxFileSelector);
105 wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
106 const wxString& default_path = wxPyEmptyString,
107 const wxString& default_filename = wxPyEmptyString,
108 const wxString& default_extension = wxPyEmptyString,
109 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
111 wxWindow *parent = NULL,
112 int x = -1, int y = -1);
114 // TODO: wxFileSelectorEx
117 // Ask for filename to load
118 MustHaveApp(wxLoadFileSelector);
119 wxString wxLoadFileSelector(const wxString& what,
120 const wxString& extension,
121 const wxString& default_name = wxPyEmptyString,
122 wxWindow *parent = NULL);
124 // Ask for filename to save
125 MustHaveApp(wxSaveFileSelector);
126 wxString wxSaveFileSelector(const wxString& what,
127 const wxString& extension,
128 const wxString& default_name = wxPyEmptyString,
129 wxWindow *parent = NULL);
132 MustHaveApp(wxDirSelector);
133 wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
134 const wxString& defaultPath = wxPyEmptyString,
135 long style = wxDD_DEFAULT_STYLE,
136 const wxPoint& pos = wxDefaultPosition,
137 wxWindow *parent = NULL);
139 MustHaveApp(wxGetTextFromUser);
140 wxString wxGetTextFromUser(const wxString& message,
141 const wxString& caption = wxPyEmptyString,
142 const wxString& default_value = wxPyEmptyString,
143 wxWindow *parent = NULL,
144 int x = -1, int y = -1,
147 MustHaveApp(wxGetPasswordFromUser);
148 wxString wxGetPasswordFromUser(const wxString& message,
149 const wxString& caption = wxPyEmptyString,
150 const wxString& default_value = wxPyEmptyString,
151 wxWindow *parent = NULL);
154 // TODO: Need to custom wrap this one...
155 // int wxGetMultipleChoice(char* message, char* caption,
156 // int LCOUNT, char** choices,
157 // int nsel, int *selection,
158 // wxWindow *parent = NULL, int x = -1, int y = -1,
159 // bool centre = True, int width=150, int height=200);
162 MustHaveApp(wxGetSingleChoice);
163 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
164 int choices, wxString* choices_array,
165 wxWindow *parent = NULL,
166 int x = -1, int y = -1,
168 int width=150, int height=200);
170 MustHaveApp(wxGetSingleChoiceIndex);
171 int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
172 int choices, wxString* choices_array,
173 wxWindow *parent = NULL,
174 int x = -1, int y = -1,
176 int width=150, int height=200);
179 MustHaveApp(wxMessageBox);
180 int wxMessageBox(const wxString& message,
181 const wxString& caption = wxPyEmptyString,
182 int style = wxOK | wxCENTRE,
183 wxWindow *parent = NULL,
184 int x = -1, int y = -1);
186 MustHaveApp(wxGetNumberFromUser);
187 long wxGetNumberFromUser(const wxString& message,
188 const wxString& prompt,
189 const wxString& caption,
191 long min = 0, long max = 100,
192 wxWindow *parent = NULL,
193 const wxPoint& pos = wxDefaultPosition);
197 MustHaveApp(wxColourDisplay);
198 bool wxColourDisplay();
200 MustHaveApp(wxDisplayDepth);
201 int wxDisplayDepth();
203 MustHaveApp(wxGetDisplayDepth);
204 int wxGetDisplayDepth();
206 MustHaveApp(wxDisplaySize);
208 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
209 "DisplaySize() -> (width, height)");
211 MustHaveApp(wxGetDisplaySize);
212 wxSize wxGetDisplaySize();
214 MustHaveApp(wxDisplaySizeMM);
216 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
217 "DisplaySizeMM() -> (width, height)");
219 MustHaveApp(wxGetDisplaySizeMM);
220 wxSize wxGetDisplaySizeMM();
222 MustHaveApp(wxClientDisplayRect);
224 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
225 "ClientDisplayRect() -> (x, y, width, height)");
227 MustHaveApp(wxGetClientDisplayRect);
228 wxRect wxGetClientDisplayRect();
231 MustHaveApp(wxSetCursor);
232 void wxSetCursor(wxCursor& cursor);
236 // Miscellaneous functions
238 MustHaveApp(wxBeginBusyCursor);
239 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
241 MustHaveApp(wxGetActiveWindow);
242 wxWindow * wxGetActiveWindow();
244 MustHaveApp(wxGenericFindWindowAtPoint);
245 wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
247 MustHaveApp(wxFindWindowAtPoint);
248 wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
250 MustHaveApp(wxGetTopLevelParent);
251 wxWindow* wxGetTopLevelParent(wxWindow *win);
253 //bool wxSpawnBrowser(wxWindow *parent, wxString href);
258 MustHaveApp(wxGetKeyState);
260 bool , wxGetKeyState(wxKeyCode key),
261 "Get the state of a key (true if pressed or toggled on, false if not.)
262 This is generally most useful getting the state of the modifier or
263 toggle keys. On some platforms those may be the only keys that work.
268 //---------------------------------------------------------------------------
270 MustHaveApp(wxWakeUpMainThread);
272 #if defined(__WXMSW__) || defined(__WXMAC__)
273 void wxWakeUpMainThread();
276 void wxWakeUpMainThread() {}
281 MustHaveApp(wxMutexGuiEnter);
282 void wxMutexGuiEnter();
284 MustHaveApp(wxMutexGuiLeave);
285 void wxMutexGuiLeave();
288 MustHaveApp(wxMutexGuiLocker);
289 class wxMutexGuiLocker {
296 MustHaveApp(wxThread);
298 bool wxThread_IsMain() {
299 #ifdef WXP_WITH_THREAD
300 return wxThread::IsMain();
307 //---------------------------------------------------------------------------
308 //---------------------------------------------------------------------------