alternative to assert
[gtkD.git] / gtkD / src / pango / PgFontMap.d
blobc1d97b22f692fc93aed47ee12559a01980069c6a
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 =
26 * outPack = pango
27 * outFile = PgFontMap
28 * strct = PangoFontMap
29 * realStrct=
30 * ctorStrct=
31 * clss = PgFontMap
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - pango_font_map_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - pango.PgContext
45 * - pango.PgItem
46 * - pango.PgLayout
47 * - pango.PgFontDescription
48 * - pango.PgFontMetrics
49 * - pango.PgFontFamily
50 * - pango.PgFontFace
51 * - pango.PgFontsetSimple
52 * - pango.PgAttribute
53 * - pango.PgAttributeList
54 * - pango.PgLanguage
55 * - pango.PgTabArray
56 * - pango.PgLayout
57 * - pango.PgLayoutIter
58 * - pango.PgScriptIter
59 * - glib.Str
60 * structWrap:
61 * - PangoAttribute* -> PgAttribute
62 * - PangoAttributeList* -> PgAttributeList
63 * - PangoContext* -> PgContext
64 * - PangoFontDescription* -> PgFontDescription
65 * - PangoFontFace* -> PgFontFace
66 * - PangoFontFamily* -> PgFontFamily
67 * - PangoFontMetrics* -> PgFontMetrics
68 * - PangoFontsetSimple* -> PgFontsetSimple
69 * - PangoItem* -> PgItem
70 * - PangoLanguage* -> PgLanguage
71 * - PangoLayout* -> PgLayout
72 * - PangoLayoutIter* -> PgLayoutIter
73 * - PangoScriptIter* -> PgScriptIter
74 * - PangoTabArray* -> PgTabArray
75 * module aliases:
76 * local aliases:
79 module pango.PgFontMap;
81 version(noAssert)
83 version(Tango)
85 import tango.io.Stdout; // use the tango loging?
89 private import gtkc.pangotypes;
91 private import gtkc.pango;
94 private import pango.PgContext;
95 private import pango.PgItem;
96 private import pango.PgLayout;
97 private import pango.PgFontDescription;
98 private import pango.PgFontMetrics;
99 private import pango.PgFontFamily;
100 private import pango.PgFontFace;
101 private import pango.PgFontsetSimple;
102 private import pango.PgAttribute;
103 private import pango.PgAttributeList;
104 private import pango.PgLanguage;
105 private import pango.PgTabArray;
106 private import pango.PgLayout;
107 private import pango.PgLayoutIter;
108 private import pango.PgScriptIter;
109 private import glib.Str;
115 * Description
116 * Pango supports a flexible architecture where a
117 * particular rendering architecture can supply an
118 * implementation of fonts. The PangoFont structure
119 * represents an abstract rendering-system-independent font.
120 * Pango provides routines to list available fonts, and
121 * to load a font of a given description.
123 public class PgFontMap
126 /** the main Gtk struct */
127 protected PangoFontMap* pangoFontMap;
130 public PangoFontMap* getPgFontMapStruct()
132 return pangoFontMap;
136 /** the main Gtk struct as a void* */
137 protected void* getStruct()
139 return cast(void*)pangoFontMap;
143 * Sets our main struct and passes it to the parent class
145 public this (PangoFontMap* pangoFontMap)
147 version(noAssert)
149 if ( pangoFontMap is null )
151 int zero = 0;
152 version(Tango)
154 Stdout("struct pangoFontMap is null on constructor").newline;
156 else
158 printf("struct pangoFontMap is null on constructor");
160 zero = zero / zero;
163 else
165 assert(pangoFontMap !is null, "struct pangoFontMap is null on constructor");
167 this.pangoFontMap = pangoFontMap;
263 * Load the font in the fontmap that is the closest match for desc.
264 * fontmap:
265 * a PangoFontMap
266 * context:
267 * the PangoContext the font will be used with
268 * desc:
269 * a PangoFontDescription describing the font to load
270 * Returns:
271 * the font loaded, or NULL if no font matched.
273 public PangoFont* loadFont(PgContext context, PgFontDescription desc)
275 // PangoFont* pango_font_map_load_font (PangoFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc);
276 return pango_font_map_load_font(pangoFontMap, (context is null) ? null : context.getPgContextStruct(), (desc is null) ? null : desc.getPgFontDescriptionStruct());
280 * Load a set of fonts in the fontmap that can be used to render
281 * a font matching desc.
282 * fontmap:
283 * a PangoFontMap
284 * context:
285 * the PangoContext the font will be used with
286 * desc:
287 * a PangoFontDescription describing the font to load
288 * language:
289 * a PangoLanguage the fonts will be used for
290 * Returns:
291 * the fontset, or NULL if no font matched.
293 public PangoFontset* loadFontset(PgContext context, PgFontDescription desc, PgLanguage language)
295 // PangoFontset* pango_font_map_load_fontset (PangoFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc, PangoLanguage *language);
296 return pango_font_map_load_fontset(pangoFontMap, (context is null) ? null : context.getPgContextStruct(), (desc is null) ? null : desc.getPgFontDescriptionStruct(), (language is null) ? null : language.getPgLanguageStruct());
300 * List all families for a fontmap.
301 * fontmap:
302 * a PangoFontMap
303 * families:
304 * location to store a pointer to an array of PangoFontFamily *.
305 * This array should be freed with g_free().
306 * n_families:
307 * location to store the number of elements in families
309 public void listFamilies(PangoFontFamily*** families, int* nFamilies)
311 // void pango_font_map_list_families (PangoFontMap *fontmap, PangoFontFamily ***families, int *n_families);
312 pango_font_map_list_families(pangoFontMap, families, nFamilies);
316 * Returns the render ID for shape engines for this fontmap.
317 * See the render_type field of
318 * PangoEngineInfo.
319 * fontmap:
320 * a PangoFontMap
321 * Returns:
322 * the ID string for shape engines for
323 * this fontmap. Owned by Pango, should not be modified
324 * or freed.
325 * Since 1.4
327 public char[] getShapeEngineType()
329 // const char* pango_font_map_get_shape_engine_type (PangoFontMap *fontmap);
330 return Str.toString(pango_font_map_get_shape_engine_type(pangoFontMap) );