#define wxColour_typecheck(a) (wxPyGetCoreAPIPtr()->p_wxColour_typecheck(a))
#define wxPyCBH_setCallbackInfo(a, b, c, d) (wxPyGetCoreAPIPtr()->p_wxPyCBH_setCallbackInfo(a,b,c,d))
-#define wxPyCBH_findCallback(a, b) (wxPyGetCoreAPIPtr()->p_wxPyCBH_findCallback(a, b))
+#define wxPyCBH_findCallback(a, b) (wxPyGetCoreAPIPtr()->p_wxPyCBH_findCallback(a, b, true))
+#define wxPyCBH_findCallback2(a, b, c) (wxPyGetCoreAPIPtr()->p_wxPyCBH_findCallback(a, b, c))
#define wxPyCBH_callCallback(a, b) (wxPyGetCoreAPIPtr()->p_wxPyCBH_callCallback(a, b))
#define wxPyCBH_callCallbackObj(a, b) (wxPyGetCoreAPIPtr()->p_wxPyCBH_callCallbackObj(a, b))
#define wxPyCBH_delete(a) (wxPyGetCoreAPIPtr()->p_wxPyCBH_delete(a))
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);
}
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 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);
#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("()")); \
#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); \
#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 = wxPyMake_wxObject(cell, 0); \
wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Oii)",obj,x,y)); \
// }
-bool wxPyCallbackHelper::findCallback(const char* name) const {
+bool wxPyCallbackHelper::findCallback(const char* name, bool setGuard) const {
wxPyCallbackHelper* self = (wxPyCallbackHelper*)this; // cast away const
PyObject *method, *klass;
PyObject* nameo = PyString_FromString(name);
// ...then we'll save a pointer to the method so callCallback can
// call it. But first, set a recursion guard in case the
// overridden method wants to call the base class version.
- setRecursionGuard(method);
+ if (setGuard)
+ setRecursionGuard(method);
self->m_lastFound = method;
}
else {
cbh.setSelf(self, klass, incref);
}
-bool wxPyCBH_findCallback(const wxPyCallbackHelper& cbh, const char* name) {
- return cbh.findCallback(name);
+bool wxPyCBH_findCallback(const wxPyCallbackHelper& cbh, const char* name, bool setGuard) {
+ return cbh.findCallback(name, setGuard);
}
int wxPyCBH_callCallback(const wxPyCallbackHelper& cbh, PyObject* argTuple) {