X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f4e928794167715f19a3021d62b7c4f77611694..d2f9bbfd438290b2f2e862dd6a20b0cef3678a44:/wxPython/contrib/ogl/_ogldefs.i diff --git a/wxPython/contrib/ogl/_ogldefs.i b/wxPython/contrib/ogl/_ogldefs.i index 0660991cd3..435225c29c 100644 --- a/wxPython/contrib/ogl/_ogldefs.i +++ b/wxPython/contrib/ogl/_ogldefs.i @@ -11,62 +11,20 @@ ///////////////////////////////////////////////////////////////////////////// -//--------------------------------------------------------------------------- - - -class wxOGLConstraint; -class wxBitmapShape; -class wxDiagram; -class wxDrawnShape; -class wxCircleShape; -class wxCompositeShape; -class wxDividedShape; -class wxDivisionShape; -class wxEllipseShape; -class wxLineShape; -class wxPolygonShape; -class wxRectangleShape; -class wxPseudoMetaFile; -class wxShape; -class wxShapeCanvas; -class wxShapeEvtHandler; -class wxTextShape; -class wxControlPoint; - -class wxPyOGLConstraint; -class wxPyBitmapShape; -class wxPyDiagram; -class wxPyDrawnShape; -class wxPyCircleShape; -class wxPyCompositeShape; -class wxPyDividedShape; -class wxPyDivisionShape; -class wxPyEllipseShape; -class wxPyLineShape; -class wxPyPolygonShape; -class wxPyRectangleShape; -class wxPyPseudoMetaFile; -class wxPyShape; -class wxPyShapeCanvas; -class wxPyShapeEvtHandler; -class wxPyTextShape; -class wxPyControlPoint; - - //--------------------------------------------------------------------------- // Typemaps just for OGL // OOR Support -%typemap(python, out) wxPyShape* { $target = wxPyMake_wxShapeEvtHandler($source); } -%typemap(python, out) wxPyShapeEvtHandler* { $target = wxPyMake_wxShapeEvtHandler($source); } -%typemap(python, out) wxPyDivisionShape* { $target = wxPyMake_wxShapeEvtHandler($source); } +%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1); } +%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1); } +%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1); } -%typemap(python, out) wxPyShapeCanvas* { $target = wxPyMake_wxObject($source); } -%typemap(python, out) wxDiagram* { $target = wxPyMake_wxObject($source); } -%typemap(python, out) wxOGLConstraint* { $target = wxPyMake_wxObject($source); } -%typemap(python, out) wxPseudoMetaFile* { $target = wxPyMake_wxObject($source); } -%typemap(python, out) wxArrowHead* { $target = wxPyMake_wxObject($source); } +%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1); } +%typemap(out) wxDiagram* { $result = wxPyMake_wxObject($1); } +%typemap(out) wxOGLConstraint* { $result = wxPyMake_wxObject($1); } +%typemap(out) wxPseudoMetaFile* { $result = wxPyMake_wxObject($1); } +%typemap(out) wxArrowHead* { $result = wxPyMake_wxObject($1); } @@ -74,58 +32,58 @@ class wxPyControlPoint; // wxOGL doesn't use a ref-counted copy of pens and brushes, so we'll // use the pen and brush lists to simulate that... -%typemap(python, in) wxPen* { +%typemap(in) wxPen* { wxPen* temp; - if ($source) { - if ($source == Py_None) { temp = NULL; } - else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxPen_p")) { - PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p."); + if ($input) { + if ($input == Py_None) { temp = NULL; } + else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxPen"))) { + PyErr_SetString(PyExc_TypeError, "Type error, expected wxPen."); return NULL; } } if (temp) - $target = wxThePenList->FindOrCreatePen(temp->GetColour(), - temp->GetWidth(), - temp->GetStyle()); + $1 = wxThePenList->FindOrCreatePen(temp->GetColour(), + temp->GetWidth(), + temp->GetStyle()); else - $target = NULL; + $1 = NULL; } -%typemap(python, in) wxBrush* { +%typemap(in) wxBrush* { wxBrush* temp; - if ($source) { - if ($source == Py_None) { temp = NULL; } - else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxBrush_p")) { - PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p."); + if ($input) { + if ($input == Py_None) { temp = NULL; } + else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxBrush"))) { + PyErr_SetString(PyExc_TypeError, "Type error, expected wxBrush."); return NULL; } } if (temp) - $target = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle()); + $1 = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle()); else - $target = NULL; + $1 = NULL; } -%typemap(python, in) wxFont* { +%typemap(in) wxFont* { wxFont* temp; - if ($source) { - if ($source == Py_None) { temp = NULL; } - else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p."); + if ($input) { + if ($input == Py_None) { temp = NULL; } + else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxFont"))) { + PyErr_SetString(PyExc_TypeError, "Type error, expected wxFont."); return NULL; } } if (temp) - $target = wxTheFontList->FindOrCreateFont(temp->GetPointSize(), - temp->GetFamily(), - temp->GetStyle(), - temp->GetWeight(), - temp->GetUnderlined(), - temp->GetFaceName(), - temp->GetEncoding()); + $1 = wxTheFontList->FindOrCreateFont(temp->GetPointSize(), + temp->GetFamily(), + temp->GetStyle(), + temp->GetWeight(), + temp->GetUnderlined(), + temp->GetFaceName(), + temp->GetEncoding()); else - $target = NULL; + $1 = NULL; }