]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/include/wx/wxPython/wxPython_int.h
Remove const bool
[wxWidgets.git] / wxPython / include / wx / wxPython / wxPython_int.h
index 1388d0e2d7dc7b2d6825b38ae175879e97b25146..6cc85dd8cef2467da6848ca8dd743f7ac9a71678 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/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>    
+#include <wx/collpane.h>
+#include <wx/srchctrl.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;    
+typedef wxRect2DDouble  wxRect2D;
 
 #ifndef SWIG_TYPE_TABLE
 #define SWIG_TYPE_TABLE wxPython_type_table
@@ -164,9 +186,18 @@ bool wxPySwigInstance_Check(PyObject* obj);
 #if PY_VERSION_HEX < 0x02040000
 #define wxPyUSE_GIL_STATE 0
 typedef bool wxPyBlock_t;
+#define wxPyBlock_t_default false
 #else
 #define wxPyUSE_GIL_STATE 1
 typedef PyGILState_STATE wxPyBlock_t;
+#define wxPyBlock_t_default PyGILState_UNLOCKED
+#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
 
 
@@ -209,6 +240,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);
@@ -220,20 +252,24 @@ bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj);
 bool wxRect_helper(PyObject* source, wxRect** obj);
 bool wxColour_helper(PyObject* source, wxColour** obj);
 bool wxPoint2D_helper(PyObject* source, wxPoint2D** obj);
+bool wxRect2D_helper(PyObject* source, wxRect2D** obj);
+bool wxPosition_helper(PyObject* source, wxPosition** obj);
 
 
 bool wxPySimple_typecheck(PyObject* source, const wxChar* classname, int seqLen);
 bool wxColour_typecheck(PyObject* source);
 
-bool wxPyCheckForApp();
-
 
 // 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
 
@@ -363,7 +399,7 @@ struct wxPyCoreAPI {
     bool                (*p_wxRealPoint_helper)(PyObject* source, wxRealPoint** obj);
     bool                (*p_wxRect_helper)(PyObject* source, wxRect** obj);
     bool                (*p_wxColour_helper)(PyObject* source, wxColour** obj);
-    bool                (*p_wxPoint2D_helper)(PyObject* source, wxPoint2DDouble** obj);
+    bool                (*p_wxPoint2D_helper)(PyObject* source, wxPoint2D** obj);
 
     
     bool                (*p_wxPySimple_typecheck)(PyObject* source, const wxChar* classname, int seqLen);
@@ -395,8 +431,15 @@ 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);
+    bool                (*p_wxRect2D_helper)(PyObject* source, wxRect2D** obj);
+    bool                (*p_wxPosition_helper)(PyObject* source, wxPosition** obj);
+
 };
 
+
 #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.
@@ -590,17 +633,19 @@ 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
-    virtual void MacOpenFile(const wxString &fileName);
-    virtual void MacPrintFile(const wxString &fileName);
+    virtual void MacOpenFile(const wxString& fileName);
+    virtual void MacOpenURL(const wxString& url);
+    virtual void MacPrintFile(const wxString& fileName);
     virtual void MacNewFile();
     virtual void MacReopenApp();
 
@@ -872,6 +917,29 @@ extern wxPyApp *wxPythonApp;
     }
 
 
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_INT_WIN(CBNAME)    \
+    int CBNAME(wxWindow* a)
+
+
+#define IMP_PYCALLBACK_INT_WIN(CLASS, PCLASS, CBNAME)                           \
+    int CLASS::CBNAME(wxWindow* a) {                                            \
+        int rval=0;                                                             \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* obj = wxPyMake_wxObject(a, false);                        \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)",obj));    \
+            Py_DECREF(obj);                                                     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rval = PCLASS::CBNAME(a);                                           \
+        return rval;                                                            \
+    }
+
+
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK__DC(CBNAME)                      \
@@ -1245,9 +1313,9 @@ extern wxPyApp *wxPythonApp;
                 Py_DECREF(ro);                                                  \
             }                                                                   \
         }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a);                                           \
-        wxPyEndBlockThreads(blocked);                                           \
         return rval;                                                            \
     }                                                                           \
 
@@ -1444,6 +1512,62 @@ extern wxPyApp *wxPythonApp;
             PCLASS::CBNAME(c);                                                  \
     }                                                                           \
 
+//---------------------------------------------------------------------------
+#define DEC_PYCALLBACK__INTCOLOUR(CBNAME)                                       \
+    void CBNAME(int a, const wxColour& c);
+
+#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 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__FONT(CBNAME)                                            \
+    void CBNAME(const wxFont& a);
+
+#define IMP_PYCALLBACK__FONT(CLASS, PCLASS, CBNAME)                             \
+    void CLASS::CBNAME(const wxFont& a) {                                       \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxFont"), 0);   \
+            wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)", obj));       \
+            Py_DECREF(obj);                                                     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            PCLASS::CBNAME(a);                                                  \
+    }                                                                           \
+
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_CELLINTINTME(CBNAME)                                    \
@@ -1522,7 +1646,7 @@ extern wxPyApp *wxPythonApp;
 
 //---------------------------------------------------------------------------
 
-#define DEC_PYCALLBACK_BOOL_WXWIN(CBNAME)                      \
+#define DEC_PYCALLBACK_BOOL_WXWIN(CBNAME)                                       \
     bool CBNAME(wxWindow* a)
 
 
@@ -1530,7 +1654,7 @@ extern wxPyApp *wxPythonApp;
     bool CLASS::CBNAME(wxWindow* a) {                                           \
         bool rval=false;                                                        \
         bool found;                                                             \
-        wxPyBlock_t blocked = wxPyBeginBlockThreads();                                 \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
             PyObject* obj = wxPyMake_wxObject(a,false);                         \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
@@ -1542,6 +1666,25 @@ extern wxPyApp *wxPythonApp;
         return rval;                                                            \
     }                       
 
+
+
+#define DEC_PYCALLBACK_BOOL_WXWIN_pure(CBNAME)                                  \
+    bool CBNAME(wxWindow* a)
+
+#define IMP_PYCALLBACK_BOOL_WXWIN_pure(CLASS, PCLASS, CBNAME)                   \
+    bool CLASS::CBNAME(wxWindow* a) {                                           \
+        bool rval=false;                                                        \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* obj = wxPyMake_wxObject(a,false);                         \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
+            Py_DECREF(obj);                                                     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        return rval;                                                            \
+    }                       
+
 //---------------------------------------------------------------------------
 
 #define DEC_PYCALLBACK_BOOL_WXWINDC(CBNAME)                             \
@@ -1615,7 +1758,7 @@ extern wxPyApp *wxPythonApp;
     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);                                           \
@@ -1634,7 +1777,7 @@ extern wxPyApp *wxPythonApp;
     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);                                           \
@@ -1650,7 +1793,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;                                                       \
@@ -1660,6 +1803,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);                                                     \
@@ -1679,7 +1824,7 @@ extern wxPyApp *wxPythonApp;
     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);                                           \
@@ -1696,7 +1841,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));\
@@ -1943,6 +2088,31 @@ 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
 
@@ -2151,15 +2321,32 @@ extern wxPyApp *wxPythonApp;
 
 //---------------------------------------------------------------------------
 
-#define DEC_PYCALLBACK_COORD_SIZET_constpure(CBNAME)                            \
+#define DEC_PYCALLBACK_COORD_SIZET_const(CBNAME)                                \
     wxCoord CBNAME(size_t a) const
 
+#define IMP_PYCALLBACK_COORD_SIZET_const(CLASS, PCLASS, CBNAME)                 \
+    wxCoord CLASS::CBNAME(size_t a) const {                                     \
+        wxCoord rval=0;                                                         \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));     \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rval = PCLASS::CBNAME(a);                                           \
+        return rval;                                                            \
+    }                                                                           \
+
+
+#define DEC_PYCALLBACK_COORD_SIZET_constpure(CBNAME)                            \
+    wxCoord CBNAME(size_t a) const
 
 #define IMP_PYCALLBACK_COORD_SIZET_constpure(CLASS, PCLASS, CBNAME)             \
     wxCoord CLASS::CBNAME(size_t a) const {                                     \
         wxCoord 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("(i)", a));     \
         }                                                                       \
@@ -2215,7 +2402,7 @@ 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);                                           \
     }                                                                           \
@@ -2233,7 +2420,7 @@ 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)                                                            \
@@ -2255,7 +2442,7 @@ 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);                                           \
     }                                                                           \
@@ -2273,20 +2460,77 @@ 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);                                              \
     }            
 
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK__DCRECTINTINT_const(CBNAME)                              \
+    void CBNAME(wxDC& a, const wxRect& b, int c, int d) const
+
+#define IMP_PYCALLBACK__DCRECTINTINT_const(CLASS, PCLASS, CBNAME)               \
+    void CLASS::CBNAME(wxDC& a, const wxRect& b, int c, int d) 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("(OOii)", obj, ro, c, d)); \
+            Py_DECREF(obj); Py_DECREF(ro);                                      \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            PCLASS::CBNAME(a,b,c,d);                                            \
+    }            
 
 
 //---------------------------------------------------------------------------
 
+#define DEC_PYCALLBACK__RECTINT(CBNAME)                                         \
+    void CBNAME(const wxRect& a, int b)
+
+#define IMP_PYCALLBACK__RECTINT(CLASS, PCLASS, CBNAME)                          \
+    void CLASS::CBNAME(const wxRect& a, int b) {                                \
+        bool found;                                                             \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* ro = wxPyConstructObject((void*)&a, wxT("wxRect"), 0);    \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", ro, b));       \
+            Py_DECREF(ro);                                                      \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            PCLASS::CBNAME(a,b);                                                \
+    }            
+
+
+#define DEC_PYCALLBACK_BOOL_RECTINT(CBNAME)                                     \
+    bool CBNAME(const wxRect& a, int b)
+
+#define IMP_PYCALLBACK_BOOL_RECTINT(CLASS, PCLASS, CBNAME)                      \
+    bool CLASS::CBNAME(const wxRect& a, int b) {                                \
+        bool found;                                                             \
+        bool rval = false;                                                      \
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();                          \
+        if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
+            PyObject* ro = wxPyConstructObject((void*)&a, wxT("wxRect"), 0);    \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", ro, b));\
+            Py_DECREF(ro);                                                      \
+        }                                                                       \
+        wxPyEndBlockThreads(blocked);                                           \
+        if (! found)                                                            \
+            rval = PCLASS::CBNAME(a,b);                                         \
+        return rval;                                                            \
+    }            
 
 
-#define DEC_PYCALLBACK_STRING_SIZET(CBNAME)                                     \
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_STRING_SIZET(CBNAME)     \
     wxString CBNAME(size_t a) const
 
 #define IMP_PYCALLBACK_STRING_SIZET(CLASS, PCLASS, CBNAME)                      \
@@ -2359,4 +2603,56 @@ extern wxPyApp *wxPythonApp;
 
 //---------------------------------------------------------------------------
 
+#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;                                                              \
+    }
+
+//---------------------------------------------------------------------------
+
 #endif