X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/628c7f79d4f177b18349c9c10d49db6c9c4bc56c..62ae2780a8049aa777ccb75e14fa395024c9d80c:/wxPython/src/helpers.h diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index 9cf9014612..1ca7acd7da 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -1068,6 +1068,33 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh); //--------------------------------------------------------------------------- +#define DEC_PYCALLBACK_STRING_STRING(CBNAME) \ + wxString CBNAME(const wxString& a); \ + wxString base_##CBNAME(const wxString& a); + +#define IMP_PYCALLBACK_STRING_STRING(CLASS, PCLASS, CBNAME) \ + wxString CLASS::CBNAME(const wxString& a) { \ + wxString rval; \ + bool found; \ + wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + PyObject* ro; \ + PyObject* s = wx2PyString(a); \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)", s)); \ + Py_DECREF(s); \ + if (ro) { \ + rval = Py2wxString(ro); \ + Py_DECREF(ro); \ + } \ + } \ + if (! found) \ + rval = PCLASS::CBNAME(a); \ + wxPyEndBlockThreads(); \ + return rval; \ + } \ + +//--------------------------------------------------------------------------- + #define DEC_PYCALLBACK_STRING_STRINGINT_pure(CBNAME) \ wxString CBNAME(const wxString& a,int b); \