X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd9f7fea29e3f8bb61861f52984b7943512346ac..6a6c9417a880900ac40ce031d2aa4a19658171e9:/wxPython/src/core.i diff --git a/wxPython/src/core.i b/wxPython/src/core.i index 9d7e141292..a67cd8b9b5 100644 --- a/wxPython/src/core.i +++ b/wxPython/src/core.i @@ -10,12 +10,12 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -%module core - +%module(package="wx") _core %{ #include "wx/wxPython/wxPython_int.h" #include "wx/wxPython/pyclasses.h" +#include "wx/wxPython/twoitem.h" %} @@ -26,37 +26,56 @@ %include my_typemaps.i %include _core_api.i -%include _core_rename.i - - %native(_wxPySetDictionary) __wxPySetDictionary; + %pythoncode { %#// Give a reference to the dictionary of this module to the C++ extension %#// code. -_core._wxPySetDictionary(vars()) +_core_._wxPySetDictionary(vars()) %#// A little trick to make 'wx' be a reference to this module so wx.Names can %#// be used here. import sys as _sys wx = _sys.modules[__name__] -} +} #endif -//--------------------------------------------------------------------------- -%{ - DECLARE_DEF_STRING(EmptyString); -// DECLARE_DEF_STRING(PanelNameStr); -%} +%pythoncode { +%#---------------------------------------------------------------------------- + +def _deprecated(callable, msg=None): + """ + Create a wrapper function that will raise a DeprecationWarning + before calling the callable. + """ + if msg is None: + msg = "%s is deprecated" % callable + def deprecatedWrapper(*args, **kwargs): + import warnings + warnings.warn(msg, DeprecationWarning, stacklevel=2) + return callable(*args, **kwargs) + deprecatedWrapper.__doc__ = msg + return deprecatedWrapper + + +%#---------------------------------------------------------------------------- +} + //--------------------------------------------------------------------------- // Include all the files that make up the core module // wxObject, functions and other base stuff %include _defs.i + +MAKE_CONST_WXSTRING(EmptyString); + +%include _swigtype.i + %include _obj.i %include _gdicmn.i %include _streams.i @@ -68,6 +87,8 @@ wx = _sys.modules[__name__] %include _evthandler.i %include _event.i %include _app.i +%include _evtloop.i +%include _accel.i %include _window.i %include _validator.i %include _menu.i