]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/include/wx/wxPython/wxPython_int.h
Include wx/intl.h according to precompiled headers of wx/wx.h (with other minor clean...
[wxWidgets.git] / wxPython / include / wx / wxPython / wxPython_int.h
index 105aa18ef5c9b23f3b070981dfb2d789067b69ee..c0754621fa9dfed05713e9ccb69a8573675563dc 100644 (file)
@@ -64,7 +64,9 @@
 #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/dateevt.h>
 #include <wx/vlbox.h>
 #include <wx/vscroll.h>
 #include <wx/dateevt.h>
@@ -90,12 +92,18 @@ typedef wxPoint2DDouble wxPoint2D;
 #define SWIG_TYPE_TABLE wxPython_type_table
 #endif
 
 #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
 
 void      __wxPyPreStart(PyObject*);
 void      __wxPyCleanup();
 PyObject* __wxPySetDictionary(PyObject*, PyObject* args);
 #ifndef wxPyUSE_EXPORTED_API
 
 void      __wxPyPreStart(PyObject*);
 void      __wxPyCleanup();
 PyObject* __wxPySetDictionary(PyObject*, PyObject* args);
-PyObject* __wxPyFixStockObjects(PyObject*, PyObject* args);
 
 void        wxSetDefaultPyEncoding(const char* encoding);
 const char* wxGetDefaultPyEncoding();
 
 void        wxSetDefaultPyEncoding(const char* encoding);
 const char* wxGetDefaultPyEncoding();
@@ -279,7 +287,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);
@@ -396,7 +404,7 @@ struct wxPyCoreAPI {
     bool                (*p_wxColour_typecheck)(PyObject* source);
 
     void                (*p_wxPyCBH_setCallbackInfo)(wxPyCallbackHelper& cbh, PyObject* self, PyObject* klass, int incref);
     bool                (*p_wxColour_typecheck)(PyObject* source);
 
     void                (*p_wxPyCBH_setCallbackInfo)(wxPyCallbackHelper& cbh, PyObject* self, PyObject* klass, int incref);
-    bool                (*p_wxPyCBH_findCallback)(const wxPyCallbackHelper& cbh, const char* name);
+    bool                (*p_wxPyCBH_findCallback)(const wxPyCallbackHelper& cbh, const char* name, bool setGuard);
     int                 (*p_wxPyCBH_callCallback)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
     PyObject*           (*p_wxPyCBH_callCallbackObj)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
     void                (*p_wxPyCBH_delete)(wxPyCallbackHelper* cbh);
     int                 (*p_wxPyCBH_callCallback)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
     PyObject*           (*p_wxPyCBH_callCallbackObj)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
     void                (*p_wxPyCBH_delete)(wxPyCallbackHelper* cbh);
@@ -490,6 +498,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
@@ -518,10 +559,13 @@ public:
     }
 
     void        setSelf(PyObject* self, PyObject* klass, int incref=true);
     }
 
     void        setSelf(PyObject* self, PyObject* klass, int incref=true);
-    bool        findCallback(const char* name) const;
+    bool        findCallback(const char* name, bool setGuard=true) const;
     int         callCallback(PyObject* argTuple) const;
     PyObject*   callCallbackObj(PyObject* argTuple) const;
     PyObject*   GetLastFound() const { return m_lastFound; }
     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;
@@ -534,7 +578,7 @@ private:
 
 
 void wxPyCBH_setCallbackInfo(wxPyCallbackHelper& cbh, PyObject* self, PyObject* klass, int incref);
 
 
 void wxPyCBH_setCallbackInfo(wxPyCallbackHelper& cbh, PyObject* self, PyObject* klass, int incref);
-bool wxPyCBH_findCallback(const wxPyCallbackHelper& cbh, const char* name);
+bool wxPyCBH_findCallback(const wxPyCallbackHelper& cbh, const char* name, bool setGuard=true);
 int  wxPyCBH_callCallback(const wxPyCallbackHelper& cbh, PyObject* argTuple);
 PyObject* wxPyCBH_callCallbackObj(const wxPyCallbackHelper& cbh, PyObject* argTuple);
 void wxPyCBH_delete(wxPyCallbackHelper* cbh);
 int  wxPyCBH_callCallback(const wxPyCallbackHelper& cbh, PyObject* argTuple);
 PyObject* wxPyCBH_callCallbackObj(const wxPyCallbackHelper& cbh, PyObject* argTuple);
 void wxPyCBH_delete(wxPyCallbackHelper* cbh);
@@ -566,7 +610,7 @@ enum {
 
 class wxPyApp: public wxApp
 {
 
 class wxPyApp: public wxApp
 {
-    DECLARE_ABSTRACT_CLASS(wxPyApp);
+    DECLARE_ABSTRACT_CLASS(wxPyApp)
 
 public:
     wxPyApp();
 
 public:
     wxPyApp();
@@ -585,6 +629,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
@@ -626,8 +671,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__(CBNAME)                        \
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__(CBNAME)                        \
-    void CBNAME();                                      \
-    void base_##CBNAME()
+    void CBNAME()
 
 
 #define IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME)                         \
 
 
 #define IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME)                         \
@@ -639,16 +683,18 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME();                                           \
         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)               \
 
 
 #define IMP_PYCALLBACK_BOOL_INTINT(CLASS, PCLASS, CBNAME)               \
@@ -661,37 +707,12 @@ 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(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;                                                     \
-        wxPyBlock_t 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)               \
 
 
 #define IMP_PYCALLBACK_VOID_INTINT(CLASS, PCLASS, CBNAME)               \
@@ -703,16 +724,12 @@ 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) {                           \
-        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)                  \
 
 
 #define IMP_PYCALLBACK_VOID_INT(CLASS, PCLASS, CBNAME)                  \
@@ -724,16 +741,12 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(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)                 \
 
 
 #define IMP_PYCALLBACK_VOID_INT4(CLASS, PCLASS, CBNAME)                 \
@@ -745,15 +758,11 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(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)                 \
 
 
 #define IMP_PYCALLBACK_VOID_INT5(CLASS, PCLASS, CBNAME)                 \
@@ -765,16 +774,12 @@ 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(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)               \
 
 
 #define IMP_PYCALLBACK_VOID_INTPINTP_const(CLASS, PCLASS, CBNAME)               \
@@ -806,17 +811,12 @@ 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)                        \
 
 
 #define IMP_PYCALLBACK_SIZE_const(CLASS, PCLASS, CBNAME)                        \
@@ -850,17 +850,12 @@ 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)                 \
 
 
 #define IMP_PYCALLBACK_BOOL_BOOL(CLASS, PCLASS, CBNAME)                 \
@@ -873,16 +868,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
         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)                  \
 
 
 #define IMP_PYCALLBACK_BOOL_INT(CLASS, PCLASS, CBNAME)                  \
@@ -895,9 +886,6 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
-    }                                                                   \
-    bool CLASS::base_##CBNAME(int a) {                                  \
-        return PCLASS::CBNAME(a);                                       \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------
@@ -921,8 +909,7 @@ 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)                       \
 
 
 #define IMP_PYCALLBACK__DC(CLASS, PCLASS, CBNAME)                       \
@@ -937,18 +924,13 @@ 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)                   \
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
@@ -963,16 +945,12 @@ 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)                   \
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
@@ -987,16 +965,12 @@ 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)                     \
 
 
 #define IMP_PYCALLBACK__2DBL(CLASS, PCLASS, CBNAME)                     \
@@ -1008,16 +982,12 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(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)                 \
 
 
 #define IMP_PYCALLBACK__2DBL2INT(CLASS, PCLASS, CBNAME)                 \
@@ -1030,16 +1000,12 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(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)                               \
 
 
 #define IMP_PYCALLBACK__DC4DBLBOOL(CLASS, PCLASS, CBNAME)                               \
@@ -1054,16 +1020,12 @@ 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)                           \
 
 
 #define IMP_PYCALLBACK_BOOL_DC4DBLBOOL(CLASS, PCLASS, CBNAME)                           \
@@ -1080,16 +1042,12 @@ 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)                     \
 
 
 #define IMP_PYCALLBACK__BOOL2DBL2INT(CLASS, PCLASS, CBNAME)                     \
@@ -1102,16 +1060,12 @@ 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(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)                           \
 
 
 #define IMP_PYCALLBACK__DC4DBL(CLASS, PCLASS, CBNAME)                           \
@@ -1126,16 +1080,12 @@ 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)                           \
 
 
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                           \
@@ -1150,16 +1100,12 @@ 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)                 \
 
 
 #define IMP_PYCALLBACK__WXCPBOOL2DBL2INT(CLASS, PCLASS, CBNAME)                 \
@@ -1175,17 +1121,12 @@ 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)                     \
 
 
 #define IMP_PYCALLBACK__WXCP2DBL2INT(CLASS, PCLASS, CBNAME)                     \
@@ -1200,17 +1141,12 @@ 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)                          \
 
 
 #define IMP_PYCALLBACK__2DBLINT(CLASS, PCLASS, CBNAME)                          \
@@ -1222,16 +1158,12 @@ 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(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)                      \
 
 
 #define IMP_PYCALLBACK__BOOL2DBLINT(CLASS, PCLASS, CBNAME)                      \
@@ -1243,17 +1175,13 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(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)  {                                    \
 
 #define IMP_PYCALLBACK__STRING(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(const wxString& a)  {                                    \
@@ -1267,16 +1195,12 @@ 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)  {                                    \
@@ -1292,9 +1216,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);                                               \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------
@@ -1341,8 +1262,7 @@ 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)  {                                \
 
 #define IMP_PYCALLBACK_STRING_STRING(CLASS, PCLASS, CBNAME)                     \
     wxString CLASS::CBNAME(const wxString& a)  {                                \
@@ -1391,8 +1311,7 @@ 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) {                  \
@@ -1410,16 +1329,12 @@ 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() {                                                  \
 
 #define IMP_PYCALLBACK_STRING_(CLASS, PCLASS, CBNAME)                           \
     wxString CLASS::CBNAME() {                                                  \
@@ -1438,16 +1353,12 @@ 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 {                                            \
 
 #define IMP_PYCALLBACK_STRING__const(CLASS, PCLASS, CBNAME)                     \
     wxString CLASS::CBNAME() const {                                            \
@@ -1466,10 +1377,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();                                                \
-    }
+    }                      
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -1500,7 +1408,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;                                                          \
-        wxPyBlock_t 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("()"));        \
@@ -1522,8 +1430,8 @@ extern wxPyApp *wxPythonApp;
 #define IMP_PYCALLBACK_BOOL_TAG_pure(CLASS, PCLASS, CBNAME)                     \
     bool CLASS::CBNAME(const wxHtmlTag& a)  {                                   \
         bool rval=false;                                                        \
 #define IMP_PYCALLBACK_BOOL_TAG_pure(CLASS, PCLASS, CBNAME)                     \
     bool CLASS::CBNAME(const wxHtmlTag& a)  {                                   \
         bool rval=false;                                                        \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
-        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if (wxPyCBH_findCallback2(m_myInst, #CBNAME, false)) {                  \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxHtmlTag"), 0);\
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
             Py_DECREF(obj);                                                     \
             PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxHtmlTag"), 0);\
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
             Py_DECREF(obj);                                                     \
@@ -1535,36 +1443,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;                                                             \
-        wxPyBlock_t 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;                                                             \
-        wxPyBlock_t 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));        \
@@ -1574,35 +1477,28 @@ 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)                                    \
-    void CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e); \
-    void base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e)
+#define DEC_PYCALLBACK_BOOL_CELLINTINTME(CBNAME)                                    \
+    bool 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;                                                                     \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                         \
+#define IMP_PYCALLBACK_BOOL_CELLINTINTME(CLASS, PCLASS, CBNAME)                         \
+    bool CLASS::CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e) { \
+        bool rval=false, found;                                                         \
+        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);     \
             PyObject* o2  = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0);     \
-            wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2));      \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2));  \
             Py_DECREF(obj);                                                             \
             Py_DECREF(o2);                                                              \
         }                                                                               \
         wxPyEndBlockThreads(blocked);                                                   \
         if (! found)                                                                    \
             Py_DECREF(obj);                                                             \
             Py_DECREF(o2);                                                              \
         }                                                                               \
         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);                                                  \
-    }
-
+            rval = PCLASS::CBNAME(cell, x, y, e);                                       \
+        return rval;                                                                    \
+    }  
 
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
@@ -1638,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))               \
@@ -1660,8 +1557,7 @@ 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)                        \
 
 
 #define IMP_PYCALLBACK_BOOL_WXWIN(CLASS, PCLASS, CBNAME)                        \
@@ -1678,16 +1574,12 @@ 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)                      \
 
 
 #define IMP_PYCALLBACK_BOOL_WXWINDC(CLASS, PCLASS, CBNAME)                      \
@@ -1706,16 +1598,12 @@ 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)                    \
 
 
 #define IMP_PYCALLBACK_VOID_WXWINBASE(CLASS, PCLASS, CBNAME)                    \
@@ -1730,16 +1618,12 @@ 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)                             \
 
 
 #define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME)                             \
@@ -1753,16 +1637,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         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)                        \
 
 
 #define IMP_PYCALLBACK_BOOL_const(CLASS, PCLASS, CBNAME)                        \
@@ -1776,16 +1656,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         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)                         \
 
 
 #define IMP_PYCALLBACK_DR_2WXCDR(CLASS, PCLASS, CBNAME)                         \
@@ -1799,10 +1675,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b, c);                                     \
         return (wxDragResult)rval;                                              \
         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);                                         \
-    }
+    }        
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -1833,8 +1706,7 @@ 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)                           \
 
 
 #define IMP_PYCALLBACK_BOOL_DR(CLASS, PCLASS, CBNAME)                           \
@@ -1848,10 +1720,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxDragResult a) {                                 \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }        
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -1890,8 +1759,7 @@ 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)                            \
 
 
 #define IMP_PYCALLBACK_SIZET_(CLASS, PCLASS, CBNAME)                            \
@@ -1905,16 +1773,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         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)                      \
 
 
 #define IMP_PYCALLBACK_SIZET__const(CLASS, PCLASS, CBNAME)                      \
@@ -1928,16 +1792,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         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)                     \
 
 
 #define IMP_PYCALLBACK_DATAFMT_SIZET(CLASS, PCLASS, CBNAME)                     \
@@ -1959,16 +1819,12 @@ 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)                   \
 
 
 #define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type)                   \
@@ -1983,17 +1839,13 @@ 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)                        \
 
 
 #define IMP_PYCALLBACK__any(CLASS, PCLASS, CBNAME, Type)                        \
@@ -2008,16 +1860,12 @@ 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)                    \
 
 
 #define IMP_PYCALLBACK_bool_any(CLASS, PCLASS, CBNAME, Type)                    \
@@ -2034,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);                                               \
-    }
+    }          
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -2061,8 +1906,7 @@ 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 {                              \
 
 #define IMP_PYCALLBACK_STRING_LONGLONG(CLASS, PCLASS, CBNAME)                   \
     wxString CLASS::CBNAME(long a, long b) const {                              \
@@ -2081,16 +1925,12 @@ 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)                          \
 
 
 #define IMP_PYCALLBACK_INT_LONG(CLASS, PCLASS, CBNAME)                          \
@@ -2110,12 +1950,7 @@ 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)                                 \
 
 
 #define DEC_PYCALLBACK_INT_LONG_virtual(CBNAME)                                 \
@@ -2140,11 +1975,58 @@ extern wxPyApp *wxPythonApp;
     }  
 
 
     }  
 
 
+//---------------------------------------------------------------------------
+
+#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)                     \
 
 
 #define IMP_PYCALLBACK_LISTATTR_LONG(CLASS, PCLASS, CBNAME)                     \
@@ -2166,16 +2048,12 @@ 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) {                                       \
@@ -2196,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);                                               \
-    }
-
+    }       
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -2330,8 +2204,7 @@ 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)             \
 
 
 #define IMP_PYCALLBACK_VOID_SIZETSIZET_const(CLASS, PCLASS, CBNAME)             \
@@ -2343,16 +2216,11 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(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)                       \
 
 
 #define IMP_PYCALLBACK_COORD_const(CLASS, PCLASS, CBNAME)                       \
@@ -2366,9 +2234,6 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxCoord CLASS::base_##CBNAME() const {                                      \
-        return PCLASS::CBNAME();                                                \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------
@@ -2376,11 +2241,10 @@ extern wxPyApp *wxPythonApp;
 #define DEC_PYCALLBACK__DCRECTSIZET_constpure(CBNAME)                           \
     void CBNAME(wxDC& a, const wxRect& b, size_t c) const;
 
 #define DEC_PYCALLBACK__DCRECTSIZET_constpure(CBNAME)                           \
     void CBNAME(wxDC& a, const wxRect& b, size_t c) const;
 
-
 #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;                                                             \
-        wxPyBlock_t 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);    \
@@ -2390,12 +2254,10 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
     }                                                                           \
 
         wxPyEndBlockThreads(blocked);                                           \
     }                                                                           \
 
-//---------------------------------------------------------------------------
 
 
-#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
 
 
+#define DEC_PYCALLBACK__DCRECTSIZET_const(CBNAME)                               \
+    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 {              \
 
 #define IMP_PYCALLBACK__DCRECTSIZET_const(CLASS, PCLASS, CBNAME)                \
     void CLASS::CBNAME(wxDC& a, const wxRect& b, size_t c) const {              \
@@ -2410,17 +2272,56 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b,c);                                              \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b,c);                                              \
+    }            
+
+
+//---------------------------------------------------------------------------
+// Same as the above set, but the wxRect is not const
+
+#define DEC_PYCALLBACK__DCRECTSIZET2_constpure(CBNAME)                          \
+    void CBNAME(wxDC& a, wxRect& b, size_t c) const;
+
+#define IMP_PYCALLBACK__DCRECTSIZET2_constpure(CLASS, PCLASS, CBNAME)           \
+    void CLASS::CBNAME(wxDC& a, wxRect& b, size_t c) const {                    \
+        bool found;                                                             \
+        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);    \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOi)", obj, ro, (int)c)); \
+            Py_DECREF(obj);                                                     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
     }                                                                           \
     }                                                                           \
-    void CLASS::base_##CBNAME(wxDC& a, const wxRect& b, size_t c) const {       \
-        PCLASS::CBNAME(a,b,c);                                                  \
-    }
+
+
+
+#define DEC_PYCALLBACK__DCRECTSIZET2_const(CBNAME)                              \
+    void CBNAME(wxDC& a, wxRect& b, size_t c) const
+
+#define IMP_PYCALLBACK__DCRECTSIZET2_const(CLASS, PCLASS, CBNAME)               \
+    void CLASS::CBNAME(wxDC& a, wxRect& b, size_t c) const {                    \
+        bool found;                                                             \
+        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);    \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOi)", obj, ro, (int)c)); \
+            Py_DECREF(obj);                                                     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            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 {                                    \
 
 #define IMP_PYCALLBACK_STRING_SIZET(CLASS, PCLASS, CBNAME)                      \
     wxString CLASS::CBNAME(size_t a) const {                                    \
@@ -2439,10 +2340,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);                                               \
-    }
+    }               
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
@@ -2469,8 +2367,7 @@ 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)                          \
 
 
 #define IMP_PYCALLBACK_VIZATTR_(CLASS, PCLASS, CBNAME)                          \
@@ -2492,9 +2389,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();                                                \
     }
 
 //---------------------------------------------------------------------------
     }
 
 //---------------------------------------------------------------------------