]> git.saurik.com Git - wxWidgets.git/commitdiff
Changes to ensure that GDI objects returned from Python methods are
authorRobin Dunn <robin@alldunn.com>
Thu, 29 Nov 2001 00:51:59 +0000 (00:51 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 29 Nov 2001 00:51:59 +0000 (00:51 +0000)
copied, not just left as references.  The old way was
counter-intuitive for Python.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

32 files changed:
wxPython/demo/wxScrolledWindow.py
wxPython/src/_extras.py
wxPython/src/calendar.i
wxPython/src/controls.i
wxPython/src/controls2.i
wxPython/src/frames.i
wxPython/src/gdi.i
wxPython/src/grid.i
wxPython/src/helpers.cpp
wxPython/src/html.i
wxPython/src/msw/calendar.cpp
wxPython/src/msw/calendar.py
wxPython/src/msw/controls.cpp
wxPython/src/msw/controls.py
wxPython/src/msw/controls2.cpp
wxPython/src/msw/controls2.py
wxPython/src/msw/frames.cpp
wxPython/src/msw/frames.py
wxPython/src/msw/gdi.cpp
wxPython/src/msw/gdi.py
wxPython/src/msw/grid.cpp
wxPython/src/msw/grid.py
wxPython/src/msw/html.cpp
wxPython/src/msw/html.py
wxPython/src/msw/stattool.cpp
wxPython/src/msw/stattool.py
wxPython/src/msw/windows.cpp
wxPython/src/msw/windows.py
wxPython/src/msw/wx.py
wxPython/src/stattool.i
wxPython/src/windows.i
wxPython/src/wx.i

index 527209813077c80b46fb2d3e7643e18b6772747e..15806b1319d11230e9e87de36223fce278198fd9 100644 (file)
@@ -89,11 +89,21 @@ class MyCanvas(wxScrolledWindow):
             if style == wxUSER_DASH:
                 pen.SetDashes([1, 2, 3, 4, 5, 6, 7, 8])
                 pen.SetColour("RED")
-
             dc.SetPen(pen)
             dc.DrawLine(300, y, 400, y)
             y = y + 10
 
+        dc.SetBrush(wxNullBrush)
+        dc.SetPen(wxPen(wxColour(0xFF, 0x20, 0xFF), 1, wxSOLID))
+        dc.DrawRectangle(450, 50, 100, 100)
+        old_pen = dc.GetPen()
+        new_pen = wxPen("BLACK", 5)
+        dc.SetPen(new_pen)
+        dc.DrawRectangle(470, 70, 60, 60)
+        dc.SetPen(old_pen)
+        dc.DrawRectangle(490, 90, 20, 20)
+
+
         self.DrawSavedLines(dc)
         dc.EndDrawing()
 
index 851e4557c521193981ff8a7814a0ce67a3ea22f8..f841b51f643927958e1ec3477c5dd6634d964b62 100644 (file)
@@ -6,7 +6,6 @@
 # Author:       Robin Dunn
 #
 # Created:      6/30/97
-# RCS-ID:       $Id$
 # Copyright:    (c) 1998 by Total Control Software
 # Licence:      wxWindows license
 #----------------------------------------------------------------------------
index aed0c2ca4fecf80ee0c085675f97227d817e9ff6..0acbdd652db6e47ebf5528df42363bf5f582a3e5 100644 (file)
@@ -98,10 +98,10 @@ public:
 
     bool IsHoliday() const;
 
-    const wxColour& GetTextColour() const;
-    const wxColour& GetBackgroundColour() const;
-    const wxColour& GetBorderColour() const;
-    const wxFont& GetFont() const;
+    wxColour GetTextColour() const;
+    wxColour GetBackgroundColour() const;
+    wxColour GetBorderColour() const;
+    wxFont GetFont() const;
     wxCalendarDateBorder GetBorder() const;
 };
 
@@ -214,18 +214,18 @@ public:
 
     // header colours are used for painting the weekdays at the top
     void SetHeaderColours(const wxColour& colFg, const wxColour& colBg);
-    const wxColour& GetHeaderColourFg() const;
-    const wxColour& GetHeaderColourBg() const;
+    wxColour GetHeaderColourFg() const;
+    wxColour GetHeaderColourBg() const;
 
     // highlight colour is used for the currently selected date
     void SetHighlightColours(const wxColour& colFg, const wxColour& colBg);
-    const wxColour& GetHighlightColourFg() const;
-    const wxColour& GetHighlightColourBg() const;
+    wxColour GetHighlightColourFg() const;
+    wxColour GetHighlightColourBg() const;
 
     // holiday colour is used for the holidays (if style & wxCAL_SHOW_HOLIDAYS)
     void SetHolidayColours(const wxColour& colFg, const wxColour& colBg);
-    const wxColour& GetHolidayColourFg() const;
-    const wxColour& GetHolidayColourBg() const;
+    wxColour GetHolidayColourFg() const;
+    wxColour GetHolidayColourBg() const;
 
     // an item without custom attributes is drawn with the default colours and
     // font and without border, setting custom attributes allows to modify this
index 5b17e9785901c4c00e22ad0d3adb9d9b398cae30..a622b6145d148d5aeeb0c2201d82c87d6b5de77f 100644 (file)
@@ -188,10 +188,10 @@ public:
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
     %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)"
 
-    wxBitmap& GetBitmapLabel();
-    wxBitmap& GetBitmapDisabled();
-    wxBitmap& GetBitmapFocus();
-    wxBitmap& GetBitmapSelected();
+    wxBitmap GetBitmapLabel();
+    wxBitmap GetBitmapDisabled();
+    wxBitmap GetBitmapFocus();
+    wxBitmap GetBitmapSelected();
     void SetBitmapDisabled(const wxBitmap& bitmap);
     void SetBitmapFocus(const wxBitmap& bitmap);
     void SetBitmapSelected(const wxBitmap& bitmap);
@@ -616,9 +616,9 @@ public:
     bool HasBackgroundColour() const;
     bool HasFont() const;
 
-    const wxColour& GetTextColour() const;
-    const wxColour& GetBackgroundColour() const;
-    const wxFont& GetFont() const;
+    wxColour GetTextColour() const;
+    wxColour GetBackgroundColour() const;
+    wxFont GetFont() const;
 
     // returns false if we have any attributes set, true otherwise
     bool IsDefault();
@@ -828,7 +828,7 @@ public:
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
     %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
 
-    const wxBitmap& GetBitmap();
+    wxBitmap GetBitmap();
     void SetBitmap(const wxBitmap& bitmap);
     void SetIcon(const wxIcon& icon);
 };
index 71723b479481f3f531e1928bc6f5482b6ca08a65..298d60550208a817597d16c0b5d9cd12f8c57e3f 100644 (file)
@@ -259,9 +259,9 @@ public:
     bool HasBackgroundColour();
     bool HasFont();
 
-    const wxColour& GetTextColour();
-    const wxColour& GetBackgroundColour();
-    const wxFont& GetFont();
+    wxColour GetTextColour();
+    wxColour GetBackgroundColour();
+    wxFont GetFont();
 };
 
 
@@ -908,9 +908,9 @@ public:
     bool HasBackgroundColour();
     bool HasFont();
 
-    const wxColour& GetTextColour();
-    const wxColour& GetBackgroundColour();
-    const wxFont& GetFont();
+    wxColour GetTextColour();
+    wxColour GetBackgroundColour();
+    wxFont GetFont();
 };
 
 
index b100fc250166bfedb704009f4bf688b8c89b2bd6..3dfe261ea73888800e4c16c4ec321945651b3325 100644 (file)
@@ -90,7 +90,7 @@ public:
     virtual bool IsIconized() const;
 
     // get the frame icon
-    const wxIcon& GetIcon() const;
+    wxIcon GetIcon() const;
 
     // set the frame icon
     virtual void SetIcon(const wxIcon& icon);
index 5d0cdaf57e6edf1247cf438ab04a4532665acf36..90b74151916cfcf1bef26e48dcf93d6166cf4173 100644 (file)
@@ -757,18 +757,18 @@ public:
     void EndDrawing();
     void EndPage();
     void FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE);
-    wxBrush&  GetBackground();
-    wxBrush&  GetBrush();
+    wxBrush  GetBackground();
+    wxBrush  GetBrush();
     long GetCharHeight();
     long GetCharWidth();
     void GetClippingBox(long *OUTPUT, long *OUTPUT,
                         long *OUTPUT, long *OUTPUT);
-    wxFont& GetFont();
+    wxFont GetFont();
     int GetLogicalFunction();
     void GetLogicalScale(double *OUTPUT, double *OUTPUT);
     int GetMapMode();
     bool GetOptimization();
-    wxPen& GetPen();
+    wxPen GetPen();
     %addmethods {
         %new wxColour* GetPixel(long x, long y) {
             wxColour* wc = new wxColour();
@@ -1116,74 +1116,6 @@ public:
 
 #endif
 
-//---------------------------------------------------------------------------
-//---------------------------------------------------------------------------
-
-
-%readonly
-%{
-#if 0
-%}
-extern wxFont *wxNORMAL_FONT;
-extern wxFont *wxSMALL_FONT;
-extern wxFont *wxITALIC_FONT;
-extern wxFont *wxSWISS_FONT;
-
-extern wxPen *wxRED_PEN;
-extern wxPen *wxCYAN_PEN;
-extern wxPen *wxGREEN_PEN;
-extern wxPen *wxBLACK_PEN;
-extern wxPen *wxWHITE_PEN;
-extern wxPen *wxTRANSPARENT_PEN;
-extern wxPen *wxBLACK_DASHED_PEN;
-extern wxPen *wxGREY_PEN;
-extern wxPen *wxMEDIUM_GREY_PEN;
-extern wxPen *wxLIGHT_GREY_PEN;
-
-extern wxBrush *wxBLUE_BRUSH;
-extern wxBrush *wxGREEN_BRUSH;
-extern wxBrush *wxWHITE_BRUSH;
-extern wxBrush *wxBLACK_BRUSH;
-extern wxBrush *wxTRANSPARENT_BRUSH;
-extern wxBrush *wxCYAN_BRUSH;
-extern wxBrush *wxRED_BRUSH;
-extern wxBrush *wxGREY_BRUSH;
-extern wxBrush *wxMEDIUM_GREY_BRUSH;
-extern wxBrush *wxLIGHT_GREY_BRUSH;
-
-extern wxColour *wxBLACK;
-extern wxColour *wxWHITE;
-extern wxColour *wxRED;
-extern wxColour *wxBLUE;
-extern wxColour *wxGREEN;
-extern wxColour *wxCYAN;
-extern wxColour *wxLIGHT_GREY;
-
-extern wxCursor *wxSTANDARD_CURSOR;
-extern wxCursor *wxHOURGLASS_CURSOR;
-extern wxCursor *wxCROSS_CURSOR;
-
-extern wxBitmap wxNullBitmap;
-extern wxIcon   wxNullIcon;
-extern wxCursor wxNullCursor;
-extern wxPen    wxNullPen;
-extern wxBrush  wxNullBrush;
-extern wxPalette wxNullPalette;
-extern wxFont   wxNullFont;
-extern wxColour wxNullColour;
-
-
-extern wxFontList*       wxTheFontList;
-extern wxPenList*        wxThePenList;
-extern wxBrushList*      wxTheBrushList;
-extern wxColourDatabase* wxTheColourDatabase;
-
-
-%readwrite
-%{
-#endif
-%}
-
 //---------------------------------------------------------------------------
 
 class wxPalette : public wxGDIObject {
@@ -1301,3 +1233,72 @@ public:
 
 //---------------------------------------------------------------------------
 
+%readonly
+%{
+#if 0
+%}
+
+extern wxFont *wxNORMAL_FONT;
+extern wxFont *wxSMALL_FONT;
+extern wxFont *wxITALIC_FONT;
+extern wxFont *wxSWISS_FONT;
+
+extern wxPen *wxRED_PEN;
+extern wxPen *wxCYAN_PEN;
+extern wxPen *wxGREEN_PEN;
+extern wxPen *wxBLACK_PEN;
+extern wxPen *wxWHITE_PEN;
+extern wxPen *wxTRANSPARENT_PEN;
+extern wxPen *wxBLACK_DASHED_PEN;
+extern wxPen *wxGREY_PEN;
+extern wxPen *wxMEDIUM_GREY_PEN;
+extern wxPen *wxLIGHT_GREY_PEN;
+
+extern wxBrush *wxBLUE_BRUSH;
+extern wxBrush *wxGREEN_BRUSH;
+extern wxBrush *wxWHITE_BRUSH;
+extern wxBrush *wxBLACK_BRUSH;
+extern wxBrush *wxTRANSPARENT_BRUSH;
+extern wxBrush *wxCYAN_BRUSH;
+extern wxBrush *wxRED_BRUSH;
+extern wxBrush *wxGREY_BRUSH;
+extern wxBrush *wxMEDIUM_GREY_BRUSH;
+extern wxBrush *wxLIGHT_GREY_BRUSH;
+
+extern wxColour *wxBLACK;
+extern wxColour *wxWHITE;
+extern wxColour *wxRED;
+extern wxColour *wxBLUE;
+extern wxColour *wxGREEN;
+extern wxColour *wxCYAN;
+extern wxColour *wxLIGHT_GREY;
+
+extern wxCursor *wxSTANDARD_CURSOR;
+extern wxCursor *wxHOURGLASS_CURSOR;
+extern wxCursor *wxCROSS_CURSOR;
+
+
+extern wxBitmap wxNullBitmap;
+extern wxIcon   wxNullIcon;
+extern wxCursor wxNullCursor;
+extern wxPen    wxNullPen;
+extern wxBrush  wxNullBrush;
+extern wxPalette wxNullPalette;
+extern wxFont   wxNullFont;
+extern wxColour wxNullColour;
+
+
+extern wxFontList*       wxTheFontList;
+extern wxPenList*        wxThePenList;
+extern wxBrushList*      wxTheBrushList;
+extern wxColourDatabase* wxTheColourDatabase;
+
+
+%readwrite
+%{
+#endif
+%}
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
index 6f03581d32591a08ecb8f9d9cf3763dab642993d..d4054d714421916e120d1ca2d3d7e6b16fe81e33 100644 (file)
@@ -904,9 +904,9 @@ public:
     bool HasEditor() const;
     bool HasReadWriteMode() const;
 
-    const wxColour& GetTextColour() const;
-    const wxColour& GetBackgroundColour() const;
-    const wxFont& GetFont() const;
+    wxColour GetTextColour() const;
+    wxColour GetBackgroundColour() const;
+    wxFont GetFont() const;
     void GetAlignment(int *OUTPUT, int *OUTPUT) const;
     wxGridCellRenderer *GetRenderer(wxGrid* grid, int row, int col) const;
     wxGridCellEditor *GetEditor(wxGrid* grid, int row, int col) const;
index 28f0621eedbacb91ccf8d38f9fd1f4c7edd819a5..7b29004df3ce850d28b21a801c75dbde8e12e383 100644 (file)
@@ -402,8 +402,10 @@ PyObject* wxPyConstructObject(void* ptr,
     }
 
     char    buff[64];               // should always be big enough...
-
     sprintf(buff, "%sPtr", className);
+
+       wxASSERT_MSG(wxPython_dict, "wxPython_dict is not set yet!!");
+
     PyObject* classobj = PyDict_GetItemString(wxPython_dict, buff);
     if (! classobj) {
         char temp[128];
index 1b4f46ef924c012262669f3ba3d064739bc23ef3..96e418cf9d42548b52a540366cdddba46c1fc92e 100644 (file)
@@ -172,9 +172,9 @@ public:
     void SetFontFixed(int x);
     int GetAlign();
     void SetAlign(int a);
-    const wxColour& GetLinkColor();
+    wxColour GetLinkColor();
     void SetLinkColor(const wxColour& clr);
-    const wxColour& GetActualColor();
+    wxColour GetActualColor();
     void SetActualColor(const wxColour& clr);
     void SetLink(const wxString& link);
     wxFont* CreateCurrentFont();
index 0dc63c5f6a8b413f498b4a87d56f49e8828d4ce1..b8f5d81d8369f2f3644915fbca233469c9a0e157 100644 (file)
@@ -585,18 +585,12 @@ static PyObject *_wrap_wxCalendarDateAttr_GetTextColour(PyObject *self, PyObject
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarDateAttr_GetTextColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarDateAttr_GetTextColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -621,18 +615,12 @@ static PyObject *_wrap_wxCalendarDateAttr_GetBackgroundColour(PyObject *self, Py
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarDateAttr_GetBackgroundColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarDateAttr_GetBackgroundColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -657,18 +645,12 @@ static PyObject *_wrap_wxCalendarDateAttr_GetBorderColour(PyObject *self, PyObje
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarDateAttr_GetBorderColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarDateAttr_GetBorderColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -693,18 +675,12 @@ static PyObject *_wrap_wxCalendarDateAttr_GetFont(PyObject *self, PyObject *args
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxFont & _result_ref = wxCalendarDateAttr_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxCalendarDateAttr_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1473,18 +1449,12 @@ static PyObject *_wrap_wxCalendarCtrl_GetHeaderColourFg(PyObject *self, PyObject
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarCtrl_GetHeaderColourFg(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarCtrl_GetHeaderColourFg(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1509,18 +1479,12 @@ static PyObject *_wrap_wxCalendarCtrl_GetHeaderColourBg(PyObject *self, PyObject
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarCtrl_GetHeaderColourBg(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarCtrl_GetHeaderColourBg(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1589,18 +1553,12 @@ static PyObject *_wrap_wxCalendarCtrl_GetHighlightColourFg(PyObject *self, PyObj
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarCtrl_GetHighlightColourFg(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarCtrl_GetHighlightColourFg(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1625,18 +1583,12 @@ static PyObject *_wrap_wxCalendarCtrl_GetHighlightColourBg(PyObject *self, PyObj
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarCtrl_GetHighlightColourBg(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarCtrl_GetHighlightColourBg(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1705,18 +1657,12 @@ static PyObject *_wrap_wxCalendarCtrl_GetHolidayColourFg(PyObject *self, PyObjec
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarCtrl_GetHolidayColourFg(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarCtrl_GetHolidayColourFg(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1741,18 +1687,12 @@ static PyObject *_wrap_wxCalendarCtrl_GetHolidayColourBg(PyObject *self, PyObjec
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxCalendarCtrl_GetHolidayColourBg(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxCalendarCtrl_GetHolidayColourBg(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index ab9fa83fb3619793def9c82123b36c22e7698362..8821a2a7a9b03587afab233a8dbb46d1df6b0f72 100644 (file)
@@ -77,19 +77,19 @@ class wxCalendarDateAttrPtr :
         return val
     def GetTextColour(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarDateAttr_GetTextColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetBackgroundColour(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarDateAttr_GetBackgroundColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetBorderColour(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarDateAttr_GetBorderColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarDateAttr_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def GetBorder(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarDateAttr_GetBorder,(self,) + _args, _kwargs)
@@ -175,33 +175,33 @@ class wxCalendarCtrlPtr(wxControlPtr):
         return val
     def GetHeaderColourFg(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_GetHeaderColourFg,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetHeaderColourBg(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_GetHeaderColourBg,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def SetHighlightColours(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_SetHighlightColours,(self,) + _args, _kwargs)
         return val
     def GetHighlightColourFg(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_GetHighlightColourFg,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetHighlightColourBg(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_GetHighlightColourBg,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def SetHolidayColours(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_SetHolidayColours,(self,) + _args, _kwargs)
         return val
     def GetHolidayColourFg(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_GetHolidayColourFg,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetHolidayColourBg(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_GetHolidayColourBg,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetAttr(self, *_args, **_kwargs):
         val = apply(calendarc.wxCalendarCtrl_GetAttr,(self,) + _args, _kwargs)
index e6fec6467d9b86daf06bce82d9cce3bca01a52d1..eb41795a0feaa259f6fbb6293064d0c123af1ff3 100644 (file)
@@ -1549,18 +1549,12 @@ static PyObject *_wrap_wxBitmapButton_GetBitmapLabel(PyObject *self, PyObject *a
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxBitmap & _result_ref = wxBitmapButton_GetBitmapLabel(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxBitmapButton_GetBitmapLabel(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1585,18 +1579,12 @@ static PyObject *_wrap_wxBitmapButton_GetBitmapDisabled(PyObject *self, PyObject
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxBitmap & _result_ref = wxBitmapButton_GetBitmapDisabled(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxBitmapButton_GetBitmapDisabled(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1621,18 +1609,12 @@ static PyObject *_wrap_wxBitmapButton_GetBitmapFocus(PyObject *self, PyObject *a
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxBitmap & _result_ref = wxBitmapButton_GetBitmapFocus(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxBitmapButton_GetBitmapFocus(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -1657,18 +1639,12 @@ static PyObject *_wrap_wxBitmapButton_GetBitmapSelected(PyObject *self, PyObject
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxBitmap & _result_ref = wxBitmapButton_GetBitmapSelected(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxBitmapButton_GetBitmapSelected(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -5876,18 +5852,12 @@ static PyObject *_wrap_wxTextAttr_GetTextColour(PyObject *self, PyObject *args,
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxTextAttr_GetTextColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxTextAttr_GetTextColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -5912,18 +5882,12 @@ static PyObject *_wrap_wxTextAttr_GetBackgroundColour(PyObject *self, PyObject *
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxTextAttr_GetBackgroundColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxTextAttr_GetBackgroundColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -5948,18 +5912,12 @@ static PyObject *_wrap_wxTextAttr_GetFont(PyObject *self, PyObject *args, PyObje
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxFont & _result_ref = wxTextAttr_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxTextAttr_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -8634,18 +8592,12 @@ static PyObject *_wrap_wxStaticBitmap_GetBitmap(PyObject *self, PyObject *args,
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxBitmap & _result_ref = wxStaticBitmap_GetBitmap(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxStaticBitmap_GetBitmap(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index 7cebb7b1b41acf257020d7865bc085e21042b305..663b480b5a6f2b632b4a57a3c27f035f934e9e4c 100644 (file)
@@ -139,19 +139,19 @@ class wxBitmapButtonPtr(wxButtonPtr):
         return val
     def GetBitmapLabel(self, *_args, **_kwargs):
         val = apply(controlsc.wxBitmapButton_GetBitmapLabel,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def GetBitmapDisabled(self, *_args, **_kwargs):
         val = apply(controlsc.wxBitmapButton_GetBitmapDisabled,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def GetBitmapFocus(self, *_args, **_kwargs):
         val = apply(controlsc.wxBitmapButton_GetBitmapFocus,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def GetBitmapSelected(self, *_args, **_kwargs):
         val = apply(controlsc.wxBitmapButton_GetBitmapSelected,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def SetBitmapDisabled(self, *_args, **_kwargs):
         val = apply(controlsc.wxBitmapButton_SetBitmapDisabled,(self,) + _args, _kwargs)
@@ -581,15 +581,15 @@ class wxTextAttrPtr :
         return val
     def GetTextColour(self, *_args, **_kwargs):
         val = apply(controlsc.wxTextAttr_GetTextColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetBackgroundColour(self, *_args, **_kwargs):
         val = apply(controlsc.wxTextAttr_GetBackgroundColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(controlsc.wxTextAttr_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def IsDefault(self, *_args, **_kwargs):
         val = apply(controlsc.wxTextAttr_IsDefault,(self,) + _args, _kwargs)
@@ -854,7 +854,7 @@ class wxStaticBitmapPtr(wxControlPtr):
         return val
     def GetBitmap(self, *_args, **_kwargs):
         val = apply(controlsc.wxStaticBitmap_GetBitmap,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def SetBitmap(self, *_args, **_kwargs):
         val = apply(controlsc.wxStaticBitmap_SetBitmap,(self,) + _args, _kwargs)
index ab7241061c765367943c8e70941f8a44954ca6a8..8d659bd35249f97d430adc25b13113f5389eb590 100644 (file)
@@ -491,18 +491,12 @@ static PyObject *_wrap_wxListItemAttr_GetTextColour(PyObject *self, PyObject *ar
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxListItemAttr_GetTextColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxListItemAttr_GetTextColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -527,18 +521,12 @@ static PyObject *_wrap_wxListItemAttr_GetBackgroundColour(PyObject *self, PyObje
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxListItemAttr_GetBackgroundColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxListItemAttr_GetBackgroundColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -563,18 +551,12 @@ static PyObject *_wrap_wxListItemAttr_GetFont(PyObject *self, PyObject *args, Py
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxFont & _result_ref = wxListItemAttr_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxListItemAttr_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -5908,18 +5890,12 @@ static PyObject *_wrap_wxTreeItemAttr_GetTextColour(PyObject *self, PyObject *ar
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxTreeItemAttr_GetTextColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxTreeItemAttr_GetTextColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -5944,18 +5920,12 @@ static PyObject *_wrap_wxTreeItemAttr_GetBackgroundColour(PyObject *self, PyObje
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxTreeItemAttr_GetBackgroundColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxTreeItemAttr_GetBackgroundColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -5980,18 +5950,12 @@ static PyObject *_wrap_wxTreeItemAttr_GetFont(PyObject *self, PyObject *args, Py
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxFont & _result_ref = wxTreeItemAttr_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxTreeItemAttr_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index fac780afe383fd3afc1e19af62b1ea78c6752b8c..5fc50375709d52051120ff0e392ba16fbfd66b21 100644 (file)
@@ -160,15 +160,15 @@ class wxListItemAttrPtr :
         return val
     def GetTextColour(self, *_args, **_kwargs):
         val = apply(controls2c.wxListItemAttr_GetTextColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetBackgroundColour(self, *_args, **_kwargs):
         val = apply(controls2c.wxListItemAttr_GetBackgroundColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(controls2c.wxListItemAttr_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def __repr__(self):
         return "<C wxListItemAttr instance at %s>" % (self.this,)
@@ -745,15 +745,15 @@ class wxTreeItemAttrPtr :
         return val
     def GetTextColour(self, *_args, **_kwargs):
         val = apply(controls2c.wxTreeItemAttr_GetTextColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetBackgroundColour(self, *_args, **_kwargs):
         val = apply(controls2c.wxTreeItemAttr_GetBackgroundColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(controls2c.wxTreeItemAttr_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def __repr__(self):
         return "<C wxTreeItemAttr instance at %s>" % (self.this,)
index c51123fdb1b6b4f6fefc6950583fa68daa902afe..9c597fbe7d9f64d2f434790d2c1662a22d8ae3ac 100644 (file)
@@ -473,18 +473,12 @@ static PyObject *_wrap_wxTopLevelWindow_GetIcon(PyObject *self, PyObject *args,
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxIcon & _result_ref = wxTopLevelWindow_GetIcon(_arg0);
-    _result = (wxIcon *) &_result_ref;
+        _result = new wxIcon (wxTopLevelWindow_GetIcon(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxIcon_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxIcon_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index f3d8317ae1561191f8798cfa53b0c577db08dd54..085ba55ddac7476635ad802fc4349d16c1687056 100644 (file)
@@ -39,7 +39,7 @@ class wxTopLevelWindowPtr(wxWindowPtr):
         return val
     def GetIcon(self, *_args, **_kwargs):
         val = apply(framesc.wxTopLevelWindow_GetIcon,(self,) + _args, _kwargs)
-        if val: val = wxIconPtr(val) 
+        if val: val = wxIconPtr(val) ; val.thisown = 1
         return val
     def SetIcon(self, *_args, **_kwargs):
         val = apply(framesc.wxTopLevelWindow_SetIcon,(self,) + _args, _kwargs)
index 46a16a1df089198e3952ab54c9cf64cb6710d12b..03a5df49da91ed1fcf50205f82b79d4200ef625b 100644 (file)
@@ -7391,18 +7391,12 @@ static PyObject *_wrap_wxDC_GetBackground(PyObject *self, PyObject *args, PyObje
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxBrush & _result_ref = wxDC_GetBackground(_arg0);
-    _result = (wxBrush *) &_result_ref;
+        _result = new wxBrush (wxDC_GetBackground(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBrush_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -7427,18 +7421,12 @@ static PyObject *_wrap_wxDC_GetBrush(PyObject *self, PyObject *args, PyObject *k
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxBrush & _result_ref = wxDC_GetBrush(_arg0);
-    _result = (wxBrush *) &_result_ref;
+        _result = new wxBrush (wxDC_GetBrush(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBrush_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -7587,18 +7575,12 @@ static PyObject *_wrap_wxDC_GetFont(PyObject *self, PyObject *args, PyObject *kw
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxFont & _result_ref = wxDC_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxDC_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -7755,18 +7737,12 @@ static PyObject *_wrap_wxDC_GetPen(PyObject *self, PyObject *args, PyObject *kwa
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxPen & _result_ref = wxDC_GetPen(_arg0);
-    _result = (wxPen *) &_result_ref;
+        _result = new wxPen (wxDC_GetPen(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxPen_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxPen_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -12768,6 +12744,16 @@ SWIGEXPORT(void) initgdic() {
         PyDict_SetItemString(d,"wxFONTENCODING_UTF8", PyInt_FromLong((long) wxFONTENCODING_UTF8));
         PyDict_SetItemString(d,"wxFONTENCODING_UNICODE", PyInt_FromLong((long) wxFONTENCODING_UNICODE));
         PyDict_SetItemString(d,"wxFONTENCODING_MAX", PyInt_FromLong((long) wxFONTENCODING_MAX));
+        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_NORMAL", PyInt_FromLong((long) wxIMAGELIST_DRAW_NORMAL));
+        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_TRANSPARENT", PyInt_FromLong((long) wxIMAGELIST_DRAW_TRANSPARENT));
+        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_SELECTED", PyInt_FromLong((long) wxIMAGELIST_DRAW_SELECTED));
+        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_FOCUSED", PyInt_FromLong((long) wxIMAGELIST_DRAW_FOCUSED));
+        PyDict_SetItemString(d,"wxIMAGE_LIST_NORMAL", PyInt_FromLong((long) wxIMAGE_LIST_NORMAL));
+        PyDict_SetItemString(d,"wxIMAGE_LIST_SMALL", PyInt_FromLong((long) wxIMAGE_LIST_SMALL));
+        PyDict_SetItemString(d,"wxIMAGE_LIST_STATE", PyInt_FromLong((long) wxIMAGE_LIST_STATE));
+        PyDict_SetItemString(d,"wxOutRegion", PyInt_FromLong((long) wxOutRegion));
+        PyDict_SetItemString(d,"wxPartRegion", PyInt_FromLong((long) wxPartRegion));
+        PyDict_SetItemString(d,"wxInRegion", PyInt_FromLong((long) wxInRegion));
         PyDict_SetItemString(d,"cvar", SWIG_globals);
         SWIG_addvarlink(SWIG_globals,"wxNORMAL_FONT",_wrap_wxNORMAL_FONT_get, _wrap_wxNORMAL_FONT_set);
         SWIG_addvarlink(SWIG_globals,"wxSMALL_FONT",_wrap_wxSMALL_FONT_get, _wrap_wxSMALL_FONT_set);
@@ -12815,16 +12801,6 @@ SWIGEXPORT(void) initgdic() {
         SWIG_addvarlink(SWIG_globals,"wxThePenList",_wrap_wxThePenList_get, _wrap_wxThePenList_set);
         SWIG_addvarlink(SWIG_globals,"wxTheBrushList",_wrap_wxTheBrushList_get, _wrap_wxTheBrushList_set);
         SWIG_addvarlink(SWIG_globals,"wxTheColourDatabase",_wrap_wxTheColourDatabase_get, _wrap_wxTheColourDatabase_set);
-        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_NORMAL", PyInt_FromLong((long) wxIMAGELIST_DRAW_NORMAL));
-        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_TRANSPARENT", PyInt_FromLong((long) wxIMAGELIST_DRAW_TRANSPARENT));
-        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_SELECTED", PyInt_FromLong((long) wxIMAGELIST_DRAW_SELECTED));
-        PyDict_SetItemString(d,"wxIMAGELIST_DRAW_FOCUSED", PyInt_FromLong((long) wxIMAGELIST_DRAW_FOCUSED));
-        PyDict_SetItemString(d,"wxIMAGE_LIST_NORMAL", PyInt_FromLong((long) wxIMAGE_LIST_NORMAL));
-        PyDict_SetItemString(d,"wxIMAGE_LIST_SMALL", PyInt_FromLong((long) wxIMAGE_LIST_SMALL));
-        PyDict_SetItemString(d,"wxIMAGE_LIST_STATE", PyInt_FromLong((long) wxIMAGE_LIST_STATE));
-        PyDict_SetItemString(d,"wxOutRegion", PyInt_FromLong((long) wxOutRegion));
-        PyDict_SetItemString(d,"wxPartRegion", PyInt_FromLong((long) wxPartRegion));
-        PyDict_SetItemString(d,"wxInRegion", PyInt_FromLong((long) wxInRegion));
 {
    int i;
    for (i = 0; _swig_mapping[i].n1; i++)
index 43ade8a86ab893880b5148f556abff9d583aa73d..169e04a51b85450643d823921ba418a186a5f0a4 100644 (file)
@@ -737,11 +737,11 @@ class wxDCPtr(wxObjectPtr):
         return val
     def GetBackground(self, *_args, **_kwargs):
         val = apply(gdic.wxDC_GetBackground,(self,) + _args, _kwargs)
-        if val: val = wxBrushPtr(val) 
+        if val: val = wxBrushPtr(val) ; val.thisown = 1
         return val
     def GetBrush(self, *_args, **_kwargs):
         val = apply(gdic.wxDC_GetBrush,(self,) + _args, _kwargs)
-        if val: val = wxBrushPtr(val) 
+        if val: val = wxBrushPtr(val) ; val.thisown = 1
         return val
     def GetCharHeight(self, *_args, **_kwargs):
         val = apply(gdic.wxDC_GetCharHeight,(self,) + _args, _kwargs)
@@ -754,7 +754,7 @@ class wxDCPtr(wxObjectPtr):
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(gdic.wxDC_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def GetLogicalFunction(self, *_args, **_kwargs):
         val = apply(gdic.wxDC_GetLogicalFunction,(self,) + _args, _kwargs)
@@ -770,7 +770,7 @@ class wxDCPtr(wxObjectPtr):
         return val
     def GetPen(self, *_args, **_kwargs):
         val = apply(gdic.wxDC_GetPen,(self,) + _args, _kwargs)
-        if val: val = wxPenPtr(val) 
+        if val: val = wxPenPtr(val) ; val.thisown = 1
         return val
     def GetPixel(self, *_args, **_kwargs):
         val = apply(gdic.wxDC_GetPixel,(self,) + _args, _kwargs)
@@ -1416,6 +1416,16 @@ wxFONTENCODING_UTF7 = gdic.wxFONTENCODING_UTF7
 wxFONTENCODING_UTF8 = gdic.wxFONTENCODING_UTF8
 wxFONTENCODING_UNICODE = gdic.wxFONTENCODING_UNICODE
 wxFONTENCODING_MAX = gdic.wxFONTENCODING_MAX
+wxIMAGELIST_DRAW_NORMAL = gdic.wxIMAGELIST_DRAW_NORMAL
+wxIMAGELIST_DRAW_TRANSPARENT = gdic.wxIMAGELIST_DRAW_TRANSPARENT
+wxIMAGELIST_DRAW_SELECTED = gdic.wxIMAGELIST_DRAW_SELECTED
+wxIMAGELIST_DRAW_FOCUSED = gdic.wxIMAGELIST_DRAW_FOCUSED
+wxIMAGE_LIST_NORMAL = gdic.wxIMAGE_LIST_NORMAL
+wxIMAGE_LIST_SMALL = gdic.wxIMAGE_LIST_SMALL
+wxIMAGE_LIST_STATE = gdic.wxIMAGE_LIST_STATE
+wxOutRegion = gdic.wxOutRegion
+wxPartRegion = gdic.wxPartRegion
+wxInRegion = gdic.wxInRegion
 cvar = gdic.cvar
 wxNORMAL_FONT = wxFontPtr(gdic.cvar.wxNORMAL_FONT)
 wxSMALL_FONT = wxFontPtr(gdic.cvar.wxSMALL_FONT)
@@ -1463,13 +1473,3 @@ wxTheFontList = wxFontListPtr(gdic.cvar.wxTheFontList)
 wxThePenList = wxPenListPtr(gdic.cvar.wxThePenList)
 wxTheBrushList = wxBrushListPtr(gdic.cvar.wxTheBrushList)
 wxTheColourDatabase = wxColourDatabasePtr(gdic.cvar.wxTheColourDatabase)
-wxIMAGELIST_DRAW_NORMAL = gdic.wxIMAGELIST_DRAW_NORMAL
-wxIMAGELIST_DRAW_TRANSPARENT = gdic.wxIMAGELIST_DRAW_TRANSPARENT
-wxIMAGELIST_DRAW_SELECTED = gdic.wxIMAGELIST_DRAW_SELECTED
-wxIMAGELIST_DRAW_FOCUSED = gdic.wxIMAGELIST_DRAW_FOCUSED
-wxIMAGE_LIST_NORMAL = gdic.wxIMAGE_LIST_NORMAL
-wxIMAGE_LIST_SMALL = gdic.wxIMAGE_LIST_SMALL
-wxIMAGE_LIST_STATE = gdic.wxIMAGE_LIST_STATE
-wxOutRegion = gdic.wxOutRegion
-wxPartRegion = gdic.wxPartRegion
-wxInRegion = gdic.wxInRegion
index 85077f99189c4a8a1cf7fdc0f8431bc6427628d5..73dfdd0d5a4eb606b1acdb3e796563361fd590df 100644 (file)
@@ -3766,18 +3766,12 @@ static PyObject *_wrap_wxGridCellAttr_GetTextColour(PyObject *self, PyObject *ar
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxGridCellAttr_GetTextColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxGridCellAttr_GetTextColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -3802,18 +3796,12 @@ static PyObject *_wrap_wxGridCellAttr_GetBackgroundColour(PyObject *self, PyObje
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxGridCellAttr_GetBackgroundColour(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxGridCellAttr_GetBackgroundColour(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -3838,18 +3826,12 @@ static PyObject *_wrap_wxGridCellAttr_GetFont(PyObject *self, PyObject *args, Py
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxFont & _result_ref = wxGridCellAttr_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxGridCellAttr_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index d8bb23db2669ee7d5c28b45aedc9764209526b6e..a2a653b730a49c4d089e5bc66e28c2269f2bb018 100644 (file)
@@ -511,15 +511,15 @@ class wxGridCellAttrPtr :
         return val
     def GetTextColour(self, *_args, **_kwargs):
         val = apply(gridc.wxGridCellAttr_GetTextColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetBackgroundColour(self, *_args, **_kwargs):
         val = apply(gridc.wxGridCellAttr_GetBackgroundColour,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(gridc.wxGridCellAttr_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def GetAlignment(self, *_args, **_kwargs):
         val = apply(gridc.wxGridCellAttr_GetAlignment,(self,) + _args, _kwargs)
index c240f45c0658c21e06f9302cc07c4bb0abd6eac4..222f3d7fb1e1f2fadb73ede3f6b4826ca397db80 100644 (file)
@@ -2015,17 +2015,11 @@ static PyObject *_wrap_wxHtmlWinParser_GetLinkColor(PyObject *self, PyObject *ar
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxHtmlWinParser_GetLinkColor(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxHtmlWinParser_GetLinkColor(_arg0));
 
     wxPy_END_ALLOW_THREADS;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -2085,17 +2079,11 @@ static PyObject *_wrap_wxHtmlWinParser_GetActualColor(PyObject *self, PyObject *
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxColour & _result_ref = wxHtmlWinParser_GetActualColor(_arg0);
-    _result = (wxColour *) &_result_ref;
+        _result = new wxColour (wxHtmlWinParser_GetActualColor(_arg0));
 
     wxPy_END_ALLOW_THREADS;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index 030ed6b2b8f6777784fdceab813d4d29859de4b5..c4103cd6e140ce3478f4a25b7f40158f3f937935 100644 (file)
@@ -230,14 +230,14 @@ class wxHtmlWinParserPtr(wxHtmlParserPtr):
         return val
     def GetLinkColor(self, *_args, **_kwargs):
         val = apply(htmlc.wxHtmlWinParser_GetLinkColor,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def SetLinkColor(self, *_args, **_kwargs):
         val = apply(htmlc.wxHtmlWinParser_SetLinkColor,(self,) + _args, _kwargs)
         return val
     def GetActualColor(self, *_args, **_kwargs):
         val = apply(htmlc.wxHtmlWinParser_GetActualColor,(self,) + _args, _kwargs)
-        if val: val = wxColourPtr(val) 
+        if val: val = wxColourPtr(val) ; val.thisown = 1
         return val
     def SetActualColor(self, *_args, **_kwargs):
         val = apply(htmlc.wxHtmlWinParser_SetActualColor,(self,) + _args, _kwargs)
index a28ddd9d2c73b3a4fee95cb5556c8e41e085c1b9..65c661c8236317618b351a44670951b10210db48 100644 (file)
@@ -879,18 +879,12 @@ static PyObject *_wrap_wxToolBarToolBase_GetBitmap1(PyObject *self, PyObject *ar
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxBitmap & _result_ref = wxToolBarToolBase_GetBitmap1(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxToolBarToolBase_GetBitmap1(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -915,18 +909,12 @@ static PyObject *_wrap_wxToolBarToolBase_GetBitmap2(PyObject *self, PyObject *ar
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxBitmap & _result_ref = wxToolBarToolBase_GetBitmap2(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxToolBarToolBase_GetBitmap2(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -951,18 +939,12 @@ static PyObject *_wrap_wxToolBarToolBase_GetBitmap(PyObject *self, PyObject *arg
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxBitmap & _result_ref = wxToolBarToolBase_GetBitmap(_arg0);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxToolBarToolBase_GetBitmap(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index 72b3d89da0e133e9a1f0c1a60308a267c1d22b63..59f27eec6bfc44fe31bf3c09fb41a09bf3ab2c5e 100644 (file)
@@ -104,15 +104,15 @@ class wxToolBarToolBasePtr(wxObjectPtr):
         return val
     def GetBitmap1(self, *_args, **_kwargs):
         val = apply(stattoolc.wxToolBarToolBase_GetBitmap1,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def GetBitmap2(self, *_args, **_kwargs):
         val = apply(stattoolc.wxToolBarToolBase_GetBitmap2,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def GetBitmap(self, *_args, **_kwargs):
         val = apply(stattoolc.wxToolBarToolBase_GetBitmap,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def GetShortHelp(self, *_args, **_kwargs):
         val = apply(stattoolc.wxToolBarToolBase_GetShortHelp,(self,) + _args, _kwargs)
index 4ac2d168ac47e2108d2174e61f703ce15af88503..b0950603dbdf5f3054a424ae85143915853f8993 100644 (file)
@@ -1888,18 +1888,12 @@ static PyObject *_wrap_wxWindow_GetFont(PyObject *self, PyObject *args, PyObject
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxFont & _result_ref = wxWindow_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxWindow_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -10057,18 +10051,12 @@ static PyObject *_wrap_wxMenuItem_GetFont(PyObject *self, PyObject *args, PyObje
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxFont & _result_ref = wxMenuItem_GetFont(_arg0);
-    _result = (wxFont *) &_result_ref;
+        _result = new wxFont (wxMenuItem_GetFont(_arg0));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
@@ -10311,18 +10299,12 @@ static PyObject *_wrap_wxMenuItem_GetBitmap(PyObject *self, PyObject *args, PyOb
     _arg1 = (bool ) tempbool1;
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        const wxBitmap & _result_ref = wxMenuItem_GetBitmap(_arg0,_arg1);
-    _result = (wxBitmap *) &_result_ref;
+        _result = new wxBitmap (wxMenuItem_GetBitmap(_arg0,_arg1));
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
 
index e874ed06edf7ab8f569094a33ca5a9edf477c082..d702a31a85b4f7613cb3767bba3c227ef41c40e0 100644 (file)
@@ -204,7 +204,7 @@ class wxWindowPtr(wxEvtHandlerPtr):
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def GetForegroundColour(self, *_args, **_kwargs):
         val = apply(windowsc.wxWindow_GetForegroundColour,(self,) + _args, _kwargs)
@@ -963,7 +963,7 @@ class wxMenuItemPtr(wxObjectPtr):
         return val
     def GetFont(self, *_args, **_kwargs):
         val = apply(windowsc.wxMenuItem_GetFont,(self,) + _args, _kwargs)
-        if val: val = wxFontPtr(val) 
+        if val: val = wxFontPtr(val) ; val.thisown = 1
         return val
     def SetTextColour(self, *_args, **_kwargs):
         val = apply(windowsc.wxMenuItem_SetTextColour,(self,) + _args, _kwargs)
@@ -987,7 +987,7 @@ class wxMenuItemPtr(wxObjectPtr):
         return val
     def GetBitmap(self, *_args, **_kwargs):
         val = apply(windowsc.wxMenuItem_GetBitmap,(self,) + _args, _kwargs)
-        if val: val = wxBitmapPtr(val) 
+        if val: val = wxBitmapPtr(val) ; val.thisown = 1
         return val
     def SetMarginWidth(self, *_args, **_kwargs):
         val = apply(windowsc.wxMenuItem_SetMarginWidth,(self,) + _args, _kwargs)
index 149b6822397d3eac924c21dc8374628131e5d1ee..365158fa2aafab5926f54269b1bfc5feccbfa0c1 100644 (file)
@@ -879,7 +879,6 @@ wxDefaultSize = wxSizePtr(wxc.cvar.wxDefaultSize)
 # Author:       Robin Dunn
 #
 # Created:      6/30/97
-# RCS-ID:       $Id$
 # Copyright:    (c) 1998 by Total Control Software
 # Licence:      wxWindows license
 #----------------------------------------------------------------------------
index 960762c2c73281fd1c0ff0061d616e236af9881e..8e36b4272b69011a20e24b4cba3c3e4e791dcbf4 100644 (file)
@@ -110,9 +110,9 @@ public:
     bool IsEnabled();
     bool IsToggled();
     bool CanBeToggled();
-    const wxBitmap& GetBitmap1();
-    const wxBitmap& GetBitmap2();
-    const wxBitmap& GetBitmap();
+    wxBitmap GetBitmap1();
+    wxBitmap GetBitmap2();
+    wxBitmap GetBitmap();
     wxString GetShortHelp();
     wxString GetLongHelp();
     bool Enable(bool enable);
index c941ed2e6d91c1cf7562d0708c5c0b7a751bc34b..a4bee153e1bfce86d33dc0d53dea04334d51d58e 100644 (file)
@@ -234,7 +234,7 @@ public:
     wxLayoutConstraints * GetConstraints();
     wxEvtHandler* GetEventHandler();
 
-    wxFont& GetFont();
+    wxFont GetFont();
     wxColour GetForegroundColour();
     wxWindow * GetGrandParent();
     %addmethods {
@@ -332,7 +332,7 @@ public:
     %name(SetClientSizeWH)void SetClientSize(int width, int height);
     void SetClientSize(const wxSize& size);
     //void SetPalette(wxPalette* palette);
-    void SetCursor(const wxCursor&cursor);
+    void SetCursor(const wxCursor& cursor);
     void SetEventHandler(wxEvtHandler* handler);
     void SetExtraStyle(long exStyle);
     void SetTitle(const wxString& title);
@@ -656,7 +656,7 @@ public:
     // wxOwnerDrawn methods
 #ifdef __WXMSW__
     void SetFont(const wxFont& font);
-    wxFont& GetFont();
+    wxFont GetFont();
     void SetTextColour(const wxColour& colText);
     wxColour GetTextColour();
     void SetBackgroundColour(const wxColour& colBack);
@@ -664,7 +664,7 @@ public:
     void SetBitmaps(const wxBitmap& bmpChecked,
                     const wxBitmap& bmpUnchecked = wxNullBitmap);
     void SetBitmap(const wxBitmap& bmpChecked);
-    const wxBitmap& GetBitmap(bool bChecked = TRUE);
+    wxBitmap GetBitmap(bool bChecked = TRUE);
     void SetMarginWidth(int nWidth);
     int GetMarginWidth();
     static int GetDefaultMarginWidth();
index 6b45c74e3f95e72c0137e885d4943d65dd21256f..b052ac0dcc73cc1c37da1cb2097c323513e16641 100644 (file)
 #include "helpers.h"
 %}
 
+//  %pragma(python) code="
+//  # This gives this module's dictionary to the C++ extension code...
+//  wxc._wxSetDictionary(vars())
+//  "
+
 //----------------------------------------------------------------------
 // This is where we include the other wrapper definition files for SWIG
 //----------------------------------------------------------------------
@@ -112,6 +117,8 @@ public:
     }
 %}
 
+
+
 //----------------------------------------------------------------------
 // this is used to cleanup after wxWindows when Python shuts down.