PageRenderTime 16ms CodeModel.GetById 1ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

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