1 ////////////////////////////////////////////////////////////////////////////
3 // Purpose: Helper functions/classes for the wxPython extension module
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef __wxp_helpers__
14 #define __wxp_helpers__
17 #include <wx/geometry.h>
19 //---------------------------------------------------------------------------
21 typedef unsigned char byte
;
23 void __wxPreStart(PyObject
*);
24 PyObject
* __wxStart(PyObject
*, PyObject
* args
);
27 //extern PyObject* wxPython_dict;
28 PyObject
* __wxSetDictionary(PyObject
*, PyObject
* args
);
30 void wxPyEventThunker(wxObject
*, wxEvent
& event
);
32 PyObject
* wxPyConstructObject(void* ptr
,
33 const wxString
& className
,
35 PyObject
* wxPyConstructObject(void* ptr
,
36 const wxString
& className
,
40 PyObject
* wx2PyString(const wxString
& src
);
41 wxString
Py2wxString(PyObject
* source
);
43 PyObject
* wxPyClassExists(const wxString
& className
);
44 PyObject
* wxPyMake_wxObject(wxObject
* source
, bool checkEvtHandler
=TRUE
);
45 PyObject
* wxPyMake_wxSizer(wxSizer
* source
);
46 void wxPyPtrTypeMap_Add(const char* commonName
, const char* ptrName
);
48 PyObject
* wxPy_ConvertList(wxListBase
* list
, const char* className
);
49 long wxPyGetWinHandle(wxWindow
* win
);
51 //----------------------------------------------------------------------
53 // if we want to handle threads and Python threads are available...
54 #if defined(WXP_USE_THREAD) && defined(WITH_THREAD)
55 #define WXP_WITH_THREAD
56 #else // no Python threads...
57 #undef WXP_WITH_THREAD
62 PyThreadState
* wxPyBeginAllowThreads();
63 void wxPyEndAllowThreads(PyThreadState
* state
);
66 void wxPyBeginBlockThreads();
67 void wxPyEndBlockThreads();
69 #define wxPyBLOCK_THREADS(stmt) wxPyBeginBlockThreads(); stmt; wxPyEndBlockThreads()
71 //----------------------------------------------------------------------
72 // These are helpers used by the typemaps
74 wxString
* wxString_in_helper(PyObject
* source
);
76 byte
* byte_LIST_helper(PyObject
* source
);
77 int* int_LIST_helper(PyObject
* source
);
78 long* long_LIST_helper(PyObject
* source
);
79 char** string_LIST_helper(PyObject
* source
);
80 wxPoint
* wxPoint_LIST_helper(PyObject
* source
, int* npoints
);
81 wxBitmap
** wxBitmap_LIST_helper(PyObject
* source
);
82 wxString
* wxString_LIST_helper(PyObject
* source
);
83 wxAcceleratorEntry
* wxAcceleratorEntry_LIST_helper(PyObject
* source
);
84 wxPen
** wxPen_LIST_helper(PyObject
* source
);
86 bool wxSize_helper(PyObject
* source
, wxSize
** obj
);
87 bool wxPoint_helper(PyObject
* source
, wxPoint
** obj
);
88 bool wxRealPoint_helper(PyObject
* source
, wxRealPoint
** obj
);
89 bool wxRect_helper(PyObject
* source
, wxRect
** obj
);
90 bool wxColour_helper(PyObject
* source
, wxColour
** obj
);
92 bool wxPoint2DDouble_helper(PyObject
* source
, wxPoint2DDouble
** obj
);
95 //----------------------------------------------------------------------
96 // Other helpful stuff
98 #if PYTHON_API_VERSION < 1009
99 #define PySequence_Fast_GET_ITEM(o, i) \
100 (PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))
103 bool wxPy2int_seq_helper(PyObject
* source
, int* i1
, int* i2
);
104 bool wxPy4int_seq_helper(PyObject
* source
, int* i1
, int* i2
, int* i3
, int* i4
);
107 PyObject
* wxArrayString2PyList_helper(const wxArrayString
& arr
);
108 PyObject
* wxArrayInt2PyList_helper(const wxArrayInt
& arr
);
110 #define RETURN_NONE() { Py_INCREF(Py_None); return Py_None; }
111 #define DECLARE_DEF_STRING(name) static const wxString wxPy##name(wx##name)
112 #define DECLARE_DEF_STRING2(name,val) static const wxString wxPy##name(val)
114 //----------------------------------------------------------------------
115 // functions used by the DrawXXXList enhancements added to wxDC
117 typedef bool (*wxPyDrawListOp_t
)(wxDC
& dc
, PyObject
* coords
);
118 PyObject
* wxPyDrawXXXList(wxDC
& dc
, wxPyDrawListOp_t doDraw
,
119 PyObject
* pyCoords
, PyObject
* pyPens
, PyObject
* pyBrushes
);
120 bool wxPyDrawXXXPoint(wxDC
& dc
, PyObject
* coords
);
121 bool wxPyDrawXXXLine(wxDC
& dc
, PyObject
* coords
);
122 bool wxPyDrawXXXRectangle(wxDC
& dc
, PyObject
* coords
);
123 bool wxPyDrawXXXEllipse(wxDC
& dc
, PyObject
* coords
);
124 bool wxPyDrawXXXPolygon(wxDC
& dc
, PyObject
* coords
);
126 PyObject
* wxPyDrawTextList(wxDC
& dc
, PyObject
* textList
, PyObject
* pyPoints
,
127 PyObject
* foregroundList
, PyObject
* backgroundList
);
129 //----------------------------------------------------------------------
132 extern "C" void SWIG_MakePtr(char *, void *, char *);
133 extern "C" char *SWIG_GetPtr(char *, void **, char *);
134 extern "C" char *SWIG_GetPtrObj(PyObject
*obj
, void **ptr
, char *type
);
139 # pragma warning(disable:4800)
140 # pragma warning(disable:4190)
143 //----------------------------------------------------------------------
145 class wxPyCallback
: public wxObject
{
146 DECLARE_ABSTRACT_CLASS(wxPyCallback
);
148 wxPyCallback(PyObject
* func
);
149 wxPyCallback(const wxPyCallback
& other
);
152 void EventThunker(wxEvent
& event
);
157 //---------------------------------------------------------------------------
159 class wxPyTimer
: public wxTimer
{
161 wxPyTimer(PyObject
* callback
);
170 //---------------------------------------------------------------------------
171 //---------------------------------------------------------------------------
172 // These Event classes can be derived from in Python and passed through the
173 // event system without loosing anything. They do this by keeping a reference
174 // to themselves and some special case handling in wxPyCallback::EventThunker.
177 class wxPyEvtSelfRef
{
182 void SetSelf(PyObject
* self
, bool clone
=FALSE
);
183 PyObject
* GetSelf() const;
191 class wxPyEvent
: public wxEvent
, public wxPyEvtSelfRef
{
192 DECLARE_ABSTRACT_CLASS(wxPyEvent
)
195 wxPyEvent(const wxPyEvent
& evt
);
198 virtual wxEvent
* Clone() const { return new wxPyEvent(*this); }
202 class wxPyCommandEvent
: public wxCommandEvent
, public wxPyEvtSelfRef
{
203 DECLARE_ABSTRACT_CLASS(wxPyCommandEvent
)
205 wxPyCommandEvent(wxEventType commandType
= wxEVT_NULL
, int id
=0);
206 wxPyCommandEvent(const wxPyCommandEvent
& evt
);
209 virtual wxEvent
* Clone() const { return new wxPyCommandEvent(*this); }
214 //----------------------------------------------------------------------
215 // Forward decalre a few things used in the exported API
216 class wxPyClientData
;
218 class wxPyOORClientData
;
219 class wxPyCBInputStream
;
221 void wxPyClientData_dtor(wxPyClientData
* self
);
222 void wxPyUserData_dtor(wxPyUserData
* self
);
223 void wxPyOORClientData_dtor(wxPyOORClientData
* self
);
224 wxPyCBInputStream
* wxPyCBInputStream_create(PyObject
*py
, bool block
);
227 //---------------------------------------------------------------------------
228 // Export a C API in a struct. Other modules will be able to load this from
229 // the wxc module and will then have safe access to these functions, even if
230 // in another shared library.
232 class wxPyCallbackHelper
;
235 // Make SunCC happy and make typedef's for these that are extern "C"
236 typedef void (*p_SWIG_MakePtr_t
)(char*, void*, char*);
237 typedef char* (*p_SWIG_GetPtr_t
)(char*, void**, char*);
238 typedef char* (*p_SWIG_GetPtrObj_t
)(PyObject
*, void**, char*);
239 typedef void (*p_SWIG_RegisterMapping_t
)(char*, char*, void *(*cast
)(void *));
240 typedef void (*p_SWIG_addvarlink_t
)(PyObject
*, char*, PyObject
*(*get_attr
)(void), int (*set_attr
)(PyObject
*p
));
241 typedef PyObject
* (*p_SWIG_newvarlink_t
)(void);
246 p_SWIG_MakePtr_t p_SWIG_MakePtr
;
247 p_SWIG_GetPtr_t p_SWIG_GetPtr
;
248 p_SWIG_GetPtrObj_t p_SWIG_GetPtrObj
;
249 p_SWIG_RegisterMapping_t p_SWIG_RegisterMapping
;
250 p_SWIG_addvarlink_t p_SWIG_addvarlink
;
251 p_SWIG_newvarlink_t p_SWIG_newvarlink
;
253 PyThreadState
* (*p_wxPyBeginAllowThreads
)();
254 void (*p_wxPyEndAllowThreads
)(PyThreadState
* state
);
255 void (*p_wxPyBeginBlockThreads
)();
256 void (*p_wxPyEndBlockThreads
)();
258 PyObject
* (*p_wxPyConstructObject
)(void *, const wxString
&, int);
259 PyObject
* (*p_wxPy_ConvertList
)(wxListBase
* list
, const char* className
);
261 wxString
* (*p_wxString_in_helper
)(PyObject
* source
);
262 wxString (*p_Py2wxString
)(PyObject
* source
);
263 PyObject
* (*p_wx2PyString
)(const wxString
& src
);
265 byte
* (*p_byte_LIST_helper
)(PyObject
* source
);
266 int* (*p_int_LIST_helper
)(PyObject
* source
);
267 long* (*p_long_LIST_helper
)(PyObject
* source
);
268 char** (*p_string_LIST_helper
)(PyObject
* source
);
269 wxPoint
* (*p_wxPoint_LIST_helper
)(PyObject
* source
, int* npoints
);
270 wxBitmap
** (*p_wxBitmap_LIST_helper
)(PyObject
* source
);
271 wxString
* (*p_wxString_LIST_helper
)(PyObject
* source
);
272 wxAcceleratorEntry
* (*p_wxAcceleratorEntry_LIST_helper
)(PyObject
* source
);
274 bool (*p_wxSize_helper
)(PyObject
* source
, wxSize
** obj
);
275 bool (*p_wxPoint_helper
)(PyObject
* source
, wxPoint
** obj
);
276 bool (*p_wxRealPoint_helper
)(PyObject
* source
, wxRealPoint
** obj
);
277 bool (*p_wxRect_helper
)(PyObject
* source
, wxRect
** obj
);
278 bool (*p_wxColour_helper
)(PyObject
* source
, wxColour
** obj
);
279 bool (*p_wxPoint2DDouble_helper
)(PyObject
* source
, wxPoint2DDouble
** obj
);
281 void (*p_wxPyCBH_setCallbackInfo
)(wxPyCallbackHelper
& cbh
, PyObject
* self
, PyObject
* klass
, int incref
);
282 bool (*p_wxPyCBH_findCallback
)(const wxPyCallbackHelper
& cbh
, const char* name
);
283 int (*p_wxPyCBH_callCallback
)(const wxPyCallbackHelper
& cbh
, PyObject
* argTuple
);
284 PyObject
* (*p_wxPyCBH_callCallbackObj
)(const wxPyCallbackHelper
& cbh
, PyObject
* argTuple
);
285 void (*p_wxPyCBH_delete
)(wxPyCallbackHelper
* cbh
);
287 PyObject
* (*p_wxPyClassExists
)(const wxString
& className
);
288 PyObject
* (*p_wxPyMake_wxObject
)(wxObject
* source
, bool checkEvtHandler
);
289 PyObject
* (*p_wxPyMake_wxSizer
)(wxSizer
* source
);
290 void (*p_wxPyPtrTypeMap_Add
)(const char* commonName
, const char* ptrName
);
291 PyObject
* (*p_wxArrayString2PyList_helper
)(const wxArrayString
& arr
);
292 PyObject
* (*p_wxArrayInt2PyList_helper
)(const wxArrayInt
& arr
);
294 void (*p_wxPyClientData_dtor
)(wxPyClientData
*);
295 void (*p_wxPyUserData_dtor
)(wxPyUserData
*);
296 void (*p_wxPyOORClientData_dtor
)(wxPyOORClientData
*);
298 wxPyCBInputStream
* (*p_wxPyCBInputStream_create
)(PyObject
*py
, bool block
);
302 #ifdef wxPyUSE_EXPORT
303 // Notice that this is static, not extern. This is by design, each module
304 // needs one, but doesn't have to use it.
305 static wxPyCoreAPI
* wxPyCoreAPIPtr
= NULL
;
309 //---------------------------------------------------------------------------
312 class wxPyUserData
: public wxObject
{
314 wxPyUserData(PyObject
* obj
) {
320 #ifdef wxPyUSE_EXPORT
321 wxPyCoreAPIPtr
->p_wxPyUserData_dtor(this);
323 wxPyUserData_dtor(this);
330 class wxPyClientData
: public wxClientData
{
332 wxPyClientData(PyObject
* obj
) {
338 #ifdef wxPyUSE_EXPORT
339 wxPyCoreAPIPtr
->p_wxPyClientData_dtor(this);
341 wxPyClientData_dtor(this);
348 class wxPyOORClientData
: public wxPyClientData
{
350 wxPyOORClientData(PyObject
* obj
)
351 : wxPyClientData(obj
) {}
353 ~wxPyOORClientData() {
354 #ifdef wxPyUSE_EXPORT
355 wxPyCoreAPIPtr
->p_wxPyOORClientData_dtor(this);
357 wxPyOORClientData_dtor(this);
362 //---------------------------------------------------------------------------
363 // This class holds an instance of a Python Shadow Class object and assists
364 // with looking up and invoking Python callback methods from C++ virtual
365 // method redirections. For all classes which have virtuals which should be
366 // overridable in wxPython, a new subclass is created that contains a
367 // wxPyCallbackHelper.
370 class wxPyCallbackHelper
{
372 wxPyCallbackHelper(const wxPyCallbackHelper
& other
);
374 wxPyCallbackHelper() {
381 ~wxPyCallbackHelper() {
382 #ifdef wxPyUSE_EXPORT
383 wxPyCoreAPIPtr
->p_wxPyCBH_delete(this);
385 wxPyCBH_delete(this);
389 void setSelf(PyObject
* self
, PyObject
* klass
, int incref
=TRUE
);
390 bool findCallback(const char* name
) const;
391 int callCallback(PyObject
* argTuple
) const;
392 PyObject
* callCallbackObj(PyObject
* argTuple
) const;
397 PyObject
* m_lastFound
;
400 friend void wxPyCBH_delete(wxPyCallbackHelper
* cbh
);
404 void wxPyCBH_setCallbackInfo(wxPyCallbackHelper
& cbh
, PyObject
* self
, PyObject
* klass
, int incref
);
405 bool wxPyCBH_findCallback(const wxPyCallbackHelper
& cbh
, const char* name
);
406 int wxPyCBH_callCallback(const wxPyCallbackHelper
& cbh
, PyObject
* argTuple
);
407 PyObject
* wxPyCBH_callCallbackObj(const wxPyCallbackHelper
& cbh
, PyObject
* argTuple
);
408 void wxPyCBH_delete(wxPyCallbackHelper
* cbh
);
413 //---------------------------------------------------------------------------
415 // This is used in C++ classes that need to be able to make callback to
416 // "overloaded" python methods
419 void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=1) { \
420 wxPyCBH_setCallbackInfo(m_myInst, self, _class, incref); \
422 private: wxPyCallbackHelper m_myInst
425 //---------------------------------------------------------------------------
428 wxPYAPP_ASSERT_SUPPRESS
= 1,
429 wxPYAPP_ASSERT_EXCEPTION
= 2,
430 wxPYAPP_ASSERT_DIALOG
= 4,
431 wxPYAPP_ASSERT_LOG
= 8
434 class wxPyApp
: public wxApp
436 DECLARE_ABSTRACT_CLASS(wxPyApp
);
444 int GetAssertMode() { return m_assertMode
; }
445 void SetAssertMode(int mode
) { m_assertMode
= mode
; }
447 virtual bool OnInitGui();
448 virtual int OnExit();
450 virtual void OnAssert(const wxChar
*file
,
455 // virtual int FilterEvent(wxEvent& event); // This one too????
458 static bool GetMacDefaultEncodingIsPC();
459 static bool GetMacSupportPCMenuShortcuts();
460 static long GetMacAboutMenuItemId();
461 static long GetMacPreferencesMenuItemId();
462 static long GetMacExitMenuItemId();
463 static wxString
GetMacHelpMenuTitleName();
465 static void SetMacDefaultEncodingIsPC(bool val
);
466 static void SetMacSupportPCMenuShortcuts(bool val
);
467 static void SetMacAboutMenuItemId(long val
);
468 static void SetMacPreferencesMenuItemId(long val
);
469 static void SetMacExitMenuItemId(long val
);
470 static void SetMacHelpMenuTitleName(const wxString
& val
);
477 extern wxPyApp
*wxPythonApp
;
480 //----------------------------------------------------------------------
481 // These macros are used to implement the virtual methods that should
482 // redirect to a Python method if one exists. The names designate the
483 // return type, if any, as well as any parameter types.
484 //---------------------------------------------------------------------------
486 #define DEC_PYCALLBACK__(CBNAME) \
488 void base_##CBNAME();
491 #define IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME) \
492 void CLASS::CBNAME() { \
494 wxPyBeginBlockThreads(); \
495 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
496 wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
497 wxPyEndBlockThreads(); \
501 void CLASS::base_##CBNAME() { \
505 //---------------------------------------------------------------------------
507 #define DEC_PYCALLBACK_BOOL_INTINT(CBNAME) \
508 bool CBNAME(int a, int b); \
509 bool base_##CBNAME(int a, int b);
512 #define IMP_PYCALLBACK_BOOL_INTINT(CLASS, PCLASS, CBNAME) \
513 bool CLASS::CBNAME(int a, int b) { \
514 bool rval=FALSE, found; \
515 wxPyBeginBlockThreads(); \
516 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
517 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \
518 wxPyEndBlockThreads(); \
520 rval = PCLASS::CBNAME(a,b); \
523 bool CLASS::base_##CBNAME(int a, int b) { \
524 return PCLASS::CBNAME(a,b); \
527 //---------------------------------------------------------------------------
529 #define DEC_PYCALLBACK_VOID_INTINT(CBNAME) \
530 void CBNAME(int a, int b); \
531 void base_##CBNAME(int a, int b);
534 #define IMP_PYCALLBACK_VOID_INTINT(CLASS, PCLASS, CBNAME) \
535 void CLASS::CBNAME(int a, int b) { \
537 wxPyBeginBlockThreads(); \
538 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
539 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \
540 wxPyEndBlockThreads(); \
542 PCLASS::CBNAME(a,b); \
544 void CLASS::base_##CBNAME(int a, int b) { \
545 PCLASS::CBNAME(a,b); \
548 //---------------------------------------------------------------------------
550 #define DEC_PYCALLBACK_VOID_INT4(CBNAME) \
551 void CBNAME(int a, int b, int c, int d); \
552 void base_##CBNAME(int a, int b, int c, int d);
555 #define IMP_PYCALLBACK_VOID_INT4(CLASS, PCLASS, CBNAME) \
556 void CLASS::CBNAME(int a, int b, int c, int d) { \
558 wxPyBeginBlockThreads(); \
559 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
560 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiii)",a,b,c,d)); \
561 wxPyEndBlockThreads(); \
563 PCLASS::CBNAME(a,b,c,d); \
565 void CLASS::base_##CBNAME(int a, int b, int c, int d) { \
566 PCLASS::CBNAME(a,b,c,d); \
569 //---------------------------------------------------------------------------
570 #define DEC_PYCALLBACK_VOID_INT5(CBNAME) \
571 void CBNAME(int a, int b, int c, int d, int e); \
572 void base_##CBNAME(int a, int b, int c, int d, int e);
575 #define IMP_PYCALLBACK_VOID_INT5(CLASS, PCLASS, CBNAME) \
576 void CLASS::CBNAME(int a, int b, int c, int d, int e) { \
578 wxPyBeginBlockThreads(); \
579 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
580 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiiii)",a,b,c,d,e)); \
581 wxPyEndBlockThreads(); \
583 PCLASS::CBNAME(a,b,c,d,e); \
585 void CLASS::base_##CBNAME(int a, int b, int c, int d, int e) { \
586 PCLASS::CBNAME(a,b,c,d,e); \
589 //---------------------------------------------------------------------------
591 #define DEC_PYCALLBACK_VOID_INTPINTP_const(CBNAME) \
592 void CBNAME(int* a, int* b) const; \
593 void base_##CBNAME(int* a, int* b) const;
596 #define IMP_PYCALLBACK_VOID_INTPINTP_const(CLASS, PCLASS, CBNAME) \
597 void CLASS::CBNAME(int* a, int* b) const { \
598 const char* errmsg = #CBNAME " should return a 2-tuple of integers."; \
600 wxPyBeginBlockThreads(); \
601 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
603 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
605 if (PySequence_Check(ro) && PyObject_Length(ro) == 2) { \
606 PyObject* o1 = PySequence_GetItem(ro, 0); \
607 PyObject* o2 = PySequence_GetItem(ro, 1); \
608 if (PyNumber_Check(o1) && PyNumber_Check(o2)) { \
609 *a = PyInt_AsLong(o1); *b = PyInt_AsLong(o2); \
612 PyErr_SetString(PyExc_TypeError, errmsg); \
617 PyErr_SetString(PyExc_TypeError, errmsg); \
622 wxPyEndBlockThreads(); \
624 PCLASS::CBNAME(a,b); \
626 void CLASS::base_##CBNAME(int* a, int* b) const { \
627 PCLASS::CBNAME(a,b); \
631 //---------------------------------------------------------------------------
633 #define DEC_PYCALLBACK_SIZE_const(CBNAME) \
634 wxSize CBNAME() const; \
635 wxSize base_##CBNAME() const;
638 #define IMP_PYCALLBACK_SIZE_const(CLASS, PCLASS, CBNAME) \
639 wxSize CLASS::CBNAME() const { \
640 const char* errmsg = #CBNAME " should return a 2-tuple of integers."; \
641 bool found; wxSize rval(0,0); \
642 wxPyBeginBlockThreads(); \
643 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
645 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
647 if (PySequence_Check(ro) && PyObject_Length(ro) == 2) { \
648 PyObject* o1 = PySequence_GetItem(ro, 0); \
649 PyObject* o2 = PySequence_GetItem(ro, 1); \
650 if (PyNumber_Check(o1) && PyNumber_Check(o2)) { \
651 rval = wxSize(PyInt_AsLong(o1), PyInt_AsLong(o2)); \
654 PyErr_SetString(PyExc_TypeError, errmsg); \
659 PyErr_SetString(PyExc_TypeError, errmsg); \
664 wxPyEndBlockThreads(); \
666 return PCLASS::CBNAME(); \
670 wxSize CLASS::base_##CBNAME() const { \
671 return PCLASS::CBNAME(); \
675 //---------------------------------------------------------------------------
677 #define DEC_PYCALLBACK_BOOL_INT(CBNAME) \
678 bool CBNAME(int a); \
679 bool base_##CBNAME(int a);
682 #define IMP_PYCALLBACK_BOOL_INT(CLASS, PCLASS, CBNAME) \
683 bool CLASS::CBNAME(int a) { \
684 bool rval=FALSE, found; \
685 wxPyBeginBlockThreads(); \
686 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
687 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\
688 wxPyEndBlockThreads(); \
690 rval = PCLASS::CBNAME(a); \
693 bool CLASS::base_##CBNAME(int a) { \
694 return PCLASS::CBNAME(a); \
697 //---------------------------------------------------------------------------
699 #define DEC_PYCALLBACK_BOOL_INT_pure(CBNAME) \
703 #define IMP_PYCALLBACK_BOOL_INT_pure(CLASS, PCLASS, CBNAME) \
704 bool CLASS::CBNAME(int a) { \
706 wxPyBeginBlockThreads(); \
707 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
708 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a)); \
710 wxPyEndBlockThreads(); \
715 //---------------------------------------------------------------------------
717 #define DEC_PYCALLBACK__DC(CBNAME) \
718 void CBNAME(wxDC& a); \
719 void base_##CBNAME(wxDC& a);
722 #define IMP_PYCALLBACK__DC(CLASS, PCLASS, CBNAME) \
723 void CLASS::CBNAME(wxDC& a) { \
725 wxPyBeginBlockThreads(); \
726 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
727 PyObject* obj = wxPyMake_wxObject(&a); \
728 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
731 wxPyEndBlockThreads(); \
735 void CLASS::base_##CBNAME(wxDC& a) { \
741 //---------------------------------------------------------------------------
743 #define DEC_PYCALLBACK__DCBOOL(CBNAME) \
744 void CBNAME(wxDC& a, bool b); \
745 void base_##CBNAME(wxDC& a, bool b);
748 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
749 void CLASS::CBNAME(wxDC& a, bool b) { \
751 wxPyBeginBlockThreads(); \
752 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
753 PyObject* obj = wxPyMake_wxObject(&a); \
754 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
757 wxPyEndBlockThreads(); \
759 PCLASS::CBNAME(a, b); \
761 void CLASS::base_##CBNAME(wxDC& a, bool b) { \
762 PCLASS::CBNAME(a, b); \
765 //---------------------------------------------------------------------------
767 #define DEC_PYCALLBACK__DCBOOL(CBNAME) \
768 void CBNAME(wxDC& a, bool b); \
769 void base_##CBNAME(wxDC& a, bool b);
772 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
773 void CLASS::CBNAME(wxDC& a, bool b) { \
775 wxPyBeginBlockThreads(); \
776 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
777 PyObject* obj = wxPyMake_wxObject(&a); \
778 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
781 wxPyEndBlockThreads(); \
783 PCLASS::CBNAME(a, b); \
785 void CLASS::base_##CBNAME(wxDC& a, bool b) { \
786 PCLASS::CBNAME(a, b); \
789 //---------------------------------------------------------------------------
791 #define DEC_PYCALLBACK__2DBL(CBNAME) \
792 void CBNAME(double a, double b); \
793 void base_##CBNAME(double a, double b);
796 #define IMP_PYCALLBACK__2DBL(CLASS, PCLASS, CBNAME) \
797 void CLASS::CBNAME(double a, double b) { \
799 wxPyBeginBlockThreads(); \
800 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
801 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(dd)",a,b)); \
802 wxPyEndBlockThreads(); \
804 PCLASS::CBNAME(a, b); \
806 void CLASS::base_##CBNAME(double a, double b) { \
807 PCLASS::CBNAME(a, b); \
810 //---------------------------------------------------------------------------
812 #define DEC_PYCALLBACK__2DBL2INT(CBNAME) \
813 void CBNAME(double a, double b, int c, int d); \
814 void base_##CBNAME(double a, double b, int c, int d);
817 #define IMP_PYCALLBACK__2DBL2INT(CLASS, PCLASS, CBNAME) \
818 void CLASS::CBNAME(double a, double b, int c, int d) { \
820 wxPyBeginBlockThreads(); \
821 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
822 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddii)", \
824 wxPyEndBlockThreads(); \
826 PCLASS::CBNAME(a, b, c, d); \
828 void CLASS::base_##CBNAME(double a, double b, int c, int d) { \
829 PCLASS::CBNAME(a, b, c, d); \
832 //---------------------------------------------------------------------------
834 #define DEC_PYCALLBACK__DC4DBLBOOL(CBNAME) \
835 void CBNAME(wxDC& a, double b, double c, double d, double e, bool f); \
836 void base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f);
839 #define IMP_PYCALLBACK__DC4DBLBOOL(CLASS, PCLASS, CBNAME) \
840 void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
842 wxPyBeginBlockThreads(); \
843 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
844 PyObject* obj = wxPyMake_wxObject(&a); \
845 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f)); \
848 wxPyEndBlockThreads(); \
850 PCLASS::CBNAME(a, b, c, d, e, f); \
852 void CLASS::base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {\
853 PCLASS::CBNAME(a, b, c, d, e, f); \
856 //---------------------------------------------------------------------------
858 #define DEC_PYCALLBACK_BOOL_DC4DBLBOOL(CBNAME) \
859 bool CBNAME(wxDC& a, double b, double c, double d, double e, bool f); \
860 bool base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f);
863 #define IMP_PYCALLBACK_BOOL_DC4DBLBOOL(CLASS, PCLASS, CBNAME) \
864 bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
866 wxPyBeginBlockThreads(); \
868 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
869 PyObject* obj = wxPyMake_wxObject(&a); \
870 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
873 wxPyEndBlockThreads(); \
875 rval = PCLASS::CBNAME(a, b, c, d, e, f); \
878 bool CLASS::base_##CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {\
879 return PCLASS::CBNAME(a, b, c, d, e, f); \
882 //---------------------------------------------------------------------------
884 #define DEC_PYCALLBACK__BOOL2DBL2INT(CBNAME) \
885 void CBNAME(bool a, double b, double c, int d, int e); \
886 void base_##CBNAME(bool a, double b, double c, int d, int e);
889 #define IMP_PYCALLBACK__BOOL2DBL2INT(CLASS, PCLASS, CBNAME) \
890 void CLASS::CBNAME(bool a, double b, double c, int d, int e) { \
892 wxPyBeginBlockThreads(); \
893 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
894 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddii)", \
896 wxPyEndBlockThreads(); \
898 PCLASS::CBNAME(a, b, c, d, e); \
900 void CLASS::base_##CBNAME(bool a, double b, double c, int d, int e) { \
901 PCLASS::CBNAME(a, b, c, d, e); \
904 //---------------------------------------------------------------------------
906 #define DEC_PYCALLBACK__DC4DBL(CBNAME) \
907 void CBNAME(wxDC& a, double b, double c, double d, double e); \
908 void base_##CBNAME(wxDC& a, double b, double c, double d, double e);
911 #define IMP_PYCALLBACK__DC4DBL(CLASS, PCLASS, CBNAME) \
912 void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e) { \
914 wxPyBeginBlockThreads(); \
915 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
916 PyObject* obj = wxPyMake_wxObject(&a); \
917 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Odddd)", obj, b, c, d, e)); \
920 wxPyEndBlockThreads(); \
922 PCLASS::CBNAME(a, b, c, d, e); \
924 void CLASS::base_##CBNAME(wxDC& a, double b, double c, double d, double e) {\
925 PCLASS::CBNAME(a, b, c, d, e); \
928 //---------------------------------------------------------------------------
930 #define DEC_PYCALLBACK__DCBOOL(CBNAME) \
931 void CBNAME(wxDC& a, bool b); \
932 void base_##CBNAME(wxDC& a, bool b);
935 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
936 void CLASS::CBNAME(wxDC& a, bool b) { \
938 wxPyBeginBlockThreads(); \
939 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
940 PyObject* obj = wxPyMake_wxObject(&a); \
941 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
944 wxPyEndBlockThreads(); \
946 PCLASS::CBNAME(a, b); \
948 void CLASS::base_##CBNAME(wxDC& a, bool b) { \
949 PCLASS::CBNAME(a, b); \
952 //---------------------------------------------------------------------------
954 #define DEC_PYCALLBACK__WXCPBOOL2DBL2INT(CBNAME) \
955 void CBNAME(wxControlPoint* a, bool b, double c, double d, int e, int f); \
956 void base_##CBNAME(wxControlPoint* a, bool b, double c, double d, int e, int f);
959 #define IMP_PYCALLBACK__WXCPBOOL2DBL2INT(CLASS, PCLASS, CBNAME) \
960 void CLASS::CBNAME(wxControlPoint* a, bool b, double c, double d, \
963 wxPyBeginBlockThreads(); \
964 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
965 PyObject* obj = wxPyMake_wxObject(a); \
966 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
969 wxPyEndBlockThreads(); \
971 PCLASS::CBNAME(a, b, c, d, e, f); \
973 void CLASS::base_##CBNAME(wxControlPoint* a, bool b, double c, double d, \
975 PCLASS::CBNAME(a, b, c, d, e, f); \
978 //---------------------------------------------------------------------------
980 #define DEC_PYCALLBACK__WXCP2DBL2INT(CBNAME) \
981 void CBNAME(wxControlPoint* a, double b, double c, int d, int e); \
982 void base_##CBNAME(wxControlPoint* a, double b, double c, int d, int e);
985 #define IMP_PYCALLBACK__WXCP2DBL2INT(CLASS, PCLASS, CBNAME) \
986 void CLASS::CBNAME(wxControlPoint* a, double b, double c, int d, int e) { \
988 wxPyBeginBlockThreads(); \
989 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
990 PyObject* obj = wxPyMake_wxObject(a); \
991 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddii)", obj, b, c, d, e)); \
994 wxPyEndBlockThreads(); \
996 PCLASS::CBNAME(a, b, c, d, e); \
998 void CLASS::base_##CBNAME(wxControlPoint* a, double b, double c, \
1000 PCLASS::CBNAME(a, b, c, d, e); \
1003 //---------------------------------------------------------------------------
1005 #define DEC_PYCALLBACK__2DBLINT(CBNAME) \
1006 void CBNAME(double a, double b, int c); \
1007 void base_##CBNAME(double a, double b, int c);
1010 #define IMP_PYCALLBACK__2DBLINT(CLASS, PCLASS, CBNAME) \
1011 void CLASS::CBNAME(double a, double b, int c) { \
1013 wxPyBeginBlockThreads(); \
1014 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
1015 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddi)", a,b,c)); \
1016 wxPyEndBlockThreads(); \
1018 PCLASS::CBNAME(a, b, c); \
1020 void CLASS::base_##CBNAME(double a, double b, int c) { \
1021 PCLASS::CBNAME(a, b, c); \
1024 //---------------------------------------------------------------------------
1026 #define DEC_PYCALLBACK__BOOL2DBLINT(CBNAME) \
1027 void CBNAME(bool a, double b, double c, int d); \
1028 void base_##CBNAME(bool a, double b, double c, int d);
1031 #define IMP_PYCALLBACK__BOOL2DBLINT(CLASS, PCLASS, CBNAME) \
1032 void CLASS::CBNAME(bool a, double b, double c, int d) { \
1034 wxPyBeginBlockThreads(); \
1035 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
1036 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddi)", (int)a,b,c,d));\
1037 wxPyEndBlockThreads(); \
1039 PCLASS::CBNAME(a, b, c, d); \
1041 void CLASS::base_##CBNAME(bool a, double b, double c, int d) { \
1042 PCLASS::CBNAME(a, b, c, d); \
1045 //---------------------------------------------------------------------------
1046 //---------------------------------------------------------------------------
1048 #define DEC_PYCALLBACK__STRING(CBNAME) \
1049 void CBNAME(const wxString& a); \
1050 void base_##CBNAME(const wxString& a);
1052 #define IMP_PYCALLBACK__STRING(CLASS, PCLASS, CBNAME) \
1053 void CLASS::CBNAME(const wxString& a) { \
1055 wxPyBeginBlockThreads(); \
1056 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1057 PyObject* s = wx2PyString(a); \
1058 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s)); \
1061 wxPyEndBlockThreads(); \
1063 PCLASS::CBNAME(a); \
1065 void CLASS::base_##CBNAME(const wxString& a) { \
1066 PCLASS::CBNAME(a); \
1069 //---------------------------------------------------------------------------
1071 #define DEC_PYCALLBACK_BOOL_STRING(CBNAME) \
1072 bool CBNAME(const wxString& a); \
1073 bool base_##CBNAME(const wxString& a);
1075 #define IMP_PYCALLBACK_BOOL_STRING(CLASS, PCLASS, CBNAME) \
1076 bool CLASS::CBNAME(const wxString& a) { \
1079 wxPyBeginBlockThreads(); \
1080 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1081 PyObject* s = wx2PyString(a); \
1082 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s)); \
1085 wxPyEndBlockThreads(); \
1087 rval = PCLASS::CBNAME(a); \
1090 bool CLASS::base_##CBNAME(const wxString& a) { \
1091 return PCLASS::CBNAME(a); \
1094 //---------------------------------------------------------------------------
1096 #define DEC_PYCALLBACK_BOOL_STRING_pure(CBNAME) \
1097 bool CBNAME(const wxString& a);
1099 #define IMP_PYCALLBACK_BOOL_STRING_pure(CLASS, PCLASS, CBNAME) \
1100 bool CLASS::CBNAME(const wxString& a) { \
1102 wxPyBeginBlockThreads(); \
1103 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1104 PyObject* s = wx2PyString(a); \
1105 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s)); \
1108 wxPyEndBlockThreads(); \
1112 //---------------------------------------------------------------------------
1114 #define DEC_PYCALLBACK_STRING_STRING_pure(CBNAME) \
1115 wxString CBNAME(const wxString& a); \
1117 #define IMP_PYCALLBACK_STRING_STRING_pure(CLASS, PCLASS, CBNAME) \
1118 wxString CLASS::CBNAME(const wxString& a) { \
1120 wxPyBeginBlockThreads(); \
1121 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1123 PyObject* s = wx2PyString(a); \
1124 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)", s)); \
1127 rval = Py2wxString(ro); \
1131 wxPyEndBlockThreads(); \
1135 //---------------------------------------------------------------------------
1137 #define DEC_PYCALLBACK_STRING_STRING(CBNAME) \
1138 wxString CBNAME(const wxString& a); \
1139 wxString base_##CBNAME(const wxString& a);
1141 #define IMP_PYCALLBACK_STRING_STRING(CLASS, PCLASS, CBNAME) \
1142 wxString CLASS::CBNAME(const wxString& a) { \
1145 wxPyBeginBlockThreads(); \
1146 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1148 PyObject* s = wx2PyString(a); \
1149 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)", s)); \
1152 rval = Py2wxString(ro); \
1157 rval = PCLASS::CBNAME(a); \
1158 wxPyEndBlockThreads(); \
1162 //---------------------------------------------------------------------------
1164 #define DEC_PYCALLBACK_STRING_STRINGINT_pure(CBNAME) \
1165 wxString CBNAME(const wxString& a,int b); \
1167 #define IMP_PYCALLBACK_STRING_STRINGINT_pure(CLASS, PCLASS, CBNAME) \
1168 wxString CLASS::CBNAME(const wxString& a,int b) { \
1170 wxPyBeginBlockThreads(); \
1171 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1173 PyObject* s = wx2PyString(a); \
1174 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Oi)",s,b)); \
1177 rval = Py2wxString(ro); \
1181 wxPyEndBlockThreads(); \
1185 //---------------------------------------------------------------------------
1187 #define DEC_PYCALLBACK_BOOL_STRINGSTRING(CBNAME) \
1188 bool CBNAME(const wxString& a, const wxString& b); \
1189 bool base_##CBNAME(const wxString& a, const wxString& b);
1191 #define IMP_PYCALLBACK_BOOL_STRINGSTRING(CLASS, PCLASS, CBNAME) \
1192 bool CLASS::CBNAME(const wxString& a, const wxString& b) { \
1195 wxPyBeginBlockThreads(); \
1196 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1197 PyObject* s1 = wx2PyString(a); \
1198 PyObject* s2 = wx2PyString(b); \
1199 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)",s1,s2)); \
1203 wxPyEndBlockThreads(); \
1205 rval = PCLASS::CBNAME(a, b); \
1208 bool CLASS::base_##CBNAME(const wxString& a, const wxString& b) { \
1209 return PCLASS::CBNAME(a, b); \
1212 //---------------------------------------------------------------------------
1214 #define DEC_PYCALLBACK_STRING_(CBNAME) \
1215 wxString CBNAME(); \
1216 wxString base_##CBNAME();
1218 #define IMP_PYCALLBACK_STRING_(CLASS, PCLASS, CBNAME) \
1219 wxString CLASS::CBNAME() { \
1222 wxPyBeginBlockThreads(); \
1223 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1225 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
1227 rval = Py2wxString(ro); \
1231 wxPyEndBlockThreads(); \
1233 rval = PCLASS::CBNAME(); \
1236 wxString CLASS::base_##CBNAME() { \
1237 return PCLASS::CBNAME(); \
1240 //---------------------------------------------------------------------------
1242 #define DEC_PYCALLBACK_STRING__const(CBNAME) \
1243 wxString CBNAME() const; \
1244 wxString base_##CBNAME() const;
1246 #define IMP_PYCALLBACK_STRING__const(CLASS, PCLASS, CBNAME) \
1247 wxString CLASS::CBNAME() const { \
1250 wxPyBeginBlockThreads(); \
1251 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1253 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
1255 rval = Py2wxString(ro); \
1259 wxPyEndBlockThreads(); \
1261 rval = PCLASS::CBNAME(); \
1264 wxString CLASS::base_##CBNAME() const { \
1265 return PCLASS::CBNAME(); \
1268 //---------------------------------------------------------------------------
1270 #define DEC_PYCALLBACK_STRING__pure(CBNAME) \
1273 #define IMP_PYCALLBACK_STRING__pure(CLASS, PCLASS, CBNAME) \
1274 wxString CLASS::CBNAME() { \
1276 wxPyBeginBlockThreads(); \
1277 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1279 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
1281 rval = Py2wxString(ro); \
1285 wxPyEndBlockThreads(); \
1289 //---------------------------------------------------------------------------
1291 #define DEC_PYCALLBACK_BOOL_TAG_pure(CBNAME) \
1292 bool CBNAME(const wxHtmlTag& a); \
1295 #define IMP_PYCALLBACK_BOOL_TAG_pure(CLASS, PCLASS, CBNAME) \
1296 bool CLASS::CBNAME(const wxHtmlTag& a) { \
1298 wxPyBeginBlockThreads(); \
1299 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1300 PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxHtmlTag"), 0); \
1301 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1304 wxPyEndBlockThreads(); \
1308 //---------------------------------------------------------------------------
1310 #define DEC_PYCALLBACK__CELLINTINT(CBNAME) \
1311 void CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y); \
1312 void base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y);
1314 #define IMP_PYCALLBACK__CELLINTINT(CLASS, PCLASS, CBNAME) \
1315 void CLASS::CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y) { \
1317 wxPyBeginBlockThreads(); \
1318 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1319 PyObject* obj = wxPyConstructObject((void*)cell, wxT("wxHtmlCell"), 0); \
1320 wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Oii)",obj,x,y)); \
1323 wxPyEndBlockThreads(); \
1325 PCLASS::CBNAME(cell, x, y); \
1327 void CLASS::base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y) { \
1328 PCLASS::CBNAME(cell, x, y); \
1332 //---------------------------------------------------------------------------
1334 #define DEC_PYCALLBACK__CELLINTINTME(CBNAME) \
1335 void CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e); \
1336 void base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e);
1338 #define IMP_PYCALLBACK__CELLINTINTME(CLASS, PCLASS, CBNAME) \
1339 void CLASS::CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e) { \
1341 wxPyBeginBlockThreads(); \
1342 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1343 PyObject* obj = wxPyConstructObject((void*)cell, wxT("wxHtmlCell"), 0); \
1344 PyObject* o2 = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0); \
1345 wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OiiO)",obj,x,y,o2)); \
1349 wxPyEndBlockThreads(); \
1351 PCLASS::CBNAME(cell, x, y, e); \
1353 void CLASS::base_##CBNAME(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& e) { \
1354 PCLASS::CBNAME(cell, x, y, e); \
1359 //---------------------------------------------------------------------------
1361 #define DEC_PYCALLBACK___pure(CBNAME) \
1365 #define IMP_PYCALLBACK___pure(CLASS, PCLASS, CBNAME) \
1366 void CLASS::CBNAME() { \
1367 wxPyBeginBlockThreads(); \
1368 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
1369 wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
1370 wxPyEndBlockThreads(); \
1373 //---------------------------------------------------------------------------
1375 #define DEC_PYCALLBACK_wxSize__pure(CBNAME) \
1379 #define IMP_PYCALLBACK_wxSize__pure(CLASS, PCLASS, CBNAME) \
1380 wxSize CLASS::CBNAME() { \
1381 const char* errmsg = #CBNAME " should return a 2-tuple of integers or a wxSize object."; \
1383 wxPyBeginBlockThreads(); \
1384 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1387 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
1389 if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxSize_p")) \
1391 else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) { \
1392 PyObject* o1 = PySequence_GetItem(ro, 0); \
1393 PyObject* o2 = PySequence_GetItem(ro, 1); \
1394 if (PyNumber_Check(o1) && PyNumber_Check(o2)) \
1395 rval = wxSize(PyInt_AsLong(o1), PyInt_AsLong(o2)); \
1397 PyErr_SetString(PyExc_TypeError, errmsg); \
1402 PyErr_SetString(PyExc_TypeError, errmsg); \
1407 wxPyEndBlockThreads(); \
1411 //---------------------------------------------------------------------------
1413 #define DEC_PYCALLBACK_BOOL_WXWIN(CBNAME) \
1414 bool CBNAME(wxWindow* a); \
1415 bool base_##CBNAME(wxWindow* a);
1418 #define IMP_PYCALLBACK_BOOL_WXWIN(CLASS, PCLASS, CBNAME) \
1419 bool CLASS::CBNAME(wxWindow* a) { \
1422 wxPyBeginBlockThreads(); \
1423 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1424 PyObject* obj = wxPyMake_wxObject(a); \
1425 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1428 wxPyEndBlockThreads(); \
1430 rval = PCLASS::CBNAME(a); \
1433 bool CLASS::base_##CBNAME(wxWindow* a) { \
1434 return PCLASS::CBNAME(a); \
1437 //---------------------------------------------------------------------------
1439 #define DEC_PYCALLBACK_VOID_WXWINBASE(CBNAME) \
1440 void CBNAME(wxWindowBase* a); \
1441 void base_##CBNAME(wxWindowBase* a);
1444 #define IMP_PYCALLBACK_VOID_WXWINBASE(CLASS, PCLASS, CBNAME) \
1445 void CLASS::CBNAME(wxWindowBase* a) { \
1447 wxPyBeginBlockThreads(); \
1448 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1449 PyObject* obj = wxPyMake_wxObject(a); \
1450 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1453 wxPyEndBlockThreads(); \
1455 PCLASS::CBNAME(a); \
1457 void CLASS::base_##CBNAME(wxWindowBase* a) { \
1458 PCLASS::CBNAME(a); \
1461 //---------------------------------------------------------------------------
1463 #define DEC_PYCALLBACK_BOOL_(CBNAME) \
1465 bool base_##CBNAME();
1468 #define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME) \
1469 bool CLASS::CBNAME() { \
1472 wxPyBeginBlockThreads(); \
1473 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
1474 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
1475 wxPyEndBlockThreads(); \
1477 rval = PCLASS::CBNAME(); \
1480 bool CLASS::base_##CBNAME() { \
1481 return PCLASS::CBNAME(); \
1484 //---------------------------------------------------------------------------
1486 #define DEC_PYCALLBACK_BOOL_const(CBNAME) \
1487 bool CBNAME() const; \
1488 bool base_##CBNAME() const;
1491 #define IMP_PYCALLBACK_BOOL_const(CLASS, PCLASS, CBNAME) \
1492 bool CLASS::CBNAME() const { \
1495 wxPyBeginBlockThreads(); \
1496 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
1497 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
1498 wxPyEndBlockThreads(); \
1500 rval = PCLASS::CBNAME(); \
1503 bool CLASS::base_##CBNAME() const { \
1504 return PCLASS::CBNAME(); \
1507 //---------------------------------------------------------------------------
1509 #define DEC_PYCALLBACK_DR_2WXCDR(CBNAME) \
1510 wxDragResult CBNAME(wxCoord x, wxCoord y, wxDragResult def); \
1511 wxDragResult base_##CBNAME(wxCoord x, wxCoord y, wxDragResult def);
1514 #define IMP_PYCALLBACK_DR_2WXCDR(CLASS, PCLASS, CBNAME) \
1515 wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) { \
1518 wxPyBeginBlockThreads(); \
1519 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
1520 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
1521 wxPyEndBlockThreads(); \
1523 rval = PCLASS::CBNAME(a, b, c); \
1524 return (wxDragResult)rval; \
1526 wxDragResult CLASS::base_##CBNAME(wxCoord a, wxCoord b, wxDragResult c) { \
1527 return PCLASS::CBNAME(a, b, c); \
1530 //---------------------------------------------------------------------------
1532 #define DEC_PYCALLBACK_FSF_FSSTRING_pure(CBNAME) \
1533 wxFSFile* CBNAME(wxFileSystem& fs, const wxString& location); \
1535 #define IMP_PYCALLBACK_FSF_FSSTRING_pure(CLASS, PCLASS, CBNAME) \
1536 wxFSFile* CLASS::CBNAME(wxFileSystem& a,const wxString& b) { \
1537 wxPyBeginBlockThreads(); \
1539 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1541 PyObject* obj = wxPyMake_wxObject(&a); \
1542 PyObject* s = wx2PyString(b); \
1543 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OO)",\
1546 SWIG_GetPtrObj(ro, (void **)&rval, "_wxFSFILE_p"); \
1552 wxPyEndBlockThreads(); \
1556 //---------------------------------------------------------------------------
1558 #define DEC_PYCALLBACK_BOOL_DR(CBNAME) \
1559 bool CBNAME(wxDragResult a); \
1560 bool base_##CBNAME(wxDragResult a);
1563 #define IMP_PYCALLBACK_BOOL_DR(CLASS, PCLASS, CBNAME) \
1564 bool CLASS::CBNAME(wxDragResult a) { \
1567 wxPyBeginBlockThreads(); \
1568 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
1569 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));\
1570 wxPyEndBlockThreads(); \
1572 rval = PCLASS::CBNAME(a); \
1575 bool CLASS::base_##CBNAME(wxDragResult a) { \
1576 return PCLASS::CBNAME(a); \
1579 //---------------------------------------------------------------------------
1581 #define DEC_PYCALLBACK_DR_2WXCDR_pure(CBNAME) \
1582 wxDragResult CBNAME(wxCoord x, wxCoord y, wxDragResult def);
1585 #define IMP_PYCALLBACK_DR_2WXCDR_pure(CLASS, PCLASS, CBNAME) \
1586 wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) { \
1587 wxPyBeginBlockThreads(); \
1589 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
1590 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
1591 wxPyEndBlockThreads(); \
1592 return (wxDragResult)rval; \
1595 //---------------------------------------------------------------------------
1597 #define DEC_PYCALLBACK_BOOL_INTINTSTR_pure(CBNAME) \
1598 bool CBNAME(int a, int b, const wxString& c);
1600 #define IMP_PYCALLBACK_BOOL_INTINTSTR_pure(CLASS, PCLASS, CBNAME) \
1601 bool CLASS::CBNAME(int a, int b, const wxString& c) { \
1603 wxPyBeginBlockThreads(); \
1604 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1605 PyObject* s = wx2PyString(c); \
1606 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",a,b,s));\
1609 wxPyEndBlockThreads(); \
1613 //---------------------------------------------------------------------------
1615 #define DEC_PYCALLBACK_SIZET_(CBNAME) \
1617 size_t base_##CBNAME();
1620 #define IMP_PYCALLBACK_SIZET_(CLASS, PCLASS, CBNAME) \
1621 size_t CLASS::CBNAME() { \
1624 wxPyBeginBlockThreads(); \
1625 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
1626 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
1627 wxPyEndBlockThreads(); \
1629 rval = PCLASS::CBNAME(); \
1632 size_t CLASS::base_##CBNAME() { \
1633 return PCLASS::CBNAME(); \
1636 //---------------------------------------------------------------------------
1638 #define DEC_PYCALLBACK_DATAFMT_SIZET(CBNAME) \
1639 wxDataFormat CBNAME(size_t a); \
1640 wxDataFormat base_##CBNAME(size_t a);
1643 #define IMP_PYCALLBACK_DATAFMT_SIZET(CLASS, PCLASS, CBNAME) \
1644 wxDataFormat CLASS::CBNAME(size_t a) { \
1645 wxDataFormat rval=0; \
1647 wxPyBeginBlockThreads(); \
1648 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1650 wxDataFormat* ptr; \
1651 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \
1653 if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxDataFormat_p")) \
1658 wxPyEndBlockThreads(); \
1660 rval = PCLASS::CBNAME(a); \
1663 wxDataFormat CLASS::base_##CBNAME(size_t a) { \
1664 return PCLASS::CBNAME(a); \
1667 //---------------------------------------------------------------------------
1669 #define DEC_PYCALLBACK__constany(CBNAME, Type) \
1670 void CBNAME(const Type& a); \
1671 void base_##CBNAME(const Type& a);
1674 #define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type) \
1675 void CLASS::CBNAME(const Type& a) { \
1677 wxPyBeginBlockThreads(); \
1678 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1679 PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0); \
1680 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1683 wxPyEndBlockThreads(); \
1685 PCLASS::CBNAME(a); \
1687 void CLASS::base_##CBNAME(const Type& a) { \
1688 PCLASS::CBNAME(a); \
1692 //---------------------------------------------------------------------------
1694 #define DEC_PYCALLBACK__any(CBNAME, Type) \
1695 void CBNAME(Type& a); \
1696 void base_##CBNAME(Type& a);
1699 #define IMP_PYCALLBACK__any(CLASS, PCLASS, CBNAME, Type) \
1700 void CLASS::CBNAME(Type& a) { \
1702 wxPyBeginBlockThreads(); \
1703 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1704 PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0); \
1705 wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1708 wxPyEndBlockThreads(); \
1710 PCLASS::CBNAME(a); \
1712 void CLASS::base_##CBNAME(Type& a) { \
1713 PCLASS::CBNAME(a); \
1716 //---------------------------------------------------------------------------
1718 #define DEC_PYCALLBACK_bool_any(CBNAME, Type) \
1719 bool CBNAME(Type& a); \
1720 bool base_##CBNAME(Type& a);
1723 #define IMP_PYCALLBACK_bool_any(CLASS, PCLASS, CBNAME, Type) \
1724 bool CLASS::CBNAME(Type& a) { \
1727 wxPyBeginBlockThreads(); \
1728 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1729 PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0); \
1730 rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1733 wxPyEndBlockThreads(); \
1735 rv = PCLASS::CBNAME(a); \
1738 bool CLASS::base_##CBNAME(Type& a) { \
1739 return PCLASS::CBNAME(a); \
1742 //---------------------------------------------------------------------------
1744 #define DEC_PYCALLBACK_bool_anypure(CBNAME, Type) \
1745 bool CBNAME(Type& a);
1748 #define IMP_PYCALLBACK_bool_anypure(CLASS, PCLASS, CBNAME, Type) \
1749 bool CLASS::CBNAME(Type& a) { \
1751 wxPyBeginBlockThreads(); \
1752 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1753 PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0); \
1754 rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1757 wxPyEndBlockThreads(); \
1761 //---------------------------------------------------------------------------
1763 #define DEC_PYCALLBACK_STRING_LONGLONG(CBNAME) \
1764 wxString CBNAME(long a, long b) const; \
1765 wxString base_##CBNAME(long a, long b)const ;
1767 #define IMP_PYCALLBACK_STRING_LONGLONG(CLASS, PCLASS, CBNAME) \
1768 wxString CLASS::CBNAME(long a, long b) const { \
1771 wxPyBeginBlockThreads(); \
1772 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1774 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b)); \
1776 rval = Py2wxString(ro); \
1780 wxPyEndBlockThreads(); \
1782 rval = PCLASS::CBNAME(a,b); \
1785 wxString CLASS::base_##CBNAME(long a, long b) const { \
1786 return PCLASS::CBNAME(a,b); \
1789 //---------------------------------------------------------------------------
1791 #define DEC_PYCALLBACK_INT_LONG(CBNAME) \
1792 int CBNAME(long a) const; \
1793 int base_##CBNAME(long a)const ;
1796 #define IMP_PYCALLBACK_INT_LONG(CLASS, PCLASS, CBNAME) \
1797 int CLASS::CBNAME(long a) const { \
1800 wxPyBeginBlockThreads(); \
1801 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1803 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a)); \
1805 rval = PyInt_AsLong(ro); \
1809 wxPyEndBlockThreads(); \
1811 rval = PCLASS::CBNAME(a); \
1814 int CLASS::base_##CBNAME(long a) const { \
1815 return PCLASS::CBNAME(a); \
1819 //---------------------------------------------------------------------------
1821 #define DEC_PYCALLBACK_LISTATTR_LONG(CBNAME) \
1822 wxListItemAttr* CBNAME(long a) const; \
1823 wxListItemAttr* base_##CBNAME(long a);
1826 #define IMP_PYCALLBACK_LISTATTR_LONG(CLASS, PCLASS, CBNAME) \
1827 wxListItemAttr *CLASS::CBNAME(long a) const { \
1828 wxListItemAttr *rval = NULL; \
1830 wxPyBeginBlockThreads(); \
1831 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1833 wxListItemAttr* ptr; \
1834 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \
1836 if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxListItemAttr_p")) \
1841 wxPyEndBlockThreads(); \
1843 rval = PCLASS::CBNAME(a); \
1846 wxListItemAttr *CLASS::base_##CBNAME(long a) { \
1847 return PCLASS::CBNAME(a); \
1850 //---------------------------------------------------------------------------
1852 #define DEC_PYCALLBACK_BOOL_ME(CBNAME) \
1853 bool CBNAME(wxMouseEvent& e); \
1854 bool base_##CBNAME(wxMouseEvent& e);
1856 #define IMP_PYCALLBACK_BOOL_ME(CLASS, PCLASS, CBNAME) \
1857 bool CLASS::CBNAME(wxMouseEvent& e) { \
1860 wxPyBeginBlockThreads(); \
1861 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
1863 PyObject* obj = wxPyConstructObject((void*)&e, wxT("wxMouseEvent"), 0); \
1864 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)",obj)); \
1866 rval = PyInt_AsLong(ro); \
1871 wxPyEndBlockThreads(); \
1873 return PCLASS::CBNAME(e); \
1876 bool CLASS::base_##CBNAME(wxMouseEvent& e) { \
1877 return PCLASS::CBNAME(e); \
1881 //---------------------------------------------------------------------------
1883 #define DEC_PYCALLBACK_WIZPG__pure(CBNAME) \
1884 wxWizardPage* CBNAME() const;
1886 #define IMP_PYCALLBACK_WIZPG__pure(CLASS, PCLASS, CBNAME) \
1887 wxWizardPage* CLASS::CBNAME() const { \
1888 wxWizardPage* rv = NULL; \
1889 wxPyBeginBlockThreads(); \
1890 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1892 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
1894 SWIG_GetPtrObj(ro, (void **)&rv, "_wxWizardPage_p"); \
1898 wxPyEndBlockThreads(); \
1902 //---------------------------------------------------------------------------
1904 #define DEC_PYCALLBACK_BITMAP__pure(CBNAME) \
1905 wxBitmap CBNAME() const;
1907 #define IMP_PYCALLBACK_BITMAP__pure(CLASS, PCLASS, CBNAME) \
1908 wxBitmap CLASS::CBNAME() const { \
1910 wxPyBeginBlockThreads(); \
1911 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1914 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
1916 if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxBitmap_p")) \
1921 wxPyEndBlockThreads(); \
1925 //---------------------------------------------------------------------------
1927 #define DEC_PYCALLBACK_OBJECT__pure(CBNAME) \
1930 #define IMP_PYCALLBACK_OBJECT__pure(CLASS, PCLASS, CBNAME) \
1931 wxObject* CLASS::CBNAME() { \
1932 wxObject* rv = NULL; \
1933 wxPyBeginBlockThreads(); \
1934 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1936 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \
1938 SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p"); \
1942 wxPyEndBlockThreads(); \
1946 //---------------------------------------------------------------------------
1948 #define DEC_PYCALLBACK_OBJECT_STRING_pure(CBNAME) \
1949 wxObject* CBNAME(const wxString& a);
1951 #define IMP_PYCALLBACK_OBJECT_STRING_pure(CLASS, PCLASS, CBNAME) \
1952 wxObject* CLASS::CBNAME(const wxString& a) { \
1953 wxObject* rv = NULL; \
1954 wxPyBeginBlockThreads(); \
1955 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1956 PyObject* so = wx2PyString(a); \
1958 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(O)", so)); \
1960 SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p"); \
1965 wxPyEndBlockThreads(); \
1969 //---------------------------------------------------------------------------
1971 #define DEC_PYCALLBACK_BOOL_NODE_pure(CBNAME) \
1972 bool CBNAME(wxXmlNode* a);
1975 #define IMP_PYCALLBACK_BOOL_NODE_pure(CLASS, PCLASS, CBNAME) \
1976 bool CLASS::CBNAME(wxXmlNode* a) { \
1978 wxPyBeginBlockThreads(); \
1979 if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
1980 PyObject* obj = wxPyConstructObject((void*)a, wxT("wxXmlNode"), 0); \
1981 rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
1984 wxPyEndBlockThreads(); \
1988 //---------------------------------------------------------------------------