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 * Pango supports a flexible architecture where a 76 * particular rendering architecture can supply an 77 * implementation of fonts. The PangoFont structure 78 * represents an abstract rendering-system-independent font. 79 * Pango provides routines to list available fonts, and 80 * to load a font of a given description. 81 */ 82 public class PgFontsetSimple : PgFontset 83 { 84 85 /** the main Gtk struct */ 86 protected PangoFontsetSimple* pangoFontsetSimple; 87 88 89 public PangoFontsetSimple* getPgFontsetSimpleStruct() 90 { 91 return pangoFontsetSimple; 92 } 93 94 95 /** the main Gtk struct as a void* */ 96 protected override void* getStruct() 97 { 98 return cast(void*)pangoFontsetSimple; 99 } 100 101 /** 102 * Sets our main struct and passes it to the parent class 103 */ 104 public this (PangoFontsetSimple* pangoFontsetSimple) 105 { 106 super(cast(PangoFontset*)pangoFontsetSimple); 107 this.pangoFontsetSimple = pangoFontsetSimple; 108 } 109 110 protected override void setStruct(GObject* obj) 111 { 112 super.setStruct(obj); 113 pangoFontsetSimple = cast(PangoFontsetSimple*)obj; 114 } 115 116 /** 117 */ 118 119 /** 120 * Creates a new PangoFontsetSimple for the given language. 121 * Params: 122 * language = a PangoLanguage tag 123 * Throws: ConstructionException GTK+ fails to create the object. 124 */ 125 public this (PgLanguage language) 126 { 127 // PangoFontsetSimple * pango_fontset_simple_new (PangoLanguage *language); 128 auto p = pango_fontset_simple_new((language is null) ? null : language.getPgLanguageStruct()); 129 if(p is null) 130 { 131 throw new ConstructionException("null returned by pango_fontset_simple_new((language is null) ? null : language.getPgLanguageStruct())"); 132 } 133 this(cast(PangoFontsetSimple*) p); 134 } 135 136 /** 137 * Adds a font to the fontset. 138 * Params: 139 * font = a PangoFont. 140 */ 141 public void append(PgFont font) 142 { 143 // void pango_fontset_simple_append (PangoFontsetSimple *fontset, PangoFont *font); 144 pango_fontset_simple_append(pangoFontsetSimple, (font is null) ? null : font.getPgFontStruct()); 145 } 146 147 /** 148 * Returns the number of fonts in the fontset. 149 * Returns: the size of fontset. 150 */ 151 public int size() 152 { 153 // int pango_fontset_simple_size (PangoFontsetSimple *fontset); 154 return pango_fontset_simple_size(pangoFontsetSimple); 155 } 156 }