From 3de0866e8ce40962137723caaf9206269534b9a7 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 27 Aug 2002 20:35:18 +0000 Subject: [PATCH] Compilation fixes for wxPython's wxWizard, added wxRegionFromPoints git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16829 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gdi.i | 1 + wxPython/src/msw/gdi.cpp | 45 ++++++++++++++++++++++++++++ wxPython/src/msw/gdi.py | 5 ++++ wxPython/src/msw/wizard.cpp | 58 ------------------------------------- wxPython/src/msw/wizard.py | 6 ---- wxPython/src/wizard.i | 6 ---- 6 files changed, 51 insertions(+), 70 deletions(-) diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index 0aeb10e711..3cc45d7cf2 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -1049,6 +1049,7 @@ enum wxRegionContain { class wxRegion : public wxGDIObject { public: wxRegion(long x=0, long y=0, long width=0, long height=0); + %name(wxRegionFromPoints)wxRegion(int PCOUNT, wxPoint* points, int fillStyle = wxWINDING_RULE); ~wxRegion(); void Clear(); diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index 6c2c3060a2..5f45f332e1 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -10204,6 +10204,50 @@ static PyObject *_wrap_new_wxRegion(PyObject *self, PyObject *args, PyObject *kw return _resultobj; } +#define new_wxRegionFromPoints(_swigarg0,_swigarg1,_swigarg2) (new wxRegion(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_new_wxRegionFromPoints(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxRegion * _result; + int _arg0; + wxPoint * _arg1; + int _arg2 = (int ) wxWINDING_RULE; + int NPOINTS; + PyObject * _obj1 = 0; + char *_kwnames[] = { "points","fillStyle", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:new_wxRegionFromPoints",_kwnames,&_obj1,&_arg2)) + return NULL; + if (_obj1) +{ + _arg1 = wxPoint_LIST_helper(_obj1, &NPOINTS); + if (_arg1 == NULL) { + return NULL; + } +} +{ + _arg0 = NPOINTS; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxRegion *)new_wxRegionFromPoints(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxRegion_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + delete [] _arg1; +} + return _resultobj; +} + #define delete_wxRegion(_swigobj) (delete _swigobj) static PyObject *_wrap_delete_wxRegion(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -11291,6 +11335,7 @@ static PyMethodDef gdicMethods[] = { { "wxRegion_Offset", (PyCFunction) _wrap_wxRegion_Offset, METH_VARARGS | METH_KEYWORDS }, { "wxRegion_Clear", (PyCFunction) _wrap_wxRegion_Clear, METH_VARARGS | METH_KEYWORDS }, { "delete_wxRegion", (PyCFunction) _wrap_delete_wxRegion, METH_VARARGS | METH_KEYWORDS }, + { "new_wxRegionFromPoints", (PyCFunction) _wrap_new_wxRegionFromPoints, METH_VARARGS | METH_KEYWORDS }, { "new_wxRegion", (PyCFunction) _wrap_new_wxRegion, METH_VARARGS | METH_KEYWORDS }, { "wxImageList_GetSize", (PyCFunction) _wrap_wxImageList_GetSize, METH_VARARGS | METH_KEYWORDS }, { "wxImageList_RemoveAll", (PyCFunction) _wrap_wxImageList_RemoveAll, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index 1c7b06801e..39610df421 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -1166,6 +1166,11 @@ class wxRegion(wxRegionPtr): +def wxRegionFromPoints(*_args,**_kwargs): + val = wxRegionPtr(apply(gdic.new_wxRegionFromPoints,_args,_kwargs)) + val.thisown = 1 + return val + class wxRegionIteratorPtr(wxObjectPtr): def __init__(self,this): diff --git a/wxPython/src/msw/wizard.cpp b/wxPython/src/msw/wizard.cpp index 0e33f29e18..6f1f695866 100644 --- a/wxPython/src/msw/wizard.cpp +++ b/wxPython/src/msw/wizard.cpp @@ -366,34 +366,6 @@ static PyObject *_wrap_wxWizardPage_Create(PyObject *self, PyObject *args, PyObj 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."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxWizardPage_Init(_arg0); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - #define wxWizardPage_GetPrev(_swigobj) (_swigobj->GetPrev()) static PyObject *_wrap_wxWizardPage_GetPrev(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1471,34 +1443,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 +2032,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 +2060,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 }, diff --git a/wxPython/src/msw/wizard.py b/wxPython/src/msw/wizard.py index 3891696b44..391048f193 100644 --- a/wxPython/src/msw/wizard.py +++ b/wxPython/src/msw/wizard.py @@ -60,9 +60,6 @@ class wxWizardPagePtr(wxPanelPtr): def Create(self, *_args, **_kwargs): val = apply(wizardc.wxWizardPage_Create,(self,) + _args, _kwargs) return val - def Init(self, *_args, **_kwargs): - val = apply(wizardc.wxWizardPage_Init,(self,) + _args, _kwargs) - return val def GetPrev(self, *_args, **_kwargs): val = apply(wizardc.wxWizardPage_GetPrev,(self,) + _args, _kwargs) return val @@ -174,9 +171,6 @@ class wxWizardPageSimplePtr(wxWizardPagePtr): def Create(self, *_args, **_kwargs): val = apply(wizardc.wxWizardPageSimple_Create,(self,) + _args, _kwargs) return val - def Init(self, *_args, **_kwargs): - val = apply(wizardc.wxWizardPageSimple_Init,(self,) + _args, _kwargs) - return val def SetPrev(self, *_args, **_kwargs): val = apply(wizardc.wxWizardPageSimple_SetPrev,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/wizard.i b/wxPython/src/wizard.i index b53e3d313c..217923d391 100644 --- a/wxPython/src/wizard.i +++ b/wxPython/src/wizard.i @@ -101,9 +101,6 @@ public: const wxBitmap& bitmap = wxNullBitmap, const char* resource = NULL); - // common part of ctors: - void Init(); - // these functions are used by the wizard to show another page when the // user chooses "Back" or "Next" button virtual wxWizardPage *GetPrev() const; @@ -270,9 +267,6 @@ public: %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreWizardPageSimple:val._setOORInfo(val)" - // common part of ctors: - void Init(); - // the pointers may be also set later - but before starting the wizard void SetPrev(wxWizardPage *prev); void SetNext(wxWizardPage *next); -- 2.45.2