## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --               GtkAda - Ada95 binding for Gtk+/Gnome               --

3.     --                                                                   --

4.     --                    Copyright (C) 2010, AdaCore                    --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU 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.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU 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.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  Generic matrix operations.

31.     --  </description>

32.     --

33.     --  <c_version>1.8.8</c_version>

34.     --  <group>Cairo</group>

36.     package Cairo.MatrixTo API docTo spec is

38.        procedure InitTo API docTo body

39.          (Matrix : access Cairo_MatrixTo API docTo spec;

40.           Xx     : GdoubleTo API docTo spec;

41.           Yx     : GdoubleTo API docTo spec;

42.           Xy     : GdoubleTo API docTo spec;

43.           Yy     : GdoubleTo API docTo spec;

44.           X0     : GdoubleTo API docTo spec;

45.           Y0     : GdoubleTo API docTo spec);

46.        --  Matrix: a Cairo_Matrix

47.        --  Xx: Xx component of the affine transformation

48.        --  Yx: Yx component of the affine transformation

49.        --  Xy: Xy component of the affine transformation

50.        --  Yy: Yy component of the affine transformation

51.        --  X0: X translation component of the affine transformation

52.        --  Y0: Y translation component of the affine transformation

53.        --

54.        --  Sets matrix to be the affine transformation given by

55.        --  Xx, Yx, Xy, Yy, X0, Y0. The transformation is given

56.        --  by:

57.        --

58.        --    X_new = Xx * X + Xy * Y + X0;

59.        --    Y_new = Yx * X + Yy * Y + Y0;

61.        procedure Init_IdentityTo API docTo body (Matrix : access Cairo_MatrixTo API docTo spec);

62.        --  Matrix: a Cairo_Matrix

63.        --

64.        --  Modifies matrix to be an identity transformation.

66.        procedure Init_TranslateTo API docTo body

67.          (Matrix : access Cairo_MatrixTo API docTo spec;

68.           Tx     : GdoubleTo API docTo spec;

69.           Ty     : GdoubleTo API docTo spec);

70.        --  Matrix: a Cairo_Matrix

71.        --  Tx: amount to translate in the X direction

72.        --  Ty: amount to translate in the Y direction

73.        --

74.        --  Initializes matrix to a transformation that translates by Tx and

75.        --  Ty in the X and Y dimensions, respectively.

77.        procedure Init_ScaleTo API docTo body

78.          (Matrix : access Cairo_MatrixTo API docTo spec;

79.           Sx     : GdoubleTo API docTo spec;

80.           Sy     : GdoubleTo API docTo spec);

81.        --  Matrix: a Cairo_Matrix

82.        --  Sx: scale factor in the X direction

83.        --  Sy: scale factor in the Y direction

84.        --

85.        --  Initializes matrix to a transformation that scales by Sx and Sy

86.        --  in the X and Y dimensions, respectively.

88.        procedure Init_RotateTo API docTo body (Matrix : access Cairo_MatrixTo API docTo spec; Radians : GdoubleTo API docTo spec);

89.        --  Matrix: a Cairo_Matrix

90.        --  Radians: angle of rotation, in Radians. The direction of rotation

91.        --  is defined such that positive angles rotate in the direction from

92.        --  the positive X axis toward the positive Y axis. With the default

93.        --  axis orientation of cairo, positive angles rotate in a clockwise

94.        --  direction.

95.        --

96.        --  Initialized matrix to a transformation that rotates by radians.

98.        procedure TranslateTo API docTo body

99.          (Matrix : access Cairo_MatrixTo API docTo spec;

100.           Tx     : GdoubleTo API docTo spec;

101.           Ty     : GdoubleTo API docTo spec);

102.        --  Matrix: a Cairo_Matrix

103.        --  Tx: amount to translate in the X direction

104.        --  Ty: amount to translate in the Y direction

105.        --

106.        --  Applies a translation by Tx, Ty to the transformation in

107.        --  matrix. The effect of the new transformation is to first translate

108.        --  the coordinates by Tx and Ty, then apply the original transformation

109.        --  to the coordinates.

111.        procedure ScaleTo API docTo body

112.          (Matrix : access Cairo_MatrixTo API docTo spec;

113.           Sx     : GdoubleTo API docTo spec;

114.           Sy     : GdoubleTo API docTo spec);

115.        --  Matrix: a Cairo_Matrix

116.        --  Sx: scale factor in the X direction

117.        --  Sy: scale factor in the Y direction

118.        --

119.        --  Applies scaling by Sx, Sy to the transformation in matrix. The

120.        --  effect of the new transformation is to first scale the coordinates

121.        --  by Sx and Sy, then apply the original transformation to the coordinates.

123.        procedure RotateTo API docTo body (Matrix : access Cairo_MatrixTo API docTo spec; Radians : GdoubleTo API docTo spec);

124.        --  Matrix: a Cairo_Matrix

125.        --  Radians: angle of rotation, in Radians. The direction of rotation

126.        --  is defined such that positive angles rotate in the direction from

127.        --  the positive X axis toward the positive Y axis. With the default

128.        --  axis orientation of cairo, positive angles rotate in a clockwise

129.        --  direction.

130.        --

131.        --  Applies rotation by radians to the transformation in matrix. The effect

132.        --  of the new transformation is to first rotate the coordinates by radians,

133.        --  then apply the original transformation to the coordinates.

135.        function InvertTo API docTo body (Matrix : access Cairo_MatrixTo API docTo spec) return Cairo_StatusTo API docTo spec;

136.        --  Matrix: a Cairo_Matrix

137.        --

138.        --  Changes matrix to be the inverse of its original value. Not

139.        --  all transformation matrices have inverses; if the matrix

140.        --  collapses points together (it is "degenerate"),

141.        --  then it has no inverse and this function will fail.

142.        --

143.        --  Returns: If matrix has an inverse, modifies matrix to

144.        --  be the inverse matrix and returns Cairo_Status_Success. Otherwise,

145.        --  returns Cairo_Status_Invalid_Matrix.

147.        procedure MultiplyTo API docTo body

148.          (Result : access Cairo_MatrixTo API docTo spec;

149.           A      : access Cairo_MatrixTo API docTo spec;

150.           B      : access Cairo_MatrixTo API docTo spec);

151.        --  Result: a Cairo_Matrix in which to store the Result

152.        --  A: a Cairo_Matrix

153.        --  B: a Cairo_Matrix

154.        --

155.        --  Multiplies the affine transformations in a and b together

156.        --  and stores the result in result. The effect of the resulting

157.        --  transformation is to first apply the transformation in a to the

158.        --  coordinates and then apply the transformation in b to the

159.        --  coordinates.

160.        --

161.        --  It is allowable for result to be identical to either a or b.

163.        procedure Transform_DistanceTo API docTo body

164.          (Matrix : access Cairo_MatrixTo API docTo spec;

165.           Dx     : access GdoubleTo API docTo spec;

166.           Dy     : access GdoubleTo API docTo spec);

167.        --  Matrix: a Cairo_Matrix

168.        --  Dx: X component of a distance vector. An in/out parameter

169.        --  Dy: Y component of a distance vector. An in/out parameter

170.        --

171.        --  Transforms the distance vector (Dx,Dy) by matrix. This is

172.        --  similar to Cairo.Matrix.Transform_Point except that the translation

173.        --  components of the transformation are ignored. The calculation of

174.        --  the returned vector is as follows:

175.        --

176.        --  Dx2 = Dx1 * A + Dy1 * C;

177.        --  Dy2 = Dx1 * B + Dy1 * D;

178.        --

179.        --  Affine transformations are position invariant, so the same vector

180.        --  always transforms to the same vector. If (X1,Y1) transforms

181.        --  to (X2,Y2) then (X1+Dx1,Y1+Dy1) will transform to

182.        --  (X1+Dx2,Y1+Dy2) for all values of X1 and X2.

184.        procedure Transform_PointTo API docTo body

185.          (Matrix : access Cairo_MatrixTo API docTo spec;

186.           X      : access GdoubleTo API docTo spec;

187.           Y      : access GdoubleTo API docTo spec);

188.        --  Matrix: a Cairo_Matrix

189.        --  X: X position. An in/out parameter

190.        --  Y: Y position. An in/out parameter

191.        --

192.        --  Transforms the point (X, Y) by matrix.

194.     private

196.        pragma Import (C, InitTo API docTo spec, "cairo_matrix_init");

197.        pragma Import (C, Init_IdentityTo API docTo spec, "cairo_matrix_init_identity");

198.        pragma Import (C, Init_TranslateTo API docTo spec, "cairo_matrix_init_translate");

199.        pragma Import (C, Init_ScaleTo API docTo spec, "cairo_matrix_init_scale");

200.        pragma Import (C, Init_RotateTo API docTo spec, "cairo_matrix_init_rotate");

201.        pragma Import (C, TranslateTo API docTo spec, "cairo_matrix_translate");

202.        pragma Import (C, ScaleTo API docTo spec, "cairo_matrix_scale");

203.        pragma Import (C, RotateTo API docTo spec, "cairo_matrix_rotate");

204.        pragma Import (C, InvertTo API docTo spec, "cairo_matrix_invert");

205.        pragma Import (C, MultiplyTo API docTo spec, "cairo_matrix_multiply");

206.        pragma Import (C, Transform_DistanceTo API docTo spec, "cairo_matrix_transform_distance");

207.        pragma Import (C, Transform_PointTo API docTo spec, "cairo_matrix_transform_point");

209.     end Cairo.MatrixTo API docTo spec;