]> git.saurik.com Git - wxWidgets.git/blob - include/wx/graphics.h
Reduce ambiguity of selection functions in wxPropertyGridManager, make them better...
[wxWidgets.git] / include / wx / graphics.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/graphics.h
3 // Purpose: graphics context header
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created:
7 // Copyright: (c) Stefan Csomor
8 // RCS-ID: $Id$
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GRAPHICS_H_
13 #define _WX_GRAPHICS_H_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_GRAPHICS_CONTEXT
18
19 #include "wx/geometry.h"
20 #include "wx/dynarray.h"
21
22 class WXDLLIMPEXP_FWD_CORE wxWindowDC;
23 class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
24 #if wxUSE_PRINTING_ARCHITECTURE
25 class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
26 #endif
27 class WXDLLIMPEXP_FWD_CORE wxGraphicsContext;
28 class WXDLLIMPEXP_FWD_CORE wxGraphicsPath;
29 class WXDLLIMPEXP_FWD_CORE wxGraphicsMatrix;
30 class WXDLLIMPEXP_FWD_CORE wxGraphicsFigure;
31 class WXDLLIMPEXP_FWD_CORE wxGraphicsRenderer;
32 class WXDLLIMPEXP_FWD_CORE wxGraphicsPen;
33 class WXDLLIMPEXP_FWD_CORE wxGraphicsBrush;
34 class WXDLLIMPEXP_FWD_CORE wxGraphicsFont;
35 class WXDLLIMPEXP_FWD_CORE wxGraphicsBitmap;
36
37 /*
38 * notes about the graphics context apis
39 *
40 * angles : are measured in radians, 0.0 being in direction of positiv x axis, PI/2 being
41 * in direction of positive y axis.
42 */
43
44 // Base class of all objects used for drawing in the new graphics API, the always point back to their
45 // originating rendering engine, there is no dynamic unloading of a renderer currently allowed,
46 // these references are not counted
47
48 //
49 // The data used by objects like graphics pens etc is ref counted, in order to avoid unnecessary expensive
50 // duplication. Any operation on a shared instance that results in a modified state, uncouples this
51 // instance from the other instances that were shared - using copy on write semantics
52 //
53
54 class WXDLLIMPEXP_FWD_CORE wxGraphicsObjectRefData;
55 class WXDLLIMPEXP_FWD_CORE wxGraphicsMatrixData;
56 class WXDLLIMPEXP_FWD_CORE wxGraphicsPathData;
57
58 class WXDLLIMPEXP_CORE wxGraphicsObject : public wxObject
59 {
60 public :
61 wxGraphicsObject() ;
62 wxGraphicsObject( wxGraphicsRenderer* renderer ) ;
63 virtual ~wxGraphicsObject() ;
64
65 bool IsNull() const ;
66
67 // returns the renderer that was used to create this instance, or NULL if it has not been initialized yet
68 wxGraphicsRenderer* GetRenderer() const ;
69 wxGraphicsObjectRefData* GetGraphicsData() const ;
70 protected :
71 virtual wxObjectRefData* CreateRefData() const;
72 virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const;
73
74 DECLARE_DYNAMIC_CLASS(wxGraphicsObject)
75 } ;
76
77 class WXDLLIMPEXP_CORE wxGraphicsPen : public wxGraphicsObject
78 {
79 public :
80 wxGraphicsPen() {}
81 virtual ~wxGraphicsPen() {}
82 private :
83 DECLARE_DYNAMIC_CLASS(wxGraphicsPen)
84 } ;
85
86 extern WXDLLIMPEXP_DATA_CORE(wxGraphicsPen) wxNullGraphicsPen;
87
88 class WXDLLIMPEXP_CORE wxGraphicsBrush : public wxGraphicsObject
89 {
90 public :
91 wxGraphicsBrush() {}
92 virtual ~wxGraphicsBrush() {}
93 private :
94 DECLARE_DYNAMIC_CLASS(wxGraphicsBrush)
95 } ;
96
97 extern WXDLLIMPEXP_DATA_CORE(wxGraphicsBrush) wxNullGraphicsBrush;
98
99 class WXDLLIMPEXP_CORE wxGraphicsFont : public wxGraphicsObject
100 {
101 public :
102 wxGraphicsFont() {}
103 virtual ~wxGraphicsFont() {}
104 private :
105 DECLARE_DYNAMIC_CLASS(wxGraphicsFont)
106 } ;
107
108 extern WXDLLIMPEXP_DATA_CORE(wxGraphicsFont) wxNullGraphicsFont;
109
110 class WXDLLIMPEXP_CORE wxGraphicsBitmap : public wxGraphicsObject
111 {
112 public :
113 wxGraphicsBitmap() {}
114 virtual ~wxGraphicsBitmap() {}
115 private :
116 DECLARE_DYNAMIC_CLASS(wxGraphicsBitmap)
117 } ;
118
119 extern WXDLLIMPEXP_DATA_CORE(wxGraphicsBitmap) wxNullGraphicsBitmap;
120
121 class WXDLLIMPEXP_CORE wxGraphicsMatrix : public wxGraphicsObject
122 {
123 public :
124 wxGraphicsMatrix() {}
125
126 virtual ~wxGraphicsMatrix() {}
127
128 // concatenates the matrix
129 virtual void Concat( const wxGraphicsMatrix *t );
130 void Concat( const wxGraphicsMatrix &t ) { Concat( &t ); }
131
132 // sets the matrix to the respective values
133 virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
134 wxDouble tx=0.0, wxDouble ty=0.0);
135
136 // gets the component valuess of the matrix
137 virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL,
138 wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const;
139
140 // makes this the inverse matrix
141 virtual void Invert();
142
143 // returns true if the elements of the transformation matrix are equal ?
144 virtual bool IsEqual( const wxGraphicsMatrix* t) const;
145 bool IsEqual( const wxGraphicsMatrix& t) const { return IsEqual( &t ); }
146
147 // return true if this is the identity matrix
148 virtual bool IsIdentity() const;
149
150 //
151 // transformation
152 //
153
154 // add the translation to this matrix
155 virtual void Translate( wxDouble dx , wxDouble dy );
156
157 // add the scale to this matrix
158 virtual void Scale( wxDouble xScale , wxDouble yScale );
159
160 // add the rotation to this matrix (radians)
161 virtual void Rotate( wxDouble angle );
162
163 //
164 // apply the transforms
165 //
166
167 // applies that matrix to the point
168 virtual void TransformPoint( wxDouble *x, wxDouble *y ) const;
169
170 // applies the matrix except for translations
171 virtual void TransformDistance( wxDouble *dx, wxDouble *dy ) const;
172
173 // returns the native representation
174 virtual void * GetNativeMatrix() const;
175
176 const wxGraphicsMatrixData* GetMatrixData() const
177 { return (const wxGraphicsMatrixData*) GetRefData(); }
178 wxGraphicsMatrixData* GetMatrixData()
179 { return (wxGraphicsMatrixData*) GetRefData(); }
180
181 private :
182 DECLARE_DYNAMIC_CLASS(wxGraphicsMatrix)
183 } ;
184
185 extern WXDLLIMPEXP_DATA_CORE(wxGraphicsMatrix) wxNullGraphicsMatrix;
186
187 class WXDLLIMPEXP_CORE wxGraphicsPath : public wxGraphicsObject
188 {
189 public :
190 wxGraphicsPath() {}
191 virtual ~wxGraphicsPath() {}
192
193 //
194 // These are the path primitives from which everything else can be constructed
195 //
196
197 // begins a new subpath at (x,y)
198 virtual void MoveToPoint( wxDouble x, wxDouble y );
199 void MoveToPoint( const wxPoint2DDouble& p);
200
201 // adds a straight line from the current point to (x,y)
202 virtual void AddLineToPoint( wxDouble x, wxDouble y );
203 void AddLineToPoint( const wxPoint2DDouble& p);
204
205 // adds a cubic Bezier curve from the current point, using two control points and an end point
206 virtual void AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y ) ;
207 void AddCurveToPoint( const wxPoint2DDouble& c1, const wxPoint2DDouble& c2, const wxPoint2DDouble& e);
208
209 // adds another path
210 virtual void AddPath( const wxGraphicsPath& path );
211
212 // closes the current sub-path
213 virtual void CloseSubpath() ;
214
215 // gets the last point of the current path, (0,0) if not yet set
216 virtual void GetCurrentPoint( wxDouble* x, wxDouble* y) const;
217 wxPoint2DDouble GetCurrentPoint() const;
218
219 // adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle
220 virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ) ;
221 void AddArc( const wxPoint2DDouble& c, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise);
222
223 //
224 // These are convenience functions which - if not available natively will be assembled
225 // using the primitives from above
226 //
227
228 // adds a quadratic Bezier curve from the current point, using a control point and an end point
229 virtual void AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y );
230
231 // appends a rectangle as a new closed subpath
232 virtual void AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h );
233
234 // appends an ellipsis as a new closed subpath fitting the passed rectangle
235 virtual void AddCircle( wxDouble x, wxDouble y, wxDouble r );
236
237 // appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1)
238 virtual void AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) ;
239
240 // appends an ellipse
241 virtual void AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h);
242
243 // appends a rounded rectangle
244 virtual void AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius);
245
246 // returns the native path
247 virtual void * GetNativePath() const;
248
249 // give the native path returned by GetNativePath() back (there might be some deallocations necessary)
250 virtual void UnGetNativePath(void *p)const;
251
252 // transforms each point of this path by the matrix
253 virtual void Transform( const wxGraphicsMatrix& matrix );
254
255 // gets the bounding box enclosing all points (possibly including control points)
256 virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h)const;
257 wxRect2DDouble GetBox()const;
258
259 virtual bool Contains( wxDouble x, wxDouble y, int fillStyle = wxODDEVEN_RULE)const;
260 bool Contains( const wxPoint2DDouble& c, int fillStyle = wxODDEVEN_RULE)const;
261
262 const wxGraphicsPathData* GetPathData() const
263 { return (const wxGraphicsPathData*) GetRefData(); }
264 wxGraphicsPathData* GetPathData()
265 { return (wxGraphicsPathData*) GetRefData(); }
266
267 private :
268 DECLARE_DYNAMIC_CLASS(wxGraphicsPath)
269 } ;
270
271 extern WXDLLIMPEXP_DATA_CORE(wxGraphicsPath) wxNullGraphicsPath;
272
273
274 class WXDLLIMPEXP_CORE wxGraphicsContext : public wxGraphicsObject
275 {
276 public:
277 wxGraphicsContext(wxGraphicsRenderer* renderer);
278
279 virtual ~wxGraphicsContext();
280
281 static wxGraphicsContext* Create( const wxWindowDC& dc) ;
282 static wxGraphicsContext * Create( const wxMemoryDC& dc) ;
283 #if wxUSE_PRINTING_ARCHITECTURE
284 static wxGraphicsContext * Create( const wxPrinterDC& dc) ;
285 #endif
286
287 static wxGraphicsContext* CreateFromNative( void * context ) ;
288
289 static wxGraphicsContext* CreateFromNativeWindow( void * window ) ;
290
291 static wxGraphicsContext* Create( wxWindow* window ) ;
292
293 // create a context that can be used for measuring texts only, no drawing allowed
294 static wxGraphicsContext * Create();
295
296 // begin a new document (relevant only for printing / pdf etc) if there is a progress dialog, message will be shown
297 virtual bool StartDoc( const wxString& message ) ;
298
299 // done with that document (relevant only for printing / pdf etc)
300 virtual void EndDoc();
301
302 // opens a new page (relevant only for printing / pdf etc) with the given size in points
303 // (if both are null the default page size will be used)
304 virtual void StartPage( wxDouble width = 0, wxDouble height = 0 );
305
306 // ends the current page (relevant only for printing / pdf etc)
307 virtual void EndPage();
308
309 // make sure that the current content of this context is immediately visible
310 virtual void Flush();
311
312 wxGraphicsPath CreatePath() const;
313
314 virtual wxGraphicsPen CreatePen(const wxPen& pen) const;
315
316 virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) const;
317
318 // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
319 virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
320 const wxColour&c1, const wxColour&c2) const;
321
322 // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
323 // with radius r and color cColor
324 virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
325 const wxColour &oColor, const wxColour &cColor) const;
326
327 // sets the font
328 virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) const;
329
330 // create a native bitmap representation
331 virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const;
332
333 // create a native bitmap representation
334 virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) const;
335
336 // create a 'native' matrix corresponding to these values
337 virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
338 wxDouble tx=0.0, wxDouble ty=0.0) const;
339
340 // push the current state of the context, ie the transformation matrix on a stack
341 virtual void PushState() = 0;
342
343 // pops a stored state from the stack
344 virtual void PopState() = 0;
345
346 // clips drawings to the region intersected with the current clipping region
347 virtual void Clip( const wxRegion &region ) = 0;
348
349 // clips drawings to the rect intersected with the current clipping region
350 virtual void Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
351
352 // resets the clipping to original extent
353 virtual void ResetClip() = 0 ;
354
355 // returns the native context
356 virtual void * GetNativeContext() = 0;
357
358 // returns the current logical function
359 virtual int GetLogicalFunction() const { return m_logicalFunction; }
360
361 // sets the current logical function, returns true if it supported
362 virtual bool SetLogicalFunction(int function) ;
363
364 // returns the size of the graphics context in device coordinates
365 virtual void GetSize( wxDouble* width, wxDouble* height);
366
367 // returns the resolution of the graphics context in device points per inch
368 virtual void GetDPI( wxDouble* dpiX, wxDouble* dpiY);
369
370 #if 0
371 // sets the current alpha on this context
372 virtual void SetAlpha( wxDouble alpha );
373
374 // returns the alpha on this context
375 virtual wxDouble GetAlpha() const;
376 #endif
377 //
378 // transformation : changes the current transformation matrix CTM of the context
379 //
380
381 // translate
382 virtual void Translate( wxDouble dx , wxDouble dy ) = 0;
383
384 // scale
385 virtual void Scale( wxDouble xScale , wxDouble yScale ) = 0;
386
387 // rotate (radians)
388 virtual void Rotate( wxDouble angle ) = 0;
389
390 // concatenates this transform with the current transform of this context
391 virtual void ConcatTransform( const wxGraphicsMatrix& matrix ) = 0;
392
393 // sets the transform of this context
394 virtual void SetTransform( const wxGraphicsMatrix& matrix ) = 0;
395
396 // gets the matrix of this context
397 virtual wxGraphicsMatrix GetTransform() const = 0;
398 //
399 // setting the paint
400 //
401
402 // sets the pen
403 virtual void SetPen( const wxGraphicsPen& pen );
404
405 void SetPen( const wxPen& pen );
406
407 // sets the brush for filling
408 virtual void SetBrush( const wxGraphicsBrush& brush );
409
410 void SetBrush( const wxBrush& brush );
411
412 // sets the font
413 virtual void SetFont( const wxGraphicsFont& font );
414
415 void SetFont( const wxFont& font, const wxColour& colour );
416
417
418 // strokes along a path with the current pen
419 virtual void StrokePath( const wxGraphicsPath& path ) = 0;
420
421 // fills a path with the current brush
422 virtual void FillPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE ) = 0;
423
424 // draws a path by first filling and then stroking
425 virtual void DrawPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE );
426
427 //
428 // text
429 //
430
431 virtual void DrawText( const wxString &str, wxDouble x, wxDouble y ) = 0;
432
433 virtual void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle );
434
435 virtual void DrawText( const wxString &str, wxDouble x, wxDouble y, const wxGraphicsBrush& backgroundBrush ) ;
436
437 virtual void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle, const wxGraphicsBrush& backgroundBrush );
438
439 virtual void GetTextExtent( const wxString &text, wxDouble *width, wxDouble *height,
440 wxDouble *descent, wxDouble *externalLeading ) const = 0;
441
442 virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const = 0;
443
444 //
445 // image support
446 //
447
448 #ifndef __WXGTK20__
449 virtual void DrawBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
450 #endif
451
452 virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
453
454 virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
455
456 //
457 // convenience methods
458 //
459
460 // strokes a single line
461 virtual void StrokeLine( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2);
462
463 // stroke lines connecting each of the points
464 virtual void StrokeLines( size_t n, const wxPoint2DDouble *points);
465
466 // stroke disconnected lines from begin to end points
467 virtual void StrokeLines( size_t n, const wxPoint2DDouble *beginPoints, const wxPoint2DDouble *endPoints);
468
469 // draws a polygon
470 virtual void DrawLines( size_t n, const wxPoint2DDouble *points, int fillStyle = wxODDEVEN_RULE );
471
472 // draws a polygon
473 virtual void DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h);
474
475 // draws an ellipse
476 virtual void DrawEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h);
477
478 // draws a rounded rectangle
479 virtual void DrawRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius);
480
481 // wrappers using wxPoint2DDouble TODO
482
483 // helper to determine if a 0.5 offset should be applied for the drawing operation
484 virtual bool ShouldOffset() const { return false; }
485
486 protected :
487
488 wxGraphicsPen m_pen;
489 wxGraphicsBrush m_brush;
490 wxGraphicsFont m_font;
491 int m_logicalFunction;
492
493 private :
494 DECLARE_NO_COPY_CLASS(wxGraphicsContext)
495 DECLARE_ABSTRACT_CLASS(wxGraphicsContext)
496 };
497
498 #if 0
499
500 //
501 // A graphics figure allows to cache path, pen etc creations, also will be a basis for layering/grouping elements
502 //
503
504 class WXDLLIMPEXP_CORE wxGraphicsFigure : public wxGraphicsObject
505 {
506 public :
507 wxGraphicsFigure(wxGraphicsRenderer* renderer) ;
508
509 virtual ~wxGraphicsFigure() ;
510
511 void SetPath( wxGraphicsMatrix* matrix );
512
513 void SetMatrix( wxGraphicsPath* path);
514
515 // draws this object on the context
516 virtual void Draw( wxGraphicsContext* cg );
517
518 // returns the path of this object
519 wxGraphicsPath* GetPath() { return m_path; }
520
521 // returns the transformation matrix of this object, may be null if there is no transformation necessary
522 wxGraphicsMatrix* GetMatrix() { return m_matrix; }
523
524 private :
525 wxGraphicsMatrix* m_matrix;
526 wxGraphicsPath* m_path;
527
528 DECLARE_DYNAMIC_CLASS(wxGraphicsFigure)
529 } ;
530
531 #endif
532
533 //
534 // The graphics renderer is the instance corresponding to the rendering engine used, eg there is ONE core graphics renderer
535 // instance on OSX. This instance is pointed back to by all objects created by it. Therefore you can create eg additional
536 // paths at any point from a given matrix etc.
537 //
538
539 class WXDLLIMPEXP_CORE wxGraphicsRenderer : public wxObject
540 {
541 public :
542 wxGraphicsRenderer() {}
543
544 virtual ~wxGraphicsRenderer() {}
545
546 static wxGraphicsRenderer* GetDefaultRenderer();
547
548 // Context
549
550 virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0 ;
551 virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0 ;
552 #if wxUSE_PRINTING_ARCHITECTURE
553 virtual wxGraphicsContext * CreateContext( const wxPrinterDC& dc) = 0 ;
554 #endif
555
556 virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ) = 0;
557
558 virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ) = 0;
559
560 virtual wxGraphicsContext * CreateContext( wxWindow* window ) = 0;
561
562 // create a context that can be used for measuring texts only, no drawing allowed
563 virtual wxGraphicsContext * CreateMeasuringContext() = 0;
564
565 // Path
566
567 virtual wxGraphicsPath CreatePath() = 0;
568
569 // Matrix
570
571 virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
572 wxDouble tx=0.0, wxDouble ty=0.0) = 0;
573
574 // Paints
575
576 virtual wxGraphicsPen CreatePen(const wxPen& pen) = 0 ;
577
578 virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) = 0 ;
579
580 // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
581 virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
582 const wxColour&c1, const wxColour&c2) = 0;
583
584 // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
585 // with radius r and color cColor
586 virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
587 const wxColour &oColor, const wxColour &cColor) = 0;
588
589 // sets the font
590 virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) = 0;
591
592 #ifndef __WXGTK20__
593 // create a native bitmap representation
594 virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) = 0;
595
596 // create a subimage from a native image representation
597 virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
598 #endif
599
600
601 private :
602 DECLARE_NO_COPY_CLASS(wxGraphicsRenderer)
603 DECLARE_ABSTRACT_CLASS(wxGraphicsRenderer)
604 } ;
605
606 #endif
607
608 #endif // _WX_GRAPHICS_H_