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