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