]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/core.i
Avoid crash in SelectAll if there are no nodes besides the root
[wxWidgets.git] / wxPython / src / core.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: core.i
3// Purpose: SWIG interface file for the CORE wxPython classes and stuff.
4//
5// Author: Robin Dunn
6//
7// Created: 22-May-1998
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
b2eb030f 13%module(package="wx") _core
d14a1e28
RD
14
15%{
16#include "wx/wxPython/wxPython_int.h"
17#include "wx/wxPython/pyclasses.h"
57ffa585 18#include "wx/wxPython/twoitem.h"
d14a1e28
RD
19%}
20
21
22//---------------------------------------------------------------------------
23
24#ifndef SWIGXML
25%include typemaps.i
26%include my_typemaps.i
27
28%include _core_api.i
d14a1e28 29
d14a1e28
RD
30%native(_wxPySetDictionary) __wxPySetDictionary;
31
61863841 32
d14a1e28
RD
33%pythoncode {
34%#// Give a reference to the dictionary of this module to the C++ extension
35%#// code.
54f9ee45 36_core_._wxPySetDictionary(vars())
d14a1e28
RD
37
38%#// A little trick to make 'wx' be a reference to this module so wx.Names can
39%#// be used here.
40import sys as _sys
41wx = _sys.modules[__name__]
d14a1e28 42
dce2bd22 43}
d14a1e28
RD
44#endif
45
d14a1e28 46
dce2bd22
RD
47%pythoncode {
48%#----------------------------------------------------------------------------
49
50def _deprecated(callable, msg=None):
51 """
52 Create a wrapper function that will raise a DeprecationWarning
53 before calling the callable.
54 """
55 if msg is None:
56 msg = "%s is deprecated" % callable
57 def deprecatedWrapper(*args, **kwargs):
58 import warnings
59 warnings.warn(msg, DeprecationWarning, stacklevel=2)
60 return callable(*args, **kwargs)
61 deprecatedWrapper.__doc__ = msg
62 return deprecatedWrapper
63
64
65%#----------------------------------------------------------------------------
66}
67
d14a1e28
RD
68
69//---------------------------------------------------------------------------
70// Include all the files that make up the core module
71
72// wxObject, functions and other base stuff
73%include _defs.i
64e8a1f0
RD
74
75MAKE_CONST_WXSTRING(EmptyString);
76
10694396
RD
77%include _swigtype.i
78
d14a1e28
RD
79%include _obj.i
80%include _gdicmn.i
81%include _streams.i
82%include _filesys.i
83%include _image.i
84
85
86// Events, event handlers, base Windows and such
87%include _evthandler.i
88%include _event.i
89%include _app.i
96d49f0e 90%include _evtloop.i
1e0c8722 91%include _accel.i
d14a1e28
RD
92%include _window.i
93%include _validator.i
94%include _menu.i
95%include _control.i
96
97
98// Layout
99%include _sizers.i
100%include _gbsizer.i
101%include _constraints.i
102
103
104%pythoncode "_core_ex.py"
105
106//---------------------------------------------------------------------------
107// This code gets added to the module initialization function
108
109%init %{
110 // Initialize threading, some globals and such
111 __wxPyPreStart(d);
112
113
114 // Although these are defined in __version__ they need to be here too so
115 // that an assert can be done to ensure that the wxPython and the wxWindows
116 // versions match.
117 PyDict_SetItemString(d,"MAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION ));
118 PyDict_SetItemString(d,"MINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION ));
119 PyDict_SetItemString(d,"RELEASE_VERSION", PyInt_FromLong((long)wxRELEASE_NUMBER ));
120%}
121
122//---------------------------------------------------------------------------