%module oglbasic
%{
-#include "helpers.h"
+#include "wxPython.h"
#include "oglhelpers.h"
%}
//---------------------------------------------------------------------------
-class wxShapeRegion {
+class wxShapeRegion : public wxObject {
public:
wxShapeRegion();
//~wxShapeRegion();
%}
-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 wxPyOORClientData(_self));
+ }
}
+
void SetShape(wxPyShape *sh);
wxPyShape *GetShape();
void SetPreviousHandler(wxPyShapeEvtHandler* handler);
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);
%addmethods {
PyObject* GetChildren() {
wxList& list = self->GetChildren();
- return wxPy_ConvertList(&list, "wxPyShape");
+ return wxPy_ConvertShapeList(&list, "wxPyShape");
}
}
%addmethods {
PyObject* GetLines() {
wxList& list = self->GetLines();
- return wxPy_ConvertList(&list, "wxPyLineShape");
+ return wxPy_ConvertShapeList(&list, "wxPyLineShape");
}
}
int GetAttachmentMode();
void SetId(long i);
long GetId();
+
void SetPen(wxPen *pen);
void SetBrush(wxBrush *brush);
+
// 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 ClearAttachments();
void Recentre(wxDC& dc);
void ClearPointList(wxList& list);
+ wxPen GetBackgroundPen();
+ wxBrush GetBackgroundBrush();
void base_OnDelete();
void base_OnDraw(wxDC& dc);