Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/pango-1.0/pango/pango-matrix.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* Pango
0002  * pango-matrix.h: Matrix manipulation routines
0003  *
0004  * Copyright (C) 2002, 2006 Red Hat Software
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public
0017  * License along with this library; if not, write to the
0018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0019  * Boston, MA 02111-1307, USA.
0020  */
0021 
0022 #ifndef __PANGO_MATRIX_H__
0023 #define __PANGO_MATRIX_H__
0024 
0025 #include <glib.h>
0026 #include <glib-object.h>
0027 
0028 G_BEGIN_DECLS
0029 
0030 typedef struct _PangoMatrix    PangoMatrix;
0031 
0032 /**
0033  * PangoMatrix:
0034  * @xx: 1st component of the transformation matrix
0035  * @xy: 2nd component of the transformation matrix
0036  * @yx: 3rd component of the transformation matrix
0037  * @yy: 4th component of the transformation matrix
0038  * @x0: x translation
0039  * @y0: y translation
0040  *
0041  * A `PangoMatrix` specifies a transformation between user-space
0042  * and device coordinates.
0043  *
0044  * The transformation is given by
0045  *
0046  * ```
0047  * x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
0048  * y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
0049  * ```
0050  *
0051  * Since: 1.6
0052  */
0053 struct _PangoMatrix
0054 {
0055   double xx;
0056   double xy;
0057   double yx;
0058   double yy;
0059   double x0;
0060   double y0;
0061 };
0062 
0063 #define PANGO_TYPE_MATRIX (pango_matrix_get_type ())
0064 
0065 /**
0066  * PANGO_MATRIX_INIT:
0067  *
0068  * Constant that can be used to initialize a `PangoMatrix` to
0069  * the identity transform.
0070  *
0071  * ```
0072  * PangoMatrix matrix = PANGO_MATRIX_INIT;
0073  * pango_matrix_rotate (&matrix, 45.);
0074  * ```
0075  *
0076  * Since: 1.6
0077  **/
0078 #define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. }
0079 
0080 /* for PangoRectangle */
0081 #include <pango/pango-types.h>
0082 
0083 PANGO_AVAILABLE_IN_1_6
0084 GType pango_matrix_get_type (void) G_GNUC_CONST;
0085 
0086 PANGO_AVAILABLE_IN_1_6
0087 PangoMatrix *pango_matrix_copy   (const PangoMatrix *matrix);
0088 PANGO_AVAILABLE_IN_1_6
0089 void         pango_matrix_free   (PangoMatrix *matrix);
0090 
0091 PANGO_AVAILABLE_IN_1_6
0092 void pango_matrix_translate (PangoMatrix *matrix,
0093                  double       tx,
0094                  double       ty);
0095 PANGO_AVAILABLE_IN_1_6
0096 void pango_matrix_scale     (PangoMatrix *matrix,
0097                  double       scale_x,
0098                  double       scale_y);
0099 PANGO_AVAILABLE_IN_1_6
0100 void pango_matrix_rotate    (PangoMatrix *matrix,
0101                  double       degrees);
0102 PANGO_AVAILABLE_IN_1_6
0103 void pango_matrix_concat    (PangoMatrix       *matrix,
0104                  const PangoMatrix *new_matrix);
0105 PANGO_AVAILABLE_IN_1_16
0106 void pango_matrix_transform_point    (const PangoMatrix *matrix,
0107                       double            *x,
0108                       double            *y);
0109 PANGO_AVAILABLE_IN_1_16
0110 void pango_matrix_transform_distance (const PangoMatrix *matrix,
0111                       double            *dx,
0112                       double            *dy);
0113 PANGO_AVAILABLE_IN_1_16
0114 void pango_matrix_transform_rectangle (const PangoMatrix *matrix,
0115                        PangoRectangle    *rect);
0116 PANGO_AVAILABLE_IN_1_16
0117 void pango_matrix_transform_pixel_rectangle (const PangoMatrix *matrix,
0118                          PangoRectangle    *rect);
0119 PANGO_AVAILABLE_IN_1_12
0120 double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix) G_GNUC_PURE;
0121 PANGO_AVAILABLE_IN_1_38
0122 void pango_matrix_get_font_scale_factors (const PangoMatrix *matrix,
0123                       double *xscale, double *yscale);
0124 PANGO_AVAILABLE_IN_1_50
0125 double pango_matrix_get_slant_ratio (const PangoMatrix *matrix) G_GNUC_PURE;
0126 
0127 
0128 G_END_DECLS
0129 
0130 #endif /* __PANGO_MATRIX_H__ */