]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/include/wx/wxPython/wxPython_int.h
docstring fix
[wxWidgets.git] / wxPython / include / wx / wxPython / wxPython_int.h
index 44886701d56344886c842aae45ad93f0993f1cf8..863f5c0f6819e867c8990445b21f6b5a12458e5e 100644 (file)
@@ -29,6 +29,7 @@
 #include <wx/dcps.h>
 #include <wx/dirctrl.h>
 #include <wx/dirdlg.h>
+#include <wx/numdlg.h>
 #include <wx/dnd.h>
 #include <wx/docview.h>
 #include <wx/encconv.h>
 #include <wx/taskbar.h>
 #include <wx/tglbtn.h>
 #include <wx/tipwin.h>
+#include <wx/toolbook.h>
 #include <wx/tooltip.h>
+#include <wx/treebook.h>
 #include <wx/vlbox.h>
 #include <wx/vscroll.h>
 #include <wx/dateevt.h>
 #include <wx/datectrl.h>
-
+#include <wx/power.h>
+#include <wx/hyperlink.h>
+#include <wx/pickerbase.h>
+#include <wx/clrpicker.h>
+#include <wx/filepicker.h>
+#include <wx/fontpicker.h>    
 
 
 #ifdef _MSC_VER
 
 //---------------------------------------------------------------------------
 
-typedef unsigned char byte;
+#ifndef wxHAS_POWER_EVENTS
+class wxPowerEvent : public wxEvent
+{
+public:
+    wxPowerEvent(wxEventType evtType) : wxEvent(wxID_NONE, evtType) {}
+    void Veto() {}
+    bool IsVetoed() const { return false; }
+    virtual wxEvent *Clone() const { return new wxPowerEvent(*this); }
+};
+#endif
+
+//---------------------------------------------------------------------------
+typedef unsigned char  byte;
+typedef unsigned char* buffer;
+
 typedef wxPoint2DDouble wxPoint2D;    
 
 #ifndef SWIG_TYPE_TABLE
@@ -102,7 +124,6 @@ typedef wxPoint2DDouble wxPoint2D;
 void      __wxPyPreStart(PyObject*);
 void      __wxPyCleanup();
 PyObject* __wxPySetDictionary(PyObject*, PyObject* args);
-PyObject* __wxPyFixStockObjects(PyObject*, PyObject* args);
 
 void        wxSetDefaultPyEncoding(const char* encoding);
 const char* wxGetDefaultPyEncoding();
@@ -168,6 +189,13 @@ typedef PyGILState_STATE wxPyBlock_t;
 #endif
 
 
+// Python 2.5 changes the type of some API parameter and return types.  Using
+// this typedef for versions < 2.5 will help with the transition...
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#endif
+
+
 #ifndef wxPyUSE_EXPORTED_API
 
 // For Python --> C++
@@ -207,6 +235,7 @@ int* int_LIST_helper(PyObject* source);
 long* long_LIST_helper(PyObject* source);
 char** string_LIST_helper(PyObject* source);
 wxPoint* wxPoint_LIST_helper(PyObject* source, int* npoints);
+wxPoint2D* wxPoint2D_LIST_helper(PyObject* source, size_t* npoints);
 wxBitmap** wxBitmap_LIST_helper(PyObject* source);
 wxString* wxString_LIST_helper(PyObject* source);
 wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source);
@@ -223,50 +252,17 @@ bool wxPoint2D_helper(PyObject* source, wxPoint2D** obj);
 bool wxPySimple_typecheck(PyObject* source, const wxChar* classname, int seqLen);
 bool wxColour_typecheck(PyObject* source);
 
-bool wxPyCheckForApp();
-
-    
-template<class T>
-bool wxPyTwoIntItem_helper(PyObject* source, T** obj, const wxChar* name)
-{
-    // If source is an object instance then it may already be the right type
-    if (wxPySwigInstance_Check(source)) {
-        T* ptr;
-        if (! wxPyConvertSwigPtr(source, (void **)&ptr, name))
-            goto error;
-        *obj = ptr;
-        return true;
-    }
-    // otherwise a 2-tuple of integers is expected
-    else if (PySequence_Check(source) && PyObject_Length(source) == 2) {
-        PyObject* o1 = PySequence_GetItem(source, 0);
-        PyObject* o2 = PySequence_GetItem(source, 1);
-        if (!PyNumber_Check(o1) || !PyNumber_Check(o2)) {
-            Py_DECREF(o1);
-            Py_DECREF(o2);
-            goto error;
-        }
-        **obj = T(PyInt_AsLong(o1), PyInt_AsLong(o2));
-        Py_DECREF(o1);
-        Py_DECREF(o2);
-        return true;
-    }
-
- error:
-    wxString msg;
-    msg.Printf(wxT("Expected a 2-tuple of integers or a %s object."), name);
-    PyErr_SetString(PyExc_TypeError, msg.mb_str());
-    return false;
-}
-
-
 
 // Other helpful stuff
+bool wxPyCheckForApp();
+bool wxPyTestDisplayAvailable();
+
 bool wxPy2int_seq_helper(PyObject* source, int* i1, int* i2);
 bool wxPy4int_seq_helper(PyObject* source, int* i1, int* i2, int* i3, int* i4);
 
 PyObject* wxArrayString2PyList_helper(const wxArrayString& arr);
 PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr);
+PyObject* wxArrayDouble2PyList_helper(const wxArrayDouble& arr);
 
 #endif // wxPyUSE_EXPORTED_API
 
@@ -286,7 +282,7 @@ PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr);
 #ifndef wxPyUSE_EXPORTED_API
 
 class wxPyCallback : public wxObject {
-    DECLARE_ABSTRACT_CLASS(wxPyCallback);
+    DECLARE_ABSTRACT_CLASS(wxPyCallback)
 public:
     wxPyCallback(PyObject* func);
     wxPyCallback(const wxPyCallback& other);
@@ -403,7 +399,7 @@ struct wxPyCoreAPI {
     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);
@@ -428,8 +424,12 @@ struct wxPyCoreAPI {
 
     bool                (*p_wxPyCheckForApp)();
 
+    // Add all new items at the end...
+    PyObject*           (*p_wxArrayDoublePyList_helper)(const wxArrayDouble& arr);
+    wxPoint2D*          (*p_wxPoint2D_LIST_helper)(PyObject* source, size_t* npoints);
 };
 
+
 #ifdef wxPyUSE_EXPORTED_API
 // Notice that this is static, not extern.  This is by design, each module
 // needs one, but doesn't have to use it.
@@ -497,6 +497,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
@@ -525,10 +558,13 @@ public:
     }
 
     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; }
+
+    void        setRecursionGuard(PyObject* method) const;
+    void        clearRecursionGuard(PyObject* method) const;
     
 private:
     PyObject*   m_self;
@@ -541,7 +577,7 @@ private:
 
 
 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);
@@ -573,7 +609,7 @@ enum {
 
 class wxPyApp: public wxApp
 {
-    DECLARE_ABSTRACT_CLASS(wxPyApp);
+    DECLARE_ABSTRACT_CLASS(wxPyApp)
 
 public:
     wxPyApp();
@@ -587,11 +623,13 @@ public:
     virtual bool OnInitGui();
     virtual int OnExit();
 #ifdef __WXDEBUG__
-    virtual void OnAssert(const wxChar *file,
-                          int line,
-                          const wxChar *cond,
-                          const wxChar *msg);
+    virtual void OnAssertFailure(const wxChar *file,
+                                 int line,
+                                 const wxChar *func,
+                                 const wxChar *cond,
+                                 const wxChar *msg);
 #endif
+    virtual void ExitMainLoop();
     // virtual int FilterEvent(wxEvent& event); // This one too????
 
     // For catching Apple Events
@@ -633,8 +671,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__(CBNAME)                        \
-    void CBNAME();                                      \
-    void base_##CBNAME()
+    void CBNAME()
 
 
 #define IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME)                         \
@@ -646,16 +683,18 @@ extern wxPyApp *wxPythonApp;
         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)                      \
-    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)               \
@@ -668,37 +707,12 @@ extern wxPyApp *wxPythonApp;
         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)                      \
-    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)               \
@@ -710,16 +724,12 @@ extern wxPyApp *wxPythonApp;
         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)                         \
-    void CBNAME(int a);                                         \
-    void base_##CBNAME(int a)
+    void CBNAME(int a)
 
 
 #define IMP_PYCALLBACK_VOID_INT(CLASS, PCLASS, CBNAME)                  \
@@ -731,16 +741,12 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a);                                          \
-    }                                                                   \
-    void CLASS::base_##CBNAME(int a) {                                  \
-        PCLASS::CBNAME(a);                                              \
-    }
+    }                 
 
 //---------------------------------------------------------------------------
 
 #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)                 \
@@ -752,15 +758,11 @@ extern wxPyApp *wxPythonApp;
         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)                                \
-    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)                 \
@@ -772,16 +774,12 @@ extern wxPyApp *wxPythonApp;
         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)                              \
-    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)               \
@@ -813,17 +811,12 @@ extern wxPyApp *wxPythonApp;
         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)                                       \
-    wxSize CBNAME() const;                                                      \
-    wxSize base_##CBNAME() const
+    wxSize CBNAME() const
 
 
 #define IMP_PYCALLBACK_SIZE_const(CLASS, PCLASS, CBNAME)                        \
@@ -857,17 +850,12 @@ extern wxPyApp *wxPythonApp;
             return PCLASS::CBNAME();                                            \
         else                                                                    \
             return rval;                                                        \
-    }                                                                           \
-    wxSize CLASS::base_##CBNAME() const {                                       \
-        return PCLASS::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)                 \
@@ -880,16 +868,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
-    }                                                                   \
-    bool CLASS::base_##CBNAME(bool a) {                                 \
-        return PCLASS::CBNAME(a);                                       \
     }
 
 //---------------------------------------------------------------------------
 
 #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)                  \
@@ -902,9 +886,6 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                    \
             rval = PCLASS::CBNAME(a);                                   \
         return rval;                                                    \
-    }                                                                   \
-    bool CLASS::base_##CBNAME(int a) {                                  \
-        return PCLASS::CBNAME(a);                                       \
     }
 
 //---------------------------------------------------------------------------
@@ -928,8 +909,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #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)                       \
@@ -944,18 +924,13 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                   \
         if (! found)                                                    \
             PCLASS::CBNAME(a);                                          \
-    }                                                                   \
-    void CLASS::base_##CBNAME(wxDC& a) {                                \
-        PCLASS::CBNAME(a);                                              \
-    }
-
+    }                   
 
 
 //---------------------------------------------------------------------------
 
 #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)                   \
@@ -970,16 +945,12 @@ extern wxPyApp *wxPythonApp;
         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)                          \
-    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)                   \
@@ -994,16 +965,12 @@ extern wxPyApp *wxPythonApp;
         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)                    \
-    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)                     \
@@ -1015,16 +982,12 @@ extern wxPyApp *wxPythonApp;
         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)                        \
-    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)                 \
@@ -1037,16 +1000,12 @@ extern wxPyApp *wxPythonApp;
         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)                                      \
-    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)                               \
@@ -1061,16 +1020,12 @@ extern wxPyApp *wxPythonApp;
         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)                                  \
-    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)                           \
@@ -1087,16 +1042,12 @@ extern wxPyApp *wxPythonApp;
         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)                            \
-    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)                     \
@@ -1109,16 +1060,12 @@ extern wxPyApp *wxPythonApp;
         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)                                          \
-    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)                           \
@@ -1133,16 +1080,12 @@ extern wxPyApp *wxPythonApp;
         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)                  \
-    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)                           \
@@ -1157,16 +1100,12 @@ extern wxPyApp *wxPythonApp;
         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)                                \
-    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)                 \
@@ -1182,17 +1121,12 @@ extern wxPyApp *wxPythonApp;
         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)                                    \
-    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)                     \
@@ -1207,17 +1141,12 @@ extern wxPyApp *wxPythonApp;
         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)                 \
-    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)                          \
@@ -1229,16 +1158,12 @@ extern wxPyApp *wxPythonApp;
         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)                     \
-    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)                      \
@@ -1250,17 +1175,13 @@ extern wxPyApp *wxPythonApp;
         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)                  \
-    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)  {                                    \
@@ -1274,16 +1195,12 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(const wxString& a) {                              \
-        PCLASS::CBNAME(a);                                                      \
     }
 
 //---------------------------------------------------------------------------
 
 #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)  {                                    \
@@ -1299,9 +1216,6 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(const wxString& a) {                              \
-        return PCLASS::CBNAME(a);                                               \
     }
 
 //---------------------------------------------------------------------------
@@ -1348,8 +1262,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #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)  {                                \
@@ -1366,9 +1279,9 @@ extern wxPyApp *wxPythonApp;
                 Py_DECREF(ro);                                                  \
             }                                                                   \
         }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
-        wxPyEndBlockThreads(blocked);                                           \
         return rval;                                                            \
     }                                                                           \
 
@@ -1398,8 +1311,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #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) {                  \
@@ -1417,16 +1329,12 @@ extern wxPyApp *wxPythonApp;
         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)                  \
-    wxString CBNAME();                                  \
-    wxString base_##CBNAME()
+    wxString CBNAME()
 
 #define IMP_PYCALLBACK_STRING_(CLASS, PCLASS, CBNAME)                           \
     wxString CLASS::CBNAME() {                                                  \
@@ -1445,16 +1353,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxString CLASS::base_##CBNAME() {                                           \
-        return PCLASS::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 {                                            \
@@ -1473,10 +1377,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxString CLASS::base_##CBNAME() const {                                     \
-        return PCLASS::CBNAME();                                                \
-    }
+    }                      
 
 //---------------------------------------------------------------------------
 
@@ -1507,7 +1408,7 @@ extern wxPyApp *wxPythonApp;
 #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("()"));        \
@@ -1529,8 +1430,8 @@ extern wxPyApp *wxPythonApp;
 #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);                                                     \
@@ -1542,36 +1443,31 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #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;                                                             \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
         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);                                         \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y) {         \
-        PCLASS::CBNAME(cell, x, y);                                             \
-    }
+    }                                                  
 
 //---------------------------------------------------------------------------
 
 #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;                                                             \
-        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));        \
@@ -1581,35 +1477,65 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             PCLASS::CBNAME(c);                                                  \
     }                                                                           \
-    void CLASS::base_##CBNAME(const wxColour& c) {                              \
-        PCLASS::CBNAME(c);                                                      \
-    }
 
 //---------------------------------------------------------------------------
+#define DEC_PYCALLBACK__INTCOLOUR(CBNAME)                                       \
+    void CBNAME(int a, const wxColour& 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 IMP_PYCALLBACK__INTCOLOUR(CLASS, PCLASS, CBNAME)                        \
+    void CLASS::CBNAME(int a, const wxColour& c) {                              \
+        bool found;                                                             \
+        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("(iO)",a, obj));    \
+            Py_DECREF(obj);                                                     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            PCLASS::CBNAME(a, c);                                               \
+    }                                                                           \
 
-#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 DEC_PYCALLBACK__INTFONT(CBNAME)       \
+    void CBNAME(int a, const wxFont& c);
+
+#define IMP_PYCALLBACK__INTFONT(CLASS, PCLASS, CBNAME)                          \
+    void CLASS::CBNAME(int a, const wxFont& c) {                                \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* obj = wxPyConstructObject((void*)&c, wxT("wxFont"), 0);   \
+            wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(iO)",a, obj));    \
+            Py_DECREF(obj);                                                     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            PCLASS::CBNAME(a, c);                                               \
+    }                                                                           \
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_BOOL_CELLINTINTME(CBNAME)                                    \
+    bool CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e)
+
+#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))) {                        \
-            PyObject* obj = wxPyConstructObject((void*)cell, wxT("wxHtmlCell"), 0);     \
+            PyObject* obj = wxPyMake_wxObject(cell, 0);                                 \
             PyObject* o2  = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0);     \
-            wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2));      \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2));  \
             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;                                                                    \
+    }  
 
 
 //---------------------------------------------------------------------------
@@ -1645,6 +1571,7 @@ extern wxPyApp *wxPythonApp;
                 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))               \
@@ -1667,8 +1594,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #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)                        \
@@ -1685,16 +1611,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxWindow* a) {                                    \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }                       
 
 //---------------------------------------------------------------------------
 
 #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)                      \
@@ -1713,16 +1635,12 @@ extern wxPyApp *wxPythonApp;
         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)                      \
-    void CBNAME(wxWindowBase* a);                                  \
-    void base_##CBNAME(wxWindowBase* a)
+    void CBNAME(wxWindowBase* a)
 
 
 #define IMP_PYCALLBACK_VOID_WXWINBASE(CLASS, PCLASS, CBNAME)                    \
@@ -1737,16 +1655,12 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxWindowBase* a) {                                \
-        PCLASS::CBNAME(a);                                                      \
-    }
+    }                 
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_(CBNAME)                      \
-    bool CBNAME();                                        \
-    bool base_##CBNAME()
+    bool CBNAME()
 
 
 #define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME)                             \
@@ -1760,56 +1674,45 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME() {                                               \
-        return PCLASS::CBNAME();                                                \
-    }
+    }       
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_const(CBNAME)                       \
-    bool CBNAME() const;                                        \
-    bool base_##CBNAME() const
+    bool CBNAME() const
 
 
 #define IMP_PYCALLBACK_BOOL_const(CLASS, PCLASS, CBNAME)                        \
     bool CLASS::CBNAME() const {                                                \
         bool rval=false;                                                        \
         bool found;                                                             \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));         \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME() const {                                         \
-        return PCLASS::CBNAME();                                                \
-    }
+    }      
 
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_DR_2WXCDR(CBNAME)                                \
-    wxDragResult CBNAME(wxCoord x, wxCoord y, wxDragResult def);        \
-    wxDragResult base_##CBNAME(wxCoord x, wxCoord y, wxDragResult def)
+    wxDragResult CBNAME(wxCoord x, wxCoord y, wxDragResult def)
 
 
 #define IMP_PYCALLBACK_DR_2WXCDR(CLASS, PCLASS, CBNAME)                         \
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {          \
         int rval=0;                                                             \
         bool found;                                                             \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b, c);                                     \
         return (wxDragResult)rval;                                              \
-    }                                                                           \
-    wxDragResult CLASS::base_##CBNAME(wxCoord a, wxCoord b, wxDragResult c) {   \
-        return PCLASS::CBNAME(a, b, c);                                         \
-    }
+    }        
 
 //---------------------------------------------------------------------------
 
@@ -1818,7 +1721,7 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_FSF_FSSTRING_pure(CLASS, PCLASS, CBNAME)                 \
     wxFSFile* CLASS::CBNAME(wxFileSystem& a,const wxString& b) {                \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
         wxFSFile* rval=0;                                                       \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
             PyObject* ro;                                                       \
@@ -1828,6 +1731,8 @@ extern wxPyApp *wxPythonApp;
                                          obj, s));                              \
             if (ro) {                                                           \
                 wxPyConvertSwigPtr(ro, (void **)&rval, wxT("wxFSFile"));        \
+                /* release ownership of the C++ wx.FSFile object. */            \
+                PyObject_SetAttrString(ro, "thisown", Py_False);                \
                 Py_DECREF(ro);                                                  \
             }                                                                   \
             Py_DECREF(obj);                                                     \
@@ -1840,25 +1745,21 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_DR(CBNAME)                  \
-    bool CBNAME(wxDragResult a);                        \
-    bool base_##CBNAME(wxDragResult a)
+    bool CBNAME(wxDragResult a)
 
 
 #define IMP_PYCALLBACK_BOOL_DR(CLASS, PCLASS, CBNAME)                           \
     bool CLASS::CBNAME(wxDragResult a) {                                        \
         bool rval=false;                                                        \
         bool found;                                                             \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME)))                  \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));     \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxDragResult a) {                                 \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }        
 
 //---------------------------------------------------------------------------
 
@@ -1868,7 +1769,7 @@ extern wxPyApp *wxPythonApp;
 
 #define IMP_PYCALLBACK_DR_2WXCDR_pure(CLASS, PCLASS, CBNAME)                    \
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {          \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
         int rval=0;                                                             \
         if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
@@ -1897,8 +1798,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_SIZET_(CBNAME)                  \
-    size_t CBNAME();                                   \
-    size_t base_##CBNAME()
+    size_t CBNAME()
 
 
 #define IMP_PYCALLBACK_SIZET_(CLASS, PCLASS, CBNAME)                            \
@@ -1912,16 +1812,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    size_t CLASS::base_##CBNAME() {                                             \
-        return PCLASS::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)                      \
@@ -1935,16 +1831,12 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    size_t CLASS::base_##CBNAME() const {                                       \
-        return PCLASS::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)                     \
@@ -1966,16 +1858,12 @@ extern wxPyApp *wxPythonApp;
         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)          \
-    void CBNAME(const Type& a);                         \
-    void base_##CBNAME(const Type& a)
+    void CBNAME(const Type& a)
 
 
 #define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type)                   \
@@ -1990,17 +1878,13 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(const Type& a) {                                  \
-        PCLASS::CBNAME(a);                                                      \
-    }
+    }           
 
 
 //---------------------------------------------------------------------------
 
 #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)                        \
@@ -2015,16 +1899,12 @@ extern wxPyApp *wxPythonApp;
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a);                                                  \
-    }                                                                           \
-    void CLASS::base_##CBNAME(Type& a) {                                        \
-        PCLASS::CBNAME(a);                                                      \
-    }
+    }              
 
 //---------------------------------------------------------------------------
 
 #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)                    \
@@ -2041,10 +1921,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rv = PCLASS::CBNAME(a);                                             \
         return rv;                                                              \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(Type& a) {                                        \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }          
 
 //---------------------------------------------------------------------------
 
@@ -2068,8 +1945,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #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 {                              \
@@ -2088,16 +1964,12 @@ extern wxPyApp *wxPythonApp;
         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)                                         \
-    int CBNAME(long a) const;                                                   \
-    int base_##CBNAME(long a) const
+    int CBNAME(long a) const
 
 
 #define IMP_PYCALLBACK_INT_LONG(CLASS, PCLASS, CBNAME)                          \
@@ -2117,12 +1989,7 @@ extern wxPyApp *wxPythonApp;
         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)                                 \
@@ -2147,11 +2014,83 @@ extern wxPyApp *wxPythonApp;
     }  
 
 
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_INT_INT(CBNAME)          \
+    int CBNAME(int a)
+
+
+#define IMP_PYCALLBACK_INT_INT(CLASS, PCLASS, CBNAME)                           \
+    int CLASS::CBNAME(int a) {                                                  \
+        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("(i)",a));     \
+            if (ro) {                                                           \
+                rval = PyInt_AsLong(ro);                                        \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rval = PCLASS::CBNAME(a);                                           \
+        return rval;                                                            \
+    }
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_INT_LONGLONG(CBNAME)                                     \
+    int CBNAME(long a, long b) const
+
+
+#define IMP_PYCALLBACK_INT_LONGLONG(CLASS, PCLASS, CBNAME)                      \
+    int CLASS::CBNAME(long a, long b) const {                                   \
+        int rval=-1;                                                            \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* ro;                                                       \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b));  \
+            if (ro) {                                                           \
+                rval = PyInt_AsLong(ro);                                        \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rval = PCLASS::CBNAME(a, b);                                        \
+        return rval;                                                            \
+    }          
+
+
+#define DEC_PYCALLBACK_INT_LONGLONG_virtual(CBNAME)                             \
+    int CBNAME(long a, long b) const;
+
+
+#define IMP_PYCALLBACK_INT_LONGLONG_virtual(CLASS, PCLASS, CBNAME)              \
+    int CLASS::CBNAME(long a, long b) const {                                   \
+        int rval=-1;    /* this rval is important for OnGetItemImage */         \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* ro;                                                       \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b));  \
+            if (ro) {                                                           \
+                rval = PyInt_AsLong(ro);                                        \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        return rval;                                                            \
+    }  
+
+
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_LISTATTR_LONG(CBNAME)                                    \
-    wxListItemAttr*  CBNAME(long a) const;                                      \
-    wxListItemAttr*  base_##CBNAME(long a) const
+    wxListItemAttr*  CBNAME(long a) const
 
 
 #define IMP_PYCALLBACK_LISTATTR_LONG(CLASS, PCLASS, CBNAME)                     \
@@ -2173,16 +2112,12 @@ extern wxPyApp *wxPythonApp;
         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)                                          \
-    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) {                                       \
@@ -2203,11 +2138,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             return PCLASS::CBNAME(e);                                           \
         return rval;                                                            \
-    }                                                                           \
-    bool CLASS::base_##CBNAME(wxMouseEvent& e) {                                \
-        return PCLASS::CBNAME(e);                                               \
-    }
-
+    }       
 
 //---------------------------------------------------------------------------
 
@@ -2337,8 +2268,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #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)             \
@@ -2350,16 +2280,11 @@ extern wxPyApp *wxPythonApp;
         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)                       \
-    wxCoord CBNAME() const;                                      \
-    wxCoord base_##CBNAME() const
+    wxCoord CBNAME() const
 
 
 #define IMP_PYCALLBACK_COORD_const(CLASS, PCLASS, CBNAME)                       \
@@ -2373,9 +2298,6 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxCoord CLASS::base_##CBNAME() const {                                      \
-        return PCLASS::CBNAME();                                                \
     }
 
 //---------------------------------------------------------------------------
@@ -2383,26 +2305,23 @@ extern wxPyApp *wxPythonApp;
 #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;                                                             \
-        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);    \
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOi)", obj, ro, (int)c)); \
-            Py_DECREF(obj);                                                     \
+            Py_DECREF(obj); Py_DECREF(ro);                                      \
         }                                                                       \
         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 {              \
@@ -2412,22 +2331,57 @@ extern wxPyApp *wxPythonApp;
             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);                                                     \
+            Py_DECREF(obj); Py_DECREF(ro);                                      \
         }                                                                       \
         wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             PCLASS::CBNAME(a,b,c);                                              \
-    }                                                                           \
-    void CLASS::base_##CBNAME(wxDC& a, const wxRect& b, size_t c) const {       \
-        PCLASS::CBNAME(a,b,c);                                                  \
-    }
+    }            
+
 
 //---------------------------------------------------------------------------
+// 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 DEC_PYCALLBACK_STRING_SIZET(CBNAME)                                     \
-    wxString CBNAME(size_t a) const;                                            \
-    wxString base_##CBNAME(size_t a) 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); Py_DECREF(ro);                                      \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+    }                                                                           \
+
+
+
+#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); Py_DECREF(ro);                                      \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            PCLASS::CBNAME(a,b,c);                                              \
+    }            
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_STRING_SIZET(CBNAME)     \
+    wxString CBNAME(size_t a) const
 
 #define IMP_PYCALLBACK_STRING_SIZET(CLASS, PCLASS, CBNAME)                      \
     wxString CLASS::CBNAME(size_t a) const {                                    \
@@ -2446,10 +2400,7 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
         return rval;                                                            \
-    }                                                                           \
-    wxString CLASS::base_##CBNAME(size_t a) const {                             \
-        return PCLASS::CBNAME(a);                                               \
-    }
+    }               
 
 //---------------------------------------------------------------------------
 
@@ -2476,8 +2427,7 @@ extern wxPyApp *wxPythonApp;
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_VIZATTR_(CBNAME)                                         \
-    wxVisualAttributes  CBNAME() const;                                         \
-    wxVisualAttributes  base_##CBNAME()
+    wxVisualAttributes  CBNAME() const
 
 
 #define IMP_PYCALLBACK_VIZATTR_(CLASS, PCLASS, CBNAME)                          \
@@ -2499,9 +2449,58 @@ extern wxPyApp *wxPythonApp;
         if (! found)                                                            \
             rval = PCLASS::CBNAME();                                            \
         return rval;                                                            \
-    }                                                                           \
-    wxVisualAttributes  CLASS::base_##CBNAME() {                                \
-        return PCLASS::CBNAME();                                                \
+    }
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_FONT_INT(CBNAME)                                         \
+    wxFont CBNAME(int a)
+
+#define IMP_PYCALLBACK_FONT_INT(CLASS, PCLASS, CBNAME)                          \
+    wxFont CLASS::CBNAME(int a) {                                               \
+        wxFont rv;                                                              \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
+            PyObject* ro;                                                       \
+            wxFont* ptr;                                                        \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a));    \
+            if (ro) {                                                           \
+                if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxFont")))       \
+                    rv = *ptr;                                                  \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rv = PCLASS::CBNAME(a);                                             \
+        return rv;                                                              \
+    }
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_COLOUR_INT(CBNAME)                                       \
+    wxColour CBNAME(int a)
+
+#define IMP_PYCALLBACK_COLOUR_INT(CLASS, PCLASS, CBNAME)                        \
+    wxColour CLASS::CBNAME(int a) {                                             \
+        wxColour rv;                                                            \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
+            PyObject* ro;                                                       \
+            wxColour* ptr;                                                      \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a));    \
+            if (ro) {                                                           \
+                if (wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxColour")))     \
+                    rv = *ptr;                                                  \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rv = PCLASS::CBNAME(a);                                             \
+        return rv;                                                              \
     }
 
 //---------------------------------------------------------------------------