- // creates a path instance that corresponds to the type of graphics context, ie GDIPlus, cairo, CoreGraphics ...
- virtual wxGraphicsPath * CreatePath() = 0;
-
- /*
- // create a 'native' matrix corresponding to these values
- 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) = 0;
- */
-
+ // create a context that can be used for measuring texts only, no drawing allowed
+ static wxGraphicsContext * Create();
+
+ // begin a new document (relevant only for printing / pdf etc) if there is a progress dialog, message will be shown
+ virtual bool StartDoc( const wxString& message ) ;
+
+ // done with that document (relevant only for printing / pdf etc)
+ virtual void EndDoc();
+
+ // opens a new page (relevant only for printing / pdf etc) with the given size in points
+ // (if both are null the default page size will be used)
+ virtual void StartPage( wxDouble width = 0, wxDouble height = 0 );
+
+ // ends the current page (relevant only for printing / pdf etc)
+ virtual void EndPage();
+
+ // make sure that the current content of this context is immediately visible
+ virtual void Flush();
+
+ wxGraphicsPath CreatePath() const;
+
+ virtual wxGraphicsPen CreatePen(const wxPen& pen) const;
+
+ virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) const;
+
+ // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
+ virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
+ const wxColour&c1, const wxColour&c2) const;
+
+ // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
+ // with radius r and color cColor
+ virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
+ const wxColour &oColor, const wxColour &cColor) const;
+
+ // sets the font
+ virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) const;
+
+ // create a native bitmap representation
+ virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const;
+
+ // create a native bitmap representation
+ virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) const;
+
+ // create a 'native' matrix corresponding to these values
+ 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) const;
+