]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/ogl/oglshapes2.i
fix text scrolling in GTK2 (patch 703988)
[wxWidgets.git] / wxPython / contrib / ogl / oglshapes2.i
index a79ebca598c4a1957a1aa858454f275b1a9e1074..108a423acde9c5d208223ac86a41f200745a0b8b 100644 (file)
@@ -14,7 +14,7 @@
 %module oglshapes2
 
 %{
 %module oglshapes2
 
 %{
-#include "export.h"
+#include "wxPython.h"
 #include "oglhelpers.h"
 %}
 
 #include "oglhelpers.h"
 %}
 
 %pragma(python) code = "import wx"
 
 //---------------------------------------------------------------------------
 %pragma(python) code = "import wx"
 
 //---------------------------------------------------------------------------
+
+%{
+    // Put some wx default wxChar* values into wxStrings.
+    static const wxString wxPyEmptyString(wxT(""));
+%}
+
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
+
 %{
     WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
 %}
 %{
     WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
 %}
@@ -47,8 +54,9 @@ class wxPyEllipseShape : public wxPyShape {
 public:
     wxPyEllipseShape(double width = 0.0, double height = 0.0);
 
 public:
     wxPyEllipseShape(double width = 0.0, double height = 0.0);
 
-    void _setSelf(PyObject* self, PyObject* _class);
-    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyEllipseShape)"
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyEllipseShape)"
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
     void base_OnDraw(wxDC& dc);
     void base_OnDrawContents(wxDC& dc);
 
     void base_OnDraw(wxDC& dc);
     void base_OnDrawContents(wxDC& dc);
@@ -90,8 +98,9 @@ class wxPyCircleShape : public wxPyEllipseShape {
 public:
     wxPyCircleShape(double width = 0.0);
 
 public:
     wxPyCircleShape(double width = 0.0);
 
-    void _setSelf(PyObject* self, PyObject* _class);
-    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyCircleShape)"
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyCircleShape)"
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
     void base_OnDraw(wxDC& dc);
     void base_OnDrawContents(wxDC& dc);
 
     void base_OnDraw(wxDC& dc);
     void base_OnDrawContents(wxDC& dc);
@@ -125,13 +134,13 @@ public:
 };
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 };
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
-class wxArrowHead {
+class wxArrowHead : public wxObject {
 public:
     wxArrowHead(int type = 0,
                 int end = 0,
                 double size = 0.0,
                 double dist = 0.0,
 public:
     wxArrowHead(int type = 0,
                 int end = 0,
                 double size = 0.0,
                 double dist = 0.0,
-                const char * name = "",
+                const wxString& name = wxPyEmptyString,
                 wxPseudoMetaFile *mf = NULL,
                 long arrowId = -1);
     ~wxArrowHead();
                 wxPseudoMetaFile *mf = NULL,
                 long arrowId = -1);
     ~wxArrowHead();
@@ -162,12 +171,13 @@ class wxPyLineShape : public wxPyShape {
 public:
     wxPyLineShape();
 
 public:
     wxPyLineShape();
 
-    void _setSelf(PyObject* self, PyObject* _class);
-    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyLineShape)"
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyLineShape)"
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
     void AddArrow(int type, int end = ARROW_POSITION_END,
                   double arrowSize = 10.0, double xOffset = 0.0,
 
     void AddArrow(int type, int end = ARROW_POSITION_END,
                   double arrowSize = 10.0, double xOffset = 0.0,
-                  char* name = "", wxPseudoMetaFile *mf = NULL,
+                  const wxString& name = wxPyEmptyString, wxPseudoMetaFile *mf = NULL,
                   long arrowId = -1);
 
     //void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
                   long arrowId = -1);
 
     //void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
@@ -199,7 +209,7 @@ public:
     void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
     wxPyShape * GetFrom();
     void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
     void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
     wxPyShape * GetFrom();
     void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
-    wxPoint * GetNextControlPoint(wxPyShape *shape);
+    wxRealPoint * GetNextControlPoint(wxPyShape *shape);
     wxPyShape * GetTo();
     void Initialise();
     void InsertLineControlPoint(wxDC* dc);
     wxPyShape * GetTo();
     void Initialise();
     void InsertLineControlPoint(wxDC* dc);
@@ -207,8 +217,13 @@ public:
     bool IsSpline();
     void MakeLineControlPoints(int n);
 
     bool IsSpline();
     void MakeLineControlPoints(int n);
 
-    // TODO:
     //   inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
     //   inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
+    %addmethods {
+        PyObject* GetLineControlPoints() {
+            wxList* list = self->GetLineControlPoints();
+            return wxPy_ConvertShapeList(list, "wxPyControlPoint");
+        }
+    }
 
     void SetAttachmentFrom(int fromAttach);
     void SetAttachments(int fromAttach, int toAttach);
 
     void SetAttachmentFrom(int fromAttach);
     void SetAttachments(int fromAttach, int toAttach);
@@ -262,8 +277,9 @@ class wxPyPolygonShape : public wxPyShape {
 public:
     wxPyPolygonShape();
 
 public:
     wxPyPolygonShape();
 
-    void _setSelf(PyObject* self, PyObject* _class);
-    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyPolygonShape)"
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyPolygonShape)"
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 
     // void Create(wxList* points);
 
 
     // void Create(wxList* points);
@@ -333,8 +349,9 @@ class wxPyTextShape : public wxPyRectangleShape {
 public:
     wxPyTextShape(double width = 0.0, double height = 0.0);
 
 public:
     wxPyTextShape(double width = 0.0, double height = 0.0);
 
-    void _setSelf(PyObject* self, PyObject* _class);
-    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyTextShape)"
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyTextShape)"
+    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
 
 
     void base_OnDelete();
 
 
     void base_OnDelete();