PgMatrix

A structure specifying a transformation between user-space coordinates and device coordinates. The transformation is given by

<programlisting> x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0; y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0; </programlisting>

Constructors

this
this(PangoMatrix* pangoMatrix, bool ownedRef)

Sets our main struct and passes it to the parent class.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

concat
void concat(PgMatrix newMatrix)

Changes the transformation represented by matrix to be the transformation given by first applying transformation given by new_matrix then applying the original transformation.

copy
PgMatrix copy()

Copies a cairo.Matrix

free
void free()

Free a cairo.Matrix created with Matrix.copy.

getFontScaleFactor
double getFontScaleFactor()

Returns the scale factor of a matrix on the height of the font. That is, the scale factor in the direction perpendicular to the vector that the X coordinate is mapped to. If the scale in the X coordinate is needed as well, use Matrix.getFontScaleFactors.

getFontScaleFactors
void getFontScaleFactors(double xscale, double yscale)

Calculates the scale factor of a matrix on the width and height of the font. That is, xscale is the scale factor in the direction of the X coordinate, and yscale is the scale factor in the direction perpendicular to the vector that the X coordinate is mapped to.

getPgMatrixStruct
PangoMatrix* getPgMatrixStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

rotate
void rotate(double degrees)

Changes the transformation represented by matrix to be the transformation given by first rotating by degrees degrees counter-clockwise then applying the original transformation.

scale
void scale(double scaleX, double scaleY)

Changes the transformation represented by matrix to be the transformation given by first scaling by sx in the X direction and sy in the Y direction then applying the original transformation.

transformDistance
void transformDistance(double dx, double dy)

Transforms the distance vector (dx,dy) by matrix. This is similar to Matrix.transformPoint except that the translation components of the transformation are ignored. The calculation of the returned vector is as follows:

transformPixelRectangle
void transformPixelRectangle(PangoRectangle rect)

First transforms the rect using matrix, then calculates the bounding box of the transformed rectangle. The rectangle should be in device units (pixels).

transformPoint
void transformPoint(double x, double y)

Transforms the point (x, y) by matrix.

transformRectangle
void transformRectangle(PangoRectangle rect)

First transforms rect using matrix, then calculates the bounding box of the transformed rectangle. The rectangle should be in Pango units.

translate
void translate(double tx, double ty)

Changes the transformation represented by matrix to be the transformation given by first translating by (tx, ty) then applying the original transformation.

Properties

x0
double x0 [@property getter]
double x0 [@property setter]

x translation

xx
double xx [@property getter]
double xx [@property setter]

1st component of the transformation matrix

xy
double xy [@property getter]
double xy [@property setter]

2nd component of the transformation matrix

y0
double y0 [@property getter]
double y0 [@property setter]

y translation

yx
double yx [@property getter]
double yx [@property setter]

3rd component of the transformation matrix

yy
double yy [@property getter]
double yy [@property setter]

4th component of the transformation matrix

Static functions

extentsToPixels
void extentsToPixels(PangoRectangle* inclusive, PangoRectangle* nearest)

Converts extents from Pango units to device units, dividing by the PANGO_SCALE factor and performing rounding.

getType
GType getType()
unitsFromDouble
int unitsFromDouble(double d)

Converts a floating-point number to Pango units: multiplies it by PANGO_SCALE and rounds to nearest integer.

unitsToDouble
double unitsToDouble(int i)

Converts a number in Pango units to floating-point: divides it by PANGO_SCALE.

Variables

pangoMatrix
PangoMatrix* pangoMatrix;

the main Gtk struct

Meta