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  * Conversion parameters:
26  * inFile  = 
27  * outPack = pango
28  * outFile = PgFontMetrics
29  * strct   = PangoFontMetrics
30  * realStrct=
31  * ctorStrct=
32  * clss    = PgFontMetrics
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- pango_font_metrics_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * structWrap:
47  * 	- PangoFontMetrics* -> PgFontMetrics
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module pango.PgFontMetrics;
54 
55 public  import gtkc.pangotypes;
56 
57 private import gtkc.pango;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 
62 
63 
64 
65 
66 /**
67  * Description
68  * Pango supports a flexible architecture where a
69  * particular rendering architecture can supply an
70  * implementation of fonts. The PangoFont structure
71  * represents an abstract rendering-system-independent font.
72  * Pango provides routines to list available fonts, and
73  * to load a font of a given description.
74  */
75 public class PgFontMetrics
76 {
77 	
78 	/** the main Gtk struct */
79 	protected PangoFontMetrics* pangoFontMetrics;
80 	
81 	
82 	public PangoFontMetrics* getPgFontMetricsStruct()
83 	{
84 		return pangoFontMetrics;
85 	}
86 	
87 	
88 	/** the main Gtk struct as a void* */
89 	protected void* getStruct()
90 	{
91 		return cast(void*)pangoFontMetrics;
92 	}
93 	
94 	/**
95 	 * Sets our main struct and passes it to the parent class
96 	 */
97 	public this (PangoFontMetrics* pangoFontMetrics)
98 	{
99 		this.pangoFontMetrics = pangoFontMetrics;
100 	}
101 	
102 	/**
103 	 */
104 	
105 	/**
106 	 * Increase the reference count of a font metrics structure by one.
107 	 * Returns: metrics
108 	 */
109 	public PgFontMetrics doref()
110 	{
111 		// PangoFontMetrics * pango_font_metrics_ref (PangoFontMetrics *metrics);
112 		auto p = pango_font_metrics_ref(pangoFontMetrics);
113 		
114 		if(p is null)
115 		{
116 			return null;
117 		}
118 		
119 		return ObjectG.getDObject!(PgFontMetrics)(cast(PangoFontMetrics*) p);
120 	}
121 	
122 	/**
123 	 * Decrease the reference count of a font metrics structure by one. If
124 	 * the result is zero, frees the structure and any associated
125 	 * memory.
126 	 */
127 	public void unref()
128 	{
129 		// void pango_font_metrics_unref (PangoFontMetrics *metrics);
130 		pango_font_metrics_unref(pangoFontMetrics);
131 	}
132 	
133 	/**
134 	 * Gets the ascent from a font metrics structure. The ascent is
135 	 * the distance from the baseline to the logical top of a line
136 	 * of text. (The logical top may be above or below the top of the
137 	 * actual drawn ink. It is necessary to lay out the text to figure
138 	 * where the ink will be.)
139 	 * Returns: the ascent, in Pango units.
140 	 */
141 	public int getAscent()
142 	{
143 		// int pango_font_metrics_get_ascent (PangoFontMetrics *metrics);
144 		return pango_font_metrics_get_ascent(pangoFontMetrics);
145 	}
146 	
147 	/**
148 	 * Gets the descent from a font metrics structure. The descent is
149 	 * the distance from the baseline to the logical bottom of a line
150 	 * of text. (The logical bottom may be above or below the bottom of the
151 	 * actual drawn ink. It is necessary to lay out the text to figure
152 	 * where the ink will be.)
153 	 * Returns: the descent, in Pango units.
154 	 */
155 	public int getDescent()
156 	{
157 		// int pango_font_metrics_get_descent (PangoFontMetrics *metrics);
158 		return pango_font_metrics_get_descent(pangoFontMetrics);
159 	}
160 	
161 	/**
162 	 * Gets the approximate character width for a font metrics structure.
163 	 * This is merely a representative value useful, for example, for
164 	 * determining the initial size for a window. Actual characters in
165 	 * text will be wider and narrower than this.
166 	 * Returns: the character width, in Pango units.
167 	 */
168 	public int getApproximateCharWidth()
169 	{
170 		// int pango_font_metrics_get_approximate_char_width  (PangoFontMetrics *metrics);
171 		return pango_font_metrics_get_approximate_char_width(pangoFontMetrics);
172 	}
173 	
174 	/**
175 	 * Gets the approximate digit width for a font metrics structure.
176 	 * This is merely a representative value useful, for example, for
177 	 * determining the initial size for a window. Actual digits in
178 	 * text can be wider or narrower than this, though this value
179 	 * is generally somewhat more accurate than the result of
180 	 * pango_font_metrics_get_approximate_char_width() for digits.
181 	 * Returns: the digit width, in Pango units.
182 	 */
183 	public int getApproximateDigitWidth()
184 	{
185 		// int pango_font_metrics_get_approximate_digit_width  (PangoFontMetrics *metrics);
186 		return pango_font_metrics_get_approximate_digit_width(pangoFontMetrics);
187 	}
188 	
189 	/**
190 	 * Gets the suggested thickness to draw for the underline.
191 	 * Since 1.6
192 	 * Returns: the suggested underline thickness, in Pango units.
193 	 */
194 	public int getUnderlineThickness()
195 	{
196 		// int pango_font_metrics_get_underline_thickness  (PangoFontMetrics *metrics);
197 		return pango_font_metrics_get_underline_thickness(pangoFontMetrics);
198 	}
199 	
200 	/**
201 	 * Gets the suggested position to draw the underline.
202 	 * The value returned is the distance above the
203 	 * baseline of the top of the underline. Since most fonts have
204 	 * underline positions beneath the baseline, this value is typically
205 	 * negative.
206 	 * Since 1.6
207 	 * Returns: the suggested underline position, in Pango units.
208 	 */
209 	public int getUnderlinePosition()
210 	{
211 		// int pango_font_metrics_get_underline_position  (PangoFontMetrics *metrics);
212 		return pango_font_metrics_get_underline_position(pangoFontMetrics);
213 	}
214 	
215 	/**
216 	 * Gets the suggested thickness to draw for the strikethrough.
217 	 * Since 1.6
218 	 * Returns: the suggested strikethrough thickness, in Pango units.
219 	 */
220 	public int getStrikethroughThickness()
221 	{
222 		// int pango_font_metrics_get_strikethrough_thickness  (PangoFontMetrics *metrics);
223 		return pango_font_metrics_get_strikethrough_thickness(pangoFontMetrics);
224 	}
225 	
226 	/**
227 	 * Gets the suggested position to draw the strikethrough.
228 	 * The value returned is the distance above the
229 	 * baseline of the top of the strikethrough.
230 	 * Since 1.6
231 	 * Returns: the suggested strikethrough position, in Pango units.
232 	 */
233 	public int getStrikethroughPosition()
234 	{
235 		// int pango_font_metrics_get_strikethrough_position  (PangoFontMetrics *metrics);
236 		return pango_font_metrics_get_strikethrough_position(pangoFontMetrics);
237 	}
238 }