X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5a32574e8ddaf996ad31d0c4414de11c06303cac..a90253f00d9290c4682968f18a4f84a2b6d4a98a:/wxPython/src/gtk/wizard.cpp diff --git a/wxPython/src/gtk/wizard.cpp b/wxPython/src/gtk/wizard.cpp index fc809ea177..013fc0e23c 100644 --- a/wxPython/src/gtk/wizard.cpp +++ b/wxPython/src/gtk/wizard.cpp @@ -84,6 +84,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); // C++ Version of a Python aware class class wxPyWizardPage : public wxWizardPage { DECLARE_ABSTRACT_CLASS(wxPyWizardPage); @@ -319,21 +322,27 @@ static void *SwigwxWizardPageTowxObject(void *ptr) { return (void *) dest; } -#define wxWizardPage_Create(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->Create(_swigarg0,_swigarg1,_swigarg2)) +static bool wxWizardPage_Create(wxWizardPage *self,wxWizard * parent,const wxBitmap & bitmap,const wxString & resource) { + wxChar* res = NULL; + if (resource.Length()) + res = (wxChar*)resource.c_str(); + return self->Create(parent, bitmap, res); + } static PyObject *_wrap_wxWizardPage_Create(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxWizardPage * _arg0; wxWizard * _arg1; wxBitmap * _arg2 = (wxBitmap *) &wxNullBitmap; - char * _arg3 = (char *) NULL; + wxString * _arg3 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _argo2 = 0; + PyObject * _obj3 = 0; char *_kwnames[] = { "self","parent","bitmap","resource", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|Os:wxWizardPage_Create",_kwnames,&_argo0,&_argo1,&_argo2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OO:wxWizardPage_Create",_kwnames,&_argo0,&_argo1,&_argo2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -356,41 +365,23 @@ static PyObject *_wrap_wxWizardPage_Create(PyObject *self, PyObject *args, PyObj return NULL; } } + if (_obj3) { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxWizardPage_Create(_arg0,_arg1,*_arg2,_arg3); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define wxWizardPage_Init(_swigobj) (_swigobj->Init()) -static PyObject *_wrap_wxWizardPage_Init(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxWizardPage * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWizardPage_Init",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWizardPage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWizardPage_Init. Expected _wxWizardPage_p."); + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) return NULL; - } - } +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxWizardPage_Init(_arg0); + _result = (bool )wxWizardPage_Create(_arg0,_arg1,*_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj3) + delete _arg3; +} return _resultobj; } @@ -520,20 +511,27 @@ static void *SwigwxPyWizardPageTowxObject(void *ptr) { return (void *) dest; } -#define new_wxPyWizardPage(_swigarg0,_swigarg1,_swigarg2) (new wxPyWizardPage(_swigarg0,_swigarg1,_swigarg2)) +static wxPyWizardPage *new_wxPyWizardPage(wxWizard *parent,const wxBitmap *bitmap,const wxString *resource) { + wxChar* res = NULL; + if (resource->Length()) + res = (wxChar*)resource->c_str(); + return new wxPyWizardPage(parent, *bitmap, res); + } + static PyObject *_wrap_new_wxPyWizardPage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxPyWizardPage * _result; wxWizard * _arg0; wxBitmap * _arg1 = (wxBitmap *) &wxNullBitmap; - char * _arg2 = (char *) NULL; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj2 = 0; char *_kwnames[] = { "parent","bitmap","resource", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|Os:new_wxPyWizardPage",_kwnames,&_argo0,&_argo1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OO:new_wxPyWizardPage",_kwnames,&_argo0,&_argo1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -549,9 +547,15 @@ static PyObject *_wrap_new_wxPyWizardPage(PyObject *self, PyObject *args, PyObje return NULL; } } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPyWizardPage *)new_wxPyWizardPage(_arg0,*_arg1,_arg2); + _result = (wxPyWizardPage *)new_wxPyWizardPage(_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -562,6 +566,10 @@ static PyObject *_wrap_new_wxPyWizardPage(PyObject *self, PyObject *args, PyObje Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj2) + delete _arg2; +} return _resultobj; } @@ -591,21 +599,27 @@ static PyObject *_wrap_new_wxPrePyWizardPage(PyObject *self, PyObject *args, PyO return _resultobj; } -#define wxPyWizardPage_Create(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->Create(_swigarg0,_swigarg1,_swigarg2)) +static bool wxPyWizardPage_Create(wxPyWizardPage *self,wxWizard * parent,const wxBitmap & bitmap,const wxString & resource) { + wxChar* res = NULL; + if (resource.Length()) + res = (wxChar*)resource.c_str(); + return self->Create(parent, bitmap, res); + } static PyObject *_wrap_wxPyWizardPage_Create(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxPyWizardPage * _arg0; wxWizard * _arg1; wxBitmap * _arg2 = (wxBitmap *) &wxNullBitmap; - char * _arg3 = (char *) NULL; + wxString * _arg3 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _argo2 = 0; + PyObject * _obj3 = 0; char *_kwnames[] = { "self","parent","bitmap","resource", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|Os:wxPyWizardPage_Create",_kwnames,&_argo0,&_argo1,&_argo2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OO:wxPyWizardPage_Create",_kwnames,&_argo0,&_argo1,&_argo2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -628,13 +642,23 @@ static PyObject *_wrap_wxPyWizardPage_Create(PyObject *self, PyObject *args, PyO return NULL; } } + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxPyWizardPage_Create(_arg0,_arg1,*_arg2,_arg3); + _result = (bool )wxPyWizardPage_Create(_arg0,_arg1,*_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj3) + delete _arg3; +} return _resultobj; } @@ -1471,34 +1495,6 @@ static PyObject *_wrap_wxWizardPageSimple_Create(PyObject *self, PyObject *args, return _resultobj; } -#define wxWizardPageSimple_Init(_swigobj) (_swigobj->Init()) -static PyObject *_wrap_wxWizardPageSimple_Init(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxWizardPageSimple * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWizardPageSimple_Init",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWizardPageSimple_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWizardPageSimple_Init. Expected _wxWizardPageSimple_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxWizardPageSimple_Init(_arg0); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - #define wxWizardPageSimple_SetPrev(_swigobj,_swigarg0) (_swigobj->SetPrev(_swigarg0)) static PyObject *_wrap_wxWizardPageSimple_SetPrev(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2088,7 +2084,6 @@ static PyMethodDef wizardcMethods[] = { { "wxWizardPageSimple_Chain", (PyCFunction) _wrap_wxWizardPageSimple_Chain, METH_VARARGS | METH_KEYWORDS }, { "wxWizardPageSimple_SetNext", (PyCFunction) _wrap_wxWizardPageSimple_SetNext, METH_VARARGS | METH_KEYWORDS }, { "wxWizardPageSimple_SetPrev", (PyCFunction) _wrap_wxWizardPageSimple_SetPrev, METH_VARARGS | METH_KEYWORDS }, - { "wxWizardPageSimple_Init", (PyCFunction) _wrap_wxWizardPageSimple_Init, METH_VARARGS | METH_KEYWORDS }, { "wxWizardPageSimple_Create", (PyCFunction) _wrap_wxWizardPageSimple_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreWizardPageSimple", (PyCFunction) _wrap_new_wxPreWizardPageSimple, METH_VARARGS | METH_KEYWORDS }, { "new_wxWizardPageSimple", (PyCFunction) _wrap_new_wxWizardPageSimple, METH_VARARGS | METH_KEYWORDS }, @@ -2117,7 +2112,6 @@ static PyMethodDef wizardcMethods[] = { { "wxWizardPage_GetBitmap", (PyCFunction) _wrap_wxWizardPage_GetBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxWizardPage_GetNext", (PyCFunction) _wrap_wxWizardPage_GetNext, METH_VARARGS | METH_KEYWORDS }, { "wxWizardPage_GetPrev", (PyCFunction) _wrap_wxWizardPage_GetPrev, METH_VARARGS | METH_KEYWORDS }, - { "wxWizardPage_Init", (PyCFunction) _wrap_wxWizardPage_Init, METH_VARARGS | METH_KEYWORDS }, { "wxWizardPage_Create", (PyCFunction) _wrap_wxWizardPage_Create, METH_VARARGS | METH_KEYWORDS }, { "wxWizardEvent_GetPage", (PyCFunction) _wrap_wxWizardEvent_GetPage, METH_VARARGS | METH_KEYWORDS }, { "wxWizardEvent_GetDirection", (PyCFunction) _wrap_wxWizardEvent_GetDirection, METH_VARARGS | METH_KEYWORDS },