1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: graphics context header
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GRAPHICS_H_
13 #define _WX_GRAPHICS_H_
15 #if wxUSE_GRAPHICS_CONTEXT
17 #include "wx/geometry.h"
18 #include "wx/dynarray.h"
20 class WXDLLIMPEXP_CORE wxWindowDC
;
21 class WXDLLIMPEXP_CORE wxGraphicsContext
;
22 class WXDLLIMPEXP_CORE wxGraphicsPath
;
23 class WXDLLIMPEXP_CORE wxGraphicsMatrix
;
24 class WXDLLIMPEXP_CORE wxGraphicsFigure
;
25 class WXDLLIMPEXP_CORE wxGraphicsRenderer
;
26 class WXDLLIMPEXP_CORE wxGraphicsPen
;
27 class WXDLLIMPEXP_CORE wxGraphicsBrush
;
28 class WXDLLIMPEXP_CORE wxGraphicsFont
;
31 * notes about the graphics context apis
33 * angles : are measured in radians, 0.0 being in direction of positiv x axis, PI/2 being
34 * in direction of positive y axis.
37 // Base class of all objects used for drawing in the new graphics API, the always point back to their
38 // originating rendering engine, there is no dynamic unloading of a renderer currently allowed,
39 // these references are not counted
42 // The data used by objects like graphics pens etc is ref counted, in order to avoid unnecessary expensive
43 // duplication. Any operation on a shared instance that results in a modified state, uncouples this
44 // instance from the other instances that were shared - using copy on write semantics
47 class WXDLLIMPEXP_CORE wxGraphicsObjectRefData
: public wxObjectRefData
50 wxGraphicsObjectRefData( wxGraphicsRenderer
* renderer
);
51 wxGraphicsObjectRefData( const wxGraphicsObjectRefData
* data
);
52 wxGraphicsRenderer
* GetRenderer() const ;
53 virtual wxGraphicsObjectRefData
* Clone() const ;
56 wxGraphicsRenderer
* m_renderer
;
59 class WXDLLIMPEXP_CORE wxGraphicsObject
: public wxObject
63 wxGraphicsObject( wxGraphicsRenderer
* renderer
) ;
64 virtual ~wxGraphicsObject() ;
68 // returns the renderer that was used to create this instance, or NULL if it has not been initialized yet
69 wxGraphicsRenderer
* GetRenderer() const ;
70 wxGraphicsObjectRefData
* GetGraphicsData() const ;
72 virtual wxObjectRefData
* CreateRefData() const;
73 virtual wxObjectRefData
* CloneRefData(const wxObjectRefData
* data
) const;
75 DECLARE_DYNAMIC_CLASS(wxGraphicsObject
);
78 class WXDLLIMPEXP_CORE wxGraphicsPen
: public wxGraphicsObject
82 virtual ~wxGraphicsPen() {}
84 DECLARE_DYNAMIC_CLASS(wxGraphicsPen
)
87 extern WXDLLEXPORT_DATA(wxGraphicsPen
) wxNullGraphicsPen
;
89 class WXDLLIMPEXP_CORE wxGraphicsBrush
: public wxGraphicsObject
93 virtual ~wxGraphicsBrush() {}
95 DECLARE_DYNAMIC_CLASS(wxGraphicsBrush
)
98 extern WXDLLEXPORT_DATA(wxGraphicsBrush
) wxNullGraphicsBrush
;
100 class WXDLLIMPEXP_CORE wxGraphicsFont
: public wxGraphicsObject
104 virtual ~wxGraphicsFont() {}
106 DECLARE_DYNAMIC_CLASS(wxGraphicsFont
)
109 extern WXDLLEXPORT_DATA(wxGraphicsFont
) wxNullGraphicsFont
;
112 class WXDLLIMPEXP_CORE wxGraphicsMatrixData
: public wxGraphicsObjectRefData
115 wxGraphicsMatrixData( wxGraphicsRenderer
* renderer
) :
116 wxGraphicsObjectRefData(renderer
) {}
118 virtual ~wxGraphicsMatrixData() {}
120 // concatenates the matrix
121 virtual void Concat( const wxGraphicsMatrixData
*t
) = 0;
123 // sets the matrix to the respective values
124 virtual void Set(wxDouble a
=1.0, wxDouble b
=0.0, wxDouble c
=0.0, wxDouble d
=1.0,
125 wxDouble tx
=0.0, wxDouble ty
=0.0) = 0;
127 // makes this the inverse matrix
128 virtual void Invert() = 0;
130 // returns true if the elements of the transformation matrix are equal ?
131 virtual bool IsEqual( const wxGraphicsMatrixData
* t
) const = 0;
133 // return true if this is the identity matrix
134 virtual bool IsIdentity() const = 0;
140 // add the translation to this matrix
141 virtual void Translate( wxDouble dx
, wxDouble dy
) = 0;
143 // add the scale to this matrix
144 virtual void Scale( wxDouble xScale
, wxDouble yScale
) = 0;
146 // add the rotation to this matrix (radians)
147 virtual void Rotate( wxDouble angle
) = 0;
150 // apply the transforms
153 // applies that matrix to the point
154 virtual void TransformPoint( wxDouble
*x
, wxDouble
*y
) const = 0;
156 // applies the matrix except for translations
157 virtual void TransformDistance( wxDouble
*dx
, wxDouble
*dy
) const =0;
159 // returns the native representation
160 virtual void * GetNativeMatrix() const = 0;
163 class WXDLLIMPEXP_CORE wxGraphicsMatrix
: public wxGraphicsObject
166 wxGraphicsMatrix() {}
168 virtual ~wxGraphicsMatrix() {}
170 // concatenates the matrix
171 virtual void Concat( const wxGraphicsMatrix
*t
);
172 void Concat( const wxGraphicsMatrix
&t
) { Concat( &t
); }
174 // sets the matrix to the respective values
175 virtual void Set(wxDouble a
=1.0, wxDouble b
=0.0, wxDouble c
=0.0, wxDouble d
=1.0,
176 wxDouble tx
=0.0, wxDouble ty
=0.0);
178 // makes this the inverse matrix
179 virtual void Invert();
181 // returns true if the elements of the transformation matrix are equal ?
182 virtual bool IsEqual( const wxGraphicsMatrix
* t
) const;
183 bool IsEqual( const wxGraphicsMatrix
& t
) const { return IsEqual( &t
); }
185 // return true if this is the identity matrix
186 virtual bool IsIdentity() const;
192 // add the translation to this matrix
193 virtual void Translate( wxDouble dx
, wxDouble dy
);
195 // add the scale to this matrix
196 virtual void Scale( wxDouble xScale
, wxDouble yScale
);
198 // add the rotation to this matrix (radians)
199 virtual void Rotate( wxDouble angle
);
202 // apply the transforms
205 // applies that matrix to the point
206 virtual void TransformPoint( wxDouble
*x
, wxDouble
*y
) const;
208 // applies the matrix except for translations
209 virtual void TransformDistance( wxDouble
*dx
, wxDouble
*dy
) const;
211 // returns the native representation
212 virtual void * GetNativeMatrix() const;
214 const wxGraphicsMatrixData
* GetMatrixData() const
215 { return (const wxGraphicsMatrixData
*) GetRefData(); }
216 wxGraphicsMatrixData
* GetMatrixData()
217 { return (wxGraphicsMatrixData
*) GetRefData(); }
220 DECLARE_DYNAMIC_CLASS(wxGraphicsMatrix
)
223 extern WXDLLEXPORT_DATA(wxGraphicsMatrix
) wxNullGraphicsMatrix
;
225 class WXDLLIMPEXP_CORE wxGraphicsPathData
: public wxGraphicsObjectRefData
228 wxGraphicsPathData(wxGraphicsRenderer
* renderer
) : wxGraphicsObjectRefData(renderer
) {}
229 virtual ~wxGraphicsPathData() {}
232 // These are the path primitives from which everything else can be constructed
235 // begins a new subpath at (x,y)
236 virtual void MoveToPoint( wxDouble x
, wxDouble y
) = 0;
238 // adds a straight line from the current point to (x,y)
239 virtual void AddLineToPoint( wxDouble x
, wxDouble y
) = 0;
241 // adds a cubic Bezier curve from the current point, using two control points and an end point
242 virtual void AddCurveToPoint( wxDouble cx1
, wxDouble cy1
, wxDouble cx2
, wxDouble cy2
, wxDouble x
, wxDouble y
) = 0;
245 virtual void AddPath( const wxGraphicsPathData
* path
) =0;
247 // closes the current sub-path
248 virtual void CloseSubpath() = 0;
250 // gets the last point of the current path, (0,0) if not yet set
251 virtual void GetCurrentPoint( wxDouble
* x
, wxDouble
* y
) const = 0;
253 // adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle
254 virtual void AddArc( wxDouble x
, wxDouble y
, wxDouble r
, wxDouble startAngle
, wxDouble endAngle
, bool clockwise
) = 0;
257 // These are convenience functions which - if not available natively will be assembled
258 // using the primitives from above
261 // adds a quadratic Bezier curve from the current point, using a control point and an end point
262 virtual void AddQuadCurveToPoint( wxDouble cx
, wxDouble cy
, wxDouble x
, wxDouble y
);
264 // appends a rectangle as a new closed subpath
265 virtual void AddRectangle( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
);
267 // appends an ellipsis as a new closed subpath fitting the passed rectangle
268 virtual void AddCircle( wxDouble x
, wxDouble y
, wxDouble r
);
270 // 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)
271 virtual void AddArcToPoint( wxDouble x1
, wxDouble y1
, wxDouble x2
, wxDouble y2
, wxDouble r
) ;
273 // appends an ellipse
274 virtual void AddEllipse( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
);
276 // appends a rounded rectangle
277 virtual void AddRoundedRectangle( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
, wxDouble radius
);
279 // returns the native path
280 virtual void * GetNativePath() const = 0;
282 // give the native path returned by GetNativePath() back (there might be some deallocations necessary)
283 virtual void UnGetNativePath(void *p
) const= 0;
285 // transforms each point of this path by the matrix
286 virtual void Transform( const wxGraphicsMatrixData
* matrix
) =0;
288 // gets the bounding box enclosing all points (possibly including control points)
289 virtual void GetBox(wxDouble
*x
, wxDouble
*y
, wxDouble
*w
, wxDouble
*h
) const=0;
291 virtual bool Contains( wxDouble x
, wxDouble y
, int fillStyle
= wxODDEVEN_RULE
) const=0;
294 class WXDLLIMPEXP_CORE wxGraphicsPath
: public wxGraphicsObject
298 virtual ~wxGraphicsPath() {}
301 // These are the path primitives from which everything else can be constructed
304 // begins a new subpath at (x,y)
305 virtual void MoveToPoint( wxDouble x
, wxDouble y
);
306 void MoveToPoint( const wxPoint2DDouble
& p
);
308 // adds a straight line from the current point to (x,y)
309 virtual void AddLineToPoint( wxDouble x
, wxDouble y
);
310 void AddLineToPoint( const wxPoint2DDouble
& p
);
312 // adds a cubic Bezier curve from the current point, using two control points and an end point
313 virtual void AddCurveToPoint( wxDouble cx1
, wxDouble cy1
, wxDouble cx2
, wxDouble cy2
, wxDouble x
, wxDouble y
) ;
314 void AddCurveToPoint( const wxPoint2DDouble
& c1
, const wxPoint2DDouble
& c2
, const wxPoint2DDouble
& e
);
317 virtual void AddPath( const wxGraphicsPath
& path
);
319 // closes the current sub-path
320 virtual void CloseSubpath() ;
322 // gets the last point of the current path, (0,0) if not yet set
323 virtual void GetCurrentPoint( wxDouble
* x
, wxDouble
* y
) const;
324 wxPoint2DDouble
GetCurrentPoint() const;
326 // adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle
327 virtual void AddArc( wxDouble x
, wxDouble y
, wxDouble r
, wxDouble startAngle
, wxDouble endAngle
, bool clockwise
) ;
328 void AddArc( const wxPoint2DDouble
& c
, wxDouble r
, wxDouble startAngle
, wxDouble endAngle
, bool clockwise
);
331 // These are convenience functions which - if not available natively will be assembled
332 // using the primitives from above
335 // adds a quadratic Bezier curve from the current point, using a control point and an end point
336 virtual void AddQuadCurveToPoint( wxDouble cx
, wxDouble cy
, wxDouble x
, wxDouble y
);
338 // appends a rectangle as a new closed subpath
339 virtual void AddRectangle( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
);
341 // appends an ellipsis as a new closed subpath fitting the passed rectangle
342 virtual void AddCircle( wxDouble x
, wxDouble y
, wxDouble r
);
344 // 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)
345 virtual void AddArcToPoint( wxDouble x1
, wxDouble y1
, wxDouble x2
, wxDouble y2
, wxDouble r
) ;
347 // appends an ellipse
348 virtual void AddEllipse( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
);
350 // appends a rounded rectangle
351 virtual void AddRoundedRectangle( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
, wxDouble radius
);
353 // returns the native path
354 virtual void * GetNativePath() const;
356 // give the native path returned by GetNativePath() back (there might be some deallocations necessary)
357 virtual void UnGetNativePath(void *p
)const;
359 // transforms each point of this path by the matrix
360 virtual void Transform( const wxGraphicsMatrix
& matrix
);
362 // gets the bounding box enclosing all points (possibly including control points)
363 virtual void GetBox(wxDouble
*x
, wxDouble
*y
, wxDouble
*w
, wxDouble
*h
)const;
364 wxRect2DDouble
GetBox()const;
366 virtual bool Contains( wxDouble x
, wxDouble y
, int fillStyle
= wxODDEVEN_RULE
)const;
367 bool Contains( const wxPoint2DDouble
& c
, int fillStyle
= wxODDEVEN_RULE
)const;
369 const wxGraphicsPathData
* GetPathData() const
370 { return (const wxGraphicsPathData
*) GetRefData(); }
371 wxGraphicsPathData
* GetPathData()
372 { return (wxGraphicsPathData
*) GetRefData(); }
375 DECLARE_DYNAMIC_CLASS(wxGraphicsPath
)
378 extern WXDLLEXPORT_DATA(wxGraphicsPath
) wxNullGraphicsPath
;
381 class WXDLLIMPEXP_CORE wxGraphicsContext
: public wxGraphicsObject
384 wxGraphicsContext(wxGraphicsRenderer
* renderer
);
386 virtual ~wxGraphicsContext();
388 static wxGraphicsContext
* Create( const wxWindowDC
& dc
) ;
390 static wxGraphicsContext
* CreateFromNative( void * context
) ;
392 static wxGraphicsContext
* CreateFromNativeWindow( void * window
) ;
394 static wxGraphicsContext
* Create( wxWindow
* window
) ;
396 wxGraphicsPath
CreatePath() const;
398 virtual wxGraphicsPen
CreatePen(const wxPen
& pen
) const;
400 virtual wxGraphicsBrush
CreateBrush(const wxBrush
& brush
) const;
402 // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
403 virtual wxGraphicsBrush
CreateLinearGradientBrush( wxDouble x1
, wxDouble y1
, wxDouble x2
, wxDouble y2
,
404 const wxColour
&c1
, const wxColour
&c2
) const;
406 // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
407 // with radius r and color cColor
408 virtual wxGraphicsBrush
CreateRadialGradientBrush( wxDouble xo
, wxDouble yo
, wxDouble xc
, wxDouble yc
, wxDouble radius
,
409 const wxColour
&oColor
, const wxColour
&cColor
) const;
412 virtual wxGraphicsFont
CreateFont( const wxFont
&font
, const wxColour
&col
= *wxBLACK
) const;
414 // create a 'native' matrix corresponding to these values
415 virtual wxGraphicsMatrix
CreateMatrix( wxDouble a
=1.0, wxDouble b
=0.0, wxDouble c
=0.0, wxDouble d
=1.0,
416 wxDouble tx
=0.0, wxDouble ty
=0.0) const;
418 // push the current state of the context, ie the transformation matrix on a stack
419 virtual void PushState() = 0;
421 // pops a stored state from the stack
422 virtual void PopState() = 0;
424 // clips drawings to the region, combined to current clipping region
425 virtual void Clip( const wxRegion
®ion
) = 0;
427 // clips drawings to the rect
428 virtual void Clip( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
) = 0;
430 // resets the clipping to original extent
431 virtual void ResetClip() = 0 ;
433 // returns the native context
434 virtual void * GetNativeContext() = 0;
437 // transformation : changes the current transformation matrix CTM of the context
441 virtual void Translate( wxDouble dx
, wxDouble dy
) = 0;
444 virtual void Scale( wxDouble xScale
, wxDouble yScale
) = 0;
447 virtual void Rotate( wxDouble angle
) = 0;
449 // concatenates this transform with the current transform of this context
450 virtual void ConcatTransform( const wxGraphicsMatrix
& matrix
) = 0;
452 // sets the transform of this context
453 virtual void SetTransform( const wxGraphicsMatrix
& matrix
) = 0;
455 // gets the matrix of this context
456 virtual wxGraphicsMatrix
GetTransform() const = 0;
462 virtual void SetPen( const wxGraphicsPen
& pen
);
464 void SetPen( const wxPen
& pen
);
466 // sets the brush for filling
467 virtual void SetBrush( const wxGraphicsBrush
& brush
);
469 void SetBrush( const wxBrush
& brush
);
472 virtual void SetFont( const wxGraphicsFont
& font
);
474 void SetFont( const wxFont
& font
, const wxColour
& colour
);
477 // strokes along a path with the current pen
478 virtual void StrokePath( const wxGraphicsPath
& path
) = 0;
480 // fills a path with the current brush
481 virtual void FillPath( const wxGraphicsPath
& path
, int fillStyle
= wxODDEVEN_RULE
) = 0;
483 // draws a path by first filling and then stroking
484 virtual void DrawPath( const wxGraphicsPath
& path
, int fillStyle
= wxODDEVEN_RULE
);
490 virtual void DrawText( const wxString
&str
, wxDouble x
, wxDouble y
) = 0;
492 virtual void DrawText( const wxString
&str
, wxDouble x
, wxDouble y
, wxDouble angle
);
494 virtual void GetTextExtent( const wxString
&text
, wxDouble
*width
, wxDouble
*height
,
495 wxDouble
*descent
, wxDouble
*externalLeading
) const = 0;
497 virtual void GetPartialTextExtents(const wxString
& text
, wxArrayDouble
& widths
) const = 0;
503 virtual void DrawBitmap( const wxBitmap
&bmp
, wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
) = 0;
505 virtual void DrawIcon( const wxIcon
&icon
, wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
) = 0;
508 // convenience methods
511 // strokes a single line
512 virtual void StrokeLine( wxDouble x1
, wxDouble y1
, wxDouble x2
, wxDouble y2
);
514 // stroke lines connecting each of the points
515 virtual void StrokeLines( size_t n
, const wxPoint2DDouble
*points
);
517 // stroke disconnected lines from begin to end points
518 virtual void StrokeLines( size_t n
, const wxPoint2DDouble
*beginPoints
, const wxPoint2DDouble
*endPoints
);
521 virtual void DrawLines( size_t n
, const wxPoint2DDouble
*points
, int fillStyle
= wxODDEVEN_RULE
);
524 virtual void DrawRectangle( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
);
527 virtual void DrawEllipse( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
);
529 // draws a rounded rectangle
530 virtual void DrawRoundedRectangle( wxDouble x
, wxDouble y
, wxDouble w
, wxDouble h
, wxDouble radius
);
532 // wrappers using wxPoint2DDouble TODO
534 // helper to determine if a 0.5 offset should be applied for the drawing operation
535 virtual bool ShouldOffset() const { return false; }
540 wxGraphicsBrush m_brush
;
541 wxGraphicsFont m_font
;
544 DECLARE_NO_COPY_CLASS(wxGraphicsContext
)
545 DECLARE_ABSTRACT_CLASS(wxGraphicsContext
)
551 // A graphics figure allows to cache path, pen etc creations, also will be a basis for layering/grouping elements
554 class WXDLLIMPEXP_CORE wxGraphicsFigure
: public wxGraphicsObject
557 wxGraphicsFigure(wxGraphicsRenderer
* renderer
) ;
559 virtual ~wxGraphicsFigure() ;
561 void SetPath( wxGraphicsMatrix
* matrix
);
563 void SetMatrix( wxGraphicsPath
* path
);
565 // draws this object on the context
566 virtual void Draw( wxGraphicsContext
* cg
);
568 // returns the path of this object
569 wxGraphicsPath
* GetPath() { return m_path
; }
571 // returns the transformation matrix of this object, may be null if there is no transformation necessary
572 wxGraphicsMatrix
* GetMatrix() { return m_matrix
; }
575 wxGraphicsMatrix
* m_matrix
;
576 wxGraphicsPath
* m_path
;
578 DECLARE_DYNAMIC_CLASS(wxGraphicsFigure
)
584 // The graphics renderer is the instance corresponding to the rendering engine used, eg there is ONE core graphics renderer
585 // instance on OSX. This instance is pointed back to by all objects created by it. Therefore you can create eg additional
586 // paths at any point from a given matrix etc.
589 class WXDLLIMPEXP_CORE wxGraphicsRenderer
: public wxObject
592 wxGraphicsRenderer() {}
594 virtual ~wxGraphicsRenderer() {}
596 static wxGraphicsRenderer
* GetDefaultRenderer();
600 virtual wxGraphicsContext
* CreateContext( const wxWindowDC
& dc
) = 0 ;
602 virtual wxGraphicsContext
* CreateContextFromNativeContext( void * context
) = 0;
604 virtual wxGraphicsContext
* CreateContextFromNativeWindow( void * window
) = 0;
606 virtual wxGraphicsContext
* CreateContext( wxWindow
* window
) = 0;
610 virtual wxGraphicsPath
CreatePath() = 0;
614 virtual wxGraphicsMatrix
CreateMatrix( wxDouble a
=1.0, wxDouble b
=0.0, wxDouble c
=0.0, wxDouble d
=1.0,
615 wxDouble tx
=0.0, wxDouble ty
=0.0) = 0;
619 virtual wxGraphicsPen
CreatePen(const wxPen
& pen
) = 0 ;
621 virtual wxGraphicsBrush
CreateBrush(const wxBrush
& brush
) = 0 ;
623 // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
624 virtual wxGraphicsBrush
CreateLinearGradientBrush( wxDouble x1
, wxDouble y1
, wxDouble x2
, wxDouble y2
,
625 const wxColour
&c1
, const wxColour
&c2
) = 0;
627 // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
628 // with radius r and color cColor
629 virtual wxGraphicsBrush
CreateRadialGradientBrush( wxDouble xo
, wxDouble yo
, wxDouble xc
, wxDouble yc
, wxDouble radius
,
630 const wxColour
&oColor
, const wxColour
&cColor
) = 0;
633 virtual wxGraphicsFont
CreateFont( const wxFont
&font
, const wxColour
&col
= *wxBLACK
) = 0;
636 DECLARE_NO_COPY_CLASS(wxGraphicsRenderer
)
637 DECLARE_ABSTRACT_CLASS(wxGraphicsRenderer
)
642 #endif // _WX_GRAPHICS_H_