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 module pango.PgMap;
26 
27 private import glib.ListSG;
28 private import gobject.ObjectG;
29 private import gtkc.pango;
30 public  import gtkc.pangotypes;
31 private import pango.PgEngine;
32 private import pango.PgLanguage;
33 
34 
35 /** */
36 public class PgMap
37 {
38 	/** the main Gtk struct */
39 	protected PangoMap* pangoMap;
40 	protected bool ownedRef;
41 
42 	/** Get the main Gtk struct */
43 	public PangoMap* getPgMapStruct(bool transferOwnership = false)
44 	{
45 		if (transferOwnership)
46 			ownedRef = false;
47 		return pangoMap;
48 	}
49 
50 	/** the main Gtk struct as a void* */
51 	protected void* getStruct()
52 	{
53 		return cast(void*)pangoMap;
54 	}
55 
56 	/**
57 	 * Sets our main struct and passes it to the parent class.
58 	 */
59 	public this (PangoMap* pangoMap, bool ownedRef = false)
60 	{
61 		this.pangoMap = pangoMap;
62 		this.ownedRef = ownedRef;
63 	}
64 
65 
66 	/**
67 	 * Do not use.  Does not do anything.
68 	 *
69 	 * Params:
70 	 *     script = a #PangoScript
71 	 *
72 	 * Returns: %NULL.
73 	 */
74 	public PgEngine getEngine(PangoScript script)
75 	{
76 		auto p = pango_map_get_engine(pangoMap, script);
77 		
78 		if(p is null)
79 		{
80 			return null;
81 		}
82 		
83 		return ObjectG.getDObject!(PgEngine)(cast(PangoEngine*) p);
84 	}
85 
86 	/**
87 	 * Do not use.  Does not do anything.
88 	 *
89 	 * Params:
90 	 *     script = a #PangoScript
91 	 *     exactEngines = location to store list of engines that exactly
92 	 *         handle this script.
93 	 *     fallbackEngines = location to store list of engines that approximately
94 	 *         handle this script.
95 	 *
96 	 * Since: 1.4
97 	 */
98 	public void getEngines(PangoScript script, out ListSG exactEngines, out ListSG fallbackEngines)
99 	{
100 		GSList* outexactEngines = null;
101 		GSList* outfallbackEngines = null;
102 		
103 		pango_map_get_engines(pangoMap, script, &outexactEngines, &outfallbackEngines);
104 		
105 		exactEngines = new ListSG(outexactEngines);
106 		fallbackEngines = new ListSG(outfallbackEngines);
107 	}
108 
109 	/**
110 	 * Do not use.  Does not do anything.
111 	 *
112 	 * Params:
113 	 *     language = the language tag for which to find the map
114 	 *     engineTypeId = the engine type for the map to find
115 	 *     renderTypeId = the render type for the map to find
116 	 *
117 	 * Returns: %NULL.
118 	 */
119 	public static PgMap findMap(PgLanguage language, uint engineTypeId, uint renderTypeId)
120 	{
121 		auto p = pango_find_map((language is null) ? null : language.getPgLanguageStruct(), engineTypeId, renderTypeId);
122 		
123 		if(p is null)
124 		{
125 			return null;
126 		}
127 		
128 		return ObjectG.getDObject!(PgMap)(cast(PangoMap*) p);
129 	}
130 
131 	/**
132 	 * Do not use.  Does not do anything.
133 	 *
134 	 * Params:
135 	 *     modul = a #PangoIncludedModule
136 	 */
137 	public static void moduleRegister(PangoIncludedModule* modul)
138 	{
139 		pango_module_register(modul);
140 	}
141 }