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