From d8ac6a6267cb95303d1a93dcb555501b3e8c5a4b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 10 Apr 2003 21:58:03 +0000 Subject: [PATCH] SWIGged updates for wxGTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gtk/fonts.py | 2 + wxPython/src/gtk/gdi.py | 7 +++ wxPython/src/gtk/grid.cpp | 114 +++++++++++++++++++----------------- wxPython/src/gtk/image.py | 1 + wxPython/src/gtk/misc2.py | 3 + wxPython/src/gtk/printfw.py | 4 ++ 6 files changed, 77 insertions(+), 54 deletions(-) diff --git a/wxPython/src/gtk/fonts.py b/wxPython/src/gtk/fonts.py index b6a35cb2cc..d6240d3358 100644 --- a/wxPython/src/gtk/fonts.py +++ b/wxPython/src/gtk/fonts.py @@ -212,6 +212,7 @@ class wxFontPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxFont instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxFont(wxFontPtr): def __init__(self,*_args,**_kwargs): self.this = fontsc.new_wxFont(*_args,**_kwargs) @@ -398,6 +399,7 @@ class wxEncodingConverterPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxEncodingConverter instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxEncodingConverter(wxEncodingConverterPtr): def __init__(self,*_args,**_kwargs): self.this = fontsc.new_wxEncodingConverter(*_args,**_kwargs) diff --git a/wxPython/src/gtk/gdi.py b/wxPython/src/gtk/gdi.py index 5d8d809a81..5bfb05b9b7 100644 --- a/wxPython/src/gtk/gdi.py +++ b/wxPython/src/gtk/gdi.py @@ -96,6 +96,7 @@ class wxBitmapPtr(wxGDIObjectPtr): mask = wxMaskColour(self, colour) self.SetMask(mask) + def __nonzero__(self): return self.Ok() class wxBitmap(wxBitmapPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxBitmap(*_args,**_kwargs) @@ -160,6 +161,7 @@ class wxIconPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxIcon instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxIcon(wxIconPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxIcon(*_args,**_kwargs) @@ -223,6 +225,7 @@ class wxCursorPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxCursor instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxCursor(wxCursorPtr): def __init__(self,this): self.this = this @@ -357,6 +360,7 @@ class wxPenPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPen instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPen(wxPenPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxPen(*_args,**_kwargs) @@ -449,6 +453,7 @@ class wxBrushPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxBrush instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxBrush(wxBrushPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxBrush(*_args,**_kwargs) @@ -797,6 +802,7 @@ class wxDCPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() def DrawPointList(self, points, pens=None): if pens is None: @@ -1041,6 +1047,7 @@ class wxPalettePtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPalette instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPalette(wxPalettePtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxPalette(*_args,**_kwargs) diff --git a/wxPython/src/gtk/grid.cpp b/wxPython/src/gtk/grid.cpp index 1a23cddeed..646c11df05 100644 --- a/wxPython/src/gtk/grid.cpp +++ b/wxPython/src/gtk/grid.cpp @@ -4094,14 +4094,20 @@ static PyObject *_wrap_wxGridCellAttr_GetSize(PyObject *self, PyObject *args, Py PyObject * _resultobj; wxGridCellAttr * _arg0; int * _arg1; + int temp; int * _arg2; + int temp0; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","num_rows","num_cols", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGridCellAttr_GetSize",_kwnames,&_argo0,&_argo1,&_argo2)) +{ + _arg1 = &temp; +} +{ + _arg2 = &temp0; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGridCellAttr_GetSize",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4110,20 +4116,6 @@ static PyObject *_wrap_wxGridCellAttr_GetSize(PyObject *self, PyObject *args, Py return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGridCellAttr_GetSize. Expected _int_p."); - return NULL; - } - } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGridCellAttr_GetSize. Expected _int_p."); - return NULL; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxGridCellAttr_GetSize(_arg0,_arg1,_arg2); @@ -4132,6 +4124,16 @@ static PyObject *_wrap_wxGridCellAttr_GetSize(PyObject *self, PyObject *args, Py if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg1)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg2)); + _resultobj = t_output_helper(_resultobj, o); +} return _resultobj; } @@ -11022,14 +11024,20 @@ static PyObject *_wrap_wxGrid_GetDefaultCellAlignment(PyObject *self, PyObject * PyObject * _resultobj; wxGrid * _arg0; int * _arg1; + int temp; int * _arg2; + int temp0; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","horiz","vert", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_GetDefaultCellAlignment",_kwnames,&_argo0,&_argo1,&_argo2)) +{ + _arg1 = &temp; +} +{ + _arg2 = &temp0; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGrid_GetDefaultCellAlignment",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -11038,20 +11046,6 @@ static PyObject *_wrap_wxGrid_GetDefaultCellAlignment(PyObject *self, PyObject * return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_GetDefaultCellAlignment. Expected _int_p."); - return NULL; - } - } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGrid_GetDefaultCellAlignment. Expected _int_p."); - return NULL; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxGrid_GetDefaultCellAlignment(_arg0,_arg1,_arg2); @@ -11060,6 +11054,16 @@ static PyObject *_wrap_wxGrid_GetDefaultCellAlignment(PyObject *self, PyObject * if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg1)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg2)); + _resultobj = t_output_helper(_resultobj, o); +} return _resultobj; } @@ -11070,14 +11074,20 @@ static PyObject *_wrap_wxGrid_GetCellAlignment(PyObject *self, PyObject *args, P int _arg1; int _arg2; int * _arg3; + int temp; int * _arg4; + int temp0; PyObject * _argo0 = 0; - PyObject * _argo3 = 0; - PyObject * _argo4 = 0; - char *_kwnames[] = { "self","row","col","horiz","vert", NULL }; + char *_kwnames[] = { "self","row","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiOO:wxGrid_GetCellAlignment",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3,&_argo4)) +{ + _arg3 = &temp; +} +{ + _arg4 = &temp0; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxGrid_GetCellAlignment",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -11086,20 +11096,6 @@ static PyObject *_wrap_wxGrid_GetCellAlignment(PyObject *self, PyObject *args, P return NULL; } } - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxGrid_GetCellAlignment. Expected _int_p."); - return NULL; - } - } - if (_argo4) { - if (_argo4 == Py_None) { _arg4 = NULL; } - else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxGrid_GetCellAlignment. Expected _int_p."); - return NULL; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxGrid_GetCellAlignment(_arg0,_arg1,_arg2,_arg3,_arg4); @@ -11108,6 +11104,16 @@ static PyObject *_wrap_wxGrid_GetCellAlignment(PyObject *self, PyObject *args, P if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg3)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg4)); + _resultobj = t_output_helper(_resultobj, o); +} return _resultobj; } diff --git a/wxPython/src/gtk/image.py b/wxPython/src/gtk/image.py index a292abc2f5..63d6120d19 100644 --- a/wxPython/src/gtk/image.py +++ b/wxPython/src/gtk/image.py @@ -345,6 +345,7 @@ class wxImagePtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxImage(wxImagePtr): def __init__(self,*_args,**_kwargs): self.this = imagec.new_wxImage(*_args,**_kwargs) diff --git a/wxPython/src/gtk/misc2.py b/wxPython/src/gtk/misc2.py index 73f8753a64..380d9ee1ca 100644 --- a/wxPython/src/gtk/misc2.py +++ b/wxPython/src/gtk/misc2.py @@ -147,6 +147,7 @@ class wxCaretPtr : return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxCaret instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxCaret(wxCaretPtr): def __init__(self,*_args,**_kwargs): self.this = misc2c.new_wxCaret(*_args,**_kwargs) @@ -794,6 +795,7 @@ class wxJoystickPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxJoystick instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxJoystick(wxJoystickPtr): def __init__(self,*_args,**_kwargs): self.this = misc2c.new_wxJoystick(*_args,**_kwargs) @@ -820,6 +822,7 @@ class wxWavePtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxWave instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxWave(wxWavePtr): def __init__(self,*_args,**_kwargs): self.this = misc2c.new_wxWave(*_args,**_kwargs) diff --git a/wxPython/src/gtk/printfw.py b/wxPython/src/gtk/printfw.py index 899b78f48c..9ba9d8d608 100644 --- a/wxPython/src/gtk/printfw.py +++ b/wxPython/src/gtk/printfw.py @@ -157,6 +157,7 @@ class wxPrintDataPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPrintData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPrintData(wxPrintDataPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPrintData(*_args,**_kwargs) @@ -291,6 +292,7 @@ class wxPageSetupDialogDataPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPageSetupDialogData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPageSetupDialogData(wxPageSetupDialogDataPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPageSetupDialogData(*_args,**_kwargs) @@ -403,6 +405,7 @@ class wxPrintDialogDataPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPrintDialogData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPrintDialogData(wxPrintDialogDataPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPrintDialogData(*_args,**_kwargs) @@ -593,6 +596,7 @@ class wxPrintPreviewPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPrintPreview instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPrintPreview(wxPrintPreviewPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPrintPreview(*_args,**_kwargs)