File: PgVertical.d

package info (click to toggle)
gtk-d 3.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,152 kB
  • sloc: javascript: 565; sh: 71; makefile: 25
file content (127 lines) | stat: -rw-r--r-- 4,196 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
 * This file is part of gtkD.
 *
 * gtkD is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version, with
 * some exceptions, please read the COPYING file.
 *
 * gtkD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with gtkD; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 */

// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage


module pango.PgVertical;

public  import gtkc.pangotypes;
private import pango.PgMatrix;
private import pango.c.functions;
public  import pango.c.types;


/** */
public struct PgVertical
{

	/**
	 * Finds the gravity that best matches the rotation component
	 * in a #PangoMatrix.
	 *
	 * Params:
	 *     matrix = a #PangoMatrix
	 *
	 * Returns: the gravity of @matrix, which will never be
	 *     %PANGO_GRAVITY_AUTO, or %PANGO_GRAVITY_SOUTH if @matrix is %NULL
	 *
	 * Since: 1.16
	 */
	public static PangoGravity gravityGetForMatrix(PgMatrix matrix)
	{
		return pango_gravity_get_for_matrix((matrix is null) ? null : matrix.getPgMatrixStruct());
	}

	/**
	 * Based on the script, base gravity, and hint, returns actual gravity
	 * to use in laying out a single #PangoItem.
	 *
	 * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the
	 * preferred gravity of @script.  To get the preferred gravity of a script,
	 * pass %PANGO_GRAVITY_AUTO and %PANGO_GRAVITY_HINT_STRONG in.
	 *
	 * Params:
	 *     script = #PangoScript to query
	 *     baseGravity = base gravity of the paragraph
	 *     hint = orientation hint
	 *
	 * Returns: resolved gravity suitable to use for a run of text
	 *     with @script.
	 *
	 * Since: 1.16
	 */
	public static PangoGravity gravityGetForScript(PangoScript script, PangoGravity baseGravity, PangoGravityHint hint)
	{
		return pango_gravity_get_for_script(script, baseGravity, hint);
	}

	/**
	 * Based on the script, East Asian width, base gravity, and hint,
	 * returns actual gravity to use in laying out a single character
	 * or #PangoItem.
	 *
	 * This function is similar to pango_gravity_get_for_script() except
	 * that this function makes a distinction between narrow/half-width and
	 * wide/full-width characters also.  Wide/full-width characters always
	 * stand <emphasis>upright</emphasis>, that is, they always take the base gravity,
	 * whereas narrow/full-width characters are always rotated in vertical
	 * context.
	 *
	 * If @base_gravity is %PANGO_GRAVITY_AUTO, it is first replaced with the
	 * preferred gravity of @script.
	 *
	 * Params:
	 *     script = #PangoScript to query
	 *     wide = %TRUE for wide characters as returned by g_unichar_iswide()
	 *     baseGravity = base gravity of the paragraph
	 *     hint = orientation hint
	 *
	 * Returns: resolved gravity suitable to use for a run of text
	 *     with @script and @wide.
	 *
	 * Since: 1.26
	 */
	public static PangoGravity gravityGetForScriptAndWidth(PangoScript script, bool wide, PangoGravity baseGravity, PangoGravityHint hint)
	{
		return pango_gravity_get_for_script_and_width(script, wide, baseGravity, hint);
	}

	/**
	 * Converts a #PangoGravity value to its natural rotation in radians.
	 * @gravity should not be %PANGO_GRAVITY_AUTO.
	 *
	 * Note that pango_matrix_rotate() takes angle in degrees, not radians.
	 * So, to call pango_matrix_rotate() with the output of this function
	 * you should multiply it by (180. / G_PI).
	 *
	 * Params:
	 *     gravity = gravity to query
	 *
	 * Returns: the rotation value corresponding to @gravity.
	 *
	 * Since: 1.16
	 */
	public static double gravityToRotation(PangoGravity gravity)
	{
		return pango_gravity_to_rotation(gravity);
	}
}