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