]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_functions.i
pi --> math.pi
[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
16//---------------------------------------------------------------------------
17
b2dc1044
RD
18MAKE_CONST_WXSTRING(FileSelectorPromptStr);
19MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr);
20MAKE_CONST_WXSTRING(DirSelectorPromptStr);
d14a1e28
RD
21
22//---------------------------------------------------------------------------
23%newgroup;
24
25
26long wxNewId();
27void wxRegisterId(long id);
28long wxGetCurrentId();
29
ab1f7d2a 30MustHaveApp(wxBell);
d14a1e28 31void wxBell();
ab1f7d2a
RD
32
33MustHaveApp(wxEndBusyCursor);
d14a1e28
RD
34void wxEndBusyCursor();
35
dd9f7fea 36long wxGetElapsedTime(bool resetTimer = True);
322913ce 37
ab1f7d2a 38MustHaveApp(wxGetMousePosition);
322913ce
RD
39DocDeclA(
40 void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
41 "GetMousePosition() -> (x,y)");
42
d14a1e28
RD
43bool wxIsBusy();
44wxString wxNow();
45bool wxShell(const wxString& command = wxPyEmptyString);
46void wxStartTimer();
322913ce
RD
47
48DocDeclA(
49 int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
50 "GetOsVersion() -> (platform, major, minor)");
51
d14a1e28
RD
52wxString wxGetOsDescription();
53
54#if defined(__WXMSW__) || defined(__WXMAC__)
55long wxGetFreeMemory();
56#else
57%inline %{
58 long wxGetFreeMemory()
81cfe5e1 59 { wxPyRaiseNotImplemented(); return 0; }
d14a1e28
RD
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
ab1f7d2a 70MustHaveApp(wxShutdown);
d14a1e28
RD
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
ab1f7d2a 96MustHaveApp(wxFileSelector);
d14a1e28
RD
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
ab1f7d2a 110MustHaveApp(wxLoadFileSelector);
d14a1e28
RD
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
ab1f7d2a 117MustHaveApp(wxSaveFileSelector);
d14a1e28
RD
118wxString wxSaveFileSelector(const wxString& what,
119 const wxString& extension,
120 const wxString& default_name = wxPyEmptyString,
121 wxWindow *parent = NULL);
122
123
ab1f7d2a 124MustHaveApp(wxDirSelector);
d14a1e28
RD
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
ab1f7d2a 131MustHaveApp(wxGetTextFromUser);
d14a1e28
RD
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,
dd9f7fea 137 bool centre = True);
d14a1e28 138
ab1f7d2a 139MustHaveApp(wxGetPasswordFromUser);
d14a1e28
RD
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,
dd9f7fea 151// bool centre = True, int width=150, int height=200);
d14a1e28
RD
152
153
ab1f7d2a 154MustHaveApp(wxGetSingleChoice);
d14a1e28
RD
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,
dd9f7fea 159 bool centre = True,
d14a1e28
RD
160 int width=150, int height=200);
161
ab1f7d2a 162MustHaveApp(wxGetSingleChoiceIndex);
d14a1e28
RD
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,
dd9f7fea 167 bool centre = True,
d14a1e28
RD
168 int width=150, int height=200);
169
170
ab1f7d2a 171MustHaveApp(wxMessageBox);
d14a1e28
RD
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
ab1f7d2a 178MustHaveApp(wxGetNumberFromUser);
d14a1e28
RD
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
ab1f7d2a 189MustHaveApp(wxColourDisplay);
d14a1e28
RD
190bool wxColourDisplay();
191
ab1f7d2a 192MustHaveApp(wxDisplayDepth);
d14a1e28 193int wxDisplayDepth();
ab1f7d2a
RD
194
195MustHaveApp(wxGetDisplayDepth);
d14a1e28
RD
196int wxGetDisplayDepth();
197
ab1f7d2a 198MustHaveApp(wxDisplaySize);
322913ce
RD
199DocDeclA(
200 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
201 "DisplaySize() -> (width, height)");
ab1f7d2a
RD
202
203MustHaveApp(wxGetDisplaySize);
d14a1e28
RD
204wxSize wxGetDisplaySize();
205
ab1f7d2a 206MustHaveApp(wxDisplaySizeMM);
322913ce
RD
207DocDeclA(
208 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
209 "DisplaySizeMM() -> (width, height)");
ab1f7d2a
RD
210
211MustHaveApp(wxGetDisplaySizeMM);
d14a1e28
RD
212wxSize wxGetDisplaySizeMM();
213
ab1f7d2a 214MustHaveApp(wxClientDisplayRect);
322913ce
RD
215DocDeclA(
216 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
217 "ClientDisplayRect() -> (x, y, width, height)");
ab1f7d2a
RD
218
219MustHaveApp(wxGetClientDisplayRect);
d14a1e28
RD
220wxRect wxGetClientDisplayRect();
221
ab1f7d2a
RD
222
223MustHaveApp(wxSetCursor);
d14a1e28
RD
224void wxSetCursor(wxCursor& cursor);
225
226
227
228// Miscellaneous functions
229
ab1f7d2a 230MustHaveApp(wxBeginBusyCursor);
d14a1e28 231void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
ab1f7d2a
RD
232
233MustHaveApp(wxGetActiveWindow);
d14a1e28
RD
234wxWindow * wxGetActiveWindow();
235
ab1f7d2a 236MustHaveApp(wxGenericFindWindowAtPoint);
d14a1e28 237wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
ab1f7d2a
RD
238
239MustHaveApp(wxFindWindowAtPoint);
d14a1e28
RD
240wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
241
ab1f7d2a 242MustHaveApp(wxGetTopLevelParent);
d14a1e28
RD
243wxWindow* wxGetTopLevelParent(wxWindow *win);
244
245//bool wxSpawnBrowser(wxWindow *parent, wxString href);
246
247
248
89c876de 249
ab1f7d2a 250MustHaveApp(wxGetKeyState);
ad411ab2
RD
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
57b1892f
RD
258
259
d14a1e28
RD
260//---------------------------------------------------------------------------
261
ab1f7d2a
RD
262MustHaveApp(wxWakeUpMainThread);
263
d14a1e28
RD
264#if defined(__WXMSW__) || defined(__WXMAC__)
265void wxWakeUpMainThread();
266#else
267%inline %{
268 void wxWakeUpMainThread() {}
269%}
270#endif
271
ab1f7d2a
RD
272
273MustHaveApp(wxMutexGuiEnter);
d14a1e28 274void wxMutexGuiEnter();
ab1f7d2a
RD
275
276MustHaveApp(wxMutexGuiLeave);
d14a1e28
RD
277void wxMutexGuiLeave();
278
279
ab1f7d2a 280MustHaveApp(wxMutexGuiLocker);
d14a1e28
RD
281class wxMutexGuiLocker {
282public:
283 wxMutexGuiLocker();
284 ~wxMutexGuiLocker();
285};
286
287
ab1f7d2a 288MustHaveApp(wxThread);
d14a1e28
RD
289%inline %{
290 bool wxThread_IsMain() {
291#ifdef WXP_WITH_THREAD
292 return wxThread::IsMain();
293#else
dd9f7fea 294 return True;
d14a1e28
RD
295#endif
296 }
297%}
298
299//---------------------------------------------------------------------------
300//---------------------------------------------------------------------------