1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module pango.PgVertical;
26 
27 private import gtkc.pango;
28 public  import gtkc.pangotypes;
29 private import pango.PgMatrix;
30 
31 
32 public struct PgVertical
33 {
34 	/**
35 	 */
36 
37 	/**
38 	 * Finds the gravity that best matches the rotation component
39 	 * in a #PangoMatrix.
40 	 *
41 	 * Params:
42 	 *     matrix = a #PangoMatrix
43 	 *
44 	 * Return: the gravity of @matrix, which will never be
45 	 *     %PANGO_GRAVITY_AUTO, or %PANGO_GRAVITY_SOUTH if @matrix is %NULL
46 	 *
47 	 * Since: 1.16
48 	 */
49 	public static PangoGravity gravityGetForMatrix(PgMatrix matrix)
50 	{
51 		return pango_gravity_get_for_matrix((matrix is null) ? null : matrix.getPgMatrixStruct());
52 	}
53 
54 	/**
55 	 * Based on the script, base gravity, and hint, returns actual gravity
56 	 * to use in laying out a single #PangoItem.
57 	 *
58 	 * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the
59 	 * preferred gravity of @script.  To get the preferred gravity of a script,
60 	 * pass %PANGO_GRAVITY_AUTO and %PANGO_GRAVITY_HINT_STRONG in.
61 	 *
62 	 * Params:
63 	 *     script = #PangoScript to query
64 	 *     baseGravity = base gravity of the paragraph
65 	 *     hint = orientation hint
66 	 *
67 	 * Return: resolved gravity suitable to use for a run of text
68 	 *     with @script.
69 	 *
70 	 * Since: 1.16
71 	 */
72 	public static PangoGravity gravityGetForScript(PangoScript script, PangoGravity baseGravity, PangoGravityHint hint)
73 	{
74 		return pango_gravity_get_for_script(script, baseGravity, hint);
75 	}
76 
77 	/**
78 	 * Based on the script, East Asian width, base gravity, and hint,
79 	 * returns actual gravity to use in laying out a single character
80 	 * or #PangoItem.
81 	 *
82 	 * This function is similar to pango_gravity_get_for_script() except
83 	 * that this function makes a distinction between narrow/half-width and
84 	 * wide/full-width characters also.  Wide/full-width characters always
85 	 * stand <emphasis>upright</emphasis>, that is, they always take the base gravity,
86 	 * whereas narrow/full-width characters are always rotated in vertical
87 	 * context.
88 	 *
89 	 * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the
90 	 * preferred gravity of @script.
91 	 *
92 	 * Params:
93 	 *     script = #PangoScript to query
94 	 *     wide = %TRUE for wide characters as returned by g_unichar_iswide()
95 	 *     baseGravity = base gravity of the paragraph
96 	 *     hint = orientation hint
97 	 *
98 	 * Return: resolved gravity suitable to use for a run of text
99 	 *     with @script and @wide.
100 	 *
101 	 * Since: 1.26
102 	 */
103 	public static PangoGravity gravityGetForScriptAndWidth(PangoScript script, bool wide, PangoGravity baseGravity, PangoGravityHint hint)
104 	{
105 		return pango_gravity_get_for_script_and_width(script, wide, baseGravity, hint);
106 	}
107 
108 	/**
109 	 * Converts a #PangoGravity value to its natural rotation in radians.
110 	 * @gravity should not be %PANGO_GRAVITY_AUTO.
111 	 *
112 	 * Note that pango_matrix_rotate() takes angle in degrees, not radians.
113 	 * So, to call pango_matrix_rotate() with the output of this function
114 	 * you should multiply it by (180. / G_PI).
115 	 *
116 	 * Params:
117 	 *     gravity = gravity to query
118 	 *
119 	 * Return: the rotation value corresponding to @gravity.
120 	 *
121 	 * Since: 1.16
122 	 */
123 	public static double gravityToRotation(PangoGravity gravity)
124 	{
125 		return pango_gravity_to_rotation(gravity);
126 	}
127 }