class wxPyClientData;
class wxPyUserData;
class wxPyOORClientData;
+class wxPyCBInputStream;
void wxPyClientData_dtor(wxPyClientData* self);
void wxPyUserData_dtor(wxPyUserData* self);
void wxPyOORClientData_dtor(wxPyOORClientData* self);
+wxPyCBInputStream* wxPyCBInputStream_create(PyObject *py, bool block);
//---------------------------------------------------------------------------
class wxPyCallbackHelper;
+
+// Make SunCC happy and make typedef's for these that are extern "C"
+typedef void (*p_SWIG_MakePtr_t)(char*, void*, char*);
+typedef char* (*p_SWIG_GetPtr_t)(char*, void**, char*);
+typedef char* (*p_SWIG_GetPtrObj_t)(PyObject*, void**, char*);
+typedef void (*p_SWIG_RegisterMapping_t)(char*, char*, void *(*cast)(void *));
+typedef void (*p_SWIG_addvarlink_t)(PyObject*, char*, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p));
+typedef PyObject* (*p_SWIG_newvarlink_t)(void);
+
+
struct wxPyCoreAPI {
- void (*p_SWIG_MakePtr)(char*, void*, char*);
- char* (*p_SWIG_GetPtr)(char*, void**, char*);
- char* (*p_SWIG_GetPtrObj)(PyObject*, void**, char*);
- void (*p_SWIG_RegisterMapping)(char*, char*, void *(*cast)(void *));
- void (*p_SWIG_addvarlink)(PyObject*, char*, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p));
- PyObject* (*p_SWIG_newvarlink)(void);
+ p_SWIG_MakePtr_t p_SWIG_MakePtr;
+ p_SWIG_GetPtr_t p_SWIG_GetPtr;
+ p_SWIG_GetPtrObj_t p_SWIG_GetPtrObj;
+ p_SWIG_RegisterMapping_t p_SWIG_RegisterMapping;
+ p_SWIG_addvarlink_t p_SWIG_addvarlink;
+ p_SWIG_newvarlink_t p_SWIG_newvarlink;
PyThreadState* (*p_wxPyBeginAllowThreads)();
void (*p_wxPyEndAllowThreads)(PyThreadState* state);
void (*p_wxPyClientData_dtor)(wxPyClientData*);
void (*p_wxPyUserData_dtor)(wxPyUserData*);
void (*p_wxPyOORClientData_dtor)(wxPyOORClientData*);
+
+ wxPyCBInputStream* (*p_wxPyCBInputStream_create)(PyObject *py, bool block);
+
};
#ifdef wxPyUSE_EXPORT
//---------------------------------------------------------------------------
+#define DEC_PYCALLBACK_VOID_WXWINBASE(CBNAME) \
+ void CBNAME(wxWindowBase* a); \
+ void base_##CBNAME(wxWindowBase* a);
+
+
+#define IMP_PYCALLBACK_VOID_WXWINBASE(CLASS, PCLASS, CBNAME) \
+ void CLASS::CBNAME(wxWindowBase* a) { \
+ bool found; \
+ wxPyBeginBlockThreads(); \
+ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
+ PyObject* obj = wxPyMake_wxObject(a); \
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
+ Py_DECREF(obj); \
+ } \
+ wxPyEndBlockThreads(); \
+ if (! found) \
+ PCLASS::CBNAME(a); \
+ } \
+ void CLASS::base_##CBNAME(wxWindowBase* a) { \
+ PCLASS::CBNAME(a); \
+ }
+
+//---------------------------------------------------------------------------
+
#define DEC_PYCALLBACK_BOOL_(CBNAME) \
bool CBNAME(); \
bool base_##CBNAME();
//---------------------------------------------------------------------------
+#define DEC_PYCALLBACK_bool_anypure(CBNAME, Type) \
+ bool CBNAME(Type& a);
+
+
+#define IMP_PYCALLBACK_bool_anypure(CLASS, PCLASS, CBNAME, Type) \
+ bool CLASS::CBNAME(Type& a) { \
+ bool rv=FALSE; \
+ wxPyBeginBlockThreads(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* obj = wxPyConstructObject((void*)&a, #Type, 0); \
+ rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
+ Py_DECREF(obj); \
+ } \
+ wxPyEndBlockThreads(); \
+ return rv; \
+ } \
+
+//---------------------------------------------------------------------------
+
#define DEC_PYCALLBACK_STRING_LONGLONG(CBNAME) \
wxString CBNAME(long a, long b) const; \
wxString base_##CBNAME(long a, long b)const ;
//---------------------------------------------------------------------------
+#define DEC_PYCALLBACK_WIZPG__pure(CBNAME) \
+ wxWizardPage* CBNAME() const;
+
+#define IMP_PYCALLBACK_WIZPG__pure(CLASS, PCLASS, CBNAME) \
+ wxWizardPage* CLASS::CBNAME() const { \
+ wxWizardPage* rv = NULL; \
+ wxPyBeginBlockThreads(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* ro; \
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
+ if (ro) { \
+ SWIG_GetPtrObj(ro, (void **)&rv, "_wxWizardPage_p"); \
+ Py_DECREF(ro); \
+ } \
+ } \
+ wxPyEndBlockThreads(); \
+ return rv; \
+ }
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_BITMAP__pure(CBNAME) \
+ wxBitmap CBNAME() const;
+
+#define IMP_PYCALLBACK_BITMAP__pure(CLASS, PCLASS, CBNAME) \
+ wxBitmap CLASS::CBNAME() const { \
+ wxBitmap rv; \
+ wxPyBeginBlockThreads(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* ro; \
+ wxBitmap* ptr; \
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
+ if (ro) { \
+ if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxBitmap_p")) \
+ rv = *ptr; \
+ Py_DECREF(ro); \
+ } \
+ } \
+ wxPyEndBlockThreads(); \
+ return rv; \
+ }
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_OBJECT__pure(CBNAME) \
+ wxObject* CBNAME();
+
+#define IMP_PYCALLBACK_OBJECT__pure(CLASS, PCLASS, CBNAME) \
+ wxObject* CLASS::CBNAME() { \
+ wxObject* rv = NULL; \
+ wxPyBeginBlockThreads(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* ro; \
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
+ if (ro) { \
+ SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p"); \
+ Py_DECREF(ro); \
+ } \
+ } \
+ wxPyEndBlockThreads(); \
+ return rv; \
+ }
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_BOOL_NODE_pure(CBNAME) \
+ bool CBNAME(wxXmlNode* a);
+
+
+#define IMP_PYCALLBACK_BOOL_NODE_pure(CLASS, PCLASS, CBNAME) \
+ bool CLASS::CBNAME(wxXmlNode* a) { \
+ bool rv=FALSE; \
+ wxPyBeginBlockThreads(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* obj = wxPyConstructObject((void*)a, "wxXmlNode", 0); \
+ rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
+ Py_DECREF(obj); \
+ } \
+ wxPyEndBlockThreads(); \
+ return rv; \
+ } \
+
+//---------------------------------------------------------------------------
#endif