1 /*
2  * Distributed under the Boost Software License, Version 1.0.
3  *    (See accompanying file LICENSE_1_0.txt or copy at
4  *          http://www.boost.org/LICENSE_1_0.txt)
5  */
6 module pango.c.matrix;
7 
8 import pango.c.types;
9 
10 import glib;
11 import gobject;
12 
13 
14 extern(C):
15 
16 /**
17  * PangoMatrix:
18  * @xx: 1st component of the transformation matrix
19  * @xy: 2nd component of the transformation matrix
20  * @yx: 3rd component of the transformation matrix
21  * @yy: 4th component of the transformation matrix
22  * @x0: x translation
23  * @y0: y translation
24  *
25  * A structure specifying a transformation between user-space
26  * coordinates and device coordinates. The transformation
27  * is given by
28  *
29  * <programlisting>
30  * x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
31  * y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
32  * </programlisting>
33  *
34  * Since: 1.6
35  **/
36 struct PangoMatrix
37 {
38   double xx=1;
39   double xy=0;
40   double yx=0;
41   double yy=1;
42   double x0=0;
43   double y0=0;
44 }
45 
46 
47 
48 pure GType pango_matrix_get_type ();
49 
50 PangoMatrix *pango_matrix_copy   (const(PangoMatrix) *matrix);
51 void         pango_matrix_free   (PangoMatrix *matrix);
52 
53 void pango_matrix_translate (PangoMatrix *matrix,
54 			     double       tx,
55 			     double       ty);
56 void pango_matrix_scale     (PangoMatrix *matrix,
57 			     double       scale_x,
58 			     double       scale_y);
59 void pango_matrix_rotate    (PangoMatrix *matrix,
60 			     double       degrees);
61 void pango_matrix_concat    (PangoMatrix       *matrix,
62 			     const(PangoMatrix) *new_matrix);
63 void pango_matrix_transform_point    (const(PangoMatrix) *matrix,
64 				      double            *x,
65 				      double            *y);
66 void pango_matrix_transform_distance (const(PangoMatrix) *matrix,
67 				      double            *dx,
68 				      double            *dy);
69 void pango_matrix_transform_rectangle (const(PangoMatrix) *matrix,
70 				       PangoRectangle    *rect);
71 void pango_matrix_transform_pixel_rectangle (const(PangoMatrix) *matrix,
72 					     PangoRectangle    *rect);
73 pure double pango_matrix_get_font_scale_factor (const(PangoMatrix) *matrix);
74