// Package pango was automatically generated by github.com/bnema/puregotk DO NOT EDIT package pango import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject/types" ) // A `PangoScriptIter` is used to iterate through a string // and identify ranges in different scripts. type ScriptIter struct { _ structs.HostLayout } var xScriptIterGLibType func() types.GType func ScriptIterGLibType() types.GType { return xScriptIterGLibType() } func (x *ScriptIter) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xNewScriptIter func(string, int) *ScriptIter // Create a new `PangoScriptIter`, used to break a string of // Unicode text into runs by Unicode script. // // No copy is made of @text, so the caller needs to make // sure it remains valid until the iterator is freed with // [method@Pango.ScriptIter.free]. func NewScriptIter(TextVar string, LengthVar int) *ScriptIter { cret := xNewScriptIter(TextVar, LengthVar) return cret } var xScriptIterFree func(uintptr) // Frees a `PangoScriptIter`. func (x *ScriptIter) Free() { xScriptIterFree(x.GoPointer()) } var xScriptIterGetRange func(uintptr, *string, *string, *Script) // Gets information about the range to which @iter currently points. // // The range is the set of locations p where *start <= p < *end. // (That is, it doesn't include the character stored at *end) // // Note that while the type of the @script argument is declared // as `PangoScript`, as of Pango 1.18, this function simply returns // `GUnicodeScript` values. Callers must be prepared to handle unknown // values. func (x *ScriptIter) GetRange(StartVar *string, EndVar *string, ScriptVar *Script) { xScriptIterGetRange(x.GoPointer(), StartVar, EndVar, ScriptVar) } var xScriptIterNext func(uintptr) bool // Advances a `PangoScriptIter` to the next range. // // If @iter is already at the end, it is left unchanged // and %FALSE is returned. func (x *ScriptIter) Next() bool { cret := xScriptIterNext(x.GoPointer()) return cret } // The `PangoScript` enumeration identifies different writing // systems. // // The values correspond to the names as defined in the Unicode standard. See // [Unicode Standard Annex 24: Script names](http://www.unicode.org/reports/tr24/) // // Note that this enumeration is deprecated and will not be updated to include values // in newer versions of the Unicode standard. Applications should use the // [enum@GLib.UnicodeScript] enumeration instead, // whose values are interchangeable with `PangoScript`. type Script int var xScriptGLibType func() types.GType func ScriptGLibType() types.GType { return xScriptGLibType() } const ( // a value never returned from pango_script_for_unichar() ScriptInvalidCodeValue Script = -1 // a character used by multiple different scripts ScriptCommonValue Script = 0 // a mark glyph that takes its script from the // base glyph to which it is attached ScriptInheritedValue Script = 1 // Arabic ScriptArabicValue Script = 2 // Armenian ScriptArmenianValue Script = 3 // Bengali ScriptBengaliValue Script = 4 // Bopomofo ScriptBopomofoValue Script = 5 // Cherokee ScriptCherokeeValue Script = 6 // Coptic ScriptCopticValue Script = 7 // Cyrillic ScriptCyrillicValue Script = 8 // Deseret ScriptDeseretValue Script = 9 // Devanagari ScriptDevanagariValue Script = 10 // Ethiopic ScriptEthiopicValue Script = 11 // Georgian ScriptGeorgianValue Script = 12 // Gothic ScriptGothicValue Script = 13 // Greek ScriptGreekValue Script = 14 // Gujarati ScriptGujaratiValue Script = 15 // Gurmukhi ScriptGurmukhiValue Script = 16 // Han ScriptHanValue Script = 17 // Hangul ScriptHangulValue Script = 18 // Hebrew ScriptHebrewValue Script = 19 // Hiragana ScriptHiraganaValue Script = 20 // Kannada ScriptKannadaValue Script = 21 // Katakana ScriptKatakanaValue Script = 22 // Khmer ScriptKhmerValue Script = 23 // Lao ScriptLaoValue Script = 24 // Latin ScriptLatinValue Script = 25 // Malayalam ScriptMalayalamValue Script = 26 // Mongolian ScriptMongolianValue Script = 27 // Myanmar ScriptMyanmarValue Script = 28 // Ogham ScriptOghamValue Script = 29 // Old Italic ScriptOldItalicValue Script = 30 // Oriya ScriptOriyaValue Script = 31 // Runic ScriptRunicValue Script = 32 // Sinhala ScriptSinhalaValue Script = 33 // Syriac ScriptSyriacValue Script = 34 // Tamil ScriptTamilValue Script = 35 // Telugu ScriptTeluguValue Script = 36 // Thaana ScriptThaanaValue Script = 37 // Thai ScriptThaiValue Script = 38 // Tibetan ScriptTibetanValue Script = 39 // Canadian Aboriginal ScriptCanadianAboriginalValue Script = 40 // Yi ScriptYiValue Script = 41 // Tagalog ScriptTagalogValue Script = 42 // Hanunoo ScriptHanunooValue Script = 43 // Buhid ScriptBuhidValue Script = 44 // Tagbanwa ScriptTagbanwaValue Script = 45 // Braille ScriptBrailleValue Script = 46 // Cypriot ScriptCypriotValue Script = 47 // Limbu ScriptLimbuValue Script = 48 // Osmanya ScriptOsmanyaValue Script = 49 // Shavian ScriptShavianValue Script = 50 // Linear B ScriptLinearBValue Script = 51 // Tai Le ScriptTaiLeValue Script = 52 // Ugaritic ScriptUgariticValue Script = 53 // New Tai Lue. Since 1.10 ScriptNewTaiLueValue Script = 54 // Buginese. Since 1.10 ScriptBugineseValue Script = 55 // Glagolitic. Since 1.10 ScriptGlagoliticValue Script = 56 // Tifinagh. Since 1.10 ScriptTifinaghValue Script = 57 // Syloti Nagri. Since 1.10 ScriptSylotiNagriValue Script = 58 // Old Persian. Since 1.10 ScriptOldPersianValue Script = 59 // Kharoshthi. Since 1.10 ScriptKharoshthiValue Script = 60 // an unassigned code point. Since 1.14 ScriptUnknownValue Script = 61 // Balinese. Since 1.14 ScriptBalineseValue Script = 62 // Cuneiform. Since 1.14 ScriptCuneiformValue Script = 63 // Phoenician. Since 1.14 ScriptPhoenicianValue Script = 64 // Phags-pa. Since 1.14 ScriptPhagsPaValue Script = 65 // N'Ko. Since 1.14 ScriptNkoValue Script = 66 // Kayah Li. Since 1.20.1 ScriptKayahLiValue Script = 67 // Lepcha. Since 1.20.1 ScriptLepchaValue Script = 68 // Rejang. Since 1.20.1 ScriptRejangValue Script = 69 // Sundanese. Since 1.20.1 ScriptSundaneseValue Script = 70 // Saurashtra. Since 1.20.1 ScriptSaurashtraValue Script = 71 // Cham. Since 1.20.1 ScriptChamValue Script = 72 // Ol Chiki. Since 1.20.1 ScriptOlChikiValue Script = 73 // Vai. Since 1.20.1 ScriptVaiValue Script = 74 // Carian. Since 1.20.1 ScriptCarianValue Script = 75 // Lycian. Since 1.20.1 ScriptLycianValue Script = 76 // Lydian. Since 1.20.1 ScriptLydianValue Script = 77 // Batak. Since 1.32 ScriptBatakValue Script = 78 // Brahmi. Since 1.32 ScriptBrahmiValue Script = 79 // Mandaic. Since 1.32 ScriptMandaicValue Script = 80 // Chakma. Since: 1.32 ScriptChakmaValue Script = 81 // Meroitic Cursive. Since: 1.32 ScriptMeroiticCursiveValue Script = 82 // Meroitic Hieroglyphs. Since: 1.32 ScriptMeroiticHieroglyphsValue Script = 83 // Miao. Since: 1.32 ScriptMiaoValue Script = 84 // Sharada. Since: 1.32 ScriptSharadaValue Script = 85 // Sora Sompeng. Since: 1.32 ScriptSoraSompengValue Script = 86 // Takri. Since: 1.32 ScriptTakriValue Script = 87 // Bassa. Since: 1.40 ScriptBassaVahValue Script = 88 // Caucasian Albanian. Since: 1.40 ScriptCaucasianAlbanianValue Script = 89 // Duployan. Since: 1.40 ScriptDuployanValue Script = 90 // Elbasan. Since: 1.40 ScriptElbasanValue Script = 91 // Grantha. Since: 1.40 ScriptGranthaValue Script = 92 // Kjohki. Since: 1.40 ScriptKhojkiValue Script = 93 // Khudawadi, Sindhi. Since: 1.40 ScriptKhudawadiValue Script = 94 // Linear A. Since: 1.40 ScriptLinearAValue Script = 95 // Mahajani. Since: 1.40 ScriptMahajaniValue Script = 96 // Manichaean. Since: 1.40 ScriptManichaeanValue Script = 97 // Mende Kikakui. Since: 1.40 ScriptMendeKikakuiValue Script = 98 // Modi. Since: 1.40 ScriptModiValue Script = 99 // Mro. Since: 1.40 ScriptMroValue Script = 100 // Nabataean. Since: 1.40 ScriptNabataeanValue Script = 101 // Old North Arabian. Since: 1.40 ScriptOldNorthArabianValue Script = 102 // Old Permic. Since: 1.40 ScriptOldPermicValue Script = 103 // Pahawh Hmong. Since: 1.40 ScriptPahawhHmongValue Script = 104 // Palmyrene. Since: 1.40 ScriptPalmyreneValue Script = 105 // Pau Cin Hau. Since: 1.40 ScriptPauCinHauValue Script = 106 // Psalter Pahlavi. Since: 1.40 ScriptPsalterPahlaviValue Script = 107 // Siddham. Since: 1.40 ScriptSiddhamValue Script = 108 // Tirhuta. Since: 1.40 ScriptTirhutaValue Script = 109 // Warang Citi. Since: 1.40 ScriptWarangCitiValue Script = 110 // Ahom. Since: 1.40 ScriptAhomValue Script = 111 // Anatolian Hieroglyphs. Since: 1.40 ScriptAnatolianHieroglyphsValue Script = 112 // Hatran. Since: 1.40 ScriptHatranValue Script = 113 // Multani. Since: 1.40 ScriptMultaniValue Script = 114 // Old Hungarian. Since: 1.40 ScriptOldHungarianValue Script = 115 // Signwriting. Since: 1.40 ScriptSignwritingValue Script = 116 ) var xScriptForUnichar func(uint32) Script // Looks up the script for a particular character. // // The script of a character is defined by // [Unicode Standard Annex 24: Script names](http://www.unicode.org/reports/tr24/). // // No check is made for @ch being a valid Unicode character; if you pass // in invalid character, the result is undefined. // // Note that while the return type of this function is declared // as `PangoScript`, as of Pango 1.18, this function simply returns // the return value of [func@GLib.unichar_get_script]. Callers must be // prepared to handle unknown values. func ScriptForUnichar(ChVar uint32) Script { cret := xScriptForUnichar(ChVar) return cret } var xScriptGetSampleLanguage func(Script) *Language // Finds a language tag that is reasonably representative of @script. // // The language will usually be the most widely spoken or used language // written in that script: for instance, the sample language for // %PANGO_SCRIPT_CYRILLIC is ru (Russian), the sample language for // %PANGO_SCRIPT_ARABIC is ar. // // For some scripts, no sample language will be returned because // there is no language that is sufficiently representative. The // best example of this is %PANGO_SCRIPT_HAN, where various different // variants of written Chinese, Japanese, and Korean all use // significantly different sets of Han characters and forms // of shared characters. No sample language can be provided // for many historical scripts as well. // // As of 1.18, this function checks the environment variables // `PANGO_LANGUAGE` and `LANGUAGE` (checked in that order) first. // If one of them is set, it is parsed as a list of language tags // separated by colons or other separators. This function // will return the first language in the parsed list that Pango // believes may use @script for writing. This last predicate // is tested using [method@Pango.Language.includes_script]. This can // be used to control Pango's font selection for non-primary // languages. For example, a `PANGO_LANGUAGE` enviroment variable // set to "en:fa" makes Pango choose fonts suitable for Persian (fa) // instead of Arabic (ar) when a segment of Arabic text is found // in an otherwise non-Arabic text. The same trick can be used to // choose a default language for %PANGO_SCRIPT_HAN when setting // context language is not feasible. func ScriptGetSampleLanguage(ScriptVar Script) *Language { cret := xScriptGetSampleLanguage(ScriptVar) return cret } func init() { core.SetPackageName("PANGO", "pango") core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("PANGO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xScriptGLibType, libs, "pango_script_get_type") core.PuregoSafeRegister(&xScriptForUnichar, libs, "pango_script_for_unichar") core.PuregoSafeRegister(&xScriptGetSampleLanguage, libs, "pango_script_get_sample_language") core.PuregoSafeRegister(&xScriptIterGLibType, libs, "pango_script_iter_get_type") core.PuregoSafeRegister(&xNewScriptIter, libs, "pango_script_iter_new") core.PuregoSafeRegister(&xScriptIterFree, libs, "pango_script_iter_free") core.PuregoSafeRegister(&xScriptIterGetRange, libs, "pango_script_iter_get_range") core.PuregoSafeRegister(&xScriptIterNext, libs, "pango_script_iter_next") }