alternative to assert
[gtkD.git] / gtkD / src / cairoLib / FontOption.d
bloba6712485878c5e891e2f5a10be2bfd2d29b98691
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = cairo-Font-Options.html
26 * outPack = cairoLib
27 * outFile = FontOption
28 * strct = cairo_font_options_t
29 * realStrct=
30 * ctorStrct=
31 * clss = FontOption
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - cairo_font_options_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * structWrap:
45 * module aliases:
46 * local aliases:
49 module cairoLib.FontOption;
51 version(noAssert)
53 version(Tango)
55 import tango.io.Stdout; // use the tango loging?
59 private import gtkc.cairoLibtypes;
61 private import gtkc.cairoLib;
68 /**
69 * Description
71 public class FontOption
74 /** the main Gtk struct */
75 protected cairo_font_options_t* cairo_font_options;
78 public cairo_font_options_t* getFontOptionStruct()
80 return cairo_font_options;
84 /** the main Gtk struct as a void* */
85 protected void* getStruct()
87 return cast(void*)cairo_font_options;
90 /**
91 * Sets our main struct and passes it to the parent class
93 public this (cairo_font_options_t* cairo_font_options)
95 version(noAssert)
97 if ( cairo_font_options is null )
99 int zero = 0;
100 version(Tango)
102 Stdout("struct cairo_font_options is null on constructor").newline;
104 else
106 printf("struct cairo_font_options is null on constructor");
108 zero = zero / zero;
111 else
113 assert(cairo_font_options !is null, "struct cairo_font_options is null on constructor");
115 this.cairo_font_options = cairo_font_options;
123 * Allocates a new font options object with all options initialized
124 * to default values.
125 * Returns:
126 * a newly allocated cairo_font_options_t. Free with
127 * cairo_font_options_destroy(). This function always returns a
128 * valid pointer; if memory cannot be allocated, then a special
129 * error object is returned where all operations on the object do nothing.
130 * You can check for this with cairo_font_options_status().
132 public static cairo_font_options_t* create()
134 // cairo_font_options_t* cairo_font_options_create (void);
135 return cairo_font_options_create();
139 * Allocates a new font options object copying the option values from
140 * original.
141 * original:
142 * a cairo_font_options_t
143 * Returns:
144 * a newly allocated cairo_font_options_t. Free with
145 * cairo_font_options_destroy(). This function always returns a
146 * valid pointer; if memory cannot be allocated, then a special
147 * error object is returned where all operations on the object do nothing.
148 * You can check for this with cairo_font_options_status().
150 public cairo_font_options_t* copy()
152 // cairo_font_options_t* cairo_font_options_copy (const cairo_font_options_t *original);
153 return cairo_font_options_copy(cairo_font_options);
157 * Destroys a cairo_font_options_t object created with with
158 * cairo_font_options_create() or cairo_font_options_copy().
159 * options:
160 * a cairo_font_options_t
162 public void destroy()
164 // void cairo_font_options_destroy (cairo_font_options_t *options);
165 cairo_font_options_destroy(cairo_font_options);
169 * Checks whether an error has previously occurred for this
170 * font options object
171 * options:
172 * a cairo_font_options_t
173 * Returns:
174 * CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
176 public cairo_status_t status()
178 // cairo_status_t cairo_font_options_status (cairo_font_options_t *options);
179 return cairo_font_options_status(cairo_font_options);
183 * Merges non-default options from other into options, replacing
184 * existing values. This operation can be thought of as somewhat
185 * similar to compositing other onto options with the operation
186 * of CAIRO_OPERATION_OVER.
187 * options:
188 * a cairo_font_options_t
189 * other:
190 * another cairo_font_options_t
192 public void merge(cairo_font_options_t* other)
194 // void cairo_font_options_merge (cairo_font_options_t *options, const cairo_font_options_t *other);
195 cairo_font_options_merge(cairo_font_options, other);
199 * Compute a hash for the font options object; this value will
200 * be useful when storing an object containing a cairo_font_options_t
201 * in a hash table.
202 * options:
203 * a cairo_font_options_t
204 * Returns:
205 * the hash value for the font options object.
206 * The return value can be cast to a 32-bit type if a
207 * 32-bit hash value is needed.
209 public ulong hash()
211 // unsigned long cairo_font_options_hash (const cairo_font_options_t *options);
212 return cairo_font_options_hash(cairo_font_options);
216 * Compares two font options objects for equality.
217 * options:
218 * a cairo_font_options_t
219 * other:
220 * another cairo_font_options_t
221 * Returns:
222 * TRUE if all fields of the two font options objects match
224 public cairo_bool_t equal(cairo_font_options_t* other)
226 // cairo_bool_t cairo_font_options_equal (const cairo_font_options_t *options, const cairo_font_options_t *other);
227 return cairo_font_options_equal(cairo_font_options, other);
231 * Sets the antiliasing mode for the font options object. This
232 * specifies the type of antialiasing to do when rendering text.
233 * options:
234 * a cairo_font_options_t
235 * antialias:
236 * the new antialiasing mode
238 public void setAntialias(cairo_antialias_t antialias)
240 // void cairo_font_options_set_antialias (cairo_font_options_t *options, cairo_antialias_t antialias);
241 cairo_font_options_set_antialias(cairo_font_options, antialias);
245 * Gets the antialising mode for the font options object.
246 * options:
247 * a cairo_font_options_t
248 * Returns:
249 * the antialiasing mode
251 public cairo_antialias_t getAntialias()
253 // cairo_antialias_t cairo_font_options_get_antialias (const cairo_font_options_t *options);
254 return cairo_font_options_get_antialias(cairo_font_options);
259 * Sets the subpixel order for the font options object. The subpixel
260 * order specifies the order of color elements within each pixel on
261 * the display device when rendering with an antialiasing mode of
262 * CAIRO_ANTIALIAS_SUBPIXEL. See the documentation for
263 * cairo_subpixel_order_t for full details.
264 * options:
265 * a cairo_font_options_t
266 * subpixel_order:
267 * the new subpixel order
269 public void setSubpixelOrder(cairo_subpixel_order_t subpixelOrder)
271 // void cairo_font_options_set_subpixel_order (cairo_font_options_t *options, cairo_subpixel_order_t subpixel_order);
272 cairo_font_options_set_subpixel_order(cairo_font_options, subpixelOrder);
276 * Gets the subpixel order for the font options object.
277 * See the documentation for cairo_subpixel_order_t for full details.
278 * options:
279 * a cairo_font_options_t
280 * Returns:
281 * the subpixel order for the font options object
283 public cairo_subpixel_order_t getSubpixelOrder()
285 // cairo_subpixel_order_t cairo_font_options_get_subpixel_order (const cairo_font_options_t *options);
286 return cairo_font_options_get_subpixel_order(cairo_font_options);
291 * Sets the hint style for font outlines for the font options object.
292 * This controls whether to fit font outlines to the pixel grid,
293 * and if so, whether to optimize for fidelity or contrast.
294 * See the documentation for cairo_hint_style_t for full details.
295 * options:
296 * a cairo_font_options_t
297 * hint_style:
298 * the new hint style
300 public void setHintStyle(cairo_hint_style_t hintStyle)
302 // void cairo_font_options_set_hint_style (cairo_font_options_t *options, cairo_hint_style_t hint_style);
303 cairo_font_options_set_hint_style(cairo_font_options, hintStyle);
307 * Gets the hint style for font outlines for the font options object.
308 * See the documentation for cairo_hint_style_t for full details.
309 * options:
310 * a cairo_font_options_t
311 * Returns:
312 * the hint style for the font options object
314 public cairo_hint_style_t getHintStyle()
316 // cairo_hint_style_t cairo_font_options_get_hint_style (const cairo_font_options_t *options);
317 return cairo_font_options_get_hint_style(cairo_font_options);
322 * Sets the metrics hinting mode for the font options object. This
323 * controls whether metrics are quantized to integer values in
324 * device units.
325 * See the documentation for cairo_hint_metrics_t for full details.
326 * options:
327 * a cairo_font_options_t
328 * hint_metrics:
329 * the new metrics hinting mode
331 public void setHintMetrics(cairo_hint_metrics_t hintMetrics)
333 // void cairo_font_options_set_hint_metrics (cairo_font_options_t *options, cairo_hint_metrics_t hint_metrics);
334 cairo_font_options_set_hint_metrics(cairo_font_options, hintMetrics);
338 * Gets the metrics hinting mode for the font options object.
339 * See the documentation for cairo_hint_metrics_t for full details.
340 * options:
341 * a cairo_font_options_t
342 * Returns:
343 * the metrics hinting mode for the font options object
345 public cairo_hint_metrics_t getHintMetrics()
347 // cairo_hint_metrics_t cairo_font_options_get_hint_metrics (const cairo_font_options_t *options);
348 return cairo_font_options_get_hint_metrics(cairo_font_options);