]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_functions.i
reSWIGged
[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);
d14a1e28
RD
36void wxGetMousePosition(int* OUTPUT, int* OUTPUT);
37bool wxIsBusy();
38wxString wxNow();
39bool wxShell(const wxString& command = wxPyEmptyString);
40void wxStartTimer();
41int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
42wxString wxGetOsDescription();
43
44#if defined(__WXMSW__) || defined(__WXMAC__)
45long wxGetFreeMemory();
46#else
47%inline %{
48 long wxGetFreeMemory()
49 { PyErr_SetNone(PyExc_NotImplementedError); return 0; }
50%}
51#endif
52
53enum wxShutdownFlags
54{
55 wxSHUTDOWN_POWEROFF, // power off the computer
56 wxSHUTDOWN_REBOOT // shutdown and reboot
57};
58
59// Shutdown or reboot the PC
60bool wxShutdown(wxShutdownFlags wFlags);
61
62
63void wxSleep(int secs);
64void wxUsleep(unsigned long milliseconds);
65void wxEnableTopLevelWindows(bool enable);
66
67wxString wxStripMenuCodes(const wxString& in);
68
69
70wxString wxGetEmailAddress();
71wxString wxGetHostName();
72wxString wxGetFullHostName();
73wxString wxGetUserId();
74wxString wxGetUserName();
75wxString wxGetHomeDir();
76wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
77
78unsigned long wxGetProcessId();
79
80void wxTrap();
81
82
83// Dialog Functions
84
85wxString 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
98wxString 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
104wxString wxSaveFileSelector(const wxString& what,
105 const wxString& extension,
106 const wxString& default_name = wxPyEmptyString,
107 wxWindow *parent = NULL);
108
109
110wxString 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
116wxString 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,
dd9f7fea 121 bool centre = True);
d14a1e28
RD
122
123wxString 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,
dd9f7fea 134// bool centre = True, int width=150, int height=200);
d14a1e28
RD
135
136
137wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
138 int choices, wxString* choices_array,
139 wxWindow *parent = NULL,
140 int x = -1, int y = -1,
dd9f7fea 141 bool centre = True,
d14a1e28
RD
142 int width=150, int height=200);
143
144int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
145 int choices, wxString* choices_array,
146 wxWindow *parent = NULL,
147 int x = -1, int y = -1,
dd9f7fea 148 bool centre = True,
d14a1e28
RD
149 int width=150, int height=200);
150
151
152int 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
158long 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
168bool wxColourDisplay();
169
170int wxDisplayDepth();
171int wxGetDisplayDepth();
172
173void wxDisplaySize(int* OUTPUT, int* OUTPUT);
174wxSize wxGetDisplaySize();
175
176void wxDisplaySizeMM(int* OUTPUT, int* OUTPUT);
177wxSize wxGetDisplaySizeMM();
178
179void wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT);
180wxRect wxGetClientDisplayRect();
181
182void wxSetCursor(wxCursor& cursor);
183
184
185
186// Miscellaneous functions
187
188void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
189wxWindow * wxGetActiveWindow();
190
191wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
192wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
193
194wxWindow* wxGetTopLevelParent(wxWindow *win);
195
196//bool wxSpawnBrowser(wxWindow *parent, wxString href);
197
198
199
200//---------------------------------------------------------------------------
201
202#if defined(__WXMSW__) || defined(__WXMAC__)
203void wxWakeUpMainThread();
204#else
205%inline %{
206 void wxWakeUpMainThread() {}
207%}
208#endif
209
210void wxMutexGuiEnter();
211void wxMutexGuiLeave();
212
213
214class wxMutexGuiLocker {
215public:
216 wxMutexGuiLocker();
217 ~wxMutexGuiLocker();
218};
219
220
221%inline %{
222 bool wxThread_IsMain() {
223#ifdef WXP_WITH_THREAD
224 return wxThread::IsMain();
225#else
dd9f7fea 226 return True;
d14a1e28
RD
227#endif
228 }
229%}
230
231//---------------------------------------------------------------------------
232//---------------------------------------------------------------------------