]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_graphics.i
Buffered DCs now take non-const bitmaps
[wxWidgets.git] / wxPython / src / _graphics.i
index 7466b8a0c8db896968fbdba0321fc740485ed41a..4ecca9582f880d60d245f86534c77cd1643703d8 100644 (file)
 // functions in this file
 %threadWrapperOff
 
-//---------------------------------------------------------------------------
 
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
 
 %{
 #if !wxUSE_GRAPHICS_CONTEXT
 // C++ stub classes for platforms or build configurations that don't have
 // wxGraphicsContext yet.
 
+
 class wxGraphicsObject : public wxObject
 {
 public :
@@ -41,32 +43,40 @@ public :
     }
     wxGraphicsObject( const wxGraphicsObject&  ) {}
     virtual ~wxGraphicsObject() {}
+    bool IsNull() const { return false; }
     wxGraphicsRenderer* GetRenderer() const { return NULL; }
 } ;
 
+
+
 class wxGraphicsPen : public wxGraphicsObject
 {
-    //wxGraphicsPen(wxGraphicsRenderer* )  {}
+    wxGraphicsPen()  {}
     virtual ~wxGraphicsPen() {}
-    virtual void Apply( wxGraphicsContext* ) {}
-    virtual wxDouble GetWidth() { return 0; }
 } ;
+wxGraphicsPen wxNullGraphicsPen;
+
+
 
 class wxGraphicsBrush : public wxGraphicsObject
 {
 public :
-    //wxGraphicsBrush(wxGraphicsRenderer* renderer) {}
+    wxGraphicsBrush() {}
     virtual ~wxGraphicsBrush() {}
-    virtual void Apply( wxGraphicsContext* ) {}
 } ;
+wxGraphicsBrush wxNullGraphicsBrush;
+
+
 
 class wxGraphicsFont : public wxGraphicsObject
 {
 public :
-    //wxGraphicsFont(wxGraphicsRenderer* renderer) {}
+    wxGraphicsFont() {}
     virtual ~wxGraphicsFont() {}
-    virtual void Apply( wxGraphicsContext* ) {}
 } ;
+wxGraphicsFont wxNullGraphicsFont;
+
+
 
 class wxGraphicsPath : public wxGraphicsObject
 {
@@ -77,8 +87,6 @@ public :
     }
     virtual ~wxGraphicsPath() {}
 
-    virtual wxGraphicsPath *Clone() const { return NULL; }
-
     void MoveToPoint( wxDouble, wxDouble ) {}
     void MoveToPoint( const wxPoint2DDouble& ) {}
     void AddLineToPoint( wxDouble, wxDouble ) {}
@@ -108,6 +116,7 @@ public :
     bool Contains( wxDouble , wxDouble , int ) { return false; }
     bool Contains( const wxPoint2DDouble& , int ) { return false; }
 };
+wxGraphicsPath wxNullGraphicsPath;
 
 
 class wxGraphicsMatrix : public wxGraphicsObject
@@ -118,7 +127,6 @@ public :
                         "wx.GraphicsMatrix is not available on this platform.");
     }
     virtual ~wxGraphicsMatrix() {}
-    virtual wxGraphicsMatrix *Clone() const { return NULL; }
     virtual void Concat( const wxGraphicsMatrix * ) {}
     virtual void Copy( const wxGraphicsMatrix * )  {}
     virtual void Set(wxDouble , wxDouble , wxDouble , wxDouble ,
@@ -133,7 +141,7 @@ public :
     virtual void TransformDistance( wxDouble *, wxDouble * ) {}
     virtual void * GetNativeMatrix() const { return NULL; }
 };
-
+wxGraphicsMatrix wxNullGraphicsMatrix;
 
 
 class wxGraphicsContext : public wxGraphicsObject
@@ -169,18 +177,18 @@ public:
 
     wxGraphicsPath * CreatePath()  { return NULL; }
 
-    virtual wxGraphicsPen* CreatePen(const wxPen& )  { return NULL; }
+    virtual wxGraphicsPen CreatePen(const wxPen& )  { return NULL; }
 
-    virtual wxGraphicsBrush* CreateBrush(const wxBrush& ) { return NULL; }
+    virtual wxGraphicsBrush CreateBrush(const wxBrush& ) { return NULL; }
 
-    virtual wxGraphicsBrush* CreateLinearGradientBrush( wxDouble , wxDouble , wxDouble , wxDouble ,
+    virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble , wxDouble , wxDouble , wxDouble ,
                                                         const wxColour&, const wxColour&) { return NULL; }
 
-    virtual wxGraphicsBrush* CreateRadialGradientBrush( wxDouble xo, wxDouble yo,
+    virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo,
                                                         wxDouble xc, wxDouble yc, wxDouble radius,
                                                         const wxColour &oColor, const wxColour &cColor) { return NULL; }
 
-    virtual wxGraphicsFont* CreateFont( const wxFont &, const wxColour & )  { return NULL; }
+    virtual wxGraphicsFont CreateFont( const wxFont &, const wxColour & )  { return NULL; }
 
     virtual wxGraphicsMatrix* CreateMatrix( wxDouble, wxDouble, wxDouble, wxDouble,
                                             wxDouble, wxDouble)  { return NULL; }
@@ -198,13 +206,13 @@ public:
     virtual void SetTransform( const wxGraphicsMatrix* ) {}
     virtual void GetTransform( wxGraphicsMatrix* ) {}
 
-    virtual void SetPen( wxGraphicsPen* , bool ) {}
+    virtual void SetPen( const wxGraphicsPen& ) {}
     void SetPen( const wxPen& ) {}
 
-    virtual void SetBrush( wxGraphicsBrush* , bool ) {}
+    virtual void SetBrush( const wxGraphicsBrush& ) {}
     void SetBrush( const wxBrush& ) {}
 
-    virtual void SetFont( wxGraphicsFont*, bool ) {}
+    virtual void SetFont( const wxGraphicsFont& ) {}
     void SetFont( const wxFont&, const wxColour& ) {}
 
     virtual void StrokePath( const wxGraphicsPath * ) {}
@@ -254,17 +262,15 @@ public :
     virtual wxGraphicsPath * CreatePath()  { return NULL; }
 
     virtual wxGraphicsMatrix * CreateMatrix( wxDouble , wxDouble , wxDouble , wxDouble ,
-                                             wxDouble , wxDouble ) {}
-
-    virtual wxGraphicsPen* CreatePen(const wxPen& )  { return NULL; }
-    virtual wxGraphicsBrush* CreateBrush(const wxBrush&  )  { return NULL; }
-    virtual wxGraphicsBrush* CreateLinearGradientBrush(
-        wxDouble , wxDouble , wxDouble , wxDouble ,
-        const wxColour&, const wxColour&)  { return NULL; }
-    virtual wxGraphicsBrush* CreateRadialGradientBrush(
-        wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ,
-        const wxColour &, const wxColour &)  { return NULL; }
-    virtual wxGraphicsFont* CreateFont( const wxFont & , const wxColour & ) { return NULL; }
+                                             wxDouble , wxDouble ) { return NULL; }
+
+    virtual wxGraphicsPen CreatePen(const wxPen& )  { return wxNullGaphicsPen; }
+    virtual wxGraphicsBrush CreateBrush(const wxBrush&  )  { return wxNullGaphicsBrush; }
+    virtual wxGraphicsBrush CreateLinearGradientBrush(xDouble , wxDouble , wxDouble , wxDouble ,
+                                                      const wxColour&, const wxColour&)  { return wxNullGaphicsBrush; }
+    virtual wxGraphicsBrush CreateRadialGradientBrush(wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ,
+                                                      const wxColour &, const wxColour &)  { return wxNullGaphicsBrush; }
+    virtual wxGraphicsFont CreateFont( const wxFont & , const wxColour & ) { return wxNullGaphicsFont; }
 };
 
 
@@ -316,12 +322,15 @@ MustHaveApp(wxGCDC);
 typedef double wxDouble;
 
 
+//---------------------------------------------------------------------------
+
 
 class wxGraphicsObject : public wxObject
 {
 public :
     wxGraphicsObject( wxGraphicsRenderer* renderer = NULL );
     virtual ~wxGraphicsObject();
+    bool IsNull() const ;
     wxGraphicsRenderer* GetRenderer() const;
 };
 
@@ -329,28 +338,99 @@ public :
 class wxGraphicsPen : public wxGraphicsObject
 {
 public :
-    //wxGraphicsPen(wxGraphicsRenderer* renderer);
+    wxGraphicsPen();
     virtual ~wxGraphicsPen();
-    virtual void Apply( wxGraphicsContext* context);
-    virtual wxDouble GetWidth();
 };
 
 
 class wxGraphicsBrush : public wxGraphicsObject
 {
 public :
-    //wxGraphicsBrush(wxGraphicsRenderer* renderer);
+    wxGraphicsBrush();
     virtual ~wxGraphicsBrush();
-    virtual void Apply( wxGraphicsContext* context);
 };
 
 
 class wxGraphicsFont : public wxGraphicsObject
 {
 public :
-    //wxGraphicsFont(wxGraphicsRenderer* renderer);
+    wxGraphicsFont();
     virtual ~wxGraphicsFont();
-    virtual void Apply( wxGraphicsContext* context);
+};
+
+
+//---------------------------------------------------------------------------
+
+class wxGraphicsMatrix : public wxGraphicsObject
+{
+public :
+    wxGraphicsMatrix(); 
+    virtual ~wxGraphicsMatrix();
+
+    DocDeclStr(
+        virtual void , Concat( const wxGraphicsMatrix& t ),
+        "concatenates the matrix", "");
+
+    %extend  {
+        DocStr(Copy,
+               "Copy the passed in matrix to this one.", "");
+        void Copy( const wxGraphicsMatrix& t ) {
+            *self = t;
+        }
+    }
+
+
+    DocDeclStr(
+        virtual void , Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
+                           wxDouble tx=0.0, wxDouble ty=0.0),
+        "sets the matrix to the respective values", "");
+
+
+    DocDeclStr(
+        virtual void , Invert(),
+        "makes this the inverse matrix", "");
+
+
+    DocDeclStr(
+        virtual bool , IsEqual( const wxGraphicsMatrix& t) const,
+        "returns true if the elements of the transformation matrix are equal", "");
+
+
+    DocDeclStr(
+        virtual bool , IsIdentity() const,
+        "return true if this is the identity matrix", "");
+
+
+    DocDeclStr(
+        virtual void , Translate( wxDouble dx , wxDouble dy ),
+        "add the translation to this matrix", "");
+
+
+    DocDeclStr(
+        virtual void , Scale( wxDouble xScale , wxDouble yScale ),
+        "add the scale to this matrix", "");
+
+
+    DocDeclStr(
+        virtual void , Rotate( wxDouble angle ),
+        "add the rotation to this matrix (radians)", "");
+
+
+    DocDeclAStr(
+        virtual void , TransformPoint( wxDouble *INOUT, wxDouble *INOUT ) const,
+        "TransformPoint(self, x, y) --> (x, y)",
+        "applies that matrix to the point", "");
+
+
+    DocDeclAStr(
+        virtual void , TransformDistance( wxDouble *INOUT, wxDouble *INOUT ) const,
+        "TransformDistance(self, dx, dy) --> (dx, dy)",
+        "applies the matrix except for translations", "");
+
+
+    DocDeclStr(
+        virtual void * , GetNativeMatrix() const,
+        "returns the native representation", "");
 };
 
 //---------------------------------------------------------------------------
@@ -358,35 +438,37 @@ public :
 class wxGraphicsPath : public wxGraphicsObject
 {
 public :
-    //wxGraphicsPath(wxGraphicsRenderer* renderer);            *** This class is an ABC, so we can't allow instances to be created directly
+    wxGraphicsPath();
     virtual ~wxGraphicsPath();
 
-    virtual wxGraphicsPath *Clone() const = 0;
 
-    DocDeclStr(
-        virtual void , MoveToPoint( wxDouble x, wxDouble y ),
+    %nokwargs MoveToPoint;
+    DocStr(MoveToPoint,
         "Begins a new subpath at (x,y)", "");
-//    void MoveToPoint( const wxPoint2D& p);
+    virtual void  MoveToPoint( wxDouble x, wxDouble y );
+    void MoveToPoint( const wxPoint2D& p);
 
 
-    DocDeclStr(
-        virtual void , AddLineToPoint( wxDouble x, wxDouble y ),
+    %nokwargs AddLineToPoint;
+    DocStr(AddLineToPoint,
         "Adds a straight line from the current point to (x,y) ", "");
-//    void AddLineToPoint( const wxPoint2D& p);
+    virtual void AddLineToPoint( wxDouble x, wxDouble y );
+    void AddLineToPoint( const wxPoint2D& p);
 
 
-    DocDeclStr(
-        virtual void , AddCurveToPoint( wxDouble cx1, wxDouble cy1,
-                                        wxDouble cx2, wxDouble cy2,
-                                        wxDouble x, wxDouble y ),
+    %nokwargs AddCurveToPoint;
+    DocStr(AddCurveToPoint,
         "Adds a cubic Bezier curve from the current point, using two control
 points and an end point", "");
-//    void AddCurveToPoint( const wxPoint2D& c1, const wxPoint2D& c2, const wxPoint2D& e);
+    virtual void AddCurveToPoint( wxDouble cx1, wxDouble cy1,
+                                  wxDouble cx2, wxDouble cy2,
+                                  wxDouble x, wxDouble y );
+    void AddCurveToPoint( const wxPoint2D& c1, const wxPoint2D& c2, const wxPoint2D& e);
 
 
 
     DocDeclStr(
-        virtual void , AddPath( const wxGraphicsPath* path ),
+        virtual void , AddPath( const wxGraphicsPath& path ),
         "adds another path", "");
 
 
@@ -395,18 +477,18 @@ points and an end point", "");
         "closes the current sub-path", "");
 
 
-    //virtual void , GetCurrentPoint( wxDouble& x, wxDouble&y),
     DocDeclStr(
-        wxPoint2D , GetCurrentPoint(),
+        wxPoint2D , GetCurrentPoint() const,
         "Gets the last point of the current path, (0,0) if not yet set", "");
 
 
-    DocDeclStr(
-        virtual void , AddArc( wxDouble x, wxDouble y, wxDouble r,
-                               wxDouble startAngle, wxDouble endAngle, bool clockwise ),
+    %nokwargs AddArc;
+    DocStr(AddArc,
         "Adds an arc of a circle centering at (x,y) with radius (r) from
 startAngle to endAngle", "");
-//    void AddArc( const wxPoint2D& c, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise);
+    virtual void AddArc( wxDouble x, wxDouble y, wxDouble r,
+                         wxDouble startAngle, wxDouble endAngle, bool clockwise );
+    void AddArc( const wxPoint2D& c, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise);
 
 
     DocDeclStr(
@@ -447,102 +529,39 @@ to (x2,y2), also a straight line from (current) to (x1,y1)", "");
 
 
     DocDeclStr(
-        virtual void , UnGetNativePath(void *p),
+        virtual void , UnGetNativePath(void *p) const,
         "give the native path returned by GetNativePath() back (there might be some
 deallocations necessary)", "");
 
 
     DocDeclStr(
-        virtual void , Transform( wxGraphicsMatrix* matrix ),
+        virtual void , Transform( const wxGraphicsMatrix& matrix ),
         "transforms each point of this path by the matrix", "");
 
 
-    //virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) =0;
     DocDeclStr(
-        wxRect2DDouble , GetBox(),
+        wxRect2DDouble , GetBox() const,
         "gets the bounding box enclosing all points (possibly including control points)", "");
 
 
-    DocDeclStr(
-        virtual bool , Contains( wxDouble x, wxDouble y, int fillStyle = wxWINDING_RULE),
+    %nokwargs Contains;
+    DocStr(Contains,
         "", "");
-    //bool Contains( const wxPoint2DDouble& c, int fillStyle = wxWINDING_RULE);
+    virtual bool Contains( wxDouble x, wxDouble y, int fillStyle = wxODDEVEN_RULE) const;
+    bool Contains( const wxPoint2DDouble& c, int fillStyle = wxODDEVEN_RULE) const;
 
 };
 
-//---------------------------------------------------------------------------
-
-class wxGraphicsMatrix : public wxGraphicsObject
-{
-public :
-    // wxGraphicsMatrix(wxGraphicsRenderer* renderer);     *** This class is an ABC
-
-    virtual ~wxGraphicsMatrix();
-
-    virtual wxGraphicsMatrix *Clone() const;
-
-    DocDeclStr(
-        virtual void , Concat( const wxGraphicsMatrix *t ),
-        "concatenates the matrix", "");
-
-
-    DocDeclStr(
-        virtual void , Copy( const wxGraphicsMatrix *t ),
-        "copies the passed in matrix", "");
-
-
-    DocDeclStr(
-        virtual void , Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
-                           wxDouble tx=0.0, wxDouble ty=0.0),
-        "sets the matrix to the respective values", "");
-
-
-    DocDeclStr(
-        virtual void , Invert(),
-        "makes this the inverse matrix", "");
-
-
-    DocDeclStr(
-        virtual bool , IsEqual( const wxGraphicsMatrix* t) const,
-        "returns true if the elements of the transformation matrix are equal", "");
-
-
-    DocDeclStr(
-        virtual bool , IsIdentity(),
-        "return true if this is the identity matrix", "");
-
-
-    DocDeclStr(
-        virtual void , Translate( wxDouble dx , wxDouble dy ),
-        "add the translation to this matrix", "");
-
-
-    DocDeclStr(
-        virtual void , Scale( wxDouble xScale , wxDouble yScale ),
-        "add the scale to this matrix", "");
-
-
-    DocDeclStr(
-        virtual void , Rotate( wxDouble angle ),
-        "add the rotation to this matrix (radians)", "");
-
-
-    DocDeclAStr(
-        virtual void , TransformPoint( wxDouble *INOUT, wxDouble *INOUT ),
-        "TransformPoint(self, x, y) --> (x, y)",
-        "applies that matrix to the point", "");
-
-
-    DocDeclAStr(
-        virtual void , TransformDistance( wxDouble *INOUT, wxDouble *INOUT ),
-        "TransformDistance(self, dx, dy) --> (dx, dy)",
-        "applies the matrix except for translations", "");
 
+//---------------------------------------------------------------------------
 
-    DocDeclStr(
-        virtual void * , GetNativeMatrix() const,
-        "returns the native representation", "");
-};
+%immutable;
+const wxGraphicsPen     wxNullGraphicsPen;
+const wxGraphicsBrush   wxNullGraphicsBrush;
+const wxGraphicsFont    wxNullGraphicsFont;
+const wxGraphicsMatrix  wxNullGraphicsMatrix;
+const wxGraphicsPath    wxNullGraphicsPath;
+%mutable;
 
 //---------------------------------------------------------------------------
 
@@ -550,7 +569,7 @@ public :
 class wxGraphicsContext : public wxGraphicsObject
 {
 public:
-    // wxGraphicsContext()         This is also an ABC, use Create to make an instance...
+    // wxGraphicsContext()         This is an ABC, use Create to make an instance...
     virtual ~wxGraphicsContext();
 
     %newobject Create;
@@ -568,36 +587,31 @@ public:
     static wxGraphicsContext* CreateFromNativeWindow( void * window ) ;
 
 
-    %newobject CreatePath;
     DocDeclStr(
-        virtual wxGraphicsPath , CreatePath(),
+        virtual wxGraphicsPath , CreatePath(),
         "creates a path instance that corresponds to the type of graphics context, ie GDIPlus, Cairo, CoreGraphics ...", "");
 
 
-    %newobject CreatePen;
     DocDeclStr(
-        virtual wxGraphicsPen* , CreatePen(const wxPen& pen),
+        virtual wxGraphicsPen , CreatePen(const wxPen& pen),
         "", "");
 
 
-    %newobject CreateBrush;
     DocDeclStr(
-        virtual wxGraphicsBrush* , CreateBrush(const wxBrush& brush ),
+        virtual wxGraphicsBrush , CreateBrush(const wxBrush& brush ),
         "", "");
 
 
-    %newobject CreateLinearGradientBrush;
     DocDeclStr(
-        virtual wxGraphicsBrush* ,
+        virtual wxGraphicsBrush ,
         CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
                                    const wxColour& c1, const wxColour& c2),
         "sets the brush to a linear gradient, starting at (x1,y1) with color c1
 to (x2,y2) with color c2", "");
 
     
-    %newobject CreateRadialGradientBrush;
     DocDeclStr(
-        virtual wxGraphicsBrush* ,
+        virtual wxGraphicsBrush ,
         CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
                                    const wxColour &oColor, const wxColour &cColor),
         "sets the brush to a radial gradient originating at (xo,yc) with color
@@ -606,17 +620,15 @@ cColor
 ", "");
 
 
-    %newobject CreateFont;
     DocDeclStr(
-        virtual wxGraphicsFont* , CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ),
+        virtual wxGraphicsFont , CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ),
         "sets the font", "");
 
 
-    %newobject CreateMatrix;
     DocDeclStr(
-        virtual wxGraphicsMatrix* , CreateMatrix( wxDouble a=1.0, wxDouble b=0.0,
-                                                  wxDouble c=0.0, wxDouble d=1.0,
-                                                  wxDouble tx=0.0, wxDouble ty=0.0),
+        virtual wxGraphicsMatrix , CreateMatrix( wxDouble a=1.0, wxDouble b=0.0,
+                                                 wxDouble c=0.0, wxDouble d=1.0,
+                                                 wxDouble tx=0.0, wxDouble ty=0.0),
         "create a 'native' matrix corresponding to these values", "");
 
 
@@ -667,38 +679,54 @@ cColor
         "rotate (radians) the current transformation matrix CTM of the context", "");
 
 
+    DocDeclStr(
+        virtual void , ConcatTransform( const wxGraphicsMatrix& matrix ),
+        "concatenates this transform with the current transform of this context", "");
+    
+
+    DocDeclStr(
+        virtual void , SetTransform( const wxGraphicsMatrix& matrix ),
+        "sets the transform of this context", "");
+    
+
+    DocDeclStr(
+        virtual wxGraphicsMatrix , GetTransform() const,
+        "gets the matrix of this context", "");
+    
+    
+
 
     DocStr(SetPen, "sets the stroke pen", "");
     %nokwargs SetPen;
-    virtual void SetPen( wxGraphicsPen* pen , bool release = true );
+    virtual void SetPen( const wxGraphicsPen& pen );
     void SetPen( const wxPen& pen );
 
     
     DocStr(SetBrush, "sets the brush for filling", "");
     %nokwargs SetBrush;
-    virtual void SetBrush( wxGraphicsBrush* brush , bool release = true );
+    virtual void SetBrush( const wxGraphicsBrush& brush );
     void SetBrush( const wxBrush& brush );
 
     
     DocStr(SetFont, "sets the font", "");
     %nokwargs SetFont;
-    virtual void SetFont( wxGraphicsFont* font, bool release = true );
+    virtual void SetFont( const wxGraphicsFont& font );
     void SetFont( const wxFont& font, const wxColour& colour = *wxBLACK);
 
     
    
     DocDeclStr(
-        virtual void , StrokePath( const wxGraphicsPath *path ),
+        virtual void , StrokePath( const wxGraphicsPathpath ),
         "strokes along a path with the current pen", "");
 
     
     DocDeclStr(
-        virtual void , FillPath( const wxGraphicsPath *path, int fillStyle = wxWINDING_RULE ),
+        virtual void , FillPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE ),
         "fills a path with the current brush", "");
 
    
     DocDeclStr(
-        virtual void , DrawPath( const wxGraphicsPath *path, int fillStyle = wxWINDING_RULE ),
+        virtual void , DrawPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE ),
         "draws a path by first filling and then stroking", "");
 
 
@@ -797,7 +825,8 @@ cColor
 
 
     DocDeclStr(
-        virtual void , DrawLines( size_t points, const wxPoint2D *points_array, int fillStyle = wxWINDING_RULE ),
+        virtual void , DrawLines( size_t points, const wxPoint2D *points_array,
+                                  int fillStyle = wxODDEVEN_RULE ),
         "draws a polygon", "");
 
 
@@ -848,29 +877,22 @@ public :
     virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window );
 
 
-    %newobject CreatePath;
-    virtual wxGraphicsPath * CreatePath();
+    virtual wxGraphicsPath CreatePath();
 
-    %newobject CreateMatrix;
-    virtual wxGraphicsMatrix * CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, 
-        wxDouble tx=0.0, wxDouble ty=0.0);
+    virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, 
+                                           wxDouble tx=0.0, wxDouble ty=0.0);
         
-    %newobject CreatePen;
-    virtual wxGraphicsPen* CreatePen(const wxPen& pen) ;
+    virtual wxGraphicsPen CreatePen(const wxPen& pen) ;
     
-    %newobject CreateBrush;
-    virtual wxGraphicsBrush* CreateBrush(const wxBrush& brush ) ;
+    virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) ;
     
-    %newobject CreateLinearGradientBrush;
-    virtual wxGraphicsBrush* CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, 
+    virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, 
                                                         const wxColour&c1, const wxColour&c2);
 
-    %newobject CreateRadialGradientBrush;
-    virtual wxGraphicsBrush* CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
+    virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
                                                         const wxColour &oColor, const wxColour &cColor);
 
-    %newobject CreateFont;
-    virtual wxGraphicsFont* CreateFont( const wxFont &font , const wxColour &col = *wxBLACK );
+    virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK );
     
 };