PyObject* __wxStart(PyObject*, PyObject* args);
void __wxCleanup();
-extern PyObject* wxPython_dict;
+//extern PyObject* wxPython_dict;
PyObject* __wxSetDictionary(PyObject*, PyObject* args);
void wxPyEventThunker(wxObject*, wxEvent& event);
PyObject* wxPyConstructObject(void* ptr,
const char* className,
int setThisOwn=0);
+PyObject* wxPyConstructObject(void* ptr,
+ const char* className,
+ PyObject* klass,
+ int setThisOwn=0);
+PyObject* wxPyClassExists(const char* className);
+PyObject* wxPyMake_wxObject(wxObject* source);
+void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
+
bool wxPyRestoreThread();
void wxPySaveThread(bool doSave);
PyObject* wxPy_ConvertList(wxListBase* list, const char* className);
int* int_LIST_helper(PyObject* source);
long* long_LIST_helper(PyObject* source);
char** string_LIST_helper(PyObject* source);
-wxPoint* wxPoint_LIST_helper(PyObject* source);
+wxPoint* wxPoint_LIST_helper(PyObject* source, int* npoints);
wxBitmap** wxBitmap_LIST_helper(PyObject* source);
wxString* wxString_LIST_helper(PyObject* source);
wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source);
# pragma warning(disable:4190)
#endif
-
-
-// Non-const versions to keep SWIG happy.
-extern wxPoint wxPyDefaultPosition;
-extern wxSize wxPyDefaultSize;
-extern wxString wxPyEmptyStr;
-
//----------------------------------------------------------------------
class wxPyCallback : public wxObject {
int* (*p_int_LIST_helper)(PyObject* source);
long* (*p_long_LIST_helper)(PyObject* source);
char** (*p_string_LIST_helper)(PyObject* source);
- wxPoint* (*p_wxPoint_LIST_helper)(PyObject* source);
+ wxPoint* (*p_wxPoint_LIST_helper)(PyObject* source, int* npoints);
wxBitmap** (*p_wxBitmap_LIST_helper)(PyObject* source);
wxString* (*p_wxString_LIST_helper)(PyObject* source);
wxAcceleratorEntry* (*p_wxAcceleratorEntry_LIST_helper)(PyObject* source);
PyObject* (*p_wxPyCBH_callCallbackObj)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
void (*p_wxPyCBH_delete)(wxPyCallbackHelper* cbh);
+ PyObject* (*p_wxPyClassExists)(const char* className);
+ PyObject* (*p_wxPyMake_wxObject)(wxObject* source);
+ void (*p_wxPyPtrTypeMap_Add)(const char* commonName, const char* ptrName);
+
};
#ifdef wxPyUSE_EXPORT
bool doSave;
#ifdef wxPyUSE_EXPORT
doSave = wxPyCoreAPIPtr->p_wxPyRestoreThread();
-#else
- doSave = wxPyRestoreThread();
-#endif
-
Py_DECREF(m_obj);
-
-#ifdef wxPyUSE_EXPORT
wxPyCoreAPIPtr->p_wxPySaveThread(doSave);
#else
+ doSave = wxPyRestoreThread();
+ Py_DECREF(m_obj);
wxPySaveThread(doSave);
#endif
}
void CLASS::CBNAME(wxDC& a) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
Py_DECREF(obj); \
} \
void CLASS::CBNAME(wxDC& a, bool b) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
Py_DECREF(obj); \
} \
void CLASS::CBNAME(wxDC& a, bool b) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
Py_DECREF(obj); \
} \
void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f)); \
Py_DECREF(obj); \
} \
bool doSave = wxPyRestoreThread(); \
bool rval; \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
Py_DECREF(obj); \
} \
#define IMP_PYCALLBACK__BOOL2DBL2INT(CLASS, PCLASS, CBNAME) \
void CLASS::CBNAME(bool a, double b, double c, int d, int e) { \
bool doSave = wxPyRestoreThread(); \
- if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
- wxPyCBH_callCallback(m_myInst, Py_BuildValue("(idii)", \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddii)", \
(int)a,b,c,d,e)); \
else \
PCLASS::CBNAME(a, b, c, d, e); \
void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Odddd)", obj, b, c, d, e)); \
Py_DECREF(obj); \
} \
void CLASS::CBNAME(wxDC& a, bool b) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b)); \
Py_DECREF(obj); \
} \
int e, int f) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint", 0); \
+ PyObject* obj = wxPyMake_wxObject(a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
Py_DECREF(obj); \
} \
void CLASS::CBNAME(wxControlPoint* a, double b, double c, int d, int e) { \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint", 0); \
+ PyObject* obj = wxPyMake_wxObject(a); \
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddii)", obj, b, c, d, e)); \
Py_DECREF(obj); \
} \
bool rval = FALSE; \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject((void*)&a,"wxHtmlTag", 0); \
+ PyObject* obj = wxPyConstructObject((void*)&a, "wxHtmlTag", 0); \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
Py_DECREF(obj); \
} \
bool rval; \
bool doSave = wxPyRestoreThread(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
- PyObject* obj = wxPyConstructObject((void*)a,"wxWindow", 0);\
+ PyObject* obj = wxPyMake_wxObject(a); \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
Py_DECREF(obj); \
} \
wxFSFile* rval=0; \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* ro; \
- PyObject* obj = wxPyConstructObject(&a, "wxFileSystem", 0); \
+ PyObject* obj = wxPyMake_wxObject(&a); \
ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Os)", \
obj, b.c_str())); \
if (ro) { \
//---------------------------------------------------------------------------
-#define DEC_PYCALLBACK_DATAFMT_SIZET(CBNAME) \
- wxDataFormat CBNAME(); \
- wxDataFormat base_##CBNAME();
+#define DEC_PYCALLBACK_DATAFMT_SIZET(CBNAME) \
+ wxDataFormat CBNAME(size_t a); \
+ wxDataFormat base_##CBNAME(size_t a);
#define IMP_PYCALLBACK_DATAFMT_SIZET(CLASS, PCLASS, CBNAME) \
wxDataFormat CLASS::CBNAME(size_t a) { \
wxDataFormat rval; \
bool doSave = wxPyRestoreThread(); \
- if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* ro; \
wxDataFormat* ptr; \
- ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \
if (ro) { \
if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxDataFormat_p")) \
rval = *ptr; \
//---------------------------------------------------------------------------
+#define DEC_PYCALLBACK_STRING_LONGLONG(CBNAME) \
+ wxString CBNAME(long a, long b) const; \
+ wxString base_##CBNAME(long a, long b)const ;
+
+
+#define IMP_PYCALLBACK_STRING_LONGLONG(CLASS, PCLASS, CBNAME) \
+ wxString CLASS::CBNAME(long a, long b) const { \
+ wxString rval; \
+ bool doSave = wxPyRestoreThread(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* ro; \
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b)); \
+ if (ro) { \
+ PyObject* str = PyObject_Str(ro); \
+ rval = PyString_AsString(str); \
+ Py_DECREF(ro); Py_DECREF(str); \
+ } \
+ } \
+ else \
+ rval = PCLASS::CBNAME(a,b); \
+ wxPySaveThread(doSave); \
+ return rval; \
+ } \
+ wxString CLASS::base_##CBNAME(long a, long b) const { \
+ return PCLASS::CBNAME(a,b); \
+ }
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_INT_LONG(CBNAME) \
+ int CBNAME(long a) const; \
+ int base_##CBNAME(long a)const ;
+
+
+#define IMP_PYCALLBACK_INT_LONG(CLASS, PCLASS, CBNAME) \
+ int CLASS::CBNAME(long a) const { \
+ int rval=-1; \
+ bool doSave = wxPyRestoreThread(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* ro; \
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a)); \
+ if (ro) { \
+ rval = PyInt_AsLong(ro); \
+ Py_DECREF(ro); \
+ } \
+ } \
+ else \
+ rval = PCLASS::CBNAME(a); \
+ wxPySaveThread(doSave); \
+ return rval; \
+ } \
+ int CLASS::base_##CBNAME(long a) const { \
+ return PCLASS::CBNAME(a); \
+ }
+
+
+//---------------------------------------------------------------------------
+
+#define DEC_PYCALLBACK_LISTATTR_LONG(CBNAME) \
+ wxListItemAttr* CBNAME(long a); \
+ wxListItemAttr* base_##CBNAME(long a);
+
+
+#define IMP_PYCALLBACK_LISTATTR_LONG(CLASS, PCLASS, CBNAME) \
+ wxListItemAttr *CLASS::CBNAME(long a) { \
+ wxListItemAttr *rval = NULL; \
+ bool doSave = wxPyRestoreThread(); \
+ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
+ PyObject* ro; \
+ wxListItemAttr* ptr; \
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \
+ if (ro) { \
+ if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxListItemAttr_p")) \
+ rval = ptr; \
+ Py_DECREF(ro); \
+ } \
+ } \
+ else \
+ rval = PCLASS::CBNAME(a); \
+ wxPySaveThread(doSave); \
+ return rval; \
+ } \
+ wxListItemAttr *CLASS::base_##CBNAME(long a) { \
+ return PCLASS::CBNAME(a); \
+ }
+
+//---------------------------------------------------------------------------
+
#endif