}
%enddef
-
+// This macro can be used to disable the releasing of the GIL when calling the
+// C++ function.
+%define KeepGIL(name)
+%exception name {
+ $action
+ if (PyErr_Occurred()) SWIG_fail;
+}
+%enddef
+
//---------------------------------------------------------------------------
// some type definitions to simplify things for SWIG
#define %noautodoc %feature("noautodoc")
#if SWIG_VERSION >= 0x010327
+#undef %kwargs
#define %kwargs %feature("kwargs", "1")
#define %nokwargs %feature("kwargs", "0")
#else
#define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN
#define %cleardisown(typespec) %typemap(in) typespec
+#define %ref %feature("ref")
+#define %unref %feature("unref")
#ifndef %pythoncode
%enddef
#endif
+
+//---------------------------------------------------------------------------
+// Generates a base_On* method that just wraps a call to the On*, and mark it
+// deprecated. We need this because there is no longer any need for a
+// base_On* method to be able to call the C++ base class method, since our
+// virtualization code can now sense when an attempt is being made to call
+// the base class version from the derived class override.
+
+%define %MAKE_BASE_FUNC(Class, Method)
+ %pythoncode {
+ def base_##Method(*args, **kw):
+ return Class.Method(*args, **kw)
+ base_##Method = wx._deprecated(base_##Method,
+ "Please use Class.Method instead.")
+ }
+%enddef
+
//---------------------------------------------------------------------------
// Forward declarations and %renames for some classes, so the autodoc strings
// will be able to use the right types even when the real class declaration is