]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_functions.i
really remove them
[wxWidgets.git] / wxPython / src / _functions.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _functions.i
3// Purpose: SWIG interface defs for various functions and such
4//
5// Author: Robin Dunn
6//
7// Created: 3-July-1997
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
1a1ed526
RD
16%{
17#include <wx/stockitem.h>
18%}
19
d14a1e28
RD
20//---------------------------------------------------------------------------
21
b2dc1044
RD
22MAKE_CONST_WXSTRING(FileSelectorPromptStr);
23MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr);
24MAKE_CONST_WXSTRING(DirSelectorPromptStr);
d14a1e28
RD
25
26//---------------------------------------------------------------------------
27%newgroup;
28
29
30long wxNewId();
31void wxRegisterId(long id);
32long wxGetCurrentId();
33
ab1f7d2a 34MustHaveApp(wxBell);
d14a1e28 35void wxBell();
ab1f7d2a
RD
36
37MustHaveApp(wxEndBusyCursor);
d14a1e28
RD
38void wxEndBusyCursor();
39
dd9f7fea 40long wxGetElapsedTime(bool resetTimer = True);
322913ce 41
ab1f7d2a 42MustHaveApp(wxGetMousePosition);
322913ce
RD
43DocDeclA(
44 void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
45 "GetMousePosition() -> (x,y)");
46
d14a1e28
RD
47bool wxIsBusy();
48wxString wxNow();
49bool wxShell(const wxString& command = wxPyEmptyString);
50void wxStartTimer();
322913ce
RD
51
52DocDeclA(
53 int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
54 "GetOsVersion() -> (platform, major, minor)");
55
d14a1e28
RD
56wxString wxGetOsDescription();
57
03d51a2d
RD
58// TODO:
59// // Parses the wildCard, returning the number of filters.
60// // Returns 0 if none or if there's a problem,
61// // The arrays will contain an equal number of items found before the error.
62// // wildCard is in the form:
63// // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
daf32463 64// int wxParseCommonDialogsFilter(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
03d51a2d 65
d14a1e28
RD
66#if defined(__WXMSW__) || defined(__WXMAC__)
67long wxGetFreeMemory();
68#else
69%inline %{
70 long wxGetFreeMemory()
81cfe5e1 71 { wxPyRaiseNotImplemented(); return 0; }
d14a1e28
RD
72%}
73#endif
74
75enum wxShutdownFlags
76{
77 wxSHUTDOWN_POWEROFF, // power off the computer
78 wxSHUTDOWN_REBOOT // shutdown and reboot
79};
80
81// Shutdown or reboot the PC
ab1f7d2a 82MustHaveApp(wxShutdown);
d14a1e28
RD
83bool wxShutdown(wxShutdownFlags wFlags);
84
85
86void wxSleep(int secs);
705b61cc
RD
87void wxMilliSleep(unsigned long milliseconds);
88void wxMicroSleep(unsigned long microseconds);
89%pythoncode { Usleep = MilliSleep }
90
d14a1e28
RD
91void wxEnableTopLevelWindows(bool enable);
92
93wxString wxStripMenuCodes(const wxString& in);
94
95
96wxString wxGetEmailAddress();
97wxString wxGetHostName();
98wxString wxGetFullHostName();
99wxString wxGetUserId();
100wxString wxGetUserName();
101wxString wxGetHomeDir();
102wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
103
104unsigned long wxGetProcessId();
105
106void wxTrap();
107
108
109// Dialog Functions
110
ab1f7d2a 111MustHaveApp(wxFileSelector);
d14a1e28
RD
112wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
113 const wxString& default_path = wxPyEmptyString,
114 const wxString& default_filename = wxPyEmptyString,
115 const wxString& default_extension = wxPyEmptyString,
116 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
117 int flags = 0,
118 wxWindow *parent = NULL,
119 int x = -1, int y = -1);
120
121// TODO: wxFileSelectorEx
122
123
124// Ask for filename to load
ab1f7d2a 125MustHaveApp(wxLoadFileSelector);
d14a1e28
RD
126wxString wxLoadFileSelector(const wxString& what,
127 const wxString& extension,
128 const wxString& default_name = wxPyEmptyString,
129 wxWindow *parent = NULL);
130
131// Ask for filename to save
ab1f7d2a 132MustHaveApp(wxSaveFileSelector);
d14a1e28
RD
133wxString wxSaveFileSelector(const wxString& what,
134 const wxString& extension,
135 const wxString& default_name = wxPyEmptyString,
136 wxWindow *parent = NULL);
137
138
ab1f7d2a 139MustHaveApp(wxDirSelector);
d14a1e28
RD
140wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
141 const wxString& defaultPath = wxPyEmptyString,
142 long style = wxDD_DEFAULT_STYLE,
143 const wxPoint& pos = wxDefaultPosition,
144 wxWindow *parent = NULL);
145
ab1f7d2a 146MustHaveApp(wxGetTextFromUser);
d14a1e28
RD
147wxString wxGetTextFromUser(const wxString& message,
148 const wxString& caption = wxPyEmptyString,
149 const wxString& default_value = wxPyEmptyString,
150 wxWindow *parent = NULL,
151 int x = -1, int y = -1,
dd9f7fea 152 bool centre = True);
d14a1e28 153
ab1f7d2a 154MustHaveApp(wxGetPasswordFromUser);
d14a1e28
RD
155wxString wxGetPasswordFromUser(const wxString& message,
156 const wxString& caption = wxPyEmptyString,
157 const wxString& default_value = wxPyEmptyString,
158 wxWindow *parent = NULL);
159
160
161// TODO: Need to custom wrap this one...
162// int wxGetMultipleChoice(char* message, char* caption,
163// int LCOUNT, char** choices,
164// int nsel, int *selection,
165// wxWindow *parent = NULL, int x = -1, int y = -1,
dd9f7fea 166// bool centre = True, int width=150, int height=200);
d14a1e28
RD
167
168
ab1f7d2a 169MustHaveApp(wxGetSingleChoice);
d14a1e28
RD
170wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
171 int choices, wxString* choices_array,
172 wxWindow *parent = NULL,
173 int x = -1, int y = -1,
dd9f7fea 174 bool centre = True,
d14a1e28
RD
175 int width=150, int height=200);
176
ab1f7d2a 177MustHaveApp(wxGetSingleChoiceIndex);
d14a1e28
RD
178int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
179 int choices, wxString* choices_array,
180 wxWindow *parent = NULL,
181 int x = -1, int y = -1,
dd9f7fea 182 bool centre = True,
d14a1e28
RD
183 int width=150, int height=200);
184
185
ab1f7d2a 186MustHaveApp(wxMessageBox);
d14a1e28
RD
187int wxMessageBox(const wxString& message,
188 const wxString& caption = wxPyEmptyString,
189 int style = wxOK | wxCENTRE,
190 wxWindow *parent = NULL,
191 int x = -1, int y = -1);
192
ab1f7d2a 193MustHaveApp(wxGetNumberFromUser);
d14a1e28
RD
194long wxGetNumberFromUser(const wxString& message,
195 const wxString& prompt,
196 const wxString& caption,
197 long value,
198 long min = 0, long max = 100,
199 wxWindow *parent = NULL,
200 const wxPoint& pos = wxDefaultPosition);
201
202// GDI Functions
203
ab1f7d2a 204MustHaveApp(wxColourDisplay);
d14a1e28
RD
205bool wxColourDisplay();
206
ab1f7d2a 207MustHaveApp(wxDisplayDepth);
d14a1e28 208int wxDisplayDepth();
ab1f7d2a
RD
209
210MustHaveApp(wxGetDisplayDepth);
d14a1e28
RD
211int wxGetDisplayDepth();
212
ab1f7d2a 213MustHaveApp(wxDisplaySize);
322913ce
RD
214DocDeclA(
215 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
216 "DisplaySize() -> (width, height)");
ab1f7d2a
RD
217
218MustHaveApp(wxGetDisplaySize);
d14a1e28
RD
219wxSize wxGetDisplaySize();
220
ab1f7d2a 221MustHaveApp(wxDisplaySizeMM);
322913ce
RD
222DocDeclA(
223 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
224 "DisplaySizeMM() -> (width, height)");
ab1f7d2a
RD
225
226MustHaveApp(wxGetDisplaySizeMM);
d14a1e28
RD
227wxSize wxGetDisplaySizeMM();
228
ab1f7d2a 229MustHaveApp(wxClientDisplayRect);
322913ce
RD
230DocDeclA(
231 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
232 "ClientDisplayRect() -> (x, y, width, height)");
ab1f7d2a
RD
233
234MustHaveApp(wxGetClientDisplayRect);
d14a1e28
RD
235wxRect wxGetClientDisplayRect();
236
ab1f7d2a
RD
237
238MustHaveApp(wxSetCursor);
d14a1e28
RD
239void wxSetCursor(wxCursor& cursor);
240
241
242
243// Miscellaneous functions
244
ab1f7d2a 245MustHaveApp(wxBeginBusyCursor);
d14a1e28 246void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
ab1f7d2a
RD
247
248MustHaveApp(wxGetActiveWindow);
d14a1e28
RD
249wxWindow * wxGetActiveWindow();
250
ab1f7d2a 251MustHaveApp(wxGenericFindWindowAtPoint);
d14a1e28 252wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
ab1f7d2a
RD
253
254MustHaveApp(wxFindWindowAtPoint);
d14a1e28
RD
255wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
256
ab1f7d2a 257MustHaveApp(wxGetTopLevelParent);
d14a1e28
RD
258wxWindow* wxGetTopLevelParent(wxWindow *win);
259
260//bool wxSpawnBrowser(wxWindow *parent, wxString href);
261
262
263
89c876de 264
ab1f7d2a 265MustHaveApp(wxGetKeyState);
ad411ab2
RD
266DocDeclStr(
267 bool , wxGetKeyState(wxKeyCode key),
268 "Get the state of a key (true if pressed or toggled on, false if not.)
269This is generally most useful getting the state of the modifier or
270toggle keys. On some platforms those may be the only keys that work.
271", "");
272
57b1892f
RD
273
274
d14a1e28
RD
275//---------------------------------------------------------------------------
276
ab1f7d2a
RD
277MustHaveApp(wxWakeUpMainThread);
278
d14a1e28
RD
279#if defined(__WXMSW__) || defined(__WXMAC__)
280void wxWakeUpMainThread();
281#else
282%inline %{
283 void wxWakeUpMainThread() {}
284%}
285#endif
286
ab1f7d2a
RD
287
288MustHaveApp(wxMutexGuiEnter);
d14a1e28 289void wxMutexGuiEnter();
ab1f7d2a
RD
290
291MustHaveApp(wxMutexGuiLeave);
d14a1e28
RD
292void wxMutexGuiLeave();
293
294
ab1f7d2a 295MustHaveApp(wxMutexGuiLocker);
d14a1e28
RD
296class wxMutexGuiLocker {
297public:
298 wxMutexGuiLocker();
299 ~wxMutexGuiLocker();
300};
301
302
ab1f7d2a 303MustHaveApp(wxThread);
d14a1e28
RD
304%inline %{
305 bool wxThread_IsMain() {
306#ifdef WXP_WITH_THREAD
307 return wxThread::IsMain();
308#else
dd9f7fea 309 return True;
d14a1e28
RD
310#endif
311 }
312%}
313
314//---------------------------------------------------------------------------
315//---------------------------------------------------------------------------