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 = PgFontsetSimple 29 * strct = PangoFontsetSimple 30 * realStrct= 31 * ctorStrct= 32 * clss = PgFontsetSimple 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = PangoFontset 38 * implements: 39 * prefixes: 40 * - pango_fontset_simple_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - pango.PgLanguage 47 * - pango.PgFont 48 * - pango.PgFontset 49 * structWrap: 50 * - PangoFont* -> PgFont 51 * - PangoLanguage* -> PgLanguage 52 * module aliases: 53 * local aliases: 54 * overrides: 55 */ 56 57 module pango.PgFontsetSimple; 58 59 public import gtkc.pangotypes; 60 61 private import gtkc.pango; 62 private import glib.ConstructionException; 63 private import gobject.ObjectG; 64 65 66 private import pango.PgLanguage; 67 private import pango.PgFont; 68 private import pango.PgFontset; 69 70 71 72 private import pango.PgFontset; 73 74 /** 75 * Description 76 * Pango supports a flexible architecture where a 77 * particular rendering architecture can supply an 78 * implementation of fonts. The PangoFont structure 79 * represents an abstract rendering-system-independent font. 80 * Pango provides routines to list available fonts, and 81 * to load a font of a given description. 82 */ 83 public class PgFontsetSimple : PgFontset 84 { 85 86 /** the main Gtk struct */ 87 protected PangoFontsetSimple* pangoFontsetSimple; 88 89 90 public PangoFontsetSimple* getPgFontsetSimpleStruct() 91 { 92 return pangoFontsetSimple; 93 } 94 95 96 /** the main Gtk struct as a void* */ 97 protected override void* getStruct() 98 { 99 return cast(void*)pangoFontsetSimple; 100 } 101 102 /** 103 * Sets our main struct and passes it to the parent class 104 */ 105 public this (PangoFontsetSimple* pangoFontsetSimple) 106 { 107 super(cast(PangoFontset*)pangoFontsetSimple); 108 this.pangoFontsetSimple = pangoFontsetSimple; 109 } 110 111 protected override void setStruct(GObject* obj) 112 { 113 super.setStruct(obj); 114 pangoFontsetSimple = cast(PangoFontsetSimple*)obj; 115 } 116 117 /** 118 */ 119 120 /** 121 * Creates a new PangoFontsetSimple for the given language. 122 * Params: 123 * language = a PangoLanguage tag 124 * Throws: ConstructionException GTK+ fails to create the object. 125 */ 126 public this (PgLanguage language) 127 { 128 // PangoFontsetSimple * pango_fontset_simple_new (PangoLanguage *language); 129 auto p = pango_fontset_simple_new((language is null) ? null : language.getPgLanguageStruct()); 130 if(p is null) 131 { 132 throw new ConstructionException("null returned by pango_fontset_simple_new((language is null) ? null : language.getPgLanguageStruct())"); 133 } 134 this(cast(PangoFontsetSimple*) p); 135 } 136 137 /** 138 * Adds a font to the fontset. 139 * Params: 140 * font = a PangoFont. 141 */ 142 public void append(PgFont font) 143 { 144 // void pango_fontset_simple_append (PangoFontsetSimple *fontset, PangoFont *font); 145 pango_fontset_simple_append(pangoFontsetSimple, (font is null) ? null : font.getPgFontStruct()); 146 } 147 148 /** 149 * Returns the number of fonts in the fontset. 150 * Returns: the size of fontset. 151 */ 152 public int size() 153 { 154 // int pango_fontset_simple_size (PangoFontsetSimple *fontset); 155 return pango_fontset_simple_size(pangoFontsetSimple); 156 } 157 }