wxGraphicsRenderer Class Reference
[Graphics Device Interface (GDI)]

#include <wx/graphics.h>

Inheritance diagram for wxGraphicsRenderer:
Inheritance graph
[legend]

Detailed Description

A wxGraphicsRenderer is the instance corresponding to the rendering engine used.

There may be multiple instances on a system, if there are different rendering engines present, but there is always only one instance per engine. This instance is pointed back to by all objects created by it (wxGraphicsContext, wxGraphicsPath etc) and can be retrieved through their wxGraphicsObject::GetRenderer() method. Therefore you can create an additional instance of a path etc. by calling wxGraphicsObject::GetRenderer() and then using the appropriate CreateXXX() function of that renderer.

    wxGraphicsPath *path = // from somewhere
    wxGraphicsBrush *brush = path->GetRenderer()->CreateBrush( *wxBLACK_BRUSH );

Library:  wxCore
Category:  Graphics Device Interface (GDI)

Public Member Functions

virtual wxGraphicsContextCreateContext (wxWindow *window)=0
 Creates a wxGraphicsContext from a wxWindow.
virtual wxGraphicsContextCreateContext (const wxWindowDC &dc)=0
 Creates a wxGraphicsContext from a wxWindowDC.
virtual wxGraphicsContextCreateContext (const wxMemoryDC &dc)=0
 Creates a wxGraphicsContext from a wxMemoryDC.
virtual wxGraphicsContextCreateContext (const wxPrinterDC &dc)=0
 Creates a wxGraphicsContext from a wxPrinterDC.
virtual wxGraphicsBrush CreateBrush (const wxBrush &brush)=0
 Creates a native brush from a wxBrush.
virtual wxGraphicsContextCreateContextFromNativeContext (void *context)=0
 Creates a wxGraphicsContext from a native context.
virtual wxGraphicsContextCreateContextFromNativeWindow (void *window)=0
 Creates a wxGraphicsContext from a native window.
virtual wxGraphicsContextCreateMeasuringContext ()=0
 Creates a wxGraphicsContext that can be used for measuring texts only.
virtual wxGraphicsFont CreateFont (const wxFont &font, const wxColour &col=*wxBLACK)=0
 Creates a native graphics font from a wxFont and a text colour.
virtual wxGraphicsBrush CreateLinearGradientBrush (wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxColour &c1, const wxColour &c2)=0
 Creates a native brush, having a linear gradient, starting at (x1, y1) with color c1 to (x2, y2) with color c2.
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
 Creates a native affine transformation matrix from the passed in values.
virtual wxGraphicsPath CreatePath ()=0
 Creates a native graphics path which is initially empty.
virtual wxGraphicsPen CreatePen (const wxPen &pen)=0
 Creates a native pen from a wxPen.
virtual wxGraphicsBrush CreateRadialGradientBrush (wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, const wxColour &oColour, const wxColour &cColour)=0
 Creates a native brush, having a radial gradient originating at (xo, yc) with color oColour and ends on a circle around (xc, yc) with the given radius and color cColour.

Static Public Member Functions

static wxGraphicsRendererGetDefaultRenderer ()
 Returns the default renderer on this platform.

List of all members.


Member Function Documentation

virtual wxGraphicsBrush wxGraphicsRenderer::CreateBrush ( const wxBrush brush  )  [pure virtual]

Creates a native brush from a wxBrush.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext ( const wxPrinterDC dc  )  [pure virtual]

Creates a wxGraphicsContext from a wxPrinterDC.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext ( const wxMemoryDC dc  )  [pure virtual]

Creates a wxGraphicsContext from a wxMemoryDC.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext ( const wxWindowDC dc  )  [pure virtual]

Creates a wxGraphicsContext from a wxWindowDC.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContext ( wxWindow window  )  [pure virtual]

Creates a wxGraphicsContext from a wxWindow.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContextFromNativeContext ( void *  context  )  [pure virtual]

Creates a wxGraphicsContext from a native context.

This native context must be a CGContextRef for Core Graphics, a Graphics pointer for GDIPlus, or a cairo_t pointer for cairo.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateContextFromNativeWindow ( void *  window  )  [pure virtual]

Creates a wxGraphicsContext from a native window.

virtual wxGraphicsFont wxGraphicsRenderer::CreateFont ( const wxFont font,
const wxColour col = *wxBLACK 
) [pure virtual]

Creates a native graphics font from a wxFont and a text colour.

virtual wxGraphicsBrush wxGraphicsRenderer::CreateLinearGradientBrush ( wxDouble  x1,
wxDouble  y1,
wxDouble  x2,
wxDouble  y2,
const wxColour c1,
const wxColour c2 
) [pure virtual]

Creates a native brush, having a linear gradient, starting at (x1, y1) with color c1 to (x2, y2) with color c2.

virtual wxGraphicsMatrix wxGraphicsRenderer::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 
) [pure virtual]

Creates a native affine transformation matrix from the passed in values.

The defaults result in an identity matrix.

virtual wxGraphicsContext* wxGraphicsRenderer::CreateMeasuringContext (  )  [pure virtual]

Creates a wxGraphicsContext that can be used for measuring texts only.

No drawing commands are allowed.

virtual wxGraphicsPath wxGraphicsRenderer::CreatePath (  )  [pure virtual]

Creates a native graphics path which is initially empty.

virtual wxGraphicsPen wxGraphicsRenderer::CreatePen ( const wxPen pen  )  [pure virtual]

Creates a native pen from a wxPen.

virtual wxGraphicsBrush wxGraphicsRenderer::CreateRadialGradientBrush ( wxDouble  xo,
wxDouble  yo,
wxDouble  xc,
wxDouble  yc,
wxDouble  radius,
const wxColour oColour,
const wxColour cColour 
) [pure virtual]

Creates a native brush, having a radial gradient originating at (xo, yc) with color oColour and ends on a circle around (xc, yc) with the given radius and color cColour.

static wxGraphicsRenderer* wxGraphicsRenderer::GetDefaultRenderer (  )  [static]

Returns the default renderer on this platform.

On OS X this is the Core Graphics (a.k.a. Quartz 2D) renderer, on MSW the GDIPlus renderer, and on GTK we currently default to the cairo renderer.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]