1// Package pango was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package pango
3
4import (
5 "github.com/ebitengine/purego"
6
7 "github.com/bnema/puregotk/pkg/core"
8 "github.com/bnema/puregotk/v4/glib"
9 "github.com/bnema/puregotk/v4/gobject/types"
10)
11
12var xFindParagraphBoundary func(string, int, *int, *int)
13
14// Locates a paragraph boundary in @text.
15//
16// A boundary is caused by delimiter characters, such as
17// a newline, carriage return, carriage return-newline pair,
18// or Unicode paragraph separator character.
19//
20// The index of the run of delimiters is returned in
21// @paragraph_delimiter_index. The index of the start of the
22// next paragraph (index after all delimiters) is stored n
23// @next_paragraph_start.
24//
25// If no delimiters are found, both @paragraph_delimiter_index
26// and @next_paragraph_start are filled with the length of @text
27// (an index one off the end).
28func FindParagraphBoundary(TextVar string, LengthVar int, ParagraphDelimiterIndexVar *int, NextParagraphStartVar *int) {
29
30 xFindParagraphBoundary(TextVar, LengthVar, ParagraphDelimiterIndexVar, NextParagraphStartVar)
31
32}
33
34var xIsZeroWidth func(uint32) bool
35
36// Checks if a character that should not be normally rendered.
37//
38// This includes all Unicode characters with "ZERO WIDTH" in their name,
39// as well as *bidi* formatting characters, and a few other ones.
40//
41// This is totally different from [func@GLib.unichar_iszerowidth] and is at best misnamed.
42func IsZeroWidth(ChVar uint32) bool {
43
44 cret := xIsZeroWidth(ChVar)
45 return cret
46}
47
48var xLog2visGetEmbeddingLevels func(string, int, *Direction) uintptr
49
50// Return the bidirectional embedding levels of the input paragraph.
51//
52// The bidirectional embedding levels are defined by the [Unicode Bidirectional
53// Algorithm](http://www.unicode.org/reports/tr9/).
54//
55// If the input base direction is a weak direction, the direction of the
56// characters in the text will determine the final resolved direction.
57func Log2visGetEmbeddingLevels(TextVar string, LengthVar int, PbaseDirVar *Direction) uintptr {
58
59 cret := xLog2visGetEmbeddingLevels(TextVar, LengthVar, PbaseDirVar)
60 return cret
61}
62
63var xParseEnum func(types.GType, uintptr, *int, bool, *string) bool
64
65// Parses an enum type and stores the result in @value.
66//
67// If @str does not match the nick name of any of the possible values
68// for the enum and is not an integer, %FALSE is returned, a warning
69// is issued if @warn is %TRUE, and a string representing the list of
70// possible values is stored in @possible_values. The list is
71// slash-separated, eg. "none/start/middle/end".
72//
73// If failed and @possible_values is not %NULL, returned string should
74// be freed using g_free().
75func ParseEnum(TypeVar types.GType, StrVar *string, ValueVar *int, WarnVar bool, PossibleValuesVar *string) bool {
76
77 StrVarPtr := core.GStrdupNullable(StrVar)
78 defer core.GFreeNullable(StrVarPtr)
79
80 cret := xParseEnum(TypeVar, StrVarPtr, ValueVar, WarnVar, PossibleValuesVar)
81 return cret
82}
83
84var xParseStretch func(string, *Stretch, bool) bool
85
86// Parses a font stretch.
87//
88// The allowed values are
89// "ultra_condensed", "extra_condensed", "condensed",
90// "semi_condensed", "normal", "semi_expanded", "expanded",
91// "extra_expanded" and "ultra_expanded". Case variations are
92// ignored and the '_' characters may be omitted.
93func ParseStretch(StrVar string, StretchVar *Stretch, WarnVar bool) bool {
94
95 cret := xParseStretch(StrVar, StretchVar, WarnVar)
96 return cret
97}
98
99var xParseStyle func(string, *Style, bool) bool
100
101// Parses a font style.
102//
103// The allowed values are "normal", "italic" and "oblique", case
104// variations being
105// ignored.
106func ParseStyle(StrVar string, StyleVar *Style, WarnVar bool) bool {
107
108 cret := xParseStyle(StrVar, StyleVar, WarnVar)
109 return cret
110}
111
112var xParseVariant func(string, *Variant, bool) bool
113
114// Parses a font variant.
115//
116// The allowed values are "normal", "small-caps", "all-small-caps",
117// "petite-caps", "all-petite-caps", "unicase" and "title-caps",
118// case variations being ignored.
119func ParseVariant(StrVar string, VariantVar *Variant, WarnVar bool) bool {
120
121 cret := xParseVariant(StrVar, VariantVar, WarnVar)
122 return cret
123}
124
125var xParseWeight func(string, *Weight, bool) bool
126
127// Parses a font weight.
128//
129// The allowed values are "heavy",
130// "ultrabold", "bold", "normal", "light", "ultraleight"
131// and integers. Case variations are ignored.
132func ParseWeight(StrVar string, WeightVar *Weight, WarnVar bool) bool {
133
134 cret := xParseWeight(StrVar, WeightVar, WarnVar)
135 return cret
136}
137
138var xQuantizeLineGeometry func(int, int)
139
140// Quantizes the thickness and position of a line to whole device pixels.
141//
142// This is typically used for underline or strikethrough. The purpose of
143// this function is to avoid such lines looking blurry.
144//
145// Care is taken to make sure @thickness is at least one pixel when this
146// function returns, but returned @position may become zero as a result
147// of rounding.
148func QuantizeLineGeometry(ThicknessVar int, PositionVar int) {
149
150 xQuantizeLineGeometry(ThicknessVar, PositionVar)
151
152}
153
154var xReadLine func(uintptr, *glib.String) int
155
156// Reads an entire line from a file into a buffer.
157//
158// Lines may be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter
159// is not written into the buffer. Text after a '#' character is treated as
160// a comment and skipped. '\' can be used to escape a # character.
161// '\' proceeding a line delimiter combines adjacent lines. A '\' proceeding
162// any other character is ignored and written into the output buffer
163// unmodified.
164func ReadLine(StreamVar uintptr, StrVar *glib.String) int {
165
166 cret := xReadLine(StreamVar, StrVar)
167 return cret
168}
169
170var xScanInt func(string, *int) bool
171
172// Scans an integer.
173//
174// Leading white space is skipped.
175func ScanInt(PosVar string, OutVar *int) bool {
176
177 cret := xScanInt(PosVar, OutVar)
178 return cret
179}
180
181var xScanString func(string, *glib.String) bool
182
183// Scans a string into a `GString` buffer.
184//
185// The string may either be a sequence of non-white-space characters,
186// or a quoted string with '"'. Instead a quoted string, '\"' represents
187// a literal quote. Leading white space outside of quotes is skipped.
188func ScanString(PosVar string, OutVar *glib.String) bool {
189
190 cret := xScanString(PosVar, OutVar)
191 return cret
192}
193
194var xScanWord func(string, *glib.String) bool
195
196// Scans a word into a `GString` buffer.
197//
198// A word consists of [A-Za-z_] followed by zero or more
199// [A-Za-z_0-9]. Leading white space is skipped.
200func ScanWord(PosVar string, OutVar *glib.String) bool {
201
202 cret := xScanWord(PosVar, OutVar)
203 return cret
204}
205
206var xSkipSpace func(string) bool
207
208// Skips 0 or more characters of white space.
209func SkipSpace(PosVar string) bool {
210
211 cret := xSkipSpace(PosVar)
212 return cret
213}
214
215var xSplitFileList func(string) []string
216
217// Splits a %G_SEARCHPATH_SEPARATOR-separated list of files, stripping
218// white space and substituting ~/ with $HOME/.
219func SplitFileList(StrVar string) []string {
220
221 cret := xSplitFileList(StrVar)
222 return cret
223}
224
225var xTrimString func(string) string
226
227// Trims leading and trailing whitespace from a string.
228func TrimString(StrVar string) string {
229
230 cret := xTrimString(StrVar)
231 return cret
232}
233
234var xVersion func() int
235
236// Returns the encoded version of Pango available at run-time.
237//
238// This is similar to the macro %PANGO_VERSION except that the macro
239// returns the encoded version available at compile-time. A version
240// number can be encoded into an integer using PANGO_VERSION_ENCODE().
241func Version() int {
242
243 cret := xVersion()
244 return cret
245}
246
247var xVersionCheck func(int, int, int) string
248
249// Checks that the Pango library in use is compatible with the
250// given version.
251//
252// Generally you would pass in the constants %PANGO_VERSION_MAJOR,
253// %PANGO_VERSION_MINOR, %PANGO_VERSION_MICRO as the three arguments
254// to this function; that produces a check that the library in use at
255// run-time is compatible with the version of Pango the application or
256// module was compiled against.
257//
258// Compatibility is defined by two things: first the version
259// of the running library is newer than the version
260// @required_major.required_minor.@required_micro. Second
261// the running library must be binary compatible with the
262// version @required_major.required_minor.@required_micro
263// (same major version.)
264//
265// For compile-time version checking use PANGO_VERSION_CHECK().
266func VersionCheck(RequiredMajorVar int, RequiredMinorVar int, RequiredMicroVar int) string {
267
268 cret := xVersionCheck(RequiredMajorVar, RequiredMinorVar, RequiredMicroVar)
269 return cret
270}
271
272var xVersionString func() string
273
274// Returns the version of Pango available at run-time.
275//
276// This is similar to the macro %PANGO_VERSION_STRING except that the
277// macro returns the version available at compile-time.
278func VersionString() string {
279
280 cret := xVersionString()
281 return cret
282}
283
284func init() {
285 core.SetPackageName("PANGO", "pango")
286 core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"})
287 var libs []uintptr
288 for _, libPath := range core.GetPaths("PANGO") {
289 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
290 if err != nil {
291 panic(err)
292 }
293 libs = append(libs, lib)
294 }
295
296 core.PuregoSafeRegister(&xFindParagraphBoundary, libs, "pango_find_paragraph_boundary")
297 core.PuregoSafeRegister(&xIsZeroWidth, libs, "pango_is_zero_width")
298 core.PuregoSafeRegister(&xLog2visGetEmbeddingLevels, libs, "pango_log2vis_get_embedding_levels")
299 core.PuregoSafeRegister(&xParseEnum, libs, "pango_parse_enum")
300 core.PuregoSafeRegister(&xParseStretch, libs, "pango_parse_stretch")
301 core.PuregoSafeRegister(&xParseStyle, libs, "pango_parse_style")
302 core.PuregoSafeRegister(&xParseVariant, libs, "pango_parse_variant")
303 core.PuregoSafeRegister(&xParseWeight, libs, "pango_parse_weight")
304 core.PuregoSafeRegister(&xQuantizeLineGeometry, libs, "pango_quantize_line_geometry")
305 core.PuregoSafeRegister(&xReadLine, libs, "pango_read_line")
306 core.PuregoSafeRegister(&xScanInt, libs, "pango_scan_int")
307 core.PuregoSafeRegister(&xScanString, libs, "pango_scan_string")
308 core.PuregoSafeRegister(&xScanWord, libs, "pango_scan_word")
309 core.PuregoSafeRegister(&xSkipSpace, libs, "pango_skip_space")
310 core.PuregoSafeRegister(&xSplitFileList, libs, "pango_split_file_list")
311 core.PuregoSafeRegister(&xTrimString, libs, "pango_trim_string")
312 core.PuregoSafeRegister(&xVersion, libs, "pango_version")
313 core.PuregoSafeRegister(&xVersionCheck, libs, "pango_version_check")
314 core.PuregoSafeRegister(&xVersionString, libs, "pango_version_string")
315
316}