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 /** */
33 public struct PgVertical
34 {
35 
36 	/**
37 	 * Finds the gravity that best matches the rotation component
38 	 * in a #PangoMatrix.
39 	 *
40 	 * Params:
41 	 *     matrix = a #PangoMatrix
42 	 *
43 	 * Return: the gravity of @matrix, which will never be
44 	 *     %PANGO_GRAVITY_AUTO, or %PANGO_GRAVITY_SOUTH if @matrix is %NULL
45 	 *
46 	 * Since: 1.16
47 	 */
48 	public static PangoGravity gravityGetForMatrix(PgMatrix matrix)
49 	{
50 		return pango_gravity_get_for_matrix((matrix is null) ? null : matrix.getPgMatrixStruct());
51 	}
52 
53 	/**
54 	 * Based on the script, base gravity, and hint, returns actual gravity
55 	 * to use in laying out a single #PangoItem.
56 	 *
57 	 * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the
58 	 * preferred gravity of @script.  To get the preferred gravity of a script,
59 	 * pass %PANGO_GRAVITY_AUTO and %PANGO_GRAVITY_HINT_STRONG in.
60 	 *
61 	 * Params:
62 	 *     script = #PangoScript to query
63 	 *     baseGravity = base gravity of the paragraph
64 	 *     hint = orientation hint
65 	 *
66 	 * Return: resolved gravity suitable to use for a run of text
67 	 *     with @script.
68 	 *
69 	 * Since: 1.16
70 	 */
71 	public static PangoGravity gravityGetForScript(PangoScript script, PangoGravity baseGravity, PangoGravityHint hint)
72 	{
73 		return pango_gravity_get_for_script(script, baseGravity, hint);
74 	}
75 
76 	/**
77 	 * Based on the script, East Asian width, base gravity, and hint,
78 	 * returns actual gravity to use in laying out a single character
79 	 * or #PangoItem.
80 	 *
81 	 * This function is similar to pango_gravity_get_for_script() except
82 	 * that this function makes a distinction between narrow/half-width and
83 	 * wide/full-width characters also.  Wide/full-width characters always
84 	 * stand <emphasis>upright</emphasis>, that is, they always take the base gravity,
85 	 * whereas narrow/full-width characters are always rotated in vertical
86 	 * context.
87 	 *
88 	 * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the
89 	 * preferred gravity of @script.
90 	 *
91 	 * Params:
92 	 *     script = #PangoScript to query
93 	 *     wide = %TRUE for wide characters as returned by g_unichar_iswide()
94 	 *     baseGravity = base gravity of the paragraph
95 	 *     hint = orientation hint
96 	 *
97 	 * Return: resolved gravity suitable to use for a run of text
98 	 *     with @script and @wide.
99 	 *
100 	 * Since: 1.26
101 	 */
102 	public static PangoGravity gravityGetForScriptAndWidth(PangoScript script, bool wide, PangoGravity baseGravity, PangoGravityHint hint)
103 	{
104 		return pango_gravity_get_for_script_and_width(script, wide, baseGravity, hint);
105 	}
106 
107 	/**
108 	 * Converts a #PangoGravity value to its natural rotation in radians.
109 	 * @gravity should not be %PANGO_GRAVITY_AUTO.
110 	 *
111 	 * Note that pango_matrix_rotate() takes angle in degrees, not radians.
112 	 * So, to call pango_matrix_rotate() with the output of this function
113 	 * you should multiply it by (180. / G_PI).
114 	 *
115 	 * Params:
116 	 *     gravity = gravity to query
117 	 *
118 	 * Return: the rotation value corresponding to @gravity.
119 	 *
120 	 * Since: 1.16
121 	 */
122 	public static double gravityToRotation(PangoGravity gravity)
123 	{
124 		return pango_gravity_to_rotation(gravity);
125 	}
126 }