Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

118 строки
3.3 KiB

  1. /* Pango
  2. * pango-matrix.h: Matrix manipulation routines
  3. *
  4. * Copyright (C) 2002, 2006 Red Hat Software
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __PANGO_MATRIX_H__
  22. #define __PANGO_MATRIX_H__
  23. #include <glib.h>
  24. #include <glib-object.h>
  25. G_BEGIN_DECLS
  26. typedef struct _PangoMatrix PangoMatrix;
  27. /**
  28. * PangoMatrix:
  29. * @xx: 1st component of the transformation matrix
  30. * @xy: 2nd component of the transformation matrix
  31. * @yx: 3rd component of the transformation matrix
  32. * @yy: 4th component of the transformation matrix
  33. * @x0: x translation
  34. * @y0: y translation
  35. *
  36. * A structure specifying a transformation between user-space
  37. * coordinates and device coordinates. The transformation
  38. * is given by
  39. *
  40. * <programlisting>
  41. * x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
  42. * y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
  43. * </programlisting>
  44. *
  45. * Since: 1.6
  46. **/
  47. struct _PangoMatrix
  48. {
  49. double xx;
  50. double xy;
  51. double yx;
  52. double yy;
  53. double x0;
  54. double y0;
  55. };
  56. /**
  57. * PANGO_TYPE_MATRIX
  58. *
  59. * The GObject type for #PangoMatrix
  60. **/
  61. #define PANGO_TYPE_MATRIX (pango_matrix_get_type ())
  62. /**
  63. * PANGO_MATRIX_INIT
  64. *
  65. * Constant that can be used to initialize a PangoMatrix to
  66. * the identity transform.
  67. *
  68. * <informalexample><programlisting>
  69. * PangoMatrix matrix = PANGO_MATRIX_INIT;
  70. * pango_matrix_rotate (&amp;matrix, 45.);
  71. * </programlisting></informalexample>
  72. *
  73. * Since: 1.6
  74. **/
  75. #define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. }
  76. /* for PangoRectangle */
  77. #include <pango/pango-types.h>
  78. GType pango_matrix_get_type (void) G_GNUC_CONST;
  79. PangoMatrix *pango_matrix_copy (const PangoMatrix *matrix);
  80. void pango_matrix_free (PangoMatrix *matrix);
  81. void pango_matrix_translate (PangoMatrix *matrix,
  82. double tx,
  83. double ty);
  84. void pango_matrix_scale (PangoMatrix *matrix,
  85. double scale_x,
  86. double scale_y);
  87. void pango_matrix_rotate (PangoMatrix *matrix,
  88. double degrees);
  89. void pango_matrix_concat (PangoMatrix *matrix,
  90. const PangoMatrix *new_matrix);
  91. void pango_matrix_transform_point (const PangoMatrix *matrix,
  92. double *x,
  93. double *y);
  94. void pango_matrix_transform_distance (const PangoMatrix *matrix,
  95. double *dx,
  96. double *dy);
  97. void pango_matrix_transform_rectangle (const PangoMatrix *matrix,
  98. PangoRectangle *rect);
  99. void pango_matrix_transform_pixel_rectangle (const PangoMatrix *matrix,
  100. PangoRectangle *rect);
  101. double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix) G_GNUC_PURE;
  102. G_END_DECLS
  103. #endif /* __PANGO_MATRIX_H__ */