]>
Commit | Line | Data |
---|---|---|
7bf85405 RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: _defs.i | |
3 | // Purpose: Definitions and stuff | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 6/24/97 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 1998 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | ||
ab1f7d2a | 14 | //--------------------------------------------------------------------------- |
ab1f7d2a | 15 | |
214c4fbe | 16 | // Globally turn on the autodoc feature |
dd9f7fea RD |
17 | %feature("autodoc", "1"); // 0 == no param types, 1 == show param types |
18 | ||
2f810297 RD |
19 | // Turn on kwargs by default |
20 | %feature("kwargs", "1"); | |
21 | ||
9c605285 RD |
22 | // Don't generate separate wrappers for each default args combination |
23 | %feature("compactdefaultargs"); | |
24 | ||
214c4fbe | 25 | #if SWIG_VERSION < 0x010328 |
9c605285 RD |
26 | // Don't generate default ctors or dtors if the C++ doesn't have them |
27 | %feature("nodefault"); | |
214c4fbe | 28 | #else |
9c605285 | 29 | // This is the SWIG 1.3.28 way to do the above... |
214c4fbe RD |
30 | %feature("nodefaultctor"); |
31 | %feature("nodefaultdtor"); | |
32 | #endif | |
33 | ||
69555b5c RD |
34 | // For all items that don't have a %rename already, give them a %rename that |
35 | // removes the leading 'wx' (except for wxEVT_* items.) | |
36 | %rename("%(wxpy)s") ""; | |
37 | ||
214c4fbe RD |
38 | // For now, just supress the warning about using Python keywords as parameter |
39 | // names. Will need to come back later and correct these rather than just | |
40 | // hide them... | |
41 | #pragma SWIG nowarn=314 | |
9c605285 | 42 | |
ab1f7d2a | 43 | //--------------------------------------------------------------------------- |
ab1f7d2a | 44 | |
214c4fbe RD |
45 | // Tell SWIG to wrap all the wrappers with our thread protection |
46 | %define %threadWrapperOn | |
ab1f7d2a RD |
47 | %exception { |
48 | PyThreadState* __tstate = wxPyBeginAllowThreads(); | |
49 | $action | |
50 | wxPyEndAllowThreads(__tstate); | |
51 | if (PyErr_Occurred()) SWIG_fail; | |
52 | } | |
214c4fbe RD |
53 | %enddef |
54 | ||
55 | // This one will turn off the generation of the thread wrapper code | |
56 | %define %threadWrapperOff | |
7499bd88 RD |
57 | %exception { |
58 | $action | |
59 | if (PyErr_Occurred()) SWIG_fail; | |
60 | } | |
214c4fbe | 61 | %enddef |
ab1f7d2a | 62 | |
214c4fbe RD |
63 | // Turn it on by default |
64 | %threadWrapperOn | |
ab1f7d2a RD |
65 | |
66 | // This one can be used to add a check for an existing wxApp before the real | |
67 | // work is done. An exception is raised if there isn't one. | |
68 | %define MustHaveApp(name) | |
db9ba246 RD |
69 | %exception name { |
70 | if (!wxPyCheckForApp()) SWIG_fail; | |
71 | PyThreadState* __tstate = wxPyBeginAllowThreads(); | |
72 | $action | |
73 | wxPyEndAllowThreads(__tstate); | |
74 | if (PyErr_Occurred()) SWIG_fail; | |
75 | } | |
ab1f7d2a RD |
76 | %enddef |
77 | ||
ab1f7d2a | 78 | |
1fce4e96 | 79 | // This macro can be used to disable the releasing of the GIL when calling the |
7499bd88 | 80 | // C++ function. This is like using threadWrapperOff for just this function. |
1fce4e96 RD |
81 | %define KeepGIL(name) |
82 | %exception name { | |
83 | $action | |
84 | if (PyErr_Occurred()) SWIG_fail; | |
85 | } | |
86 | %enddef | |
87 | ||
7bf85405 | 88 | //--------------------------------------------------------------------------- |
d14a1e28 | 89 | // some type definitions to simplify things for SWIG |
af309447 | 90 | |
d14a1e28 RD |
91 | typedef int wxEventType; |
92 | typedef unsigned int size_t; | |
93 | typedef unsigned int time_t; | |
94 | typedef unsigned char byte; | |
82bd6167 | 95 | typedef unsigned long wxUIntPtr; |
fe45b493 | 96 | typedef double wxDouble; |
d14a1e28 | 97 | |
dd9f7fea RD |
98 | #define wxWindowID int |
99 | #define wxCoord int | |
100 | #define wxInt32 int | |
101 | #define wxUint32 unsigned int | |
dd9f7fea | 102 | |
d14a1e28 RD |
103 | |
104 | //---------------------------------------------------------------------- | |
105 | // Various SWIG macros and such | |
106 | ||
2b9048c5 RD |
107 | #define %pythonAppend %feature("pythonappend") |
108 | #define %pythonPrepend %feature("pythonprepend") | |
2f810297 | 109 | #define %noautodoc %feature("noautodoc") |
3ea6e0ec | 110 | |
214c4fbe | 111 | #if SWIG_VERSION >= 0x010327 |
080b9cbc | 112 | #undef %kwargs |
214c4fbe RD |
113 | #define %kwargs %feature("kwargs", "1") |
114 | #define %nokwargs %feature("kwargs", "0") | |
115 | #else | |
116 | #define %kwargs %feature("kwargs") | |
117 | #define %nokwargs %feature("nokwargs") | |
118 | #endif | |
119 | ||
120 | #define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN | |
121 | #define %cleardisown(typespec) %typemap(in) typespec | |
122 | ||
607a3fa0 RD |
123 | #define %ref %feature("ref") |
124 | #define %unref %feature("unref") | |
d14a1e28 | 125 | |
d14a1e28 RD |
126 | |
127 | #ifndef %pythoncode | |
128 | #define %pythoncode %insert("python") | |
dd9f7fea | 129 | #endif |
d14a1e28 RD |
130 | |
131 | #define WXUNUSED(x) x | |
132 | ||
133 | ||
134 | // Given the name of a wxChar (or wxString) constant in C++, make | |
135 | // a static wxString for wxPython, and also let SWIG wrap it. | |
136 | %define MAKE_CONST_WXSTRING(strname) | |
137 | %{ static const wxString wxPy##strname(wx##strname); %} | |
138 | %immutable; | |
1b8c7ba6 RD |
139 | %rename(strname) wxPy##strname; |
140 | const wxString wxPy##strname; | |
d14a1e28 RD |
141 | %mutable; |
142 | %enddef | |
143 | ||
b2dc1044 | 144 | %define MAKE_CONST_WXSTRING2(strname, val) |
089142a5 | 145 | %{ static const wxString wxPy##strname(val); %} |
b2dc1044 | 146 | %immutable; |
1b8c7ba6 RD |
147 | %rename(strname) wxPy##strname; |
148 | const wxString wxPy##strname; | |
b2dc1044 RD |
149 | %mutable; |
150 | %enddef | |
151 | ||
152 | %define MAKE_CONST_WXSTRING_NOSWIG(strname) | |
153 | %{ static const wxString wxPy##strname(wx##strname); %} | |
154 | %enddef | |
b1462dfa | 155 | |
d14a1e28 RD |
156 | // Generate code in the module init for the event types, since they may not be |
157 | // initialized yet when they are used in the static swig_const_table. | |
158 | %typemap(consttab) wxEventType; // TODO: how to prevent code inserted into the consttab? | |
159 | %typemap(constcode) wxEventType "PyDict_SetItemString(d, \"$symname\", PyInt_FromLong($value));"; | |
160 | ||
161 | ||
1cc14cea | 162 | %define %property(NAME, STUFF...) |
0eae5d09 | 163 | %pythoncode { NAME = property(STUFF) } |
1cc14cea | 164 | %enddef |
dd9f7fea | 165 | |
c25f90f6 RD |
166 | |
167 | %define setCallbackInfo(klass) | |
168 | "klass._setCallbackInfo(self, self, klass)" | |
169 | %enddef | |
170 | ||
171 | ||
d07d2bc9 RD |
172 | //---------------------------------------------------------------------- |
173 | // Macros for the docstring and autodoc features of SWIG. These will | |
174 | // help make the code look more readable, and pretty, as well as help | |
175 | // reduce typing in some cases. | |
dd9f7fea RD |
176 | |
177 | // Set the docsring for the given full or partial declaration | |
d07d2bc9 RD |
178 | #ifdef _DO_FULL_DOCS |
179 | %define DocStr(decl, docstr, details) | |
180 | %feature("docstring") decl docstr details; | |
181 | %enddef | |
182 | #else | |
183 | %define DocStr(decl, docstr, details) | |
184 | %feature("docstring") decl docstr; | |
185 | %enddef | |
186 | #endif | |
187 | ||
dd9f7fea RD |
188 | |
189 | // Set the autodoc string for a full or partial declaration | |
b2dc1044 RD |
190 | %define DocA(decl, astr) |
191 | %feature("autodoc") decl astr; | |
192 | %enddef | |
dd9f7fea | 193 | |
dd9f7fea | 194 | |
d07d2bc9 RD |
195 | // Set both the autodoc and docstring for a full or partial declaration |
196 | #ifdef _DO_FULL_DOCS | |
197 | %define DocAStr(decl, astr, docstr, details) | |
198 | %feature("autodoc") decl astr; | |
199 | %feature("docstring") decl docstr details | |
200 | %enddef | |
201 | #else | |
202 | %define DocAStr(decl, astr, docstr, details) | |
203 | %feature("autodoc") decl astr; | |
204 | %feature("docstring") decl docstr | |
205 | %enddef | |
206 | #endif | |
dd9f7fea | 207 | |
d07d2bc9 | 208 | |
dd9f7fea RD |
209 | |
210 | ||
211 | // Set the docstring for a decl and then define the decl too. Must use the | |
212 | // full declaration of the item. | |
d07d2bc9 RD |
213 | #ifdef _DO_FULL_DOCS |
214 | %define DocDeclStr(type, decl, docstr, details) | |
215 | %feature("docstring") decl docstr details; | |
216 | type decl | |
217 | %enddef | |
218 | #else | |
219 | %define DocDeclStr(type, decl, docstr, details) | |
220 | %feature("docstring") decl docstr; | |
221 | type decl | |
222 | %enddef | |
223 | #endif | |
dd9f7fea | 224 | |
d07d2bc9 RD |
225 | |
226 | ||
dd9f7fea | 227 | // As above, but also give the decl a new %name |
d07d2bc9 RD |
228 | #ifdef _DO_FULL_DOCS |
229 | %define DocDeclStrName(type, decl, docstr, details, newname) | |
230 | %feature("docstring") decl docstr details; | |
1b8c7ba6 RD |
231 | %rename(newname) decl; |
232 | type decl | |
d07d2bc9 RD |
233 | %enddef |
234 | #else | |
235 | %define DocDeclStrName(type, decl, docstr, details, newname) | |
236 | %feature("docstring") decl docstr; | |
1b8c7ba6 RD |
237 | %rename(newname) decl; |
238 | type decl | |
d07d2bc9 RD |
239 | %enddef |
240 | #endif | |
241 | ||
dd9f7fea RD |
242 | |
243 | // Set the autodoc string for a decl and then define the decl too. Must use the | |
244 | // full declaration of the item. | |
245 | %define DocDeclA(type, decl, astr) | |
246 | %feature("autodoc") decl astr; | |
247 | type decl | |
248 | %enddef | |
249 | ||
250 | // As above, but also give the decl a new %name | |
251 | %define DocDeclAName(type, decl, astr, newname) | |
252 | %feature("autodoc") decl astr; | |
1b8c7ba6 RD |
253 | %rename(newname) decl; |
254 | type decl | |
dd9f7fea RD |
255 | %enddef |
256 | ||
257 | ||
258 | ||
259 | // Set the autodoc and the docstring for a decl and then define the decl too. | |
260 | // Must use the full declaration of the item. | |
d07d2bc9 | 261 | #ifdef _DO_FULL_DOCS |
a6ef7362 | 262 | %define DocDeclAStr(type, decl, astr, docstr, details) |
d07d2bc9 RD |
263 | %feature("autodoc") decl astr; |
264 | %feature("docstring") decl docstr details; | |
265 | type decl | |
266 | %enddef | |
267 | #else | |
a6ef7362 | 268 | %define DocDeclAStr(type, decl, astr, docstr, details) |
d07d2bc9 RD |
269 | %feature("autodoc") decl astr; |
270 | %feature("docstring") decl docstr; | |
271 | type decl | |
272 | %enddef | |
273 | #endif | |
dd9f7fea | 274 | |
d07d2bc9 | 275 | |
dd9f7fea | 276 | // As above, but also give the decl a new %name |
d07d2bc9 RD |
277 | #ifdef _DO_FULL_DOCS |
278 | %define DocDeclAStrName(type, decl, astr, docstr, details, newname) | |
279 | %feature("autodoc") decl astr; | |
280 | %feature("docstring") decl docstr details; | |
1b8c7ba6 RD |
281 | %rename(newname) decl; |
282 | type decl | |
d07d2bc9 RD |
283 | %enddef |
284 | #else | |
285 | %define DocDeclAStrName(type, decl, astr, docstr, details, newname) | |
286 | %feature("autodoc") decl astr; | |
287 | %feature("docstring") decl docstr; | |
1b8c7ba6 RD |
288 | %rename(newname) decl; |
289 | type decl | |
d07d2bc9 RD |
290 | %enddef |
291 | #endif | |
dd9f7fea RD |
292 | |
293 | ||
294 | ||
295 | // Set the docstring for a constructor decl and then define the decl too. | |
296 | // Must use the full declaration of the item. | |
d07d2bc9 RD |
297 | #ifdef _DO_FULL_DOCS |
298 | %define DocCtorStr(decl, docstr, details) | |
299 | %feature("docstring") decl docstr details; | |
300 | decl | |
301 | %enddef | |
302 | #else | |
303 | %define DocCtorStr(decl, docstr, details) | |
304 | %feature("docstring") decl docstr; | |
305 | decl | |
306 | %enddef | |
307 | #endif | |
dd9f7fea | 308 | |
d07d2bc9 | 309 | |
dd9f7fea | 310 | // As above, but also give the decl a new %name |
d07d2bc9 RD |
311 | #ifdef _DO_FULL_DOCS |
312 | %define DocCtorStrName(decl, docstr, details, newname) | |
313 | %feature("docstring") decl docstr details; | |
1b8c7ba6 RD |
314 | %rename(newname) decl; |
315 | decl | |
d07d2bc9 RD |
316 | %enddef |
317 | #else | |
318 | %define DocCtorStrName(decl, docstr, details, newname) | |
319 | %feature("docstring") decl docstr; | |
1b8c7ba6 RD |
320 | %rename(newname) decl; |
321 | decl | |
d07d2bc9 RD |
322 | %enddef |
323 | #endif | |
dd9f7fea | 324 | |
d07d2bc9 RD |
325 | |
326 | // Set the autodoc string for a constructor decl and then define the decl too. | |
327 | // Must use the full declaration of the item. | |
dd9f7fea RD |
328 | %define DocCtorA(decl, astr) |
329 | %feature("autodoc") decl astr; | |
330 | decl | |
331 | %enddef | |
332 | ||
333 | // As above, but also give the decl a new %name | |
d07d2bc9 | 334 | %define DocCtorAName(decl, astr, newname) |
dd9f7fea | 335 | %feature("autodoc") decl astr; |
1b8c7ba6 RD |
336 | %rename(newname) decl; |
337 | decl | |
dd9f7fea RD |
338 | %enddef |
339 | ||
340 | ||
341 | ||
d07d2bc9 RD |
342 | // Set the autodoc and the docstring for a constructor decl and then define |
343 | // the decl too. Must use the full declaration of the item. | |
344 | #ifdef _DO_FULL_DOCS | |
345 | %define DocCtorAStr(decl, astr, docstr, details) | |
346 | %feature("autodoc") decl astr; | |
347 | %feature("docstring") decl docstr details; | |
348 | decl | |
349 | %enddef | |
350 | #else | |
351 | %define DocCtorAStr(decl, astr, docstr, details) | |
352 | %feature("autodoc") decl astr; | |
353 | %feature("docstring") decl docstr; | |
354 | decl | |
355 | %enddef | |
356 | #endif | |
dd9f7fea | 357 | |
dd9f7fea | 358 | |
d07d2bc9 RD |
359 | |
360 | // As above, but also give the decl a new %name | |
361 | #ifdef _DO_FULL_DOCS | |
362 | %define DocCtorAStrName(decl, astr, docstr, details, newname) | |
363 | %feature("autodoc") decl astr; | |
364 | %feature("docstring") decl docstr details; | |
1b8c7ba6 RD |
365 | %rename(newname) decl; |
366 | decl | |
d07d2bc9 RD |
367 | %enddef |
368 | #else | |
369 | %define DocCtorAStrName(decl, astr, docstr, details, newname) | |
370 | %feature("autodoc") decl astr; | |
371 | %feature("docstring") decl docstr; | |
1b8c7ba6 RD |
372 | %rename(newname) decl; |
373 | decl | |
d07d2bc9 RD |
374 | %enddef |
375 | #endif | |
1e0c8722 | 376 | |
d07d2bc9 | 377 | |
dd9f7fea | 378 | |
d14a1e28 RD |
379 | %define %newgroup |
380 | %pythoncode { | |
381 | %#--------------------------------------------------------------------------- | |
dd9f7fea | 382 | } |
d14a1e28 | 383 | %enddef |
7bf85405 | 384 | |
1b8c7ba6 RD |
385 | |
386 | // A set of macros to make using %rename easier, since %name has been | |
387 | // deprecated... | |
388 | %define %Rename(newname, type, decl) | |
389 | %rename(newname) decl; | |
390 | type decl | |
391 | %enddef | |
392 | ||
393 | %define %RenameCtor(newname, decl) | |
394 | %rename(newname) decl; | |
395 | decl | |
396 | %enddef | |
397 | ||
d8194e5d RD |
398 | #ifdef _DO_FULL_DOCS |
399 | %define %RenameDocCtor(newname, docstr, details, decl) | |
400 | %feature("docstring") decl docstr details; | |
401 | %rename(newname) decl; | |
402 | decl | |
403 | %enddef | |
404 | #else | |
405 | %define %RenameDocCtor(newname, docstr, details, decl) | |
406 | %feature("docstring") decl docstr; | |
407 | %rename(newname) decl; | |
408 | decl | |
409 | %enddef | |
410 | #endif | |
1b8c7ba6 | 411 | |
fe45b493 RD |
412 | #ifdef _DO_FULL_DOCS |
413 | %define %RenameDocStr(newname, docstr, details, type, decl) | |
414 | %feature("docstring") decl docstr; | |
415 | %rename(newname) decl; | |
416 | type decl | |
417 | %enddef | |
418 | #else | |
419 | %define %RenameDocStr(newname, docstr, details, type, decl) | |
420 | %feature("docstring") decl docstr details; | |
421 | %rename(newname) decl; | |
422 | type decl | |
423 | %enddef | |
424 | #endif | |
a7a01418 RD |
425 | |
426 | //--------------------------------------------------------------------------- | |
427 | // Generates a base_On* method that just wraps a call to the On*, and mark it | |
428 | // deprecated. We need this because there is no longer any need for a | |
429 | // base_On* method to be able to call the C++ base class method, since our | |
430 | // virtualization code can now sense when an attempt is being made to call | |
431 | // the base class version from the derived class override. | |
432 | ||
433 | %define %MAKE_BASE_FUNC(Class, Method) | |
434 | %pythoncode { | |
435 | def base_##Method(*args, **kw): | |
436 | return Class.Method(*args, **kw) | |
437 | base_##Method = wx._deprecated(base_##Method, | |
438 | "Please use Class.Method instead.") | |
439 | } | |
440 | %enddef | |
441 | ||
64e8a1f0 RD |
442 | //--------------------------------------------------------------------------- |
443 | // Forward declarations and %renames for some classes, so the autodoc strings | |
444 | // will be able to use the right types even when the real class declaration is | |
3ea6e0ec | 445 | // not in the module being processed or seen by %import's. |
64e8a1f0 RD |
446 | |
447 | #ifdef BUILDING_RENAMERS | |
448 | #define FORWARD_DECLARE(wxName, Name) | |
449 | #else | |
450 | %define FORWARD_DECLARE(wxName, Name) | |
451 | %rename(Name) wxName; | |
452 | class wxName; | |
453 | %enddef | |
454 | #endif | |
455 | ||
b2dc1044 RD |
456 | FORWARD_DECLARE(wxString, String); |
457 | FORWARD_DECLARE(wxBitmap, Bitmap); | |
458 | FORWARD_DECLARE(wxDateTime, DateTime); | |
459 | FORWARD_DECLARE(wxInputStream, InputStream); | |
460 | FORWARD_DECLARE(wxDC, DC); | |
461 | FORWARD_DECLARE(wxCursor, Cursor); | |
462 | FORWARD_DECLARE(wxRegion, Region); | |
463 | FORWARD_DECLARE(wxColour, Colour); | |
464 | FORWARD_DECLARE(wxFont, Font); | |
465 | FORWARD_DECLARE(wxCaret, Caret); | |
466 | FORWARD_DECLARE(wxToolTip, ToolTip); | |
d7466b1d | 467 | FORWARD_DECLARE(wxPyDropTarget, DropTarget); |
b2dc1044 RD |
468 | FORWARD_DECLARE(wxImageList, ImageList); |
469 | FORWARD_DECLARE(wxMemoryDC, MemoryDC); | |
470 | FORWARD_DECLARE(wxHtmlTagHandler, HtmlTagHandler); | |
471 | FORWARD_DECLARE(wxConfigBase, ConfigBase); | |
472 | FORWARD_DECLARE(wxIcon, Icon); | |
3ea6e0ec | 473 | FORWARD_DECLARE(wxStaticBox, StaticBox); |
b2dc1044 | 474 | |
64e8a1f0 | 475 | |
fe45b493 RD |
476 | //--------------------------------------------------------------------------- |
477 | // This macro makes a class to wrap a type specific class derived from wxList, | |
478 | // and make it look like a Python sequence, including with iterator support | |
479 | ||
480 | %define wxLIST_WRAPPER(ListClass, ItemClass) | |
481 | // first a bit of C++ code... | |
482 | %{ | |
483 | class ListClass##_iterator | |
484 | { | |
485 | public: | |
486 | ListClass##_iterator(ListClass::compatibility_iterator start) | |
487 | : m_node(start) {} | |
488 | ||
489 | ItemClass* next() { | |
490 | ItemClass* obj = NULL; | |
491 | if (m_node) { | |
492 | obj = m_node->GetData(); | |
493 | m_node = m_node->GetNext(); | |
494 | } | |
495 | else PyErr_SetString(PyExc_StopIteration, ""); | |
496 | return obj; | |
497 | } | |
498 | private: | |
499 | ListClass::compatibility_iterator m_node; | |
500 | }; | |
501 | %} | |
502 | ||
503 | // Now declare the classes for SWIG | |
504 | ||
505 | DocStr(ListClass##_iterator, | |
506 | "This class serves as an iterator for a ListClass object.", ""); | |
507 | ||
508 | class ListClass##_iterator | |
509 | { | |
510 | public: | |
511 | //ListClass##_iterator(); | |
512 | ~ListClass_iterator(); | |
513 | KeepGIL(next); | |
514 | ItemClass* next(); | |
515 | }; | |
516 | ||
517 | ||
518 | DocStr(ListClass, | |
519 | "This class wraps a wxList-based class and gives it a Python | |
520 | sequence-like interface. Sequence operations supported are length, | |
521 | index access and iteration.", ""); | |
522 | ||
523 | class ListClass | |
524 | { | |
525 | public: | |
526 | //ListClass(); This will always be created by some C++ function | |
527 | ~ListClass(); | |
528 | ||
529 | %extend { | |
530 | KeepGIL(__len__); | |
531 | size_t __len__() { | |
532 | return self->size(); | |
533 | } | |
534 | ||
535 | KeepGIL(__getitem__); | |
536 | ItemClass* __getitem__(size_t index) { | |
537 | if (index < self->size()) { | |
538 | ListClass::compatibility_iterator node = self->Item(index); | |
539 | if (node) return node->GetData(); | |
540 | } | |
541 | PyErr_SetString(PyExc_IndexError, "Invalid list index"); | |
542 | return NULL; | |
543 | } | |
544 | ||
545 | KeepGIL(__contains__); | |
546 | bool __contains__(const ItemClass* obj) { | |
547 | return self->Find(obj) != NULL; | |
548 | } | |
549 | ||
550 | KeepGIL(__iter__); | |
551 | %newobject __iter__; | |
552 | ListClass##_iterator* __iter__() { | |
553 | return new ListClass##_iterator(self->GetFirst()); | |
554 | } | |
555 | } | |
556 | %pythoncode { | |
557 | def __repr__(self): | |
558 | return "ListClass: " + repr(list(self)) | |
559 | } | |
560 | }; | |
561 | %enddef | |
562 | ||
563 | ||
564 | ||
565 | // This macro is similar to the above, but it is to be used when there isn't a | |
566 | // type-specific C++ list class to use. In other words the C++ code is using | |
567 | // a plain wxList and typecasting the node values, so we'll do the same. | |
568 | %define wxUNTYPED_LIST_WRAPPER(ListClass, ItemClass) | |
569 | // first a bit of C++ code... | |
570 | %{ | |
571 | class ListClass | |
572 | { | |
573 | public: | |
574 | ListClass(wxList* theList) | |
575 | : m_list(theList) {} | |
576 | ~ListClass() {} | |
577 | public: | |
578 | wxList* m_list; | |
579 | }; | |
580 | ||
581 | class ListClass##_iterator | |
582 | { | |
583 | public: | |
584 | ListClass##_iterator(wxList::compatibility_iterator start) | |
585 | : m_node(start) {} | |
586 | ||
587 | ItemClass* next() { | |
588 | ItemClass* obj = NULL; | |
589 | if (m_node) { | |
590 | obj = (ItemClass*)m_node->GetData(); | |
591 | m_node = m_node->GetNext(); | |
592 | } | |
593 | else PyErr_SetString(PyExc_StopIteration, ""); | |
594 | return obj; | |
595 | } | |
596 | private: | |
597 | wxList::compatibility_iterator m_node; | |
598 | }; | |
599 | %} | |
600 | ||
601 | // Now declare the classes for SWIG | |
602 | ||
603 | DocStr(ListClass##_iterator, | |
604 | "This class serves as an iterator for a ListClass object.", ""); | |
605 | ||
606 | class ListClass##_iterator | |
607 | { | |
608 | public: | |
609 | //ListClass##_iterator(); | |
610 | ~ListClass_iterator(); | |
611 | KeepGIL(next); | |
612 | ItemClass* next(); | |
613 | }; | |
614 | ||
615 | ||
616 | DocStr(ListClass, | |
617 | "This class wraps a wxList-based class and gives it a Python | |
618 | sequence-like interface. Sequence operations supported are length, | |
619 | index access and iteration.", ""); | |
620 | class ListClass | |
621 | { | |
622 | public: | |
623 | //ListClass(); This will always be created by some C++ function | |
624 | ~ListClass(); | |
625 | ||
626 | %extend { | |
627 | KeepGIL(__len__); | |
628 | size_t __len__() { | |
629 | return self->m_list->size(); | |
630 | } | |
631 | ||
632 | KeepGIL(__getitem__); | |
633 | ItemClass* __getitem__(size_t index) { | |
634 | if (index < self->m_list->size()) { | |
635 | wxList::compatibility_iterator node = self->m_list->Item(index); | |
636 | if (node) return (ItemClass*)node->GetData(); | |
637 | } | |
638 | PyErr_SetString(PyExc_IndexError, "Invalid list index"); | |
639 | return NULL; | |
640 | } | |
641 | ||
642 | KeepGIL(__contains__); | |
643 | bool __contains__(const ItemClass* obj) { | |
644 | return self->m_list->Find(obj) != NULL; | |
645 | } | |
646 | ||
647 | KeepGIL(__iter__); | |
648 | %newobject __iter__; | |
649 | ListClass##_iterator* __iter__() { | |
650 | return new ListClass##_iterator(self->m_list->GetFirst()); | |
651 | } | |
652 | } | |
653 | %pythoncode { | |
654 | def __repr__(self): | |
655 | return "ListClass: " + repr(list(self)) | |
656 | } | |
657 | }; | |
658 | ||
659 | // A typemap to handle converting a wxList& return value to this new list | |
660 | // type. To use this just change the return value type in the class | |
661 | // definition to this typedef instead of wxList, then SWIG will use the | |
662 | // typemap. | |
663 | %{ | |
664 | typedef wxList ListClass##_t; | |
665 | %} | |
666 | %typemap(out) ListClass##_t& { | |
667 | ListClass* mylist = new ListClass($1); | |
668 | $result = SWIG_NewPointerObj(SWIG_as_voidptr(mylist), SWIGTYPE_p_##ListClass, SWIG_POINTER_OWN ); | |
669 | } | |
670 | %enddef | |
671 | ||
672 | ||
673 | ||
7bf85405 RD |
674 | //--------------------------------------------------------------------------- |
675 | ||
aeee37c3 RD |
676 | %{ |
677 | #if !WXWIN_COMPATIBILITY_2_4 | |
678 | #define wxHIDE_READONLY 0 | |
679 | #endif | |
680 | %} | |
681 | ||
682 | ||
7bf85405 RD |
683 | // General numeric #define's and etc. Making them all enums makes SWIG use the |
684 | // real macro when making the Python Int | |
685 | ||
686 | enum { | |
d14a1e28 RD |
687 | // wxMAJOR_VERSION, |
688 | // wxMINOR_VERSION, | |
689 | // wxRELEASE_NUMBER, | |
7bf85405 | 690 | |
08127323 | 691 | wxNOT_FOUND, |
7bf85405 RD |
692 | |
693 | wxVSCROLL, | |
694 | wxHSCROLL, | |
695 | wxCAPTION, | |
696 | wxDOUBLE_BORDER, | |
697 | wxSUNKEN_BORDER, | |
698 | wxRAISED_BORDER, | |
699 | wxBORDER, | |
700 | wxSIMPLE_BORDER, | |
701 | wxSTATIC_BORDER, | |
702 | wxTRANSPARENT_WINDOW, | |
703 | wxNO_BORDER, | |
c96bf2a7 | 704 | wxDEFAULT_CONTROL_BORDER, |
5f57b149 RD |
705 | wxDEFAULT_STATUSBAR_STYLE, |
706 | ||
7bf85405 | 707 | wxTAB_TRAVERSAL, |
1afc06c2 | 708 | wxWANTS_CHARS, |
0122b7e3 | 709 | wxPOPUP_WINDOW, |
7bf85405 | 710 | wxCENTER_FRAME, |
1afc06c2 RD |
711 | wxCENTRE_ON_SCREEN, |
712 | wxCENTER_ON_SCREEN, | |
713 | ||
08127323 | 714 | wxCLIP_CHILDREN, |
edf2f43e | 715 | wxCLIP_SIBLINGS, |
b8b8dda7 | 716 | |
88bb5983 RD |
717 | wxWINDOW_STYLE_MASK, |
718 | ||
6cffbf02 RD |
719 | wxALWAYS_SHOW_SB, |
720 | ||
7bf85405 RD |
721 | wxRETAINED, |
722 | wxBACKINGSTORE, | |
b96c7a38 | 723 | |
7bf85405 RD |
724 | wxCOLOURED, |
725 | wxFIXED_LENGTH, | |
1b62f00d | 726 | |
7bf85405 RD |
727 | wxLB_NEEDED_SB, |
728 | wxLB_ALWAYS_SB, | |
729 | wxLB_SORT, | |
730 | wxLB_SINGLE, | |
731 | wxLB_MULTIPLE, | |
732 | wxLB_EXTENDED, | |
733 | wxLB_OWNERDRAW, | |
734 | wxLB_HSCROLL, | |
b1e930a5 | 735 | |
7bf85405 RD |
736 | wxCB_SIMPLE, |
737 | wxCB_DROPDOWN, | |
738 | wxCB_SORT, | |
739 | wxCB_READONLY, | |
740 | wxRA_HORIZONTAL, | |
741 | wxRA_VERTICAL, | |
ed175610 RD |
742 | wxRA_SPECIFY_ROWS, |
743 | wxRA_SPECIFY_COLS, | |
8815349a | 744 | wxRA_USE_CHECKBOX, |
7bf85405 | 745 | wxRB_GROUP, |
1e4a197e | 746 | wxRB_SINGLE, |
7bf85405 RD |
747 | wxSB_HORIZONTAL, |
748 | wxSB_VERTICAL, | |
8815349a | 749 | wxRB_USE_CHECKBOX, |
cf694132 | 750 | wxST_SIZEGRIP, |
2d6a2f1d | 751 | |
7bf85405 RD |
752 | wxFLOOD_SURFACE, |
753 | wxFLOOD_BORDER, | |
754 | wxODDEVEN_RULE, | |
755 | wxWINDING_RULE, | |
756 | wxTOOL_TOP, | |
757 | wxTOOL_BOTTOM, | |
758 | wxTOOL_LEFT, | |
759 | wxTOOL_RIGHT, | |
760 | wxOK, | |
761 | wxYES_NO, | |
762 | wxCANCEL, | |
763 | wxYES, | |
764 | wxNO, | |
1afc06c2 RD |
765 | wxNO_DEFAULT, |
766 | wxYES_DEFAULT, | |
927773c7 RD |
767 | wxAPPLY, |
768 | wxCLOSE, | |
769 | ||
7bf85405 RD |
770 | wxICON_EXCLAMATION, |
771 | wxICON_HAND, | |
772 | wxICON_QUESTION, | |
773 | wxICON_INFORMATION, | |
774 | wxICON_STOP, | |
775 | wxICON_ASTERISK, | |
776 | wxICON_MASK, | |
1afc06c2 RD |
777 | wxICON_WARNING, |
778 | wxICON_ERROR, | |
779 | ||
780 | wxFORWARD, | |
781 | wxBACKWARD, | |
782 | wxRESET, | |
783 | wxHELP, | |
784 | wxMORE, | |
785 | wxSETUP, | |
786 | ||
f3d9dc1d | 787 | |
7bf85405 RD |
788 | wxSIZE_AUTO_WIDTH, |
789 | wxSIZE_AUTO_HEIGHT, | |
790 | wxSIZE_AUTO, | |
791 | wxSIZE_USE_EXISTING, | |
792 | wxSIZE_ALLOW_MINUS_ONE, | |
02b800ce | 793 | wxSIZE_FORCE, |
7bf85405 RD |
794 | wxPORTRAIT, |
795 | wxLANDSCAPE, | |
bb0054cd RD |
796 | wxPRINT_QUALITY_HIGH, |
797 | wxPRINT_QUALITY_MEDIUM, | |
798 | wxPRINT_QUALITY_LOW, | |
799 | wxPRINT_QUALITY_DRAFT, | |
26e335b8 | 800 | |
3eb221f6 RD |
801 | wxID_ANY, |
802 | wxID_SEPARATOR, | |
02b800ce | 803 | wxID_NONE, |
3eb221f6 | 804 | |
d14a1e28 | 805 | wxID_LOWEST, |
7bf85405 RD |
806 | wxID_OPEN, |
807 | wxID_CLOSE, | |
808 | wxID_NEW, | |
809 | wxID_SAVE, | |
810 | wxID_SAVEAS, | |
811 | wxID_REVERT, | |
812 | wxID_EXIT, | |
813 | wxID_UNDO, | |
814 | wxID_REDO, | |
815 | wxID_HELP, | |
816 | wxID_PRINT, | |
817 | wxID_PRINT_SETUP, | |
09c4bfc3 | 818 | wxID_PAGE_SETUP, |
7bf85405 RD |
819 | wxID_PREVIEW, |
820 | wxID_ABOUT, | |
821 | wxID_HELP_CONTENTS, | |
822 | wxID_HELP_COMMANDS, | |
823 | wxID_HELP_PROCEDURES, | |
824 | wxID_HELP_CONTEXT, | |
6aaca5ba RD |
825 | wxID_HELP_INDEX, |
826 | wxID_HELP_SEARCH, | |
b5a5d647 | 827 | wxID_CLOSE_ALL, |
1a10a058 | 828 | wxID_PREFERENCES, |
26e335b8 | 829 | |
e81b607b | 830 | wxID_EDIT, |
7bf85405 RD |
831 | wxID_CUT, |
832 | wxID_COPY, | |
833 | wxID_PASTE, | |
834 | wxID_CLEAR, | |
835 | wxID_FIND, | |
d56cebe7 RD |
836 | wxID_DUPLICATE, |
837 | wxID_SELECTALL, | |
26e335b8 | 838 | |
3ef86e32 RD |
839 | wxID_DELETE, |
840 | wxID_REPLACE, | |
841 | wxID_REPLACE_ALL, | |
842 | wxID_PROPERTIES, | |
843 | ||
844 | wxID_VIEW_DETAILS, | |
845 | wxID_VIEW_LARGEICONS, | |
846 | wxID_VIEW_SMALLICONS, | |
847 | wxID_VIEW_LIST, | |
848 | wxID_VIEW_SORTDATE, | |
849 | wxID_VIEW_SORTNAME, | |
850 | wxID_VIEW_SORTSIZE, | |
851 | wxID_VIEW_SORTTYPE, | |
852 | ||
e81b607b | 853 | wxID_FILE, |
7bf85405 RD |
854 | wxID_FILE1, |
855 | wxID_FILE2, | |
856 | wxID_FILE3, | |
857 | wxID_FILE4, | |
858 | wxID_FILE5, | |
859 | wxID_FILE6, | |
860 | wxID_FILE7, | |
861 | wxID_FILE8, | |
862 | wxID_FILE9, | |
26e335b8 | 863 | |
7bf85405 RD |
864 | wxID_OK, |
865 | wxID_CANCEL, | |
866 | wxID_APPLY, | |
867 | wxID_YES, | |
868 | wxID_NO, | |
cf694132 | 869 | wxID_STATIC, |
f3d9dc1d RD |
870 | wxID_FORWARD, |
871 | wxID_BACKWARD, | |
26e335b8 | 872 | wxID_DEFAULT, |
f3d9dc1d | 873 | wxID_MORE, |
26e335b8 RD |
874 | wxID_SETUP, |
875 | wxID_RESET, | |
876 | wxID_CONTEXT_HELP, | |
877 | wxID_YESTOALL, | |
878 | wxID_NOTOALL, | |
879 | wxID_ABORT, | |
880 | wxID_RETRY, | |
881 | wxID_IGNORE, | |
f3d9dc1d | 882 | |
1a1ed526 RD |
883 | wxID_ADD, |
884 | wxID_REMOVE, | |
885 | ||
886 | wxID_UP, | |
887 | wxID_DOWN, | |
888 | wxID_HOME, | |
889 | wxID_REFRESH, | |
890 | wxID_STOP, | |
891 | wxID_INDEX, | |
892 | ||
893 | wxID_BOLD, | |
894 | wxID_ITALIC, | |
895 | wxID_JUSTIFY_CENTER, | |
896 | wxID_JUSTIFY_FILL, | |
897 | wxID_JUSTIFY_RIGHT, | |
898 | wxID_JUSTIFY_LEFT, | |
899 | wxID_UNDERLINE, | |
900 | wxID_INDENT, | |
901 | wxID_UNINDENT, | |
902 | wxID_ZOOM_100, | |
903 | wxID_ZOOM_FIT, | |
904 | wxID_ZOOM_IN, | |
905 | wxID_ZOOM_OUT, | |
906 | wxID_UNDELETE, | |
907 | wxID_REVERT_TO_SAVED, | |
908 | ||
d14a1e28 | 909 | wxID_HIGHEST, |
dd9f7fea | 910 | |
8bf5d46e | 911 | wxMENU_TEAROFF, |
1afc06c2 | 912 | wxMB_DOCKABLE, |
8bf5d46e | 913 | wxNO_FULL_REPAINT_ON_RESIZE, |
6a8b9da4 RD |
914 | wxFULL_REPAINT_ON_RESIZE, |
915 | ||
1afc06c2 RD |
916 | wxLI_HORIZONTAL, |
917 | wxLI_VERTICAL, | |
918 | ||
d1679124 | 919 | wxWS_EX_VALIDATE_RECURSIVELY, |
0122b7e3 | 920 | wxWS_EX_BLOCK_EVENTS, |
78e8819c | 921 | wxWS_EX_TRANSIENT, |
ecc08ead | 922 | |
3ef86e32 RD |
923 | wxWS_EX_THEMED_BACKGROUND, |
924 | wxWS_EX_PROCESS_IDLE, | |
925 | wxWS_EX_PROCESS_UI_UPDATES, | |
926 | ||
927 | ||
ecc08ead RD |
928 | // Mapping modes (as per Windows) |
929 | wxMM_TEXT, | |
930 | wxMM_LOMETRIC, | |
931 | wxMM_HIMETRIC, | |
932 | wxMM_LOENGLISH, | |
933 | wxMM_HIENGLISH, | |
934 | wxMM_TWIPS, | |
935 | wxMM_ISOTROPIC, | |
936 | wxMM_ANISOTROPIC, | |
937 | wxMM_POINTS, | |
938 | wxMM_METRIC, | |
939 | ||
3eb221f6 | 940 | |
1e4a197e RD |
941 | // It looks like wxTabCtrl may rise from the dead. Uncomment these if |
942 | // it gets an implementation for all platforms... | |
943 | // wxTC_RIGHTJUSTIFY, | |
944 | // wxTC_FIXEDWIDTH, | |
945 | // wxTC_TOP, | |
946 | // wxTC_LEFT, | |
947 | // wxTC_RIGHT, | |
948 | // wxTC_BOTTOM, | |
949 | // wxTC_MULTILINE, | |
950 | // wxTC_OWNERDRAW, | |
951 | ||
7bf85405 RD |
952 | }; |
953 | ||
954 | ||
d14a1e28 RD |
955 | |
956 | enum wxGeometryCentre | |
957 | { | |
958 | wxCENTRE = 0x0001, | |
959 | wxCENTER = wxCENTRE | |
960 | }; | |
961 | ||
962 | ||
963 | enum wxOrientation | |
964 | { | |
965 | wxHORIZONTAL, | |
966 | wxVERTICAL, | |
967 | wxBOTH | |
968 | }; | |
969 | ||
970 | enum wxDirection | |
971 | { | |
972 | wxLEFT, | |
973 | wxRIGHT, | |
974 | wxUP, | |
975 | wxDOWN, | |
976 | ||
977 | wxTOP, | |
978 | wxBOTTOM, | |
979 | ||
980 | wxNORTH, | |
981 | wxSOUTH, | |
982 | wxWEST, | |
983 | wxEAST, | |
984 | ||
985 | wxALL | |
986 | }; | |
987 | ||
988 | enum wxAlignment | |
989 | { | |
990 | wxALIGN_NOT, | |
991 | wxALIGN_CENTER_HORIZONTAL, | |
992 | wxALIGN_CENTRE_HORIZONTAL, | |
993 | wxALIGN_LEFT, | |
994 | wxALIGN_TOP, | |
995 | wxALIGN_RIGHT, | |
996 | wxALIGN_BOTTOM, | |
997 | wxALIGN_CENTER_VERTICAL, | |
998 | wxALIGN_CENTRE_VERTICAL, | |
999 | ||
1000 | wxALIGN_CENTER, | |
1001 | wxALIGN_CENTRE, | |
1002 | ||
1003 | wxALIGN_MASK, | |
1004 | }; | |
1005 | ||
1006 | enum wxStretch | |
1007 | { | |
1008 | wxSTRETCH_NOT, | |
1009 | wxSHRINK, | |
1010 | wxGROW, | |
1011 | wxEXPAND, | |
1012 | wxSHAPED, | |
f52e0cf4 | 1013 | wxFIXED_MINSIZE, |
d14a1e28 RD |
1014 | wxTILE, |
1015 | }; | |
cbfc9df6 | 1016 | %pythoncode { ADJUST_MINSIZE = 0 } |
d14a1e28 | 1017 | |
ebf4302c RD |
1018 | enum wxBorder |
1019 | { | |
1020 | wxBORDER_DEFAULT, | |
1021 | wxBORDER_NONE, | |
1022 | wxBORDER_STATIC, | |
1023 | wxBORDER_SIMPLE, | |
1024 | wxBORDER_RAISED, | |
1025 | wxBORDER_SUNKEN, | |
1026 | wxBORDER_DOUBLE, | |
1027 | wxBORDER_MASK, | |
1028 | }; | |
1029 | ||
1030 | ||
1a1ed526 RD |
1031 | enum wxBackgroundStyle |
1032 | { | |
1033 | wxBG_STYLE_SYSTEM, | |
1034 | wxBG_STYLE_COLOUR, | |
1035 | wxBG_STYLE_CUSTOM | |
1036 | }; | |
1037 | ||
1038 | ||
7bf85405 RD |
1039 | enum { |
1040 | wxDEFAULT , | |
1041 | wxDECORATIVE, | |
1042 | wxROMAN, | |
1043 | wxSCRIPT, | |
1044 | wxSWISS, | |
1045 | wxMODERN, | |
1046 | wxTELETYPE, | |
1047 | wxVARIABLE, | |
1048 | wxFIXED, | |
1049 | wxNORMAL, | |
1050 | wxLIGHT, | |
1051 | wxBOLD, | |
1052 | wxITALIC, | |
1053 | wxSLANT, | |
1054 | wxSOLID, | |
1055 | wxDOT, | |
1056 | wxLONG_DASH, | |
1057 | wxSHORT_DASH, | |
1058 | wxDOT_DASH, | |
1059 | wxUSER_DASH, | |
1060 | wxTRANSPARENT, | |
1061 | wxSTIPPLE, | |
8224a808 RD |
1062 | wxSTIPPLE_MASK, |
1063 | wxSTIPPLE_MASK_OPAQUE, | |
7bf85405 RD |
1064 | wxBDIAGONAL_HATCH, |
1065 | wxCROSSDIAG_HATCH, | |
1066 | wxFDIAGONAL_HATCH, | |
1067 | wxCROSS_HATCH, | |
1068 | wxHORIZONTAL_HATCH, | |
1069 | wxVERTICAL_HATCH, | |
1070 | wxJOIN_BEVEL, | |
1071 | wxJOIN_MITER, | |
1072 | wxJOIN_ROUND, | |
1073 | wxCAP_ROUND, | |
1074 | wxCAP_PROJECTING, | |
1075 | wxCAP_BUTT | |
1076 | }; | |
1077 | ||
1078 | typedef enum { | |
1079 | wxCLEAR, // 0 | |
1080 | wxXOR, // src XOR dst | |
1081 | wxINVERT, // NOT dst | |
1082 | wxOR_REVERSE, // src OR (NOT dst) | |
1083 | wxAND_REVERSE,// src AND (NOT dst) | |
1084 | wxCOPY, // src | |
1085 | wxAND, // src AND dst | |
1086 | wxAND_INVERT, // (NOT src) AND dst | |
1087 | wxNO_OP, // dst | |
1088 | wxNOR, // (NOT src) AND (NOT dst) | |
1089 | wxEQUIV, // (NOT src) XOR dst | |
1090 | wxSRC_INVERT, // (NOT src) | |
1091 | wxOR_INVERT, // (NOT src) OR dst | |
1092 | wxNAND, // (NOT src) OR (NOT dst) | |
1093 | wxOR, // src OR dst | |
1094 | wxSET, // 1 | |
26b9cf27 RD |
1095 | // wxSRC_OR, // source _bitmap_ OR destination |
1096 | // wxSRC_AND // source _bitmap_ AND destination | |
7bf85405 RD |
1097 | } form_ops_t; |
1098 | ||
65fe3842 | 1099 | enum wxKeyCode { |
08dcfb92 RD |
1100 | WXK_BACK = 8, |
1101 | WXK_TAB = 9, | |
1102 | WXK_RETURN = 13, | |
1103 | WXK_ESCAPE = 27, | |
1104 | WXK_SPACE = 32, | |
1105 | WXK_DELETE = 127, | |
1106 | ||
1107 | WXK_START = 300, | |
1108 | WXK_LBUTTON, | |
1109 | WXK_RBUTTON, | |
1110 | WXK_CANCEL, | |
1111 | WXK_MBUTTON, | |
1112 | WXK_CLEAR, | |
1113 | WXK_SHIFT, | |
1114 | WXK_ALT, | |
1115 | WXK_CONTROL, | |
1116 | WXK_MENU, | |
1117 | WXK_PAUSE, | |
1118 | WXK_CAPITAL, | |
08dcfb92 RD |
1119 | WXK_END, |
1120 | WXK_HOME, | |
1121 | WXK_LEFT, | |
1122 | WXK_UP, | |
1123 | WXK_RIGHT, | |
1124 | WXK_DOWN, | |
1125 | WXK_SELECT, | |
1126 | WXK_PRINT, | |
1127 | WXK_EXECUTE, | |
1128 | WXK_SNAPSHOT, | |
1129 | WXK_INSERT, | |
1130 | WXK_HELP, | |
1131 | WXK_NUMPAD0, | |
1132 | WXK_NUMPAD1, | |
1133 | WXK_NUMPAD2, | |
1134 | WXK_NUMPAD3, | |
1135 | WXK_NUMPAD4, | |
1136 | WXK_NUMPAD5, | |
1137 | WXK_NUMPAD6, | |
1138 | WXK_NUMPAD7, | |
1139 | WXK_NUMPAD8, | |
1140 | WXK_NUMPAD9, | |
1141 | WXK_MULTIPLY, | |
1142 | WXK_ADD, | |
1143 | WXK_SEPARATOR, | |
1144 | WXK_SUBTRACT, | |
1145 | WXK_DECIMAL, | |
1146 | WXK_DIVIDE, | |
1147 | WXK_F1, | |
1148 | WXK_F2, | |
1149 | WXK_F3, | |
1150 | WXK_F4, | |
1151 | WXK_F5, | |
1152 | WXK_F6, | |
1153 | WXK_F7, | |
1154 | WXK_F8, | |
1155 | WXK_F9, | |
1156 | WXK_F10, | |
1157 | WXK_F11, | |
1158 | WXK_F12, | |
1159 | WXK_F13, | |
1160 | WXK_F14, | |
1161 | WXK_F15, | |
1162 | WXK_F16, | |
1163 | WXK_F17, | |
1164 | WXK_F18, | |
1165 | WXK_F19, | |
1166 | WXK_F20, | |
1167 | WXK_F21, | |
1168 | WXK_F22, | |
1169 | WXK_F23, | |
1170 | WXK_F24, | |
1171 | WXK_NUMLOCK, | |
1172 | WXK_SCROLL, | |
1173 | WXK_PAGEUP, | |
1174 | WXK_PAGEDOWN, | |
1175 | ||
1176 | WXK_NUMPAD_SPACE, | |
1177 | WXK_NUMPAD_TAB, | |
1178 | WXK_NUMPAD_ENTER, | |
1179 | WXK_NUMPAD_F1, | |
1180 | WXK_NUMPAD_F2, | |
1181 | WXK_NUMPAD_F3, | |
1182 | WXK_NUMPAD_F4, | |
1183 | WXK_NUMPAD_HOME, | |
1184 | WXK_NUMPAD_LEFT, | |
1185 | WXK_NUMPAD_UP, | |
1186 | WXK_NUMPAD_RIGHT, | |
1187 | WXK_NUMPAD_DOWN, | |
08dcfb92 | 1188 | WXK_NUMPAD_PAGEUP, |
08dcfb92 RD |
1189 | WXK_NUMPAD_PAGEDOWN, |
1190 | WXK_NUMPAD_END, | |
1191 | WXK_NUMPAD_BEGIN, | |
1192 | WXK_NUMPAD_INSERT, | |
1193 | WXK_NUMPAD_DELETE, | |
1194 | WXK_NUMPAD_EQUAL, | |
1195 | WXK_NUMPAD_MULTIPLY, | |
1196 | WXK_NUMPAD_ADD, | |
1197 | WXK_NUMPAD_SEPARATOR, | |
1198 | WXK_NUMPAD_SUBTRACT, | |
1199 | WXK_NUMPAD_DECIMAL, | |
1200 | WXK_NUMPAD_DIVIDE, | |
1201 | ||
1202 | WXK_WINDOWS_LEFT, | |
1203 | WXK_WINDOWS_RIGHT, | |
1204 | WXK_WINDOWS_MENU, | |
1205 | ||
1206 | WXK_COMMAND, | |
1207 | ||
1208 | // Hardware-specific buttons | |
1209 | WXK_SPECIAL1 = 193, | |
1210 | WXK_SPECIAL2, | |
1211 | WXK_SPECIAL3, | |
1212 | WXK_SPECIAL4, | |
1213 | WXK_SPECIAL5, | |
1214 | WXK_SPECIAL6, | |
1215 | WXK_SPECIAL7, | |
1216 | WXK_SPECIAL8, | |
1217 | WXK_SPECIAL9, | |
1218 | WXK_SPECIAL10, | |
1219 | WXK_SPECIAL11, | |
1220 | WXK_SPECIAL12, | |
1221 | WXK_SPECIAL13, | |
1222 | WXK_SPECIAL14, | |
1223 | WXK_SPECIAL15, | |
1224 | WXK_SPECIAL16, | |
1225 | WXK_SPECIAL17, | |
1226 | WXK_SPECIAL18, | |
1227 | WXK_SPECIAL19, | |
1228 | WXK_SPECIAL20 | |
7bf85405 RD |
1229 | }; |
1230 | ||
cbfc9df6 RD |
1231 | // deprecated synonymns |
1232 | %pythoncode { | |
1233 | WXK_PRIOR = WXK_PAGEUP | |
1234 | WXK_NEXT = WXK_PAGEDOWN | |
1235 | WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP | |
1236 | WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN | |
1237 | } | |
cf694132 RD |
1238 | |
1239 | typedef enum { | |
1240 | wxPAPER_NONE, // Use specific dimensions | |
1241 | wxPAPER_LETTER, // Letter, 8 1/2 by 11 inches | |
1242 | wxPAPER_LEGAL, // Legal, 8 1/2 by 14 inches | |
1243 | wxPAPER_A4, // A4 Sheet, 210 by 297 millimeters | |
1244 | wxPAPER_CSHEET, // C Sheet, 17 by 22 inches | |
1245 | wxPAPER_DSHEET, // D Sheet, 22 by 34 inches | |
1246 | wxPAPER_ESHEET, // E Sheet, 34 by 44 inches | |
1247 | wxPAPER_LETTERSMALL, // Letter Small, 8 1/2 by 11 inches | |
1248 | wxPAPER_TABLOID, // Tabloid, 11 by 17 inches | |
1249 | wxPAPER_LEDGER, // Ledger, 17 by 11 inches | |
1250 | wxPAPER_STATEMENT, // Statement, 5 1/2 by 8 1/2 inches | |
1251 | wxPAPER_EXECUTIVE, // Executive, 7 1/4 by 10 1/2 inches | |
1252 | wxPAPER_A3, // A3 sheet, 297 by 420 millimeters | |
1253 | wxPAPER_A4SMALL, // A4 small sheet, 210 by 297 millimeters | |
1254 | wxPAPER_A5, // A5 sheet, 148 by 210 millimeters | |
1255 | wxPAPER_B4, // B4 sheet, 250 by 354 millimeters | |
1256 | wxPAPER_B5, // B5 sheet, 182-by-257-millimeter paper | |
1257 | wxPAPER_FOLIO, // Folio, 8-1/2-by-13-inch paper | |
1258 | wxPAPER_QUARTO, // Quarto, 215-by-275-millimeter paper | |
1259 | wxPAPER_10X14, // 10-by-14-inch sheet | |
1260 | wxPAPER_11X17, // 11-by-17-inch sheet | |
1261 | wxPAPER_NOTE, // Note, 8 1/2 by 11 inches | |
1262 | wxPAPER_ENV_9, // #9 Envelope, 3 7/8 by 8 7/8 inches | |
1263 | wxPAPER_ENV_10, // #10 Envelope, 4 1/8 by 9 1/2 inches | |
1264 | wxPAPER_ENV_11, // #11 Envelope, 4 1/2 by 10 3/8 inches | |
1265 | wxPAPER_ENV_12, // #12 Envelope, 4 3/4 by 11 inches | |
1266 | wxPAPER_ENV_14, // #14 Envelope, 5 by 11 1/2 inches | |
1267 | wxPAPER_ENV_DL, // DL Envelope, 110 by 220 millimeters | |
1268 | wxPAPER_ENV_C5, // C5 Envelope, 162 by 229 millimeters | |
1269 | wxPAPER_ENV_C3, // C3 Envelope, 324 by 458 millimeters | |
1270 | wxPAPER_ENV_C4, // C4 Envelope, 229 by 324 millimeters | |
1271 | wxPAPER_ENV_C6, // C6 Envelope, 114 by 162 millimeters | |
1272 | wxPAPER_ENV_C65, // C65 Envelope, 114 by 229 millimeters | |
1273 | wxPAPER_ENV_B4, // B4 Envelope, 250 by 353 millimeters | |
1274 | wxPAPER_ENV_B5, // B5 Envelope, 176 by 250 millimeters | |
1275 | wxPAPER_ENV_B6, // B6 Envelope, 176 by 125 millimeters | |
1276 | wxPAPER_ENV_ITALY, // Italy Envelope, 110 by 230 millimeters | |
1277 | wxPAPER_ENV_MONARCH, // Monarch Envelope, 3 7/8 by 7 1/2 inches | |
1278 | wxPAPER_ENV_PERSONAL, // 6 3/4 Envelope, 3 5/8 by 6 1/2 inches | |
1279 | wxPAPER_FANFOLD_US, // US Std Fanfold, 14 7/8 by 11 inches | |
1280 | wxPAPER_FANFOLD_STD_GERMAN, // German Std Fanfold, 8 1/2 by 12 inches | |
1281 | wxPAPER_FANFOLD_LGL_GERMAN, // German Legal Fanfold, 8 1/2 by 13 inches | |
1282 | ||
1283 | wxPAPER_ISO_B4, // B4 (ISO) 250 x 353 mm | |
1284 | wxPAPER_JAPANESE_POSTCARD, // Japanese Postcard 100 x 148 mm | |
1285 | wxPAPER_9X11, // 9 x 11 in | |
1286 | wxPAPER_10X11, // 10 x 11 in | |
1287 | wxPAPER_15X11, // 15 x 11 in | |
1288 | wxPAPER_ENV_INVITE, // Envelope Invite 220 x 220 mm | |
1289 | wxPAPER_LETTER_EXTRA, // Letter Extra 9 \275 x 12 in | |
1290 | wxPAPER_LEGAL_EXTRA, // Legal Extra 9 \275 x 15 in | |
1291 | wxPAPER_TABLOID_EXTRA, // Tabloid Extra 11.69 x 18 in | |
1292 | wxPAPER_A4_EXTRA, // A4 Extra 9.27 x 12.69 in | |
1293 | wxPAPER_LETTER_TRANSVERSE, // Letter Transverse 8 \275 x 11 in | |
1294 | wxPAPER_A4_TRANSVERSE, // A4 Transverse 210 x 297 mm | |
1295 | wxPAPER_LETTER_EXTRA_TRANSVERSE, // Letter Extra Transverse 9\275 x 12 in | |
1296 | wxPAPER_A_PLUS, // SuperA/SuperA/A4 227 x 356 mm | |
1297 | wxPAPER_B_PLUS, // SuperB/SuperB/A3 305 x 487 mm | |
1298 | wxPAPER_LETTER_PLUS, // Letter Plus 8.5 x 12.69 in | |
1299 | wxPAPER_A4_PLUS, // A4 Plus 210 x 330 mm | |
1300 | wxPAPER_A5_TRANSVERSE, // A5 Transverse 148 x 210 mm | |
1301 | wxPAPER_B5_TRANSVERSE, // B5 (JIS) Transverse 182 x 257 mm | |
1302 | wxPAPER_A3_EXTRA, // A3 Extra 322 x 445 mm | |
1303 | wxPAPER_A5_EXTRA, // A5 Extra 174 x 235 mm | |
1304 | wxPAPER_B5_EXTRA, // B5 (ISO) Extra 201 x 276 mm | |
1305 | wxPAPER_A2, // A2 420 x 594 mm | |
1306 | wxPAPER_A3_TRANSVERSE, // A3 Transverse 297 x 420 mm | |
6c75a4cf RD |
1307 | wxPAPER_A3_EXTRA_TRANSVERSE, // A3 Extra Transverse 322 x 445 mm |
1308 | ||
1309 | wxPAPER_DBL_JAPANESE_POSTCARD,/* Japanese Double Postcard 200 x 148 mm */ | |
1310 | wxPAPER_A6, /* A6 105 x 148 mm */ | |
1311 | wxPAPER_JENV_KAKU2, /* Japanese Envelope Kaku #2 */ | |
1312 | wxPAPER_JENV_KAKU3, /* Japanese Envelope Kaku #3 */ | |
1313 | wxPAPER_JENV_CHOU3, /* Japanese Envelope Chou #3 */ | |
1314 | wxPAPER_JENV_CHOU4, /* Japanese Envelope Chou #4 */ | |
1315 | wxPAPER_LETTER_ROTATED, /* Letter Rotated 11 x 8 1/2 in */ | |
1316 | wxPAPER_A3_ROTATED, /* A3 Rotated 420 x 297 mm */ | |
1317 | wxPAPER_A4_ROTATED, /* A4 Rotated 297 x 210 mm */ | |
1318 | wxPAPER_A5_ROTATED, /* A5 Rotated 210 x 148 mm */ | |
1319 | wxPAPER_B4_JIS_ROTATED, /* B4 (JIS) Rotated 364 x 257 mm */ | |
1320 | wxPAPER_B5_JIS_ROTATED, /* B5 (JIS) Rotated 257 x 182 mm */ | |
1321 | wxPAPER_JAPANESE_POSTCARD_ROTATED,/* Japanese Postcard Rotated 148 x 100 mm */ | |
1322 | wxPAPER_DBL_JAPANESE_POSTCARD_ROTATED,/* Double Japanese Postcard Rotated 148 x 200 mm */ | |
1323 | wxPAPER_A6_ROTATED, /* A6 Rotated 148 x 105 mm */ | |
1324 | wxPAPER_JENV_KAKU2_ROTATED, /* Japanese Envelope Kaku #2 Rotated */ | |
1325 | wxPAPER_JENV_KAKU3_ROTATED, /* Japanese Envelope Kaku #3 Rotated */ | |
1326 | wxPAPER_JENV_CHOU3_ROTATED, /* Japanese Envelope Chou #3 Rotated */ | |
1327 | wxPAPER_JENV_CHOU4_ROTATED, /* Japanese Envelope Chou #4 Rotated */ | |
1328 | wxPAPER_B6_JIS, /* B6 (JIS) 128 x 182 mm */ | |
1329 | wxPAPER_B6_JIS_ROTATED, /* B6 (JIS) Rotated 182 x 128 mm */ | |
1330 | wxPAPER_12X11, /* 12 x 11 in */ | |
1331 | wxPAPER_JENV_YOU4, /* Japanese Envelope You #4 */ | |
1332 | wxPAPER_JENV_YOU4_ROTATED, /* Japanese Envelope You #4 Rotated */ | |
1333 | wxPAPER_P16K, /* PRC 16K 146 x 215 mm */ | |
1334 | wxPAPER_P32K, /* PRC 32K 97 x 151 mm */ | |
1335 | wxPAPER_P32KBIG, /* PRC 32K(Big) 97 x 151 mm */ | |
1336 | wxPAPER_PENV_1, /* PRC Envelope #1 102 x 165 mm */ | |
1337 | wxPAPER_PENV_2, /* PRC Envelope #2 102 x 176 mm */ | |
1338 | wxPAPER_PENV_3, /* PRC Envelope #3 125 x 176 mm */ | |
1339 | wxPAPER_PENV_4, /* PRC Envelope #4 110 x 208 mm */ | |
1340 | wxPAPER_PENV_5, /* PRC Envelope #5 110 x 220 mm */ | |
1341 | wxPAPER_PENV_6, /* PRC Envelope #6 120 x 230 mm */ | |
1342 | wxPAPER_PENV_7, /* PRC Envelope #7 160 x 230 mm */ | |
1343 | wxPAPER_PENV_8, /* PRC Envelope #8 120 x 309 mm */ | |
1344 | wxPAPER_PENV_9, /* PRC Envelope #9 229 x 324 mm */ | |
1345 | wxPAPER_PENV_10, /* PRC Envelope #10 324 x 458 mm */ | |
1346 | wxPAPER_P16K_ROTATED, /* PRC 16K Rotated */ | |
1347 | wxPAPER_P32K_ROTATED, /* PRC 32K Rotated */ | |
1348 | wxPAPER_P32KBIG_ROTATED, /* PRC 32K(Big) Rotated */ | |
1349 | wxPAPER_PENV_1_ROTATED, /* PRC Envelope #1 Rotated 165 x 102 mm */ | |
1350 | wxPAPER_PENV_2_ROTATED, /* PRC Envelope #2 Rotated 176 x 102 mm */ | |
1351 | wxPAPER_PENV_3_ROTATED, /* PRC Envelope #3 Rotated 176 x 125 mm */ | |
1352 | wxPAPER_PENV_4_ROTATED, /* PRC Envelope #4 Rotated 208 x 110 mm */ | |
1353 | wxPAPER_PENV_5_ROTATED, /* PRC Envelope #5 Rotated 220 x 110 mm */ | |
1354 | wxPAPER_PENV_6_ROTATED, /* PRC Envelope #6 Rotated 230 x 120 mm */ | |
1355 | wxPAPER_PENV_7_ROTATED, /* PRC Envelope #7 Rotated 230 x 160 mm */ | |
1356 | wxPAPER_PENV_8_ROTATED, /* PRC Envelope #8 Rotated 309 x 120 mm */ | |
1357 | wxPAPER_PENV_9_ROTATED, /* PRC Envelope #9 Rotated 324 x 229 mm */ | |
1358 | wxPAPER_PENV_10_ROTATED /* PRC Envelope #10 Rotated 458 x 324 m */ | |
1359 | ||
cf694132 RD |
1360 | } wxPaperSize ; |
1361 | ||
bb0054cd RD |
1362 | typedef enum { |
1363 | wxDUPLEX_SIMPLEX, // Non-duplex | |
1364 | wxDUPLEX_HORIZONTAL, | |
1365 | wxDUPLEX_VERTICAL | |
1366 | } wxDuplexMode; | |
1367 | ||
cf694132 RD |
1368 | |
1369 | ||
e9159fe8 RD |
1370 | // menu and toolbar item kinds |
1371 | enum wxItemKind | |
1372 | { | |
addd64ee | 1373 | wxITEM_SEPARATOR, |
546bfbea VS |
1374 | wxITEM_NORMAL, |
1375 | wxITEM_CHECK, | |
1376 | wxITEM_RADIO, | |
0b0849b5 | 1377 | wxITEM_DROPDOWN, |
546bfbea | 1378 | wxITEM_MAX |
e9159fe8 RD |
1379 | }; |
1380 | ||
64e8a1f0 | 1381 | |
23bed520 RD |
1382 | enum wxHitTest |
1383 | { | |
1384 | wxHT_NOWHERE, | |
1385 | ||
1386 | // scrollbar | |
1387 | wxHT_SCROLLBAR_FIRST = wxHT_NOWHERE, | |
1388 | wxHT_SCROLLBAR_ARROW_LINE_1, // left or upper arrow to scroll by line | |
1389 | wxHT_SCROLLBAR_ARROW_LINE_2, // right or down | |
1390 | wxHT_SCROLLBAR_ARROW_PAGE_1, // left or upper arrow to scroll by page | |
1391 | wxHT_SCROLLBAR_ARROW_PAGE_2, // right or down | |
1392 | wxHT_SCROLLBAR_THUMB, // on the thumb | |
1393 | wxHT_SCROLLBAR_BAR_1, // bar to the left/above the thumb | |
1394 | wxHT_SCROLLBAR_BAR_2, // bar to the right/below the thumb | |
1395 | wxHT_SCROLLBAR_LAST, | |
1396 | ||
1397 | // window | |
1398 | wxHT_WINDOW_OUTSIDE, // not in this window at all | |
1399 | wxHT_WINDOW_INSIDE, // in the client area | |
1400 | wxHT_WINDOW_VERT_SCROLLBAR, // on the vertical scrollbar | |
1401 | wxHT_WINDOW_HORZ_SCROLLBAR, // on the horizontal scrollbar | |
1402 | wxHT_WINDOW_CORNER, // on the corner between 2 scrollbars | |
1403 | ||
1404 | wxHT_MAX | |
1405 | }; | |
1406 | ||
1407 | ||
3ef86e32 | 1408 | |
a780a8dc | 1409 | enum wxKeyModifier |
3ef86e32 | 1410 | { |
a780a8dc RD |
1411 | wxMOD_NONE, |
1412 | wxMOD_ALT, | |
1413 | wxMOD_CONTROL, | |
1414 | wxMOD_ALTGR, | |
1415 | wxMOD_SHIFT, | |
1416 | wxMOD_META, | |
1417 | wxMOD_WIN, | |
1418 | wxMOD_CMD, | |
1419 | wxMOD_ALL | |
3ef86e32 RD |
1420 | }; |
1421 | ||
1422 | ||
1423 | enum wxUpdateUI | |
1424 | { | |
1425 | wxUPDATE_UI_NONE = 0x0000, | |
1426 | wxUPDATE_UI_RECURSE = 0x0001, | |
1427 | wxUPDATE_UI_FROMIDLE = 0x0002 // Invoked from On(Internal)Idle | |
1428 | }; | |
1429 | ||
1430 | ||
994453b8 RD |
1431 | enum wxLayoutDirection |
1432 | { | |
1433 | wxLayout_Default, | |
1434 | wxLayout_LeftToRight, | |
1435 | wxLayout_RightToLeft | |
1436 | }; | |
1437 | ||
1438 | ||
23bed520 | 1439 | |
7bf85405 RD |
1440 | //--------------------------------------------------------------------------- |
1441 |