Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions
Xfc::Pango::Renderer Class Reference

A PangoRenderer C++ wrapper class. More...

#include <xfc/pango/renderer.hh>

Inheritance diagram for Xfc::Pango::Renderer:
Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable Xfc::Gdk::PangoRenderer

List of all members.

Public Member Functions

Constructors


Detailed Description

A PangoRenderer C++ wrapper class.

Pango::Renderer is a base class for objects that are used to render Pango objects such as Pango::GlyphString and Pango::Layout.


Constructor & Destructor Documentation

Xfc::Pango::Renderer::Renderer ( PangoRenderer *  renderer,
bool  owns_reference = false 
) [explicit, protected]

Construct a new Renderer from an existing PangoRenderer.

Parameters:
rendererA pointer to a PangoRenderer.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

The renderer can be a newly created PangoRenderer or an existing PangoRenderer. (see G::Object::Object).


Member Function Documentation

Does initial setup before rendering operations on the renderer.

deactivate() should be called when done drawing. Calls such as draw_layout() automatically activate the layout before drawing on it. Calls to activate() and deactivate() can be nested and the renderer will only be initialized and deinitialized once.

void Xfc::Pango::Renderer::draw_error_underline ( int  x,
int  y,
int  width,
int  height 
)

Draw a squiggly line that approximately covers the given rectangle in the style of an underline used to indicate a spelling error.

Parameters:
xThe X coordinate of underline, in Pango units in user coordinate system.
yThe Y coordinate of underline, in Pango units in user coordinate system.
widthThe width of underline, in Pango units in user coordinate system.
heightThe height of underline, in Pango units in user coordinate system.

The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle.

void Xfc::Pango::Renderer::draw_glyph ( const Font font,
Glyph  glyph,
double  x,
double  y 
)

Draws a single glyph with coordinates in device space.

Parameters:
fontA Pango::Font.
glyphThe glyph index of a single glyph.
xThe X coordinate of left edge of baseline of glyph.
yThe Y coordinate of left edge of baseline of glyph.
void Xfc::Pango::Renderer::draw_glyphs ( const Font font,
const GlyphString glyphs,
int  x,
int  y 
)

Draws the glyphs in glyphs with the renderer.

Parameters:
fontA Pango::Font.
glyphsA Pango::GlyphString.
xThe X position of left edge of baseline, in user space coordinates in Pango units.
yThe Y position of left edge of baseline, in user space coordinates in Pango units.
void Xfc::Pango::Renderer::draw_layout ( const Layout layout,
int  x,
int  y 
)

Draws layout with the renderer.

Parameters:
layoutA Pango::Layout.
xThe X position of left edge of baseline, in user space coordinates in Pango units.
yThe Y position of left edge of baseline, in user space coordinates in Pango units.
void Xfc::Pango::Renderer::draw_layout_line ( const LayoutLine line,
int  x,
int  y 
)

Draws line with the renderer.

Parameters:
lineA Pango::LayoutLine.
xThe X position of left edge of baseline, in user space coordinates in Pango units.
yThe Y position of left edge of baseline, in user space coordinates in Pango units.
void Xfc::Pango::Renderer::draw_rectangle ( RenderPart  part,
int  x,
int  y,
int  width,
int  height 
)

Draws an axis-aligned rectangle in user space coordinates with the renderer.

Parameters:
partThe type of object this rectangle is part of.
xThe x position at which to draw the rectangle, in user space coordinates in Pango units.
yThe y position at which to draw the rectangle, in user space coordinates in Pango units.
widthThe width of rectangle in PangoUnits in user space coordinates.
heightThe height of rectangle in PangoUnits in user space coordinates.
void Xfc::Pango::Renderer::draw_rectangle ( RenderPart  part,
const Rectangle rectangle 
)

Draws an axis-aligned rectangle in user space coordinates with the renderer.

Parameters:
partThe type of object this rectangle is part of.
rectangleThe rectangle to draw, in user space coordinates in Pango units.
void Xfc::Pango::Renderer::draw_trapezoid ( RenderPart  part,
double  y1,
double  x11,
double  x21,
double  y2,
double  x12,
double  x22 
)

Draws a trapezoid with the parallel sides aligned with the X axis using the given renderer (coordinates are in device space).

Parameters:
partThe type of object this trapezoid is part of.
y1The Y coordinate of top of trapezoid.
x11The X coordinate of left end of top of trapezoid.
x21The X coordinate of right end of top of trapezoid.
y2The Y coordinate of bottom of trapezoid.
x12,:X coordinate of left end of bottom of trapezoid.
x22,:X coordinate of right end of bottom of trapezoid.

Gets the current rendering color for the specified part.

Parameters:
partThe part to get the color for.
Returns:
The color for the specified part, or a null pointer.

The method returns null if the color for the specified part hasn't been set and should be inherited from the environment.

Gets the transformation matrix that will be applied when rendering (see set_matrix()).

Returns:
The matrix, or null if no matrix has been set (which is the same as the identity matrix).

Informs Pango that the way that the renderering is done for part has changed in a way that would prevent multiple pieces being joined together into one drawing call.

Parameters:
partThe part for which rendering has changed.

For instance, if a subclass of Renderer was to add a stipple option for drawing underlines, it needs to call:

< renderer->part_changed(Pango::RENDER_PART_UNDERLINE);
<

when the stipple changes or underlines with different stipples might be joined together. Pango automatically calls this method for changes to colors (see set_color()).

void Xfc::Pango::Renderer::set_color ( RenderPart  part,
const Color color 
)

Sets the color for part of the rendering.

Parameters:
partThe part to change the color of.
colorThe new color or null to unset the current color.
void Xfc::Pango::Renderer::set_matrix ( const Matrix matrix)

Sets the transformation matrix that will be applied when rendering.

Parameters:
matrixA Pango::Matrix, or null to unset any existing matrix.

No matrix set is the same as setting the identity matrix.


The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC