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 pango.PgMatrix;
28 private import pango.c.functions;
29 public  import pango.c.types;
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 	 * Returns: 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 	 * Returns the gravity to use in laying out a `PangoItem`.
55 	 *
56 	 * The gravity is determined based on the script, base gravity, and hint.
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 	 * Returns: 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 	 * Returns the gravity to use in laying out a single character
79 	 * or `PangoItem`.
80 	 *
81 	 * The gravity is determined based on the script, East Asian width,
82 	 * base gravity, and hint,
83 	 *
84 	 * This function is similar to [type_func@Pango.Gravity.get_for_script] except
85 	 * that this function makes a distinction between narrow/half-width and
86 	 * wide/full-width characters also. Wide/full-width characters always
87 	 * stand *upright*, that is, they always take the base gravity,
88 	 * whereas narrow/full-width characters are always rotated in vertical
89 	 * context.
90 	 *
91 	 * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the
92 	 * preferred gravity of @script.
93 	 *
94 	 * Params:
95 	 *     script = #PangoScript to query
96 	 *     wide = %TRUE for wide characters as returned by g_unichar_iswide()
97 	 *     baseGravity = base gravity of the paragraph
98 	 *     hint = orientation hint
99 	 *
100 	 * Returns: resolved gravity suitable to use for a run of text
101 	 *     with @script and @wide.
102 	 *
103 	 * Since: 1.26
104 	 */
105 	public static PangoGravity gravityGetForScriptAndWidth(PangoScript script, bool wide, PangoGravity baseGravity, PangoGravityHint hint)
106 	{
107 		return pango_gravity_get_for_script_and_width(script, wide, baseGravity, hint);
108 	}
109 
110 	/**
111 	 * Converts a #PangoGravity value to its natural rotation in radians.
112 	 *
113 	 * Note that [method@Pango.Matrix.rotate] takes angle in degrees, not radians.
114 	 * So, to call [method@Pango.Matrix,rotate] with the output of this function
115 	 * you should multiply it by (180. / G_PI).
116 	 *
117 	 * Params:
118 	 *     gravity = gravity to query, should not be %PANGO_GRAVITY_AUTO
119 	 *
120 	 * Returns: the rotation value corresponding to @gravity.
121 	 *
122 	 * Since: 1.16
123 	 */
124 	public static double gravityToRotation(PangoGravity gravity)
125 	{
126 		return pango_gravity_to_rotation(gravity);
127 	}
128 }