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();
54 #if defined(__WXMSW__) || defined(__WXMAC__)
55 long wxGetFreeMemory();
58 long wxGetFreeMemory()
59 { wxPyRaiseNotImplemented(); return 0; }
65 wxSHUTDOWN_POWEROFF, // power off the computer
66 wxSHUTDOWN_REBOOT // shutdown and reboot
69 // Shutdown or reboot the PC
70 MustHaveApp(wxShutdown);
71 bool wxShutdown(wxShutdownFlags wFlags);
74 void wxSleep(int secs);
75 void wxUsleep(unsigned long milliseconds);
76 void wxEnableTopLevelWindows(bool enable);
78 wxString wxStripMenuCodes(const wxString& in);
81 wxString wxGetEmailAddress();
82 wxString wxGetHostName();
83 wxString wxGetFullHostName();
84 wxString wxGetUserId();
85 wxString wxGetUserName();
86 wxString wxGetHomeDir();
87 wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
89 unsigned long wxGetProcessId();
96 MustHaveApp(wxFileSelector);
97 wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
98 const wxString& default_path = wxPyEmptyString,
99 const wxString& default_filename = wxPyEmptyString,
100 const wxString& default_extension = wxPyEmptyString,
101 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
103 wxWindow *parent = NULL,
104 int x = -1, int y = -1);
106 // TODO: wxFileSelectorEx
109 // Ask for filename to load
110 MustHaveApp(wxLoadFileSelector);
111 wxString wxLoadFileSelector(const wxString& what,
112 const wxString& extension,
113 const wxString& default_name = wxPyEmptyString,
114 wxWindow *parent = NULL);
116 // Ask for filename to save
117 MustHaveApp(wxSaveFileSelector);
118 wxString wxSaveFileSelector(const wxString& what,
119 const wxString& extension,
120 const wxString& default_name = wxPyEmptyString,
121 wxWindow *parent = NULL);
124 MustHaveApp(wxDirSelector);
125 wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
126 const wxString& defaultPath = wxPyEmptyString,
127 long style = wxDD_DEFAULT_STYLE,
128 const wxPoint& pos = wxDefaultPosition,
129 wxWindow *parent = NULL);
131 MustHaveApp(wxGetTextFromUser);
132 wxString wxGetTextFromUser(const wxString& message,
133 const wxString& caption = wxPyEmptyString,
134 const wxString& default_value = wxPyEmptyString,
135 wxWindow *parent = NULL,
136 int x = -1, int y = -1,
139 MustHaveApp(wxGetPasswordFromUser);
140 wxString wxGetPasswordFromUser(const wxString& message,
141 const wxString& caption = wxPyEmptyString,
142 const wxString& default_value = wxPyEmptyString,
143 wxWindow *parent = NULL);
146 // TODO: Need to custom wrap this one...
147 // int wxGetMultipleChoice(char* message, char* caption,
148 // int LCOUNT, char** choices,
149 // int nsel, int *selection,
150 // wxWindow *parent = NULL, int x = -1, int y = -1,
151 // bool centre = True, int width=150, int height=200);
154 MustHaveApp(wxGetSingleChoice);
155 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
156 int choices, wxString* choices_array,
157 wxWindow *parent = NULL,
158 int x = -1, int y = -1,
160 int width=150, int height=200);
162 MustHaveApp(wxGetSingleChoiceIndex);
163 int wxGetSingleChoiceIndex(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);
171 MustHaveApp(wxMessageBox);
172 int wxMessageBox(const wxString& message,
173 const wxString& caption = wxPyEmptyString,
174 int style = wxOK | wxCENTRE,
175 wxWindow *parent = NULL,
176 int x = -1, int y = -1);
178 MustHaveApp(wxGetNumberFromUser);
179 long wxGetNumberFromUser(const wxString& message,
180 const wxString& prompt,
181 const wxString& caption,
183 long min = 0, long max = 100,
184 wxWindow *parent = NULL,
185 const wxPoint& pos = wxDefaultPosition);
189 MustHaveApp(wxColourDisplay);
190 bool wxColourDisplay();
192 MustHaveApp(wxDisplayDepth);
193 int wxDisplayDepth();
195 MustHaveApp(wxGetDisplayDepth);
196 int wxGetDisplayDepth();
198 MustHaveApp(wxDisplaySize);
200 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
201 "DisplaySize() -> (width, height)");
203 MustHaveApp(wxGetDisplaySize);
204 wxSize wxGetDisplaySize();
206 MustHaveApp(wxDisplaySizeMM);
208 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
209 "DisplaySizeMM() -> (width, height)");
211 MustHaveApp(wxGetDisplaySizeMM);
212 wxSize wxGetDisplaySizeMM();
214 MustHaveApp(wxClientDisplayRect);
216 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
217 "ClientDisplayRect() -> (x, y, width, height)");
219 MustHaveApp(wxGetClientDisplayRect);
220 wxRect wxGetClientDisplayRect();
223 MustHaveApp(wxSetCursor);
224 void wxSetCursor(wxCursor& cursor);
228 // Miscellaneous functions
230 MustHaveApp(wxBeginBusyCursor);
231 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
233 MustHaveApp(wxGetActiveWindow);
234 wxWindow * wxGetActiveWindow();
236 MustHaveApp(wxGenericFindWindowAtPoint);
237 wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
239 MustHaveApp(wxFindWindowAtPoint);
240 wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
242 MustHaveApp(wxGetTopLevelParent);
243 wxWindow* wxGetTopLevelParent(wxWindow *win);
245 //bool wxSpawnBrowser(wxWindow *parent, wxString href);
250 MustHaveApp(wxGetKeyState);
252 bool , wxGetKeyState(wxKeyCode key),
253 "Get the state of a key (true if pressed or toggled on, false if not.)
254 This is generally most useful getting the state of the modifier or
255 toggle keys. On some platforms those may be the only keys that work.
260 //---------------------------------------------------------------------------
262 MustHaveApp(wxWakeUpMainThread);
264 #if defined(__WXMSW__) || defined(__WXMAC__)
265 void wxWakeUpMainThread();
268 void wxWakeUpMainThread() {}
273 MustHaveApp(wxMutexGuiEnter);
274 void wxMutexGuiEnter();
276 MustHaveApp(wxMutexGuiLeave);
277 void wxMutexGuiLeave();
280 MustHaveApp(wxMutexGuiLocker);
281 class wxMutexGuiLocker {
288 MustHaveApp(wxThread);
290 bool wxThread_IsMain() {
291 #ifdef WXP_WITH_THREAD
292 return wxThread::IsMain();
299 //---------------------------------------------------------------------------
300 //---------------------------------------------------------------------------