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


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

A PangoMatrix C++ wrapper class. More...

#include <xfc/pango/types.hh>

Inheritance diagram for Xfc::Pango::Matrix:
Xfc::G::Boxed Xfc::Object Xfc::Trackable

List of all members.

Public Member Functions

Constructors

Detailed Description

A PangoMatrix C++ wrapper class.

Matrix specifies a transformation between user-space coordinates and device coordinates. The transformation is given by:

 x_device = x_user * matrix->xx() + y_user * matrix->xy() + matrix->x0();
 y_device = x_user * matrix->yx() + y_user * matrix->yy() + matrix->y0();

Constructor & Destructor Documentation

Creates a new Matrix initialized to the identity transform.

< Pango::Matrix matrix;
< matrix.rotate(45.);
<
Xfc::Pango::Matrix::Matrix ( double  xx,
double  xy,
double  yx,
double  yy,
double  x0 = 0.0,
double  y0 = 0.0 
)

Creates a new Matrix initialized with the specified values .

Parameters:
xxThe first component of the transformation matrix.
xyThe second component of the transformation matrix.
yxThe third component of the transformation matrix.
yyThe fourth component of the transformation matrix.
x0The x translation.
y0The y translation.
Xfc::Pango::Matrix::Matrix ( PangoMatrix *  matrix) [explicit]

Construct a new matrix from an existing PangoMatrix.

Parameters:
matrixA pointer to a PangoMatrix.

The matrix can be a newly created PangoMatrix or an existing PangoMatrix. The Matrix object created is a temporary object. It doesn't take over the ownership of PangoMatrix and PangoMatrix is not freed by the destructor. Matrix is created with a reference count of 1 that the caller owns.

Xfc::Pango::Matrix::Matrix ( PangoMatrix *  matrix,
bool  copy 
)

Construct a new matrix from an existing PangoMatrix.

Parameters:
matrixA pointer to a PangoMatrix.
copyWhether the Matrix object should make a copy of PangoMatrix or not.

The matrix can be a newly created PangoMatrix or an existing PangoMatrix. If copy is true Matrix will make a copy of PangoMatrix. If copy is false Matrix wont make a copy but instead takes over the ownership of PangoMatrix. Either way, the destructor will free PangoMatrix when the Matrix object is destroyed. This constructor is used by G::Boxed::wrap() to wrap PangoMatrix objects in a C++ wrapper. Matrix is created with a reference count of 1 that the caller owns.

Copy constructor.

Parameters:
srcThe source matrix.

Member Function Documentation

void Xfc::Pango::Matrix::concat ( const Matrix new_matrix)

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

Parameters:
new_matrixA Pango::Matrix.
Matrix& Xfc::Pango::Matrix::operator= ( const Matrix src)

Assignment operator.

Parameters:
srcThe source matrix.
void Xfc::Pango::Matrix::rotate ( double  degrees)

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

Parameters:
degreesThe degrees to rotate counter-clockwise.
void Xfc::Pango::Matrix::scale ( double  scale_x,
double  scale_y 
)

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.

Parameters:
scale_xThe amount to scale by in X direction.
scale_yThe amount to scale by in Y direction.
void Xfc::Pango::Matrix::set ( double  xx,
double  xy,
double  yx,
double  yy,
double  x0 = 0.0,
double  y0 = 0.0 
)

Initializes the matrix with the specified values.

Parameters:
xxThe first component of the transformation matrix.
xyThe second component of the transformation matrix.
yxThe third component of the transformation matrix.
yyThe fourth component of the transformation matrix.
x0The x translation.
y0The y translation.
void Xfc::Pango::Matrix::set_translation ( double  x0,
double  y0 
)

Sets the x and y translation.

Parameters:
x0The x translation.
y0The y translation.
void Xfc::Pango::Matrix::set_x0 ( double  x0)

Sets the x translation.

Parameters:
x0The x translation.
void Xfc::Pango::Matrix::set_y0 ( double  y0)

Sets the y translation.

Parameters:
y0The y translation.
void Xfc::Pango::Matrix::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.

Parameters:
txThe amount to translate in the X direction.
tyThe amount to translate in the Y direction.
double Xfc::Pango::Matrix::x0 ( ) const

Gets the x translation.

Returns:
The x translation.
double Xfc::Pango::Matrix::xx ( ) const

Gets the first component of the transformation matrix.

Returns:
The first component.
double Xfc::Pango::Matrix::xy ( ) const

Gets the second component of the transformation matrix.

Returns:
The second component.
double Xfc::Pango::Matrix::y0 ( ) const

Gets the y translation.

Returns:
The y translation.
double Xfc::Pango::Matrix::yx ( ) const

Gets the third component of the transformation matrix.

Returns:
The third component.
double Xfc::Pango::Matrix::yy ( ) const

Gets the fourth component of the transformation matrix.

Returns:
The fourth component.

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