#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* buffer;
typedef wxPoint2DDouble wxPoint2D;
+typedef wxRect2DDouble wxRect2D;
#ifndef SWIG_TYPE_TABLE
#define SWIG_TYPE_TABLE wxPython_type_table
#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
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);
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 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
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);
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);
+
};
+
#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.
}
+//---------------------------------------------------------------------------
+
+#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) \
Py_DECREF(ro); \
} \
} \
+ wxPyEndBlockThreads(blocked); \
if (! found) \
rval = PCLASS::CBNAME(a); \
- wxPyEndBlockThreads(blocked); \
return rval; \
} \
//---------------------------------------------------------------------------
+#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) \
bool CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e)
//---------------------------------------------------------------------------
-#define DEC_PYCALLBACK_BOOL_WXWIN(CBNAME) \
+#define DEC_PYCALLBACK_BOOL_WXWIN(CBNAME) \
bool CBNAME(wxWindow* a)
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)); \
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) \
//---------------------------------------------------------------------------
-#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)); \
} \
//---------------------------------------------------------------------------
+#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) \
wxString CBNAME(size_t a) const