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 private import pango.PgLanguage;
66 
67 
68 
69 /**
70  * The functions in this section are used to identify the writing
71  * system, or script of individual characters
72  * and of ranges within a larger text string.
73  */
74 public class PgScript
75 {
76 	
77 	/**
78 	 */
79 	
80 	/**
81 	 * Looks up the PangoScript for a particular character (as defined by
82 	 * Unicode Standard Annex 24). No check is made for ch being a
83 	 * valid Unicode character; if you pass in invalid character, the
84 	 * result is undefined.
85 	 * As of Pango 1.18, this function simply returns the return value of
86 	 * g_unichar_get_script().
87 	 * Since 1.4
88 	 * Params:
89 	 * ch = a Unicode character
90 	 * Returns: the PangoScript for the character.
91 	 */
92 	public static PangoScript scriptForUnichar(gunichar ch)
93 	{
94 		// PangoScript pango_script_for_unichar (gunichar ch);
95 		return pango_script_for_unichar(ch);
96 	}
97 	
98 	/**
99 	 * Given a script, finds a language tag that is reasonably
100 	 * representative of that script. This will usually be the
101 	 * Since 1.4
102 	 * Params:
103 	 * script = a PangoScript
104 	 * Returns: a PangoLanguage that is representative of the script, or NULL if no such language exists.
105 	 */
106 	public static PgLanguage scriptGetSampleLanguage(PangoScript script)
107 	{
108 		// PangoLanguage * pango_script_get_sample_language (PangoScript script);
109 		auto p = pango_script_get_sample_language(script);
110 		
111 		if(p is null)
112 		{
113 			return null;
114 		}
115 		
116 		return ObjectG.getDObject!(PgLanguage)(cast(PangoLanguage*) p);
117 	}
118 }