alternative to assert
[gtkD.git] / src / cairoLib / FontOption.d
blob4fd22a730bf1fc8a631f2352a5b013680af9473e
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 * local aliases:
48 module cairoLib.FontOption;
50 private import cairoLib.cairoLibtypes;
52 private import lib.cairoLib;
55 /**
56 * Description
58 public class FontOption
61 /** the main Gtk struct */
62 protected cairo_font_options_t* cairo_font_options;
65 public cairo_font_options_t* getFontOptionStruct()
67 return cairo_font_options;
71 /** the main Gtk struct as a void* */
72 protected void* getStruct()
74 return cast(void*)cairo_font_options;
77 /**
78 * Sets our main struct and passes it to the parent class
80 public this (cairo_font_options_t* cairo_font_options)
82 this.cairo_font_options = cairo_font_options;
85 /**
89 /**
90 * Allocates a new font options object with all options initialized
91 * to default values.
92 * Returns:
93 * a newly allocated cairo_font_options_t. Free with
94 * cairo_font_options_destroy(). This function always returns a
95 * valid pointer; if memory cannot be allocated, then a special
96 * error object is returned where all operations on the object do nothing.
97 * You can check for this with cairo_font_options_status().
99 public static cairo_font_options_t* create()
101 // cairo_font_options_t* cairo_font_options_create (void);
102 return cairo_font_options_create();
106 * Allocates a new font options object copying the option values from
107 * original.
108 * original:
109 * a cairo_font_options_t
110 * Returns:
111 * a newly allocated cairo_font_options_t. Free with
112 * cairo_font_options_destroy(). This function always returns a
113 * valid pointer; if memory cannot be allocated, then a special
114 * error object is returned where all operations on the object do nothing.
115 * You can check for this with cairo_font_options_status().
117 public cairo_font_options_t* copy()
119 // cairo_font_options_t* cairo_font_options_copy (const cairo_font_options_t *original);
120 return cairo_font_options_copy(cairo_font_options);
124 * Destroys a cairo_font_options_t object created with with
125 * cairo_font_options_create() or cairo_font_options_copy().
126 * options:
127 * a cairo_font_options_t
129 public void destroy()
131 // void cairo_font_options_destroy (cairo_font_options_t *options);
132 cairo_font_options_destroy(cairo_font_options);
136 * Checks whether an error has previously occurred for this
137 * font options object
138 * options:
139 * a cairo_font_options_t
140 * Returns:
141 * CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY
143 public cairo_status_t status()
145 // cairo_status_t cairo_font_options_status (cairo_font_options_t *options);
146 return cairo_font_options_status(cairo_font_options);
150 * Merges non-default options from other into options, replacing
151 * existing values. This operation can be thought of as somewhat
152 * similar to compositing other onto options with the operation
153 * of CAIRO_OPERATION_OVER.
154 * options:
155 * a cairo_font_options_t
156 * other:
157 * another cairo_font_options_t
159 public void merge(cairo_font_options_t* other)
161 // void cairo_font_options_merge (cairo_font_options_t *options, const cairo_font_options_t *other);
162 cairo_font_options_merge(cairo_font_options, other);
166 * Compute a hash for the font options object; this value will
167 * be useful when storing an object containing a cairo_font_options_t
168 * in a hash table.
169 * options:
170 * a cairo_font_options_t
171 * Returns:
172 * the hash value for the font options object.
173 * The return value can be cast to a 32-bit type if a
174 * 32-bit hash value is needed.
176 public ulong hash()
178 // unsigned long cairo_font_options_hash (const cairo_font_options_t *options);
179 return cairo_font_options_hash(cairo_font_options);
183 * Compares two font options objects for equality.
184 * options:
185 * a cairo_font_options_t
186 * other:
187 * another cairo_font_options_t
188 * Returns:
189 * TRUE if all fields of the two font options objects match
191 public cairo_bool_t equal(cairo_font_options_t* other)
193 // cairo_bool_t cairo_font_options_equal (const cairo_font_options_t *options, const cairo_font_options_t *other);
194 return cairo_font_options_equal(cairo_font_options, other);
198 * Sets the antiliasing mode for the font options object. This
199 * specifies the type of antialiasing to do when rendering text.
200 * options:
201 * a cairo_font_options_t
202 * antialias:
203 * the new antialiasing mode
205 public void setAntialias(cairo_antialias_t antialias)
207 // void cairo_font_options_set_antialias (cairo_font_options_t *options, cairo_antialias_t antialias);
208 cairo_font_options_set_antialias(cairo_font_options, antialias);
212 * Gets the antialising mode for the font options object.
213 * options:
214 * a cairo_font_options_t
215 * Returns:
216 * the antialiasing mode
218 public cairo_antialias_t getAntialias()
220 // cairo_antialias_t cairo_font_options_get_antialias (const cairo_font_options_t *options);
221 return cairo_font_options_get_antialias(cairo_font_options);
226 * Sets the subpixel order for the font options object. The subpixel
227 * order specifies the order of color elements within each pixel on
228 * the display device when rendering with an antialiasing mode of
229 * CAIRO_ANTIALIAS_SUBPIXEL. See the documentation for
230 * cairo_subpixel_order_t for full details.
231 * options:
232 * a cairo_font_options_t
233 * subpixel_order:
234 * the new subpixel order
236 public void setSubpixelOrder(cairo_subpixel_order_t subpixelOrder)
238 // void cairo_font_options_set_subpixel_order (cairo_font_options_t *options, cairo_subpixel_order_t subpixel_order);
239 cairo_font_options_set_subpixel_order(cairo_font_options, subpixelOrder);
243 * Gets the subpixel order for the font options object.
244 * See the documentation for cairo_subpixel_order_t for full details.
245 * options:
246 * a cairo_font_options_t
247 * Returns:
248 * the subpixel order for the font options object
250 public cairo_subpixel_order_t getSubpixelOrder()
252 // cairo_subpixel_order_t cairo_font_options_get_subpixel_order (const cairo_font_options_t *options);
253 return cairo_font_options_get_subpixel_order(cairo_font_options);
258 * Sets the hint style for font outlines for the font options object.
259 * This controls whether to fit font outlines to the pixel grid,
260 * and if so, whether to optimize for fidelity or contrast.
261 * See the documentation for cairo_hint_style_t for full details.
262 * options:
263 * a cairo_font_options_t
264 * hint_style:
265 * the new hint style
267 public void setHintStyle(cairo_hint_style_t hintStyle)
269 // void cairo_font_options_set_hint_style (cairo_font_options_t *options, cairo_hint_style_t hint_style);
270 cairo_font_options_set_hint_style(cairo_font_options, hintStyle);
274 * Gets the hint style for font outlines for the font options object.
275 * See the documentation for cairo_hint_style_t for full details.
276 * options:
277 * a cairo_font_options_t
278 * Returns:
279 * the hint style for the font options object
281 public cairo_hint_style_t getHintStyle()
283 // cairo_hint_style_t cairo_font_options_get_hint_style (const cairo_font_options_t *options);
284 return cairo_font_options_get_hint_style(cairo_font_options);
289 * Sets the metrics hinting mode for the font options object. This
290 * controls whether metrics are quantized to integer values in
291 * device units.
292 * See the documentation for cairo_hint_metrics_t for full details.
293 * options:
294 * a cairo_font_options_t
295 * hint_metrics:
296 * the new metrics hinting mode
298 public void setHintMetrics(cairo_hint_metrics_t hintMetrics)
300 // void cairo_font_options_set_hint_metrics (cairo_font_options_t *options, cairo_hint_metrics_t hint_metrics);
301 cairo_font_options_set_hint_metrics(cairo_font_options, hintMetrics);
305 * Gets the metrics hinting mode for the font options object.
306 * See the documentation for cairo_hint_metrics_t for full details.
307 * options:
308 * a cairo_font_options_t
309 * Returns:
310 * the metrics hinting mode for the font options object
312 public cairo_hint_metrics_t getHintMetrics()
314 // cairo_hint_metrics_t cairo_font_options_get_hint_metrics (const cairo_font_options_t *options);
315 return cairo_font_options_get_hint_metrics(cairo_font_options);