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  = pango-Scripts-and-Languages.html
27  * outPack = pango
28  * outFile = PgScript
29  * strct   = 
30  * realStrct=
31  * ctorStrct=
32  * clss    = PgScript
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- pango_
41  * 	- pango_script_
42  * omit structs:
43  * omit prefixes:
44  * 	- pango_script_iter_
45  * 	- pango_language_
46  * omit code:
47  * omit signals:
48  * imports:
49  * 	- pango.PgLanguage
50  * structWrap:
51  * 	- PangoLanguage* -> PgLanguage
52  * module aliases:
53  * local aliases:
54  * overrides:
55  */
56 
57 module pango.PgScript;
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 
68 
69 
70 
71 /**
72  * The functions in this section are used to identify the writing
73  * system, or script of individual characters
74  * and of ranges within a larger text string.
75  */
76 public class PgScript
77 {
78 	
79 	/**
80 	 */
81 	
82 	/**
83 	 * Looks up the PangoScript for a particular character (as defined by
84 	 * Unicode Standard Annex 24). No check is made for ch being a
85 	 * valid Unicode character; if you pass in invalid character, the
86 	 * result is undefined.
87 	 * As of Pango 1.18, this function simply returns the return value of
88 	 * g_unichar_get_script().
89 	 * Since 1.4
90 	 * Params:
91 	 * ch = a Unicode character
92 	 * Returns: the PangoScript for the character.
93 	 */
94 	public static PangoScript scriptForUnichar(gunichar ch)
95 	{
96 		// PangoScript pango_script_for_unichar (gunichar ch);
97 		return pango_script_for_unichar(ch);
98 	}
99 	
100 	/**
101 	 * Given a script, finds a language tag that is reasonably
102 	 * representative of that script. This will usually be the
103 	 * Since 1.4
104 	 * Params:
105 	 * script = a PangoScript
106 	 * Returns: a PangoLanguage that is representative of the script, or NULL if no such language exists.
107 	 */
108 	public static PgLanguage scriptGetSampleLanguage(PangoScript script)
109 	{
110 		// PangoLanguage * pango_script_get_sample_language (PangoScript script);
111 		auto p = pango_script_get_sample_language(script);
112 		
113 		if(p is null)
114 		{
115 			return null;
116 		}
117 		
118 		return ObjectG.getDObject!(PgLanguage)(cast(PangoLanguage*) p);
119 	}
120 }