]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/ogl/oglbasic.i
Changes needed to solve wxPython's OOR problem for the wxOGL shapes.
[wxWidgets.git] / wxPython / contrib / ogl / oglbasic.i
index 43418c3833019757fbd3056232fac78226cca77b..7e982eeb31f768da0b22557bc411c04897dd1d95 100644 (file)
@@ -42,7 +42,7 @@
 //---------------------------------------------------------------------------
 
 
-class wxShapeRegion {
+class wxShapeRegion : public wxObject {
 public:
     wxShapeRegion();
     //~wxShapeRegion();
@@ -87,18 +87,23 @@ public:
 %}
 
 
-class wxPyShapeEvtHandler {
+class wxPyShapeEvtHandler : public wxObject {
 public:
     wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL,
                         wxPyShape *shape = NULL);
 
-    void _setSelf(PyObject* self, PyObject* _class);
-    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShapeEvtHandler)"
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShapeEvtHandler)"
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
+    %addmethods { void Destroy() { delete self; } }
     %addmethods {
-        void Destroy() { delete self; }
+        void _setOORInfo(PyObject* _self) {
+            self->SetClientObject(new wxPyClientData(_self));
+        }
     }
 
+
     void SetShape(wxPyShape *sh);
     wxPyShape *GetShape();
     void SetPreviousHandler(wxPyShapeEvtHandler* handler);
@@ -147,12 +152,9 @@ class wxPyShape : public wxPyShapeEvtHandler {
 public:
     // wxPyShape(wxPyShapeCanvas *can = NULL);     abstract base class...
 
-    void _setSelf(PyObject* self, PyObject* _class);
-    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShape)"
-
-    %addmethods {
-        void Destroy() { delete self; }
-    }
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShape)"
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
     void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT);
     void GetBoundingBoxMin(double *OUTPUT, double *OUTPUT);
@@ -231,9 +233,11 @@ public:
     int GetAttachmentMode();
     void SetId(long i);
     long GetId();
+
     void SetPen(wxPen *pen);
     void SetBrush(wxBrush *brush);
 
+
     // void SetClientData(wxObject *client_data);
     // wxObject *GetClientData();
     %addmethods {
@@ -364,6 +368,8 @@ public:
     void ClearAttachments();
     void Recentre(wxDC& dc);
     void ClearPointList(wxList& list);
+    wxPen GetBackgroundPen();
+    wxBrush GetBackgroundBrush();
 
     void base_OnDelete();
     void base_OnDraw(wxDC& dc);