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