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