/binding/pango/matrix.d

http://github.com/wilkie/djehuty · D · 123 lines · 37 code · 16 blank · 70 comment · 0 complexity · 9055ddccba22114968df52c1fda743a5 MD5 · raw file

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