]>
Commit | Line | Data |
---|---|---|
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 |
18 | MAKE_CONST_WXSTRING(FileSelectorPromptStr); |
19 | MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr); | |
20 | MAKE_CONST_WXSTRING(DirSelectorPromptStr); | |
d14a1e28 RD |
21 | |
22 | //--------------------------------------------------------------------------- | |
23 | %newgroup; | |
24 | ||
25 | ||
26 | long wxNewId(); | |
27 | void wxRegisterId(long id); | |
28 | long wxGetCurrentId(); | |
29 | ||
30 | void wxBell(); | |
31 | void wxEndBusyCursor(); | |
32 | ||
dd9f7fea | 33 | long wxGetElapsedTime(bool resetTimer = True); |
322913ce RD |
34 | |
35 | DocDeclA( | |
36 | void, wxGetMousePosition(int* OUTPUT, int* OUTPUT), | |
37 | "GetMousePosition() -> (x,y)"); | |
38 | ||
d14a1e28 RD |
39 | bool wxIsBusy(); |
40 | wxString wxNow(); | |
41 | bool wxShell(const wxString& command = wxPyEmptyString); | |
42 | void wxStartTimer(); | |
322913ce RD |
43 | |
44 | DocDeclA( | |
45 | int, wxGetOsVersion(int *OUTPUT, int *OUTPUT), | |
46 | "GetOsVersion() -> (platform, major, minor)"); | |
47 | ||
d14a1e28 RD |
48 | wxString wxGetOsDescription(); |
49 | ||
50 | #if defined(__WXMSW__) || defined(__WXMAC__) | |
51 | long wxGetFreeMemory(); | |
52 | #else | |
53 | %inline %{ | |
54 | long wxGetFreeMemory() | |
55 | { PyErr_SetNone(PyExc_NotImplementedError); return 0; } | |
56 | %} | |
57 | #endif | |
58 | ||
59 | enum wxShutdownFlags | |
60 | { | |
61 | wxSHUTDOWN_POWEROFF, // power off the computer | |
62 | wxSHUTDOWN_REBOOT // shutdown and reboot | |
63 | }; | |
64 | ||
65 | // Shutdown or reboot the PC | |
66 | bool wxShutdown(wxShutdownFlags wFlags); | |
67 | ||
68 | ||
69 | void wxSleep(int secs); | |
70 | void wxUsleep(unsigned long milliseconds); | |
71 | void wxEnableTopLevelWindows(bool enable); | |
72 | ||
73 | wxString wxStripMenuCodes(const wxString& in); | |
74 | ||
75 | ||
76 | wxString wxGetEmailAddress(); | |
77 | wxString wxGetHostName(); | |
78 | wxString wxGetFullHostName(); | |
79 | wxString wxGetUserId(); | |
80 | wxString wxGetUserName(); | |
81 | wxString wxGetHomeDir(); | |
82 | wxString wxGetUserHome(const wxString& user = wxPyEmptyString); | |
83 | ||
84 | unsigned long wxGetProcessId(); | |
85 | ||
86 | void wxTrap(); | |
87 | ||
88 | ||
89 | // Dialog Functions | |
90 | ||
91 | wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr, | |
92 | const wxString& default_path = wxPyEmptyString, | |
93 | const wxString& default_filename = wxPyEmptyString, | |
94 | const wxString& default_extension = wxPyEmptyString, | |
95 | const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr, | |
96 | int flags = 0, | |
97 | wxWindow *parent = NULL, | |
98 | int x = -1, int y = -1); | |
99 | ||
100 | // TODO: wxFileSelectorEx | |
101 | ||
102 | ||
103 | // Ask for filename to load | |
104 | wxString wxLoadFileSelector(const wxString& what, | |
105 | const wxString& extension, | |
106 | const wxString& default_name = wxPyEmptyString, | |
107 | wxWindow *parent = NULL); | |
108 | ||
109 | // Ask for filename to save | |
110 | wxString wxSaveFileSelector(const wxString& what, | |
111 | const wxString& extension, | |
112 | const wxString& default_name = wxPyEmptyString, | |
113 | wxWindow *parent = NULL); | |
114 | ||
115 | ||
116 | wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr, | |
117 | const wxString& defaultPath = wxPyEmptyString, | |
118 | long style = wxDD_DEFAULT_STYLE, | |
119 | const wxPoint& pos = wxDefaultPosition, | |
120 | wxWindow *parent = NULL); | |
121 | ||
122 | wxString wxGetTextFromUser(const wxString& message, | |
123 | const wxString& caption = wxPyEmptyString, | |
124 | const wxString& default_value = wxPyEmptyString, | |
125 | wxWindow *parent = NULL, | |
126 | int x = -1, int y = -1, | |
dd9f7fea | 127 | bool centre = True); |
d14a1e28 RD |
128 | |
129 | wxString wxGetPasswordFromUser(const wxString& message, | |
130 | const wxString& caption = wxPyEmptyString, | |
131 | const wxString& default_value = wxPyEmptyString, | |
132 | wxWindow *parent = NULL); | |
133 | ||
134 | ||
135 | // TODO: Need to custom wrap this one... | |
136 | // int wxGetMultipleChoice(char* message, char* caption, | |
137 | // int LCOUNT, char** choices, | |
138 | // int nsel, int *selection, | |
139 | // wxWindow *parent = NULL, int x = -1, int y = -1, | |
dd9f7fea | 140 | // bool centre = True, int width=150, int height=200); |
d14a1e28 RD |
141 | |
142 | ||
143 | wxString wxGetSingleChoice(const wxString& message, const wxString& caption, | |
144 | int choices, wxString* choices_array, | |
145 | wxWindow *parent = NULL, | |
146 | int x = -1, int y = -1, | |
dd9f7fea | 147 | bool centre = True, |
d14a1e28 RD |
148 | int width=150, int height=200); |
149 | ||
150 | int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, | |
151 | int choices, wxString* choices_array, | |
152 | wxWindow *parent = NULL, | |
153 | int x = -1, int y = -1, | |
dd9f7fea | 154 | bool centre = True, |
d14a1e28 RD |
155 | int width=150, int height=200); |
156 | ||
157 | ||
158 | int wxMessageBox(const wxString& message, | |
159 | const wxString& caption = wxPyEmptyString, | |
160 | int style = wxOK | wxCENTRE, | |
161 | wxWindow *parent = NULL, | |
162 | int x = -1, int y = -1); | |
163 | ||
164 | long wxGetNumberFromUser(const wxString& message, | |
165 | const wxString& prompt, | |
166 | const wxString& caption, | |
167 | long value, | |
168 | long min = 0, long max = 100, | |
169 | wxWindow *parent = NULL, | |
170 | const wxPoint& pos = wxDefaultPosition); | |
171 | ||
172 | // GDI Functions | |
173 | ||
174 | bool wxColourDisplay(); | |
175 | ||
176 | int wxDisplayDepth(); | |
177 | int wxGetDisplayDepth(); | |
178 | ||
322913ce RD |
179 | DocDeclA( |
180 | void, wxDisplaySize(int* OUTPUT, int* OUTPUT), | |
181 | "DisplaySize() -> (width, height)"); | |
d14a1e28 RD |
182 | wxSize wxGetDisplaySize(); |
183 | ||
322913ce RD |
184 | DocDeclA( |
185 | void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT), | |
186 | "DisplaySizeMM() -> (width, height)"); | |
d14a1e28 RD |
187 | wxSize wxGetDisplaySizeMM(); |
188 | ||
322913ce RD |
189 | DocDeclA( |
190 | void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT), | |
191 | "ClientDisplayRect() -> (x, y, width, height)"); | |
d14a1e28 RD |
192 | wxRect wxGetClientDisplayRect(); |
193 | ||
194 | void wxSetCursor(wxCursor& cursor); | |
195 | ||
196 | ||
197 | ||
198 | // Miscellaneous functions | |
199 | ||
200 | void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); | |
201 | wxWindow * wxGetActiveWindow(); | |
202 | ||
203 | wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt); | |
204 | wxWindow* wxFindWindowAtPoint(const wxPoint& pt); | |
205 | ||
206 | wxWindow* wxGetTopLevelParent(wxWindow *win); | |
207 | ||
208 | //bool wxSpawnBrowser(wxWindow *parent, wxString href); | |
209 | ||
210 | ||
211 | ||
57b1892f RD |
212 | #if defined(__WXMSW__) || defined(__WXMAC__) |
213 | // Get the state of a key (true if pressed, false if not) | |
214 | // This is generally most useful getting the state of | |
215 | // Caps Lock, Num Lock and Scroll Lock... | |
216 | bool wxGetKeyState(wxKeyCode key); | |
217 | #endif | |
218 | ||
219 | ||
d14a1e28 RD |
220 | //--------------------------------------------------------------------------- |
221 | ||
222 | #if defined(__WXMSW__) || defined(__WXMAC__) | |
223 | void wxWakeUpMainThread(); | |
224 | #else | |
225 | %inline %{ | |
226 | void wxWakeUpMainThread() {} | |
227 | %} | |
228 | #endif | |
229 | ||
230 | void wxMutexGuiEnter(); | |
231 | void wxMutexGuiLeave(); | |
232 | ||
233 | ||
234 | class wxMutexGuiLocker { | |
235 | public: | |
236 | wxMutexGuiLocker(); | |
237 | ~wxMutexGuiLocker(); | |
238 | }; | |
239 | ||
240 | ||
241 | %inline %{ | |
242 | bool wxThread_IsMain() { | |
243 | #ifdef WXP_WITH_THREAD | |
244 | return wxThread::IsMain(); | |
245 | #else | |
dd9f7fea | 246 | return True; |
d14a1e28 RD |
247 | #endif |
248 | } | |
249 | %} | |
250 | ||
251 | //--------------------------------------------------------------------------- | |
252 | //--------------------------------------------------------------------------- |