]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/include/wx/wxPython/wxPython_int.h
change doc tweaks
[wxWidgets.git] / wxPython / include / wx / wxPython / wxPython_int.h
index 157b58bef01eb032c5499245fd69418696b0dd56..302288b4aa4c517d6ee6653fbceb2201c0dcdafc 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <wx/busyinfo.h>
 #include <wx/caret.h>
 
 #include <wx/busyinfo.h>
 #include <wx/caret.h>
+#include <wx/choicebk.h>
 #include <wx/clipbrd.h>
 #include <wx/colordlg.h>
 #include <wx/config.h>
 #include <wx/clipbrd.h>
 #include <wx/colordlg.h>
 #include <wx/config.h>
 #include <wx/taskbar.h>
 #include <wx/tglbtn.h>
 #include <wx/tipwin.h>
 #include <wx/taskbar.h>
 #include <wx/tglbtn.h>
 #include <wx/tipwin.h>
+#include <wx/toolbook.h>
 #include <wx/tooltip.h>
 #include <wx/tooltip.h>
+#include <wx/treebook.h>
 #include <wx/vlbox.h>
 #include <wx/vscroll.h>
 #include <wx/vlbox.h>
 #include <wx/vscroll.h>
+#include <wx/dateevt.h>
+#include <wx/datectrl.h>
+
 
 
 #ifdef _MSC_VER
 
 
 #ifdef _MSC_VER
 typedef unsigned char byte;
 typedef wxPoint2DDouble wxPoint2D;    
 
 typedef unsigned char byte;
 typedef wxPoint2DDouble wxPoint2D;    
 
-const bool True = true;
-const bool False = false;
+#ifndef SWIG_TYPE_TABLE
+#define SWIG_TYPE_TABLE wxPython_type_table
+#endif
+
+#ifdef __WXGTK__
+#define wxDEFAULT_STATUSBAR_STYLE wxST_SIZEGRIP|wxFULL_REPAINT_ON_RESIZE
+#else
+#define wxDEFAULT_STATUSBAR_STYLE wxST_SIZEGRIP
+#endif
 
 
 #ifndef wxPyUSE_EXPORTED_API
 
 
 #ifndef wxPyUSE_EXPORTED_API
@@ -93,6 +106,9 @@ void      __wxPyCleanup();
 PyObject* __wxPySetDictionary(PyObject*, PyObject* args);
 PyObject* __wxPyFixStockObjects(PyObject*, PyObject* args);
 
 PyObject* __wxPySetDictionary(PyObject*, PyObject* args);
 PyObject* __wxPyFixStockObjects(PyObject*, PyObject* args);
 
+void        wxSetDefaultPyEncoding(const char* encoding);
+const char* wxGetDefaultPyEncoding();
+
 
 void wxPyEventThunker(wxObject*, wxEvent& event);
 
 
 void wxPyEventThunker(wxObject*, wxEvent& event);
 
@@ -109,7 +125,7 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* classname);
 PyObject* wx2PyString(const wxString& src);
 wxString  Py2wxString(PyObject* source);
 
 PyObject* wx2PyString(const wxString& src);
 wxString  Py2wxString(PyObject* source);
 
-PyObject* wxPyMake_wxObject(wxObject* source, bool setThisOwn, bool checkEvtHandler=True);
+PyObject* wxPyMake_wxObject(wxObject* source, bool setThisOwn, bool checkEvtHandler=true);
 PyObject* wxPyMake_wxSizer(wxSizer* source, bool setThisOwn);
 void      wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
 
 PyObject* wxPyMake_wxSizer(wxSizer* source, bool setThisOwn);
 void      wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
 
@@ -132,6 +148,28 @@ bool wxPySwigInstance_Check(PyObject* obj);
 #undef WXP_WITH_THREAD
 #endif
 
 #undef WXP_WITH_THREAD
 #endif
 
+
+// In Python 2.3 and later there are the PyGILState_* APIs that we can use for
+// blocking threads when calling back into Python. Using them instead of my
+// home-grown hacks greatly simplifies wxPyBeginBlockThreads and
+// wxPyEndBlockThreads.
+//
+// Unfortunatly there is a bug somewhere when using these new APIs on Python
+// 2.3.  It manifests in Boa Constructor's debugger where it is unable to stop
+// at breakpoints located in event handlers.  I think that the cause may be
+// something like the original PyThreadState for the main thread is not being
+// restored for the callbacks, but I can't see where that could be
+// happening...  So we'll only activate this new change for Python 2.4+  :-(
+
+#if PY_VERSION_HEX < 0x02040000
+#define wxPyUSE_GIL_STATE 0
+typedef bool wxPyBlock_t;
+#else
+#define wxPyUSE_GIL_STATE 1
+typedef PyGILState_STATE wxPyBlock_t;
+#endif
+
+
 #ifndef wxPyUSE_EXPORTED_API
 
 // For Python --> C++
 #ifndef wxPyUSE_EXPORTED_API
 
 // For Python --> C++
@@ -139,8 +177,8 @@ PyThreadState* wxPyBeginAllowThreads();
 void           wxPyEndAllowThreads(PyThreadState* state);
 
 // For C++ --> Python
 void           wxPyEndAllowThreads(PyThreadState* state);
 
 // For C++ --> Python
-bool wxPyBeginBlockThreads();
-void wxPyEndBlockThreads(bool blocked);
+wxPyBlock_t wxPyBeginBlockThreads();
+void wxPyEndBlockThreads(wxPyBlock_t blocked);
 
 #endif // wxPyUSE_EXPORTED_API
 
 
 #endif // wxPyUSE_EXPORTED_API
 
@@ -148,13 +186,13 @@ void wxPyEndBlockThreads(bool blocked);
 // A macro that will help to execute simple statments wrapped in
 // StartBlock/EndBlockThreads calls
 #define wxPyBLOCK_THREADS(stmt) \
 // A macro that will help to execute simple statments wrapped in
 // StartBlock/EndBlockThreads calls
 #define wxPyBLOCK_THREADS(stmt) \
-    { bool blocked = wxPyBeginBlockThreads(); stmt; wxPyEndBlockThreads(blocked); }
+    { wxPyBlock_t blocked = wxPyBeginBlockThreads(); stmt; wxPyEndBlockThreads(blocked); }
 
 // Raise the NotImplementedError exception  (blocking threads)
 #define wxPyRaiseNotImplemented() \
     wxPyBLOCK_THREADS(PyErr_SetNone(PyExc_NotImplementedError))
 
 
 // Raise the NotImplementedError exception  (blocking threads)
 #define wxPyRaiseNotImplemented() \
     wxPyBLOCK_THREADS(PyErr_SetNone(PyExc_NotImplementedError))
 
-// Raise any exception witha string value  (blocking threads)
+// Raise any exception with a string value  (blocking threads)
 #define wxPyErr_SetString(err, str) \
     wxPyBLOCK_THREADS(PyErr_SetString(err, str))
 
 #define wxPyErr_SetString(err, str) \
     wxPyBLOCK_THREADS(PyErr_SetString(err, str))
 
@@ -199,7 +237,7 @@ bool wxPyTwoIntItem_helper(PyObject* source, T** obj, const wxChar* name)
         if (! wxPyConvertSwigPtr(source, (void **)&ptr, name))
             goto error;
         *obj = ptr;
         if (! wxPyConvertSwigPtr(source, (void **)&ptr, name))
             goto error;
         *obj = ptr;
-        return True;
+        return true;
     }
     // otherwise a 2-tuple of integers is expected
     else if (PySequence_Check(source) && PyObject_Length(source) == 2) {
     }
     // otherwise a 2-tuple of integers is expected
     else if (PySequence_Check(source) && PyObject_Length(source) == 2) {
@@ -213,14 +251,14 @@ bool wxPyTwoIntItem_helper(PyObject* source, T** obj, const wxChar* name)
         **obj = T(PyInt_AsLong(o1), PyInt_AsLong(o2));
         Py_DECREF(o1);
         Py_DECREF(o2);
         **obj = T(PyInt_AsLong(o1), PyInt_AsLong(o2));
         Py_DECREF(o1);
         Py_DECREF(o2);
-        return True;
+        return true;
     }
 
  error:
     wxString msg;
     msg.Printf(wxT("Expected a 2-tuple of integers or a %s object."), name);
     PyErr_SetString(PyExc_TypeError, msg.mb_str());
     }
 
  error:
     wxString msg;
     msg.Printf(wxT("Expected a 2-tuple of integers or a %s object."), name);
     PyErr_SetString(PyExc_TypeError, msg.mb_str());
-    return False;
+    return false;
 }
 
 
 }
 
 
@@ -250,7 +288,7 @@ PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr);
 #ifndef wxPyUSE_EXPORTED_API
 
 class wxPyCallback : public wxObject {
 #ifndef wxPyUSE_EXPORTED_API
 
 class wxPyCallback : public wxObject {
-    DECLARE_ABSTRACT_CLASS(wxPyCallback);
+    DECLARE_ABSTRACT_CLASS(wxPyCallback)
 public:
     wxPyCallback(PyObject* func);
     wxPyCallback(const wxPyCallback& other);
 public:
     wxPyCallback(PyObject* func);
     wxPyCallback(const wxPyCallback& other);
@@ -275,7 +313,7 @@ public:
     wxPyEvtSelfRef();
     ~wxPyEvtSelfRef();
 
     wxPyEvtSelfRef();
     ~wxPyEvtSelfRef();
 
-    void SetSelf(PyObject* self, bool clone=False);
+    void SetSelf(PyObject* self, bool clone=false);
     PyObject* GetSelf() const;
     bool GetCloned() const { return m_cloned; }
 
     PyObject* GetSelf() const;
     bool GetCloned() const { return m_cloned; }
 
@@ -319,7 +357,7 @@ void wxPyClientData_dtor(wxPyClientData* self);
 void wxPyUserData_dtor(wxPyUserData* self);
 void wxPyOORClientData_dtor(wxPyOORClientData* self);
 wxPyCBInputStream* wxPyCBInputStream_create(PyObject *py, bool block);
 void wxPyUserData_dtor(wxPyUserData* self);
 void wxPyOORClientData_dtor(wxPyOORClientData* self);
 wxPyCBInputStream* wxPyCBInputStream_create(PyObject *py, bool block);
-
+wxPyCBInputStream* wxPyCBInputStream_copy(wxPyCBInputStream* other);
 
 //---------------------------------------------------------------------------
 // Export a C API in a struct.  Other modules will be able to load this from
 
 //---------------------------------------------------------------------------
 // Export a C API in a struct.  Other modules will be able to load this from
@@ -327,51 +365,9 @@ wxPyCBInputStream* wxPyCBInputStream_create(PyObject *py, bool block);
 // in another shared library.
 
 class wxPyCallbackHelper;
 // in another shared library.
 
 class wxPyCallbackHelper;
-struct swig_type_info;
-struct swig_const_info;
-
-typedef double (*py_objasdbl_conv)(PyObject *obj);
-
-// Make SunCC happy and make typedef's for these that are extern "C"
-typedef swig_type_info* (*p_SWIG_Python_TypeRegister_t)(swig_type_info *);
-typedef swig_type_info* (*p_SWIG_Python_TypeCheck_t)(char *c, swig_type_info *);
-typedef void*           (*p_SWIG_Python_TypeCast_t)(swig_type_info *, void *);
-typedef swig_type_info* (*p_SWIG_Python_TypeDynamicCast_t)(swig_type_info *, void **);
-typedef const char*     (*p_SWIG_Python_TypeName_t)(const swig_type_info *);
-typedef swig_type_info* (*p_SWIG_Python_TypeQuery_t)(const char *);
-typedef void            (*p_SWIG_Python_TypeClientData_t)(swig_type_info *, void *);
-typedef PyObject*       (*p_SWIG_Python_newvarlink_t)(void);
-typedef void            (*p_SWIG_Python_addvarlink_t)(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
-typedef int             (*p_SWIG_Python_ConvertPtr_t)(PyObject *, void **, swig_type_info *, int);
-typedef int             (*p_SWIG_Python_ConvertPacked_t)(PyObject *, void *, int sz, swig_type_info *, int);
-typedef char*           (*p_SWIG_Python_PackData_t)(char *c, void *, int);
-typedef char*           (*p_SWIG_Python_UnpackData_t)(char *c, void *, int);
-typedef PyObject*       (*p_SWIG_Python_NewPointerObj_t)(void *, swig_type_info *,int own);
-typedef PyObject*       (*p_SWIG_Python_NewPackedObj_t)(void *, int sz, swig_type_info *);
-typedef void            (*p_SWIG_Python_InstallConstants_t)(PyObject *d, swig_const_info constants[]);
-typedef void*           (*p_SWIG_Python_MustGetPtr_t)(PyObject *, swig_type_info *, int, int);
-
 
 struct wxPyCoreAPI {
 
 
 struct wxPyCoreAPI {
 
-    p_SWIG_Python_TypeRegister_t       p_SWIG_Python_TypeRegister;
-    p_SWIG_Python_TypeCheck_t          p_SWIG_Python_TypeCheck;
-    p_SWIG_Python_TypeCast_t           p_SWIG_Python_TypeCast;
-    p_SWIG_Python_TypeDynamicCast_t    p_SWIG_Python_TypeDynamicCast;
-    p_SWIG_Python_TypeName_t           p_SWIG_Python_TypeName;
-    p_SWIG_Python_TypeQuery_t          p_SWIG_Python_TypeQuery;
-    p_SWIG_Python_TypeClientData_t     p_SWIG_Python_TypeClientData;
-    p_SWIG_Python_newvarlink_t         p_SWIG_Python_newvarlink;
-    p_SWIG_Python_addvarlink_t         p_SWIG_Python_addvarlink;
-    p_SWIG_Python_ConvertPtr_t         p_SWIG_Python_ConvertPtr;
-    p_SWIG_Python_ConvertPacked_t      p_SWIG_Python_ConvertPacked;
-    p_SWIG_Python_PackData_t           p_SWIG_Python_PackData;
-    p_SWIG_Python_UnpackData_t         p_SWIG_Python_UnpackData;
-    p_SWIG_Python_NewPointerObj_t      p_SWIG_Python_NewPointerObj;
-    p_SWIG_Python_NewPackedObj_t       p_SWIG_Python_NewPackedObj;
-    p_SWIG_Python_InstallConstants_t   p_SWIG_Python_InstallConstants;
-    p_SWIG_Python_MustGetPtr_t         p_SWIG_Python_MustGetPtr;
-    
     bool                (*p_wxPyCheckSwigType)(const wxChar* className);
     PyObject*           (*p_wxPyConstructObject)(void* ptr, const wxChar* className, int setThisOwn);
     bool                (*p_wxPyConvertSwigPtr)(PyObject* obj, void **ptr, const wxChar* className);
     bool                (*p_wxPyCheckSwigType)(const wxChar* className);
     PyObject*           (*p_wxPyConstructObject)(void* ptr, const wxChar* className, int setThisOwn);
     bool                (*p_wxPyConvertSwigPtr)(PyObject* obj, void **ptr, const wxChar* className);
@@ -379,8 +375,8 @@ struct wxPyCoreAPI {
         
     PyThreadState*      (*p_wxPyBeginAllowThreads)();
     void                (*p_wxPyEndAllowThreads)(PyThreadState* state);
         
     PyThreadState*      (*p_wxPyBeginAllowThreads)();
     void                (*p_wxPyEndAllowThreads)(PyThreadState* state);
-    bool                (*p_wxPyBeginBlockThreads)();
-    void                (*p_wxPyEndBlockThreads)(bool blocked);
+    wxPyBlock_t         (*p_wxPyBeginBlockThreads)();
+    void                (*p_wxPyEndBlockThreads)(wxPyBlock_t blocked);
 
     PyObject*           (*p_wxPy_ConvertList)(wxListBase* list);
 
 
     PyObject*           (*p_wxPy_ConvertList)(wxListBase* list);
 
@@ -427,7 +423,8 @@ struct wxPyCoreAPI {
     void                (*p_wxPyOORClientData_dtor)(wxPyOORClientData*);
 
     wxPyCBInputStream*  (*p_wxPyCBInputStream_create)(PyObject *py, bool block);
     void                (*p_wxPyOORClientData_dtor)(wxPyOORClientData*);
 
     wxPyCBInputStream*  (*p_wxPyCBInputStream_create)(PyObject *py, bool block);
-
+    wxPyCBInputStream*  (*p_wxPyCBInputStream_copy)(wxPyCBInputStream* other);
+    
     bool                (*p_wxPyInstance_Check)(PyObject* obj);
     bool                (*p_wxPySwigInstance_Check)(PyObject* obj);
 
     bool                (*p_wxPyInstance_Check)(PyObject* obj);
     bool                (*p_wxPySwigInstance_Check)(PyObject* obj);
 
@@ -466,12 +463,14 @@ public:
 // A wxClientData that holds a refernece to a Python object
 class wxPyClientData : public wxClientData {
 public:
 // A wxClientData that holds a refernece to a Python object
 class wxPyClientData : public wxClientData {
 public:
-    wxPyClientData(PyObject* obj) {
+    wxPyClientData(PyObject* obj, bool incref=true) {
         m_obj = obj;
         m_obj = obj;
-        Py_INCREF(m_obj);
+        m_incRef = incref;
+        if (incref)
+            Py_INCREF(m_obj);
     }
     }
-
     ~wxPyClientData() {
     ~wxPyClientData() {
+
 #ifdef wxPyUSE_EXPORTED_API
         wxPyGetCoreAPIPtr()->p_wxPyClientData_dtor(this);
 #else
 #ifdef wxPyUSE_EXPORTED_API
         wxPyGetCoreAPIPtr()->p_wxPyClientData_dtor(this);
 #else
@@ -479,6 +478,7 @@ public:
 #endif
     }
     PyObject* m_obj;
 #endif
     }
     PyObject* m_obj;
+    bool      m_incRef;
 };
 
 
 };
 
 
@@ -486,10 +486,10 @@ public:
 // OOR magic on the Python Object.
 class wxPyOORClientData : public wxPyClientData {
 public:
 // OOR magic on the Python Object.
 class wxPyOORClientData : public wxPyClientData {
 public:
-    wxPyOORClientData(PyObject* obj)
-        : wxPyClientData(obj) {}
-
+    wxPyOORClientData(PyObject* obj, bool incref=true)
+        : wxPyClientData(obj, incref) {}
     ~wxPyOORClientData() {
     ~wxPyOORClientData() {
+
 #ifdef wxPyUSE_EXPORTED_API
         wxPyGetCoreAPIPtr()->p_wxPyOORClientData_dtor(this);
 #else
 #ifdef wxPyUSE_EXPORTED_API
         wxPyGetCoreAPIPtr()->p_wxPyOORClientData_dtor(this);
 #else
@@ -499,6 +499,39 @@ public:
 };
 
 
 };
 
 
+//---------------------------------------------------------------------------
+// A wxImageHandler that can be derived from in Python.
+//
+
+class wxPyImageHandler: public wxImageHandler {
+protected:
+    PyObject *m_self;
+
+    // used for interning method names as PyStrings
+    static PyObject* m_DoCanRead_Name;
+    static PyObject* m_GetImageCount_Name;
+    static PyObject* m_LoadFile_Name;
+    static PyObject* m_SaveFile_Name;
+
+    // converstion helpers
+    PyObject* py_InputStream(wxInputStream* stream);
+    PyObject* py_Image(wxImage* image);
+    PyObject* py_OutputStream(wxOutputStream* stream);
+
+public:
+    wxPyImageHandler();
+    ~wxPyImageHandler();
+    void _SetSelf(PyObject *self);
+    
+    virtual bool LoadFile(wxImage* image, wxInputStream& stream,
+                          bool verbose=true, int index=-1 );
+    virtual bool SaveFile(wxImage* image, wxOutputStream& stream,
+                          bool verbose=true );
+    virtual int GetImageCount(wxInputStream& stream );
+    virtual bool DoCanRead(wxInputStream &stream);
+};
+
+
 //---------------------------------------------------------------------------
 // This class holds an instance of a Python Shadow Class object and assists
 // with looking up and invoking Python callback methods from C++ virtual
 //---------------------------------------------------------------------------
 // This class holds an instance of a Python Shadow Class object and assists
 // with looking up and invoking Python callback methods from C++ virtual
@@ -515,7 +548,7 @@ public:
         m_class = NULL;
         m_self = NULL;
         m_lastFound = NULL;
         m_class = NULL;
         m_self = NULL;
         m_lastFound = NULL;
-        m_incRef = False;
+        m_incRef = false;
     }
 
     ~wxPyCallbackHelper() {
     }
 
     ~wxPyCallbackHelper() {
@@ -526,11 +559,14 @@ public:
 #endif
     }
 
 #endif
     }
 
-    void        setSelf(PyObject* self, PyObject* klass, int incref=True);
+    void        setSelf(PyObject* self, PyObject* klass, int incref=true);
     bool        findCallback(const char* name) const;
     int         callCallback(PyObject* argTuple) const;
     PyObject*   callCallbackObj(PyObject* argTuple) const;
     PyObject*   GetLastFound() const { return m_lastFound; }
     bool        findCallback(const char* name) const;
     int         callCallback(PyObject* argTuple) const;
     PyObject*   callCallbackObj(PyObject* argTuple) const;
     PyObject*   GetLastFound() const { return m_lastFound; }
+
+    void        setRecursionGuard(PyObject* method) const;
+    void        clearRecursionGuard(PyObject* method) const;
     
 private:
     PyObject*   m_self;
     
 private:
     PyObject*   m_self;
@@ -575,7 +611,7 @@ enum {
 
 class wxPyApp: public wxApp
 {
 
 class wxPyApp: public wxApp
 {
-    DECLARE_ABSTRACT_CLASS(wxPyApp);
+    DECLARE_ABSTRACT_CLASS(wxPyApp)
 
 public:
     wxPyApp();
 
 public:
     wxPyApp();
@@ -594,6 +630,7 @@ public:
                           const wxChar *cond,
                           const wxChar *msg);
 #endif
                           const wxChar *cond,
                           const wxChar *msg);
 #endif
+    virtual void ExitMainLoop();
     // virtual int FilterEvent(wxEvent& event); // This one too????
 
     // For catching Apple Events
     // virtual int FilterEvent(wxEvent& event); // This one too????
 
     // For catching Apple Events
@@ -635,162 +672,122 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__(CBNAME)                        \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__(CBNAME)                        \
-    void CBNAME();                                      \
-    void base_##CBNAME()
+    void CBNAME()
 
 
 #define IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME)                         \
     void CLASS::CBNAME() {                                              \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME)                         \
     void CLASS::CBNAME() {                                              \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));        \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME();                                           \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));        \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME();                                           \
-    }                                                                   \
-    void CLASS::base_##CBNAME() {                                       \
-        PCLASS::CBNAME();                                               \
-    }
+    }                                                                   
+
+#define DEC_PYCALLBACK_VOID_(CBNAME)                                    \
+            DEC_PYCALLBACK__(CBNAME)
+
+#define IMP_PYCALLBACK_VOID_(CLASS, PCLASS, CBNAME)                     \
+             IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME)
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_INTINT(CBNAME)                      \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_INTINT(CBNAME)                      \
-    bool CBNAME(int a, int b);                                  \
-    bool base_##CBNAME(int a, int b)
+    bool CBNAME(int a, int b)
 
 
 #define IMP_PYCALLBACK_BOOL_INTINT(CLASS, PCLASS, CBNAME)               \
     bool CLASS::CBNAME(int a, int b) {                                  \
 
 
 #define IMP_PYCALLBACK_BOOL_INTINT(CLASS, PCLASS, CBNAME)               \
     bool CLASS::CBNAME(int a, int b) {                                  \
-        bool rval=False, found;                                         \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        bool rval=false, found;                                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));    \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a,b);                                 \
         return rval;                                                    \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));    \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a,b);                                 \
         return rval;                                                    \
-    }                                                                   \
-    bool CLASS::base_##CBNAME(int a, int b) {                           \
-        return PCLASS::CBNAME(a,b);                                     \
-    }
-
-//---------------------------------------------------------------------------
-
-#define DEC_PYCALLBACK_VOID_(CBNAME)                    \
-    void CBNAME();                                      \
-    void base_##CBNAME()
-
-
-#define IMP_PYCALLBACK_VOID_(CLASS, PCLASS, CBNAME)                     \
-    void CLASS::CBNAME() {                                              \
-        bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
-        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
-            wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));        \
-        wxPyEndBlockThreads(blocked);                                   \
-        if (! found)                                                    \
-            PCLASS::CBNAME();                                           \
-    }                                                                   \
-    void CLASS::base_##CBNAME() {                                       \
-        PCLASS::CBNAME();                                               \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INTINT(CBNAME)                      \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INTINT(CBNAME)                      \
-    void CBNAME(int a, int b);                                  \
-    void base_##CBNAME(int a, int b)
+    void CBNAME(int a, int b)
 
 
 #define IMP_PYCALLBACK_VOID_INTINT(CLASS, PCLASS, CBNAME)               \
     void CLASS::CBNAME(int a, int b) {                                  \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK_VOID_INTINT(CLASS, PCLASS, CBNAME)               \
     void CLASS::CBNAME(int a, int b) {                                  \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a,b);                                        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a,b);                                        \
-    }                                                                   \
-    void CLASS::base_##CBNAME(int a, int b) {                           \
-        PCLASS::CBNAME(a,b);                                            \
-    }
+    }                        
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INT(CBNAME)                         \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INT(CBNAME)                         \
-    void CBNAME(int a);                                         \
-    void base_##CBNAME(int a)
+    void CBNAME(int a)
 
 
 #define IMP_PYCALLBACK_VOID_INT(CLASS, PCLASS, CBNAME)                  \
     void CLASS::CBNAME(int a) {                                         \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK_VOID_INT(CLASS, PCLASS, CBNAME)                  \
     void CLASS::CBNAME(int a) {                                         \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));     \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a);                                          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));     \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a);                                          \
-    }                                                                   \
-    void CLASS::base_##CBNAME(int a) {                                  \
-        PCLASS::CBNAME(a);                                              \
-    }
+    }                 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INT4(CBNAME)                                \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INT4(CBNAME)                                \
-    void CBNAME(int a, int b, int c, int d);                            \
-    void base_##CBNAME(int a, int b, int c, int d)
+    void CBNAME(int a, int b, int c, int d)
 
 
 #define IMP_PYCALLBACK_VOID_INT4(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(int a, int b, int c, int d) {                    \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK_VOID_INT4(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(int a, int b, int c, int d) {                    \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiii)",a,b,c,d));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a,b,c,d);                                    \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiii)",a,b,c,d));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a,b,c,d);                                    \
-    }                                                                   \
-    void CLASS::base_##CBNAME(int a, int b, int c, int d) {             \
-        PCLASS::CBNAME(a,b,c,d);                                        \
-    }
+    }  
 
 //---------------------------------------------------------------------------
 #define DEC_PYCALLBACK_VOID_INT5(CBNAME)                                \
 
 //---------------------------------------------------------------------------
 #define DEC_PYCALLBACK_VOID_INT5(CBNAME)                                \
-    void CBNAME(int a, int b, int c, int d, int e);                     \
-    void base_##CBNAME(int a, int b, int c, int d, int e)
+    void CBNAME(int a, int b, int c, int d, int e)
 
 
 #define IMP_PYCALLBACK_VOID_INT5(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(int a, int b, int c, int d, int e) {             \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK_VOID_INT5(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(int a, int b, int c, int d, int e) {             \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiiii)",a,b,c,d,e));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a,b,c,d,e);                                  \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiiii)",a,b,c,d,e));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a,b,c,d,e);                                  \
-    }                                                                   \
-    void CLASS::base_##CBNAME(int a, int b, int c, int d, int e) {      \
-        PCLASS::CBNAME(a,b,c,d,e);                                      \
-    }
+    }                                             
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INTPINTP_const(CBNAME)                              \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_INTPINTP_const(CBNAME)                              \
-    void CBNAME(int* a, int* b) const;                                          \
-    void base_##CBNAME(int* a, int* b) const
+    void CBNAME(int* a, int* b) const
 
 
 #define IMP_PYCALLBACK_VOID_INTPINTP_const(CLASS, PCLASS, CBNAME)               \
     void CLASS::CBNAME(int* a, int* b) const {                                  \
         const char* errmsg = #CBNAME " should return a 2-tuple of integers.";   \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_VOID_INTPINTP_const(CLASS, PCLASS, CBNAME)               \
     void CLASS::CBNAME(int* a, int* b) const {                                  \
         const char* errmsg = #CBNAME " should return a 2-tuple of integers.";   \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -815,24 +812,19 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                                  \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b);                                                \
         wxPyEndBlockThreads(blocked);                                                  \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b);                                                \
-    }                                                                           \
-    void CLASS::base_##CBNAME(int* a, int* b) const {                           \
-        PCLASS::CBNAME(a,b);                                                    \
-    }
-
+    }                                
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_SIZE_const(CBNAME)                                       \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_SIZE_const(CBNAME)                                       \
-    wxSize CBNAME() const;                                                      \
-    wxSize base_##CBNAME() const
+    wxSize CBNAME() const
 
 
 #define IMP_PYCALLBACK_SIZE_const(CLASS, PCLASS, CBNAME)                        \
     wxSize CLASS::CBNAME() const {                                              \
         const char* errmsg = #CBNAME " should return a 2-tuple of integers.";   \
         bool found; wxSize rval(0,0);                                           \
 
 
 #define IMP_PYCALLBACK_SIZE_const(CLASS, PCLASS, CBNAME)                        \
     wxSize CLASS::CBNAME() const {                                              \
         const char* errmsg = #CBNAME " should return a 2-tuple of integers.";   \
         bool found; wxSize rval(0,0);                                           \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -859,54 +851,42 @@ extern wxPyApp *wxPythonApp;
             return PCLASS::CBNAME();                                            \
         else                                                                    \
             return rval;                                                        \
             return PCLASS::CBNAME();                                            \
         else                                                                    \
             return rval;                                                        \
-    }                                                                           \
-    wxSize CLASS::base_##CBNAME() const {                                       \
-        return PCLASS::CBNAME();                                                \
-    }
-
+    }                    
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_BOOL(CBNAME)                         \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_BOOL(CBNAME)                         \
-    bool CBNAME(bool a);                                         \
-    bool base_##CBNAME(bool a)
+    bool CBNAME(bool a)
 
 
 #define IMP_PYCALLBACK_BOOL_BOOL(CLASS, PCLASS, CBNAME)                 \
     bool CLASS::CBNAME(bool a) {                                        \
 
 
 #define IMP_PYCALLBACK_BOOL_BOOL(CLASS, PCLASS, CBNAME)                 \
     bool CLASS::CBNAME(bool a) {                                        \
-        bool rval=False, found;                                         \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        bool rval=false, found;                                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
-    }                                                                   \
-    bool CLASS::base_##CBNAME(bool a) {                                 \
-        return PCLASS::CBNAME(a);                                       \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_INT(CBNAME)                         \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_INT(CBNAME)                         \
-    bool CBNAME(int a);                                         \
-    bool base_##CBNAME(int a)
+    bool CBNAME(int a)
 
 
 #define IMP_PYCALLBACK_BOOL_INT(CLASS, PCLASS, CBNAME)                  \
     bool CLASS::CBNAME(int a) {                                         \
 
 
 #define IMP_PYCALLBACK_BOOL_INT(CLASS, PCLASS, CBNAME)                  \
     bool CLASS::CBNAME(int a) {                                         \
-        bool rval=False, found;                                         \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        bool rval=false, found;                                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
-    }                                                                   \
-    bool CLASS::base_##CBNAME(int a) {                                  \
-        return PCLASS::CBNAME(a);                                       \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------
@@ -917,11 +897,11 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_BOOL_INT_pure(CLASS, PCLASS, CBNAME)                     \
     bool CLASS::CBNAME(int a) {                                                 \
 
 #define IMP_PYCALLBACK_BOOL_INT_pure(CLASS, PCLASS, CBNAME)                     \
     bool CLASS::CBNAME(int a) {                                                 \
-        bool rval=False;                                                        \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        bool rval=false;                                                        \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));      \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));      \
-        else rval = False;                                                      \
+        else rval = false;                                                      \
         wxPyEndBlockThreads(blocked);                                           \
         return rval;                                                            \
     }
         wxPyEndBlockThreads(blocked);                                           \
         return rval;                                                            \
     }
@@ -930,14 +910,13 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DC(CBNAME)                      \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DC(CBNAME)                      \
-    void CBNAME(wxDC& a);                               \
-    void base_##CBNAME(wxDC& a)
+    void CBNAME(wxDC& a)
 
 
 #define IMP_PYCALLBACK__DC(CLASS, PCLASS, CBNAME)                       \
     void CLASS::CBNAME(wxDC& a) {                                       \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK__DC(CLASS, PCLASS, CBNAME)                       \
     void CLASS::CBNAME(wxDC& a) {                                       \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));  \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));  \
@@ -946,24 +925,19 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a);                                          \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a);                                          \
-    }                                                                   \
-    void CLASS::base_##CBNAME(wxDC& a) {                                \
-        PCLASS::CBNAME(a);                                              \
-    }
-
+    }                   
 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCBOOL(CBNAME)                  \
 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCBOOL(CBNAME)                  \
-    void CBNAME(wxDC& a, bool b);                       \
-    void base_##CBNAME(wxDC& a, bool b)
+    void CBNAME(wxDC& a, bool b)
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(wxDC& a, bool b) {                               \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(wxDC& a, bool b) {                               \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
@@ -972,22 +946,18 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b);                                       \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b);                                       \
-    }                                                                   \
-    void CLASS::base_##CBNAME(wxDC& a, bool b) {                        \
-        PCLASS::CBNAME(a, b);                                           \
-    }
+    }                           
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCBOOL(CBNAME)                          \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCBOOL(CBNAME)                          \
-    void CBNAME(wxDC& a, bool b);                               \
-    void base_##CBNAME(wxDC& a, bool b)
+    void CBNAME(wxDC& a, bool b)
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(wxDC& a, bool b) {                               \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(wxDC& a, bool b) {                               \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
@@ -996,65 +966,53 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b);                                       \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b);                                       \
-    }                                                                   \
-    void CLASS::base_##CBNAME(wxDC& a, bool b) {                        \
-        PCLASS::CBNAME(a, b);                                           \
-    }
+    }                           
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__2DBL(CBNAME)                    \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__2DBL(CBNAME)                    \
-    void CBNAME(double a, double b);                    \
-    void base_##CBNAME(double a, double b)
+    void CBNAME(double a, double b)
 
 
 #define IMP_PYCALLBACK__2DBL(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(double a, double b) {                            \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK__2DBL(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(double a, double b) {                            \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(dd)",a,b));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b);                                       \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(dd)",a,b));  \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b);                                       \
-    }                                                                   \
-    void CLASS::base_##CBNAME(double a, double b) {                     \
-        PCLASS::CBNAME(a, b);                                           \
-    }
+    }     
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__2DBL2INT(CBNAME)                        \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__2DBL2INT(CBNAME)                        \
-    void CBNAME(double a, double b, int c, int d);              \
-    void base_##CBNAME(double a, double b, int c, int d)
+    void CBNAME(double a, double b, int c, int d)
 
 
 #define IMP_PYCALLBACK__2DBL2INT(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(double a, double b, int c, int d) {              \
         bool found;                                                     \
 
 
 #define IMP_PYCALLBACK__2DBL2INT(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(double a, double b, int c, int d) {              \
         bool found;                                                     \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddii)",      \
                                                        a,b,c,d));       \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b, c, d);                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))          \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddii)",      \
                                                        a,b,c,d));       \
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a, b, c, d);                                 \
-    }                                                                   \
-    void CLASS::base_##CBNAME(double a, double b, int c, int d) {       \
-        PCLASS::CBNAME(a, b, c, d);                                     \
-    }
+    }                                            
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DC4DBLBOOL(CBNAME)                                      \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DC4DBLBOOL(CBNAME)                                      \
-    void CBNAME(wxDC& a, double b, double c, double d, double e, bool f);       \
-    void base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f)
+    void CBNAME(wxDC& a, double b, double c, double d, double e, bool f)
 
 
 #define IMP_PYCALLBACK__DC4DBLBOOL(CLASS, PCLASS, CBNAME)                               \
     void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {       \
         bool found;                                                                     \
 
 
 #define IMP_PYCALLBACK__DC4DBLBOOL(CLASS, PCLASS, CBNAME)                               \
     void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {       \
         bool found;                                                                     \
-        bool blocked = wxPyBeginBlockThreads();                                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));  \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                                \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));  \
@@ -1063,23 +1021,19 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                                   \
         if (! found)                                                                    \
             PCLASS::CBNAME(a, b, c, d, e, f);                                           \
         wxPyEndBlockThreads(blocked);                                                   \
         if (! found)                                                                    \
             PCLASS::CBNAME(a, b, c, d, e, f);                                           \
-    }                                                                                   \
-    void CLASS::base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {\
-        PCLASS::CBNAME(a, b, c, d, e, f);                                               \
-    }
+    }                                                                   
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_DC4DBLBOOL(CBNAME)                                  \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_DC4DBLBOOL(CBNAME)                                  \
-    bool CBNAME(wxDC& a, double b, double c, double d, double e, bool f);       \
-    bool base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f)
+    bool CBNAME(wxDC& a, double b, double c, double d, double e, bool f)
 
 
 #define IMP_PYCALLBACK_BOOL_DC4DBLBOOL(CLASS, PCLASS, CBNAME)                           \
     bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {       \
         bool found;                                                                     \
 
 
 #define IMP_PYCALLBACK_BOOL_DC4DBLBOOL(CLASS, PCLASS, CBNAME)                           \
     bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {       \
         bool found;                                                                     \
-        bool blocked = wxPyBeginBlockThreads();                                         \
-        bool rval=False;                                                                \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                         \
+        bool rval=false;                                                                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                                \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
             PyObject* obj = wxPyMake_wxObject(&a,false);                                \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
@@ -1089,44 +1043,36 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                                    \
             rval = PCLASS::CBNAME(a, b, c, d, e, f);                                    \
         return rval;                                                                    \
         if (! found)                                                                    \
             rval = PCLASS::CBNAME(a, b, c, d, e, f);                                    \
         return rval;                                                                    \
-    }                                                                                   \
-    bool CLASS::base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {\
-        return PCLASS::CBNAME(a, b, c, d, e, f);                                        \
-    }
+    }                                                                   
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__BOOL2DBL2INT(CBNAME)                            \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__BOOL2DBL2INT(CBNAME)                            \
-    void CBNAME(bool a, double b, double c, int d, int e);              \
-    void base_##CBNAME(bool a, double b, double c, int d, int e)
+    void CBNAME(bool a, double b, double c, int d, int e)
 
 
 #define IMP_PYCALLBACK__BOOL2DBL2INT(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(bool a, double b, double c, int d, int e) {              \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__BOOL2DBL2INT(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(bool a, double b, double c, int d, int e) {              \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddii)",             \
                                                 (int)a,b,c,d,e));               \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e);                                      \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddii)",             \
                                                 (int)a,b,c,d,e));               \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e);                                      \
-    }                                                                           \
-    void CLASS::base_##CBNAME(bool a, double b, double c, int d, int e) {       \
-        PCLASS::CBNAME(a, b, c, d, e);                                          \
-    }
+    }                                                    
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DC4DBL(CBNAME)                                          \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DC4DBL(CBNAME)                                          \
-    void CBNAME(wxDC& a, double b, double c, double d, double e);               \
-    void base_##CBNAME(wxDC& a, double b, double c, double d, double e)
+    void CBNAME(wxDC& a, double b, double c, double d, double e)
 
 
 #define IMP_PYCALLBACK__DC4DBL(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e) {       \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__DC4DBL(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e) {       \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Odddd)", obj, b, c, d, e));   \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Odddd)", obj, b, c, d, e));   \
@@ -1135,22 +1081,18 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e);                                      \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e);                                      \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxDC& a, double b, double c, double d, double e) {\
-        PCLASS::CBNAME(a, b, c, d, e);                                          \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCBOOL(CBNAME)                  \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCBOOL(CBNAME)                  \
-    void CBNAME(wxDC& a, bool b);                       \
-    void base_##CBNAME(wxDC& a, bool b)
+    void CBNAME(wxDC& a, bool b)
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(wxDC& a, bool b) {                                       \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(wxDC& a, bool b) {                                       \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
@@ -1159,23 +1101,19 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b);                                               \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b);                                               \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxDC& a, bool b) {                                \
-        PCLASS::CBNAME(a, b);                                                   \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__WXCPBOOL2DBL2INT(CBNAME)                                \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__WXCPBOOL2DBL2INT(CBNAME)                                \
-    void CBNAME(wxControlPoint* a, bool b, double c, double d, int e, int f);   \
-    void base_##CBNAME(wxControlPoint* a, bool b, double c, double d, int e, int f)
+    void CBNAME(wxControlPoint* a, bool b, double c, double d, int e, int f)
 
 
 #define IMP_PYCALLBACK__WXCPBOOL2DBL2INT(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(wxControlPoint* a, bool b, double c, double d,           \
                 int e, int f) {                                                 \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__WXCPBOOL2DBL2INT(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(wxControlPoint* a, bool b, double c, double d,           \
                 int e, int f) {                                                 \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
@@ -1184,23 +1122,18 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e, f);                                   \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e, f);                                   \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxControlPoint* a, bool b, double c, double d,    \
-                       int e, int f) {                                          \
-        PCLASS::CBNAME(a, b, c, d, e, f);                                       \
-    }
+    }                                                                       
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__WXCP2DBL2INT(CBNAME)                                    \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__WXCP2DBL2INT(CBNAME)                                    \
-    void CBNAME(wxControlPoint* a, double b, double c, int d, int e);           \
-    void base_##CBNAME(wxControlPoint* a, double b, double c, int d, int e)
+    void CBNAME(wxControlPoint* a, double b, double c, int d, int e)
 
 
 #define IMP_PYCALLBACK__WXCP2DBL2INT(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(wxControlPoint* a, double b, double c, int d, int e) {   \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__WXCP2DBL2INT(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(wxControlPoint* a, double b, double c, int d, int e) {   \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddii)", obj, b, c, d, e));   \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddii)", obj, b, c, d, e));   \
@@ -1209,65 +1142,52 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e);                                      \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d, e);                                      \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxControlPoint* a, double b, double c,            \
-                       int d, int e) {                                          \
-        PCLASS::CBNAME(a, b, c, d, e);                                          \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__2DBLINT(CBNAME)                 \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__2DBLINT(CBNAME)                 \
-    void CBNAME(double a, double b, int c);             \
-    void base_##CBNAME(double a, double b, int c)
+    void CBNAME(double a, double b, int c)
 
 
 #define IMP_PYCALLBACK__2DBLINT(CLASS, PCLASS, CBNAME)                          \
     void CLASS::CBNAME(double a, double b, int c) {                             \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__2DBLINT(CLASS, PCLASS, CBNAME)                          \
     void CLASS::CBNAME(double a, double b, int c) {                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddi)", a,b,c));      \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c);                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddi)", a,b,c));      \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c);                                            \
-    }                                                                           \
-    void CLASS::base_##CBNAME(double a, double b, int c) {                      \
-        PCLASS::CBNAME(a, b, c);                                                \
-    }
+    }                                     
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__BOOL2DBLINT(CBNAME)                     \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__BOOL2DBLINT(CBNAME)                     \
-    void CBNAME(bool a, double b, double c, int d);             \
-    void base_##CBNAME(bool a, double b, double c, int d)
+    void CBNAME(bool a, double b, double c, int d)
 
 
 #define IMP_PYCALLBACK__BOOL2DBLINT(CLASS, PCLASS, CBNAME)                      \
     void CLASS::CBNAME(bool a, double b, double c, int d) {                     \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__BOOL2DBLINT(CLASS, PCLASS, CBNAME)                      \
     void CLASS::CBNAME(bool a, double b, double c, int d) {                     \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddi)", (int)a,b,c,d));\
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d);                                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddi)", (int)a,b,c,d));\
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a, b, c, d);                                         \
-    }                                                                           \
-    void CLASS::base_##CBNAME(bool a, double b, double c, int d) {              \
-        PCLASS::CBNAME(a, b, c, d);                                             \
-    }
+    }                                             
 
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__STRING(CBNAME)                  \
 
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__STRING(CBNAME)                  \
-    void CBNAME(const wxString& a);                     \
-    void base_##CBNAME(const wxString& a)
+    void CBNAME(const wxString& a)
 
 #define IMP_PYCALLBACK__STRING(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(const wxString& a)  {                                    \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK__STRING(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(const wxString& a)  {                                    \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* s = wx2PyString(a);                                       \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* s = wx2PyString(a);                                       \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));            \
@@ -1276,22 +1196,18 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(const wxString& a) {                              \
-        PCLASS::CBNAME(a);                                                      \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_STRING(CBNAME)              \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_STRING(CBNAME)              \
-    bool CBNAME(const wxString& a);                     \
-    bool base_##CBNAME(const wxString& a)
+    bool CBNAME(const wxString& a)
 
 #define IMP_PYCALLBACK_BOOL_STRING(CLASS, PCLASS, CBNAME)                       \
     bool CLASS::CBNAME(const wxString& a)  {                                    \
 
 #define IMP_PYCALLBACK_BOOL_STRING(CLASS, PCLASS, CBNAME)                       \
     bool CLASS::CBNAME(const wxString& a)  {                                    \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* s = wx2PyString(a);                                       \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));     \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* s = wx2PyString(a);                                       \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));     \
@@ -1301,9 +1217,6 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(const wxString& a) {                              \
-        return PCLASS::CBNAME(a);                                               \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------
@@ -1313,8 +1226,8 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_BOOL_STRING_pure(CLASS, PCLASS, CBNAME)                  \
     bool CLASS::CBNAME(const wxString& a)  {                                    \
 
 #define IMP_PYCALLBACK_BOOL_STRING_pure(CLASS, PCLASS, CBNAME)                  \
     bool CLASS::CBNAME(const wxString& a)  {                                    \
-        bool rval=False;                                                        \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        bool rval=false;                                                        \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* s = wx2PyString(a);                                       \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));     \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* s = wx2PyString(a);                                       \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));     \
@@ -1332,7 +1245,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_STRING_STRING_pure(CLASS, PCLASS, CBNAME)                \
     wxString CLASS::CBNAME(const wxString& a)  {                                \
         wxString rval;                                                          \
 #define IMP_PYCALLBACK_STRING_STRING_pure(CLASS, PCLASS, CBNAME)                \
     wxString CLASS::CBNAME(const wxString& a)  {                                \
         wxString rval;                                                          \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             PyObject* s = wx2PyString(a);                                       \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             PyObject* s = wx2PyString(a);                                       \
@@ -1350,14 +1263,13 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING_STRING(CBNAME)                                    \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING_STRING(CBNAME)                                    \
-    wxString CBNAME(const wxString& a);                                         \
-    wxString base_##CBNAME(const wxString& a)
+    wxString CBNAME(const wxString& a)
 
 #define IMP_PYCALLBACK_STRING_STRING(CLASS, PCLASS, CBNAME)                     \
     wxString CLASS::CBNAME(const wxString& a)  {                                \
         wxString rval;                                                          \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK_STRING_STRING(CLASS, PCLASS, CBNAME)                     \
     wxString CLASS::CBNAME(const wxString& a)  {                                \
         wxString rval;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             PyObject* s = wx2PyString(a);                                       \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             PyObject* s = wx2PyString(a);                                       \
@@ -1382,7 +1294,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_STRING_STRINGINT_pure(CLASS, PCLASS, CBNAME)             \
     wxString CLASS::CBNAME(const wxString& a,int b)  {                          \
         wxString rval;                                                          \
 #define IMP_PYCALLBACK_STRING_STRINGINT_pure(CLASS, PCLASS, CBNAME)             \
     wxString CLASS::CBNAME(const wxString& a,int b)  {                          \
         wxString rval;                                                          \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             PyObject* s = wx2PyString(a);                                       \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             PyObject* s = wx2PyString(a);                                       \
@@ -1400,14 +1312,13 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_STRINGSTRING(CBNAME)              \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_STRINGSTRING(CBNAME)              \
-    bool CBNAME(const wxString& a, const wxString& b);        \
-    bool base_##CBNAME(const wxString& a, const wxString& b)
+    bool CBNAME(const wxString& a, const wxString& b)
 
 #define IMP_PYCALLBACK_BOOL_STRINGSTRING(CLASS, PCLASS, CBNAME)                 \
     bool CLASS::CBNAME(const wxString& a, const wxString& b) {                  \
 
 #define IMP_PYCALLBACK_BOOL_STRINGSTRING(CLASS, PCLASS, CBNAME)                 \
     bool CLASS::CBNAME(const wxString& a, const wxString& b) {                  \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* s1 = wx2PyString(a);                                      \
             PyObject* s2 = wx2PyString(b);                                      \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* s1 = wx2PyString(a);                                      \
             PyObject* s2 = wx2PyString(b);                                      \
@@ -1419,22 +1330,18 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(const wxString& a, const wxString& b) {           \
-        return PCLASS::CBNAME(a, b);                                            \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING_(CBNAME)                  \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING_(CBNAME)                  \
-    wxString CBNAME();                                  \
-    wxString base_##CBNAME()
+    wxString CBNAME()
 
 #define IMP_PYCALLBACK_STRING_(CLASS, PCLASS, CBNAME)                           \
     wxString CLASS::CBNAME() {                                                  \
         wxString rval;                                                          \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK_STRING_(CLASS, PCLASS, CBNAME)                           \
     wxString CLASS::CBNAME() {                                                  \
         wxString rval;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -1447,22 +1354,18 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxString CLASS::base_##CBNAME() {                                           \
-        return PCLASS::CBNAME();                                                \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING__const(CBNAME)                  \
     }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING__const(CBNAME)                  \
-    wxString CBNAME() const;                                  \
-    wxString base_##CBNAME() const;
+    wxString CBNAME() const
 
 #define IMP_PYCALLBACK_STRING__const(CLASS, PCLASS, CBNAME)                     \
     wxString CLASS::CBNAME() const {                                            \
         wxString rval;                                                          \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK_STRING__const(CLASS, PCLASS, CBNAME)                     \
     wxString CLASS::CBNAME() const {                                            \
         wxString rval;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -1475,10 +1378,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxString CLASS::base_##CBNAME() const {                                     \
-        return PCLASS::CBNAME();                                                \
-    }
+    }                      
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -1488,7 +1388,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_STRING__pure(CLASS, PCLASS, CBNAME)                      \
     wxString CLASS::CBNAME() {                                                  \
         wxString rval;                                                          \
 #define IMP_PYCALLBACK_STRING__pure(CLASS, PCLASS, CBNAME)                      \
     wxString CLASS::CBNAME() {                                                  \
         wxString rval;                                                          \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -1509,7 +1409,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_STRING__constpure(CLASS, PCLASS, CBNAME)                 \
     wxString CLASS::CBNAME() const {                                            \
         wxString rval;                                                          \
 #define IMP_PYCALLBACK_STRING__constpure(CLASS, PCLASS, CBNAME)                 \
     wxString CLASS::CBNAME() const {                                            \
         wxString rval;                                                          \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -1530,8 +1430,8 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_BOOL_TAG_pure(CLASS, PCLASS, CBNAME)                     \
     bool CLASS::CBNAME(const wxHtmlTag& a)  {                                   \
 
 #define IMP_PYCALLBACK_BOOL_TAG_pure(CLASS, PCLASS, CBNAME)                     \
     bool CLASS::CBNAME(const wxHtmlTag& a)  {                                   \
-        bool rval=False;                                                        \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        bool rval=false;                                                        \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxHtmlTag"), 0);\
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxHtmlTag"), 0);\
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
@@ -1544,36 +1444,31 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__CELLINTINT(CBNAME)                                      \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__CELLINTINT(CBNAME)                                      \
-    void CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y);                        \
-    void base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y)
+    void CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y)
 
 #define IMP_PYCALLBACK__CELLINTINT(CLASS, PCLASS, CBNAME)                       \
     void CLASS::CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y) {                \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK__CELLINTINT(CLASS, PCLASS, CBNAME)                       \
     void CLASS::CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y) {                \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* obj = wxPyConstructObject((void*)cell, wxT("wxHtmlCell"), 0);  \
+            PyObject* obj = wxPyMake_wxObject(cell, 0);                         \
             wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Oii)",obj,x,y));  \
             Py_DECREF(obj);                                                     \
         }                                                                       \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(cell, x, y);                                         \
             wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Oii)",obj,x,y));  \
             Py_DECREF(obj);                                                     \
         }                                                                       \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(cell, x, y);                                         \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y) {         \
-        PCLASS::CBNAME(cell, x, y);                                             \
-    }
+    }                                                  
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__COLOUR(CBNAME)                                      \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__COLOUR(CBNAME)                                      \
-    void CBNAME(const wxColour& c);                                         \
-    void base_##CBNAME(const wxColour& c)
+    void CBNAME(const wxColour& c);
 
 #define IMP_PYCALLBACK__COLOUR(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(const wxColour& c) {                                     \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK__COLOUR(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(const wxColour& c) {                                     \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&c, wxT("wxColour"), 0); \
             wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)",obj));        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&c, wxT("wxColour"), 0); \
             wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)",obj));        \
@@ -1583,22 +1478,18 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             PCLASS::CBNAME(c);                                                  \
     }                                                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(c);                                                  \
     }                                                                           \
-    void CLASS::base_##CBNAME(const wxColour& c) {                              \
-        PCLASS::CBNAME(c);                                                      \
-    }
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__CELLINTINTME(CBNAME)                                    \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__CELLINTINTME(CBNAME)                                    \
-    void CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e); \
-    void base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e)
+    void CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e)
 
 #define IMP_PYCALLBACK__CELLINTINTME(CLASS, PCLASS, CBNAME)                             \
     void CLASS::CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e) { \
         bool found;                                                                     \
 
 #define IMP_PYCALLBACK__CELLINTINTME(CLASS, PCLASS, CBNAME)                             \
     void CLASS::CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e) { \
         bool found;                                                                     \
-        bool blocked = wxPyBeginBlockThreads();                                         \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                         \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
-            PyObject* obj = wxPyConstructObject((void*)cell, wxT("wxHtmlCell"), 0);     \
+            PyObject* obj = wxPyMake_wxObject(cell, 0);                                 \
             PyObject* o2  = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0);     \
             wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2));      \
             Py_DECREF(obj);                                                             \
             PyObject* o2  = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0);     \
             wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2));      \
             Py_DECREF(obj);                                                             \
@@ -1607,11 +1498,7 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                                   \
         if (! found)                                                                    \
             PCLASS::CBNAME(cell, x, y, e);                                              \
         wxPyEndBlockThreads(blocked);                                                   \
         if (! found)                                                                    \
             PCLASS::CBNAME(cell, x, y, e);                                              \
-    }                                                                                   \
-    void CLASS::base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e) {\
-        PCLASS::CBNAME(cell, x, y, e);                                                  \
-    }
-
+    }                                                                         
 
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
@@ -1622,7 +1509,7 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK___pure(CLASS, PCLASS, CBNAME)                            \
     void CLASS::CBNAME() {                                                      \
 
 #define IMP_PYCALLBACK___pure(CLASS, PCLASS, CBNAME)                            \
     void CLASS::CBNAME() {                                                      \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));                \
         wxPyEndBlockThreads(blocked);                                           \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));                \
         wxPyEndBlockThreads(blocked);                                           \
@@ -1638,7 +1525,7 @@ extern wxPyApp *wxPythonApp;
     wxSize CLASS::CBNAME() {                                                    \
         const char* errmsg = #CBNAME " should return a 2-tuple of integers or a wxSize object."; \
         wxSize rval(0,0);                                                       \
     wxSize CLASS::CBNAME() {                                                    \
         const char* errmsg = #CBNAME " should return a 2-tuple of integers or a wxSize object."; \
         wxSize rval(0,0);                                                       \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             wxSize*   ptr;                                                      \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             wxSize*   ptr;                                                      \
@@ -1647,6 +1534,7 @@ extern wxPyApp *wxPythonApp;
                 if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxSize")))       \
                     rval = *ptr;                                                \
                 else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {    \
                 if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxSize")))       \
                     rval = *ptr;                                                \
                 else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {    \
+                    PyErr_Clear();                                              \
                     PyObject* o1 = PySequence_GetItem(ro, 0);                   \
                     PyObject* o2 = PySequence_GetItem(ro, 1);                   \
                     if (PyNumber_Check(o1) && PyNumber_Check(o2))               \
                     PyObject* o1 = PySequence_GetItem(ro, 0);                   \
                     PyObject* o2 = PySequence_GetItem(ro, 1);                   \
                     if (PyNumber_Check(o1) && PyNumber_Check(o2))               \
@@ -1669,15 +1557,14 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_WXWIN(CBNAME)                      \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_WXWIN(CBNAME)                      \
-    bool CBNAME(wxWindow* a);                                  \
-    bool base_##CBNAME(wxWindow* a)
+    bool CBNAME(wxWindow* a)
 
 
 #define IMP_PYCALLBACK_BOOL_WXWIN(CLASS, PCLASS, CBNAME)                        \
     bool CLASS::CBNAME(wxWindow* a) {                                           \
 
 
 #define IMP_PYCALLBACK_BOOL_WXWIN(CLASS, PCLASS, CBNAME)                        \
     bool CLASS::CBNAME(wxWindow* a) {                                           \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
@@ -1687,23 +1574,19 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxWindow* a) {                                    \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }                       
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_WXWINDC(CBNAME)                             \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_WXWINDC(CBNAME)                             \
-    bool CBNAME(wxWindow* a, wxDC& b);                                  \
-    bool base_##CBNAME(wxWindow* a, wxDC& b)
+    bool CBNAME(wxWindow* a, wxDC& b)
 
 
 #define IMP_PYCALLBACK_BOOL_WXWINDC(CLASS, PCLASS, CBNAME)                      \
     bool CLASS::CBNAME(wxWindow* a, wxDC& b) {                                  \
 
 
 #define IMP_PYCALLBACK_BOOL_WXWINDC(CLASS, PCLASS, CBNAME)                      \
     bool CLASS::CBNAME(wxWindow* a, wxDC& b) {                                  \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* win = wxPyMake_wxObject(a,false);                         \
             PyObject* dc  = wxPyMake_wxObject(&b,false);                        \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* win = wxPyMake_wxObject(a,false);                         \
             PyObject* dc  = wxPyMake_wxObject(&b,false);                        \
@@ -1715,22 +1598,18 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxWindow* a, wxDC& b) {                           \
-        return PCLASS::CBNAME(a, b);                                            \
-    }
+    }                      
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_WXWINBASE(CBNAME)                      \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_WXWINBASE(CBNAME)                      \
-    void CBNAME(wxWindowBase* a);                                  \
-    void base_##CBNAME(wxWindowBase* a)
+    void CBNAME(wxWindowBase* a)
 
 
 #define IMP_PYCALLBACK_VOID_WXWINBASE(CLASS, PCLASS, CBNAME)                    \
     void CLASS::CBNAME(wxWindowBase* a) {                                       \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_VOID_WXWINBASE(CLASS, PCLASS, CBNAME)                    \
     void CLASS::CBNAME(wxWindowBase* a) {                                       \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));          \
@@ -1739,79 +1618,64 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxWindowBase* a) {                                \
-        PCLASS::CBNAME(a);                                                      \
-    }
+    }                 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_(CBNAME)                      \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_(CBNAME)                      \
-    bool CBNAME();                                        \
-    bool base_##CBNAME()
+    bool CBNAME()
 
 
 #define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME)                             \
     bool CLASS::CBNAME() {                                                      \
 
 
 #define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME)                             \
     bool CLASS::CBNAME() {                                                      \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME() {                                               \
-        return PCLASS::CBNAME();                                                \
-    }
+    }       
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_const(CBNAME)                       \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_const(CBNAME)                       \
-    bool CBNAME() const;                                        \
-    bool base_##CBNAME() const
+    bool CBNAME() const
 
 
 #define IMP_PYCALLBACK_BOOL_const(CLASS, PCLASS, CBNAME)                        \
     bool CLASS::CBNAME() const {                                                \
 
 
 #define IMP_PYCALLBACK_BOOL_const(CLASS, PCLASS, CBNAME)                        \
     bool CLASS::CBNAME() const {                                                \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME() const {                                         \
-        return PCLASS::CBNAME();                                                \
-    }
+    }      
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_DR_2WXCDR(CBNAME)                                \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_DR_2WXCDR(CBNAME)                                \
-    wxDragResult CBNAME(wxCoord x, wxCoord y, wxDragResult def);        \
-    wxDragResult base_##CBNAME(wxCoord x, wxCoord y, wxDragResult def)
+    wxDragResult CBNAME(wxCoord x, wxCoord y, wxDragResult def)
 
 
 #define IMP_PYCALLBACK_DR_2WXCDR(CLASS, PCLASS, CBNAME)                         \
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {          \
         int rval=0;                                                             \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_DR_2WXCDR(CLASS, PCLASS, CBNAME)                         \
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {          \
         int rval=0;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b, c);                                     \
         return (wxDragResult)rval;                                              \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b, c);                                     \
         return (wxDragResult)rval;                                              \
-    }                                                                           \
-    wxDragResult CLASS::base_##CBNAME(wxCoord a, wxCoord b, wxDragResult c) {   \
-        return PCLASS::CBNAME(a, b, c);                                         \
-    }
+    }        
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -1820,7 +1684,7 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_FSF_FSSTRING_pure(CLASS, PCLASS, CBNAME)                 \
     wxFSFile* CLASS::CBNAME(wxFileSystem& a,const wxString& b) {                \
 
 #define IMP_PYCALLBACK_FSF_FSSTRING_pure(CLASS, PCLASS, CBNAME)                 \
     wxFSFile* CLASS::CBNAME(wxFileSystem& a,const wxString& b) {                \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         wxFSFile* rval=0;                                                       \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
         wxFSFile* rval=0;                                                       \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
@@ -1842,25 +1706,21 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_DR(CBNAME)                  \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_DR(CBNAME)                  \
-    bool CBNAME(wxDragResult a);                        \
-    bool base_##CBNAME(wxDragResult a)
+    bool CBNAME(wxDragResult a)
 
 
 #define IMP_PYCALLBACK_BOOL_DR(CLASS, PCLASS, CBNAME)                           \
     bool CLASS::CBNAME(wxDragResult a) {                                        \
 
 
 #define IMP_PYCALLBACK_BOOL_DR(CLASS, PCLASS, CBNAME)                           \
     bool CLASS::CBNAME(wxDragResult a) {                                        \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));     \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));     \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxDragResult a) {                                 \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }        
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -1870,7 +1730,7 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_DR_2WXCDR_pure(CLASS, PCLASS, CBNAME)                    \
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {          \
 
 #define IMP_PYCALLBACK_DR_2WXCDR_pure(CLASS, PCLASS, CBNAME)                    \
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {          \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         int rval=0;                                                             \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
         int rval=0;                                                             \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
@@ -1885,8 +1745,8 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_BOOL_INTINTSTR_pure(CLASS, PCLASS, CBNAME)       \
     bool CLASS::CBNAME(int a, int b, const wxString& c) {               \
 
 #define IMP_PYCALLBACK_BOOL_INTINTSTR_pure(CLASS, PCLASS, CBNAME)       \
     bool CLASS::CBNAME(int a, int b, const wxString& c) {               \
-        bool rval=False;                                                \
-        bool blocked = wxPyBeginBlockThreads();                         \
+        bool rval=false;                                                \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                         \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                  \
             PyObject* s = wx2PyString(c);                               \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",a,b,s));\
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                  \
             PyObject* s = wx2PyString(c);                               \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",a,b,s));\
@@ -1899,61 +1759,52 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_SIZET_(CBNAME)                  \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_SIZET_(CBNAME)                  \
-    size_t CBNAME();                                   \
-    size_t base_##CBNAME()
+    size_t CBNAME()
 
 
 #define IMP_PYCALLBACK_SIZET_(CLASS, PCLASS, CBNAME)                            \
     size_t CLASS::CBNAME() {                                                    \
         size_t rval=0;                                                          \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_SIZET_(CLASS, PCLASS, CBNAME)                            \
     size_t CLASS::CBNAME() {                                                    \
         size_t rval=0;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    size_t CLASS::base_##CBNAME() {                                             \
-        return PCLASS::CBNAME();                                                \
-    }
+    }            
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_SIZET__const(CBNAME)                  \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_SIZET__const(CBNAME)                  \
-    size_t CBNAME() const;                                   \
-    size_t base_##CBNAME() const
+    size_t CBNAME() const
 
 
 #define IMP_PYCALLBACK_SIZET__const(CLASS, PCLASS, CBNAME)                      \
     size_t CLASS::CBNAME() const {                                              \
         size_t rval=0;                                                          \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_SIZET__const(CLASS, PCLASS, CBNAME)                      \
     size_t CLASS::CBNAME() const {                                              \
         size_t rval=0;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    size_t CLASS::base_##CBNAME() const {                                       \
-        return PCLASS::CBNAME();                                                \
-    }
+    }         
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_DATAFMT_SIZET(CBNAME)                                    \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_DATAFMT_SIZET(CBNAME)                                    \
-    wxDataFormat  CBNAME(size_t a);                                             \
-    wxDataFormat  base_##CBNAME(size_t a)
+    wxDataFormat  CBNAME(size_t a)
 
 
 #define IMP_PYCALLBACK_DATAFMT_SIZET(CLASS, PCLASS, CBNAME)                     \
     wxDataFormat CLASS::CBNAME(size_t a) {                                      \
         wxDataFormat rval=0;                                                    \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_DATAFMT_SIZET(CLASS, PCLASS, CBNAME)                     \
     wxDataFormat CLASS::CBNAME(size_t a) {                                      \
         wxDataFormat rval=0;                                                    \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             wxDataFormat* ptr;                                                  \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             wxDataFormat* ptr;                                                  \
@@ -1968,22 +1819,18 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    wxDataFormat  CLASS::base_##CBNAME(size_t a) {                              \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }         
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__constany(CBNAME, Type)          \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__constany(CBNAME, Type)          \
-    void CBNAME(const Type& a);                         \
-    void base_##CBNAME(const Type& a)
+    void CBNAME(const Type& a)
 
 
 #define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type)                   \
     void CLASS::CBNAME(const Type& a) {                                         \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type)                   \
     void CLASS::CBNAME(const Type& a) {                                         \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));          \
@@ -1992,23 +1839,19 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(const Type& a) {                                  \
-        PCLASS::CBNAME(a);                                                      \
-    }
+    }           
 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__any(CBNAME, Type)          \
 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__any(CBNAME, Type)          \
-    void CBNAME(Type& a);                          \
-    void base_##CBNAME(Type& a)
+    void CBNAME(Type& a)
 
 
 #define IMP_PYCALLBACK__any(CLASS, PCLASS, CBNAME, Type)                        \
     void CLASS::CBNAME(Type& a) {                                               \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__any(CLASS, PCLASS, CBNAME, Type)                        \
     void CLASS::CBNAME(Type& a) {                                               \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));          \
@@ -2017,23 +1860,19 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(Type& a) {                                        \
-        PCLASS::CBNAME(a);                                                      \
-    }
+    }              
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_bool_any(CBNAME, Type)           \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_bool_any(CBNAME, Type)           \
-    bool CBNAME(Type& a);                               \
-    bool base_##CBNAME(Type& a)
+    bool CBNAME(Type& a)
 
 
 #define IMP_PYCALLBACK_bool_any(CLASS, PCLASS, CBNAME, Type)                    \
     bool CLASS::CBNAME(Type& a) {                                               \
 
 
 #define IMP_PYCALLBACK_bool_any(CLASS, PCLASS, CBNAME, Type)                    \
     bool CLASS::CBNAME(Type& a) {                                               \
-        bool rv=False;                                                          \
+        bool rv=false;                                                          \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));     \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));     \
@@ -2043,10 +1882,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rv = PCLASS::CBNAME(a);                                             \
         return rv;                                                              \
         if (! found)                                                            \
             rv = PCLASS::CBNAME(a);                                             \
         return rv;                                                              \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(Type& a) {                                        \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }          
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -2056,8 +1892,8 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_bool_anypure(CLASS, PCLASS, CBNAME, Type)                \
     bool CLASS::CBNAME(Type& a) {                                               \
 
 #define IMP_PYCALLBACK_bool_anypure(CLASS, PCLASS, CBNAME, Type)                \
     bool CLASS::CBNAME(Type& a) {                                               \
-        bool rv=False;                                                          \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        bool rv=false;                                                          \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));     \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0);      \
             rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));     \
@@ -2070,14 +1906,13 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING_LONGLONG(CBNAME)                                  \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_STRING_LONGLONG(CBNAME)                                  \
-    wxString CBNAME(long a, long b) const;                                      \
-    wxString base_##CBNAME(long a, long b) const
+    wxString CBNAME(long a, long b) const
 
 #define IMP_PYCALLBACK_STRING_LONGLONG(CLASS, PCLASS, CBNAME)                   \
     wxString CLASS::CBNAME(long a, long b) const {                              \
         wxString rval;                                                          \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK_STRING_LONGLONG(CLASS, PCLASS, CBNAME)                   \
     wxString CLASS::CBNAME(long a, long b) const {                              \
         wxString rval;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b));  \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b));  \
@@ -2090,23 +1925,19 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a,b);                                         \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a,b);                                         \
         return rval;                                                            \
-    }                                                                           \
-    wxString CLASS::base_##CBNAME(long a, long b) const {                       \
-        return PCLASS::CBNAME(a,b);                                             \
-    }
+    }                 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_INT_LONG(CBNAME)                                         \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_INT_LONG(CBNAME)                                         \
-    int CBNAME(long a) const;                                                   \
-    int base_##CBNAME(long a) const
+    int CBNAME(long a) const
 
 
 #define IMP_PYCALLBACK_INT_LONG(CLASS, PCLASS, CBNAME)                          \
     int CLASS::CBNAME(long a) const {                                           \
         int rval=-1;                                                            \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_INT_LONG(CLASS, PCLASS, CBNAME)                          \
     int CLASS::CBNAME(long a) const {                                           \
         int rval=-1;                                                            \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a));     \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a));     \
@@ -2119,24 +1950,90 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    int CLASS::base_##CBNAME(long a) const {                                    \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }     
+
+
+#define DEC_PYCALLBACK_INT_LONG_virtual(CBNAME)                                 \
+    int CBNAME(long a) const;
+
+
+#define IMP_PYCALLBACK_INT_LONG_virtual(CLASS, PCLASS, CBNAME)                  \
+    int CLASS::CBNAME(long a) const {                                           \
+        int rval=-1;    /* this rval is important for OnGetItemImage */         \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* ro;                                                       \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a));     \
+            if (ro) {                                                           \
+                rval = PyInt_AsLong(ro);                                        \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        return rval;                                                            \
+    }  
+
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_INT_LONGLONG(CBNAME)                                     \
+    int CBNAME(long a, long b) const
+
+
+#define IMP_PYCALLBACK_INT_LONGLONG(CLASS, PCLASS, CBNAME)                      \
+    int CLASS::CBNAME(long a, long b) const {                                   \
+        int rval=-1;                                                            \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* ro;                                                       \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b));  \
+            if (ro) {                                                           \
+                rval = PyInt_AsLong(ro);                                        \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rval = PCLASS::CBNAME(a, b);                                        \
+        return rval;                                                            \
+    }          
+
+
+#define DEC_PYCALLBACK_INT_LONGLONG_virtual(CBNAME)                             \
+    int CBNAME(long a, long b) const;
+
+
+#define IMP_PYCALLBACK_INT_LONGLONG_virtual(CLASS, PCLASS, CBNAME)              \
+    int CLASS::CBNAME(long a, long b) const {                                   \
+        int rval=-1;    /* this rval is important for OnGetItemImage */         \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* ro;                                                       \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b));  \
+            if (ro) {                                                           \
+                rval = PyInt_AsLong(ro);                                        \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        return rval;                                                            \
+    }  
 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_LISTATTR_LONG(CBNAME)                                    \
 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_LISTATTR_LONG(CBNAME)                                    \
-    wxListItemAttr*  CBNAME(long a) const;                                      \
-    wxListItemAttr*  base_##CBNAME(long a) const
+    wxListItemAttr*  CBNAME(long a) const
 
 
 #define IMP_PYCALLBACK_LISTATTR_LONG(CLASS, PCLASS, CBNAME)                     \
     wxListItemAttr *CLASS::CBNAME(long a) const {                               \
         wxListItemAttr *rval = NULL;                                            \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_LISTATTR_LONG(CLASS, PCLASS, CBNAME)                     \
     wxListItemAttr *CLASS::CBNAME(long a) const {                               \
         wxListItemAttr *rval = NULL;                                            \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             wxListItemAttr* ptr;                                                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             wxListItemAttr* ptr;                                                \
@@ -2151,22 +2048,18 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    wxListItemAttr *CLASS::base_##CBNAME(long a) const {                        \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }                 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_ME(CBNAME)                                          \
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_ME(CBNAME)                                          \
-    bool CBNAME(wxMouseEvent& e);                                               \
-    bool base_##CBNAME(wxMouseEvent& e)
+    bool CBNAME(wxMouseEvent& e)
 
 #define IMP_PYCALLBACK_BOOL_ME(CLASS, PCLASS, CBNAME)                           \
     bool CLASS::CBNAME(wxMouseEvent& e) {                                       \
 
 #define IMP_PYCALLBACK_BOOL_ME(CLASS, PCLASS, CBNAME)                           \
     bool CLASS::CBNAME(wxMouseEvent& e) {                                       \
-        bool rval=False;                                                        \
+        bool rval=false;                                                        \
         bool found;                                                             \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             PyObject* obj  = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0); \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             PyObject* obj  = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0); \
@@ -2181,11 +2074,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             return PCLASS::CBNAME(e);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             return PCLASS::CBNAME(e);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxMouseEvent& e) {                                \
-        return PCLASS::CBNAME(e);                                               \
-    }
-
+    }       
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -2195,7 +2084,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_WIZPG__pure(CLASS, PCLASS, CBNAME)                       \
     wxWizardPage* CLASS::CBNAME() const {                                       \
         wxWizardPage* rv = NULL;                                                \
 #define IMP_PYCALLBACK_WIZPG__pure(CLASS, PCLASS, CBNAME)                       \
     wxWizardPage* CLASS::CBNAME() const {                                       \
         wxWizardPage* rv = NULL;                                                \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -2216,7 +2105,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_BITMAP__pure(CLASS, PCLASS, CBNAME)                      \
     wxBitmap CLASS::CBNAME() const {                                            \
         wxBitmap rv;                                                            \
 #define IMP_PYCALLBACK_BITMAP__pure(CLASS, PCLASS, CBNAME)                      \
     wxBitmap CLASS::CBNAME() const {                                            \
         wxBitmap rv;                                                            \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             wxBitmap* ptr;                                                      \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             wxBitmap* ptr;                                                      \
@@ -2239,7 +2128,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_OBJECT__pure(CLASS, PCLASS, CBNAME)                      \
     wxObject* CLASS::CBNAME() {                                                 \
         wxObject* rv = NULL;                                                    \
 #define IMP_PYCALLBACK_OBJECT__pure(CLASS, PCLASS, CBNAME)                      \
     wxObject* CLASS::CBNAME() {                                                 \
         wxObject* rv = NULL;                                                    \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
@@ -2260,7 +2149,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_OBJECT_STRING_pure(CLASS, PCLASS, CBNAME)                \
     wxObject* CLASS::CBNAME(const wxString& a) {                                \
         wxObject* rv = NULL;                                                    \
 #define IMP_PYCALLBACK_OBJECT_STRING_pure(CLASS, PCLASS, CBNAME)                \
     wxObject* CLASS::CBNAME(const wxString& a) {                                \
         wxObject* rv = NULL;                                                    \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* so = wx2PyString(a);                                      \
             PyObject* ro;                                                       \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* so = wx2PyString(a);                                      \
             PyObject* ro;                                                       \
@@ -2283,8 +2172,8 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_BOOL_NODE_pure(CLASS, PCLASS, CBNAME)                    \
     bool CLASS::CBNAME(wxXmlNode* a) {                                          \
 
 #define IMP_PYCALLBACK_BOOL_NODE_pure(CLASS, PCLASS, CBNAME)                    \
     bool CLASS::CBNAME(wxXmlNode* a) {                                          \
-        bool rv=False;                                                          \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        bool rv=false;                                                          \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* obj = wxPyConstructObject((void*)a, wxT("wxXmlNode"), 0); \
             rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));     \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* obj = wxPyConstructObject((void*)a, wxT("wxXmlNode"), 0); \
             rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));     \
@@ -2304,7 +2193,7 @@ extern wxPyApp *wxPythonApp;
     wxCoord CLASS::CBNAME(size_t a) const {                                     \
         wxCoord rval=0;                                                         \
         bool found;                                                             \
     wxCoord CLASS::CBNAME(size_t a) const {                                     \
         wxCoord rval=0;                                                         \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));     \
         }                                                                       \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));     \
         }                                                                       \
@@ -2315,45 +2204,36 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_SIZETSIZET_const(CBNAME)                            \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VOID_SIZETSIZET_const(CBNAME)                            \
-    void CBNAME(size_t a, size_t b) const;                                      \
-    void base_##CBNAME(size_t a, size_t b) const
+    void CBNAME(size_t a, size_t b) const
 
 
 #define IMP_PYCALLBACK_VOID_SIZETSIZET_const(CLASS, PCLASS, CBNAME)             \
     void CLASS::CBNAME(size_t a, size_t b) const {                              \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_VOID_SIZETSIZET_const(CLASS, PCLASS, CBNAME)             \
     void CLASS::CBNAME(size_t a, size_t b) const {                              \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));          \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b);                                                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));          \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b);                                                \
-    }                                                                           \
-    void CLASS::base_##CBNAME(size_t a, size_t b) const {                       \
-        PCLASS::CBNAME(a,b);                                                    \
-    }
-
+    }                            
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_COORD_const(CBNAME)                       \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_COORD_const(CBNAME)                       \
-    wxCoord CBNAME() const;                                      \
-    wxCoord base_##CBNAME() const
+    wxCoord CBNAME() const
 
 
 #define IMP_PYCALLBACK_COORD_const(CLASS, PCLASS, CBNAME)                       \
     wxCoord CLASS::CBNAME() const {                                             \
         wxCoord rval=0;                                                         \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_COORD_const(CLASS, PCLASS, CBNAME)                       \
     wxCoord CLASS::CBNAME() const {                                             \
         wxCoord rval=0;                                                         \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxCoord CLASS::base_##CBNAME() const {                                      \
-        return PCLASS::CBNAME();                                                \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------
@@ -2365,7 +2245,7 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK__DCRECTSIZET_constpure(CLASS, PCLASS, CBNAME)            \
     void CLASS::CBNAME(wxDC& a, const wxRect& b, size_t c) const {              \
         bool found;                                                             \
 #define IMP_PYCALLBACK__DCRECTSIZET_constpure(CLASS, PCLASS, CBNAME)            \
     void CLASS::CBNAME(wxDC& a, const wxRect& b, size_t c) const {              \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             PyObject* ro = wxPyConstructObject((void*)&b, wxT("wxRect"), 0);    \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             PyObject* ro = wxPyConstructObject((void*)&b, wxT("wxRect"), 0);    \
@@ -2378,14 +2258,13 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCRECTSIZET_const(CBNAME)                               \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DCRECTSIZET_const(CBNAME)                               \
-    void CBNAME(wxDC& a, const wxRect& b, size_t c) const;                      \
-    void base_##CBNAME(wxDC& a, const wxRect& b, size_t c) const
+    void CBNAME(wxDC& a, const wxRect& b, size_t c) const
 
 
 #define IMP_PYCALLBACK__DCRECTSIZET_const(CLASS, PCLASS, CBNAME)                \
     void CLASS::CBNAME(wxDC& a, const wxRect& b, size_t c) const {              \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK__DCRECTSIZET_const(CLASS, PCLASS, CBNAME)                \
     void CLASS::CBNAME(wxDC& a, const wxRect& b, size_t c) const {              \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             PyObject* ro = wxPyConstructObject((void*)&b, wxT("wxRect"), 0);    \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(&a,false);                        \
             PyObject* ro = wxPyConstructObject((void*)&b, wxT("wxRect"), 0);    \
@@ -2395,23 +2274,19 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b,c);                                              \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b,c);                                              \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxDC& a, const wxRect& b, size_t c) const {       \
-        PCLASS::CBNAME(a,b,c);                                                  \
-    }
+    }            
 
 //---------------------------------------------------------------------------
 
 
 #define DEC_PYCALLBACK_STRING_SIZET(CBNAME)                                     \
 
 //---------------------------------------------------------------------------
 
 
 #define DEC_PYCALLBACK_STRING_SIZET(CBNAME)                                     \
-    wxString CBNAME(size_t a) const;                                            \
-    wxString base_##CBNAME(size_t a) const
+    wxString CBNAME(size_t a) const
 
 #define IMP_PYCALLBACK_STRING_SIZET(CLASS, PCLASS, CBNAME)                      \
     wxString CLASS::CBNAME(size_t a) const {                                    \
         wxString rval;                                                          \
         bool found;                                                             \
 
 #define IMP_PYCALLBACK_STRING_SIZET(CLASS, PCLASS, CBNAME)                      \
     wxString CLASS::CBNAME(size_t a) const {                                    \
         wxString rval;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a));     \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a));     \
@@ -2424,10 +2299,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    wxString CLASS::base_##CBNAME(size_t a) const {                             \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }               
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -2438,7 +2310,7 @@ extern wxPyApp *wxPythonApp;
     wxString CLASS::CBNAME(size_t a) const {                                    \
         wxString rval;                                                          \
         bool found;                                                             \
     wxString CLASS::CBNAME(size_t a) const {                                    \
         wxString rval;                                                          \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a));     \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a));     \
@@ -2454,15 +2326,14 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VIZATTR_(CBNAME)                                         \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VIZATTR_(CBNAME)                                         \
-    wxVisualAttributes  CBNAME() const;                                         \
-    wxVisualAttributes  base_##CBNAME()
+    wxVisualAttributes  CBNAME() const
 
 
 #define IMP_PYCALLBACK_VIZATTR_(CLASS, PCLASS, CBNAME)                          \
     wxVisualAttributes CLASS::CBNAME() const {                                  \
         wxVisualAttributes rval;                                                \
         bool found;                                                             \
 
 
 #define IMP_PYCALLBACK_VIZATTR_(CLASS, PCLASS, CBNAME)                          \
     wxVisualAttributes CLASS::CBNAME() const {                                  \
         wxVisualAttributes rval;                                                \
         bool found;                                                             \
-        bool blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             wxVisualAttributes* ptr;                                            \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* ro;                                                       \
             wxVisualAttributes* ptr;                                            \
@@ -2477,9 +2348,6 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxVisualAttributes  CLASS::base_##CBNAME() {                                \
-        return PCLASS::CBNAME();                                                \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------