]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/ogl/oglbasic.i
compilation fix
[wxWidgets.git] / wxPython / contrib / ogl / oglbasic.i
index d93ef67c75f516bded990e83da820e913cd66ca2..c1f6c8301468344739409936a7f06c4a121e4f2a 100644 (file)
@@ -42,7 +42,7 @@
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
 
 
-class wxShapeRegion {
+class wxShapeRegion : public wxObject {
 public:
     wxShapeRegion();
     //~wxShapeRegion();
 public:
     wxShapeRegion();
     //~wxShapeRegion();
@@ -87,18 +87,23 @@ public:
 %}
 
 
 %}
 
 
-class wxPyShapeEvtHandler {
+class wxPyShapeEvtHandler : public wxObject {
 public:
     wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL,
                         wxPyShape *shape = NULL);
 
 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 {
     %addmethods {
-        void Destroy() { delete self; }
+        void _setOORInfo(PyObject* _self) {
+            self->SetClientObject(new wxPyClientData(_self));
+        }
     }
 
     }
 
+
     void SetShape(wxPyShape *sh);
     wxPyShape *GetShape();
     void SetPreviousHandler(wxPyShapeEvtHandler* handler);
     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...
 
 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);
 
     void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT);
     void GetBoundingBoxMin(double *OUTPUT, double *OUTPUT);
@@ -238,25 +240,17 @@ public:
 
     // void SetClientData(wxObject *client_data);
     // wxObject *GetClientData();
 
     // void SetClientData(wxObject *client_data);
     // wxObject *GetClientData();
-    %addmethods {
-        void SetClientData(PyObject* userData) {
-            wxPyUserData* data = NULL;
-            if (userData)
-                data = new wxPyUserData(userData);
-            self->SetClientData(data);
-        }
 
 
-        PyObject* GetClientData() {
-            wxPyUserData* data = (wxPyUserData*)self->GetClientData();
-            if (data) {
-                Py_INCREF(data->m_obj);
-                return data->m_obj;
-            } else {
-                Py_INCREF(Py_None);
-                return Py_None;
-            }
-        }
-    }
+    // The real client data methods are being used for OOR, so just fake it.
+    %pragma(python) addtoclass = "
+    def SetClientData(self, data):
+        self.clientData = data
+    def GetClientData(self):
+        if hasattr(self, 'clientData'):
+            return self.clientData
+        else:
+            return None
+"
 
     void Show(bool show);
     bool IsShown();
 
     void Show(bool show);
     bool IsShown();
@@ -366,6 +360,8 @@ public:
     void ClearAttachments();
     void Recentre(wxDC& dc);
     void ClearPointList(wxList& list);
     void ClearAttachments();
     void Recentre(wxDC& dc);
     void ClearPointList(wxList& list);
+    wxPen GetBackgroundPen();
+    wxBrush GetBackgroundBrush();
 
     void base_OnDelete();
     void base_OnDraw(wxDC& dc);
 
     void base_OnDelete();
     void base_OnDraw(wxDC& dc);