]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/src/_functions.i
pi --> math.pi
[wxWidgets.git] / wxPython / src / _functions.i
... / ...
CommitLineData
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
16//---------------------------------------------------------------------------
17
18MAKE_CONST_WXSTRING(FileSelectorPromptStr);
19MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr);
20MAKE_CONST_WXSTRING(DirSelectorPromptStr);
21
22//---------------------------------------------------------------------------
23%newgroup;
24
25
26long wxNewId();
27void wxRegisterId(long id);
28long wxGetCurrentId();
29
30MustHaveApp(wxBell);
31void wxBell();
32
33MustHaveApp(wxEndBusyCursor);
34void wxEndBusyCursor();
35
36long wxGetElapsedTime(bool resetTimer = True);
37
38MustHaveApp(wxGetMousePosition);
39DocDeclA(
40 void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
41 "GetMousePosition() -> (x,y)");
42
43bool wxIsBusy();
44wxString wxNow();
45bool wxShell(const wxString& command = wxPyEmptyString);
46void wxStartTimer();
47
48DocDeclA(
49 int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
50 "GetOsVersion() -> (platform, major, minor)");
51
52wxString wxGetOsDescription();
53
54#if defined(__WXMSW__) || defined(__WXMAC__)
55long wxGetFreeMemory();
56#else
57%inline %{
58 long wxGetFreeMemory()
59 { wxPyRaiseNotImplemented(); return 0; }
60%}
61#endif
62
63enum wxShutdownFlags
64{
65 wxSHUTDOWN_POWEROFF, // power off the computer
66 wxSHUTDOWN_REBOOT // shutdown and reboot
67};
68
69// Shutdown or reboot the PC
70MustHaveApp(wxShutdown);
71bool wxShutdown(wxShutdownFlags wFlags);
72
73
74void wxSleep(int secs);
75void wxUsleep(unsigned long milliseconds);
76void wxEnableTopLevelWindows(bool enable);
77
78wxString wxStripMenuCodes(const wxString& in);
79
80
81wxString wxGetEmailAddress();
82wxString wxGetHostName();
83wxString wxGetFullHostName();
84wxString wxGetUserId();
85wxString wxGetUserName();
86wxString wxGetHomeDir();
87wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
88
89unsigned long wxGetProcessId();
90
91void wxTrap();
92
93
94// Dialog Functions
95
96MustHaveApp(wxFileSelector);
97wxString 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,
102 int flags = 0,
103 wxWindow *parent = NULL,
104 int x = -1, int y = -1);
105
106// TODO: wxFileSelectorEx
107
108
109// Ask for filename to load
110MustHaveApp(wxLoadFileSelector);
111wxString wxLoadFileSelector(const wxString& what,
112 const wxString& extension,
113 const wxString& default_name = wxPyEmptyString,
114 wxWindow *parent = NULL);
115
116// Ask for filename to save
117MustHaveApp(wxSaveFileSelector);
118wxString wxSaveFileSelector(const wxString& what,
119 const wxString& extension,
120 const wxString& default_name = wxPyEmptyString,
121 wxWindow *parent = NULL);
122
123
124MustHaveApp(wxDirSelector);
125wxString 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);
130
131MustHaveApp(wxGetTextFromUser);
132wxString 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,
137 bool centre = True);
138
139MustHaveApp(wxGetPasswordFromUser);
140wxString wxGetPasswordFromUser(const wxString& message,
141 const wxString& caption = wxPyEmptyString,
142 const wxString& default_value = wxPyEmptyString,
143 wxWindow *parent = NULL);
144
145
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);
152
153
154MustHaveApp(wxGetSingleChoice);
155wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
156 int choices, wxString* choices_array,
157 wxWindow *parent = NULL,
158 int x = -1, int y = -1,
159 bool centre = True,
160 int width=150, int height=200);
161
162MustHaveApp(wxGetSingleChoiceIndex);
163int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
164 int choices, wxString* choices_array,
165 wxWindow *parent = NULL,
166 int x = -1, int y = -1,
167 bool centre = True,
168 int width=150, int height=200);
169
170
171MustHaveApp(wxMessageBox);
172int 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);
177
178MustHaveApp(wxGetNumberFromUser);
179long wxGetNumberFromUser(const wxString& message,
180 const wxString& prompt,
181 const wxString& caption,
182 long value,
183 long min = 0, long max = 100,
184 wxWindow *parent = NULL,
185 const wxPoint& pos = wxDefaultPosition);
186
187// GDI Functions
188
189MustHaveApp(wxColourDisplay);
190bool wxColourDisplay();
191
192MustHaveApp(wxDisplayDepth);
193int wxDisplayDepth();
194
195MustHaveApp(wxGetDisplayDepth);
196int wxGetDisplayDepth();
197
198MustHaveApp(wxDisplaySize);
199DocDeclA(
200 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
201 "DisplaySize() -> (width, height)");
202
203MustHaveApp(wxGetDisplaySize);
204wxSize wxGetDisplaySize();
205
206MustHaveApp(wxDisplaySizeMM);
207DocDeclA(
208 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
209 "DisplaySizeMM() -> (width, height)");
210
211MustHaveApp(wxGetDisplaySizeMM);
212wxSize wxGetDisplaySizeMM();
213
214MustHaveApp(wxClientDisplayRect);
215DocDeclA(
216 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
217 "ClientDisplayRect() -> (x, y, width, height)");
218
219MustHaveApp(wxGetClientDisplayRect);
220wxRect wxGetClientDisplayRect();
221
222
223MustHaveApp(wxSetCursor);
224void wxSetCursor(wxCursor& cursor);
225
226
227
228// Miscellaneous functions
229
230MustHaveApp(wxBeginBusyCursor);
231void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
232
233MustHaveApp(wxGetActiveWindow);
234wxWindow * wxGetActiveWindow();
235
236MustHaveApp(wxGenericFindWindowAtPoint);
237wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
238
239MustHaveApp(wxFindWindowAtPoint);
240wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
241
242MustHaveApp(wxGetTopLevelParent);
243wxWindow* wxGetTopLevelParent(wxWindow *win);
244
245//bool wxSpawnBrowser(wxWindow *parent, wxString href);
246
247
248
249
250MustHaveApp(wxGetKeyState);
251DocDeclStr(
252 bool , wxGetKeyState(wxKeyCode key),
253 "Get the state of a key (true if pressed or toggled on, false if not.)
254This is generally most useful getting the state of the modifier or
255toggle keys. On some platforms those may be the only keys that work.
256", "");
257
258
259
260//---------------------------------------------------------------------------
261
262MustHaveApp(wxWakeUpMainThread);
263
264#if defined(__WXMSW__) || defined(__WXMAC__)
265void wxWakeUpMainThread();
266#else
267%inline %{
268 void wxWakeUpMainThread() {}
269%}
270#endif
271
272
273MustHaveApp(wxMutexGuiEnter);
274void wxMutexGuiEnter();
275
276MustHaveApp(wxMutexGuiLeave);
277void wxMutexGuiLeave();
278
279
280MustHaveApp(wxMutexGuiLocker);
281class wxMutexGuiLocker {
282public:
283 wxMutexGuiLocker();
284 ~wxMutexGuiLocker();
285};
286
287
288MustHaveApp(wxThread);
289%inline %{
290 bool wxThread_IsMain() {
291#ifdef WXP_WITH_THREAD
292 return wxThread::IsMain();
293#else
294 return True;
295#endif
296 }
297%}
298
299//---------------------------------------------------------------------------
300//---------------------------------------------------------------------------