v0.2.2 9100209

pango-types.go RawHistoryFolder

1// Package pango was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package pango
3
4import (
5	"structs"
6	"unsafe"
7
8	"github.com/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/gobject/types"
12)
13
14// The `PangoLanguage` structure is used to
15// represent a language.
16//
17// `PangoLanguage` pointers can be efficiently
18// copied and compared with each other.
19type Language struct {
20	_ structs.HostLayout
21}
22
23var xLanguageGLibType func() types.GType
24
25func LanguageGLibType() types.GType {
26	return xLanguageGLibType()
27}
28
29func (x *Language) GoPointer() uintptr {
30	return uintptr(unsafe.Pointer(x))
31}
32
33var xLanguageGetSampleString func(uintptr) string
34
35// Get a string that is representative of the characters needed to
36// render a particular language.
37//
38// The sample text may be a pangram, but is not necessarily. It is chosen
39// to be demonstrative of normal text in the language, as well as exposing
40// font feature requirements unique to the language. It is suitable for use
41// as sample text in a font selection dialog.
42//
43// If @language is %NULL, the default language as found by
44// [func@Pango.Language.get_default] is used.
45//
46// If Pango does not have a sample string for @language, the classic
47// "The quick brown fox..." is returned.  This can be detected by
48// comparing the returned pointer value to that returned for (non-existent)
49// language code "xx".  That is, compare to:
50//
51// ```
52// pango_language_get_sample_string (pango_language_from_string ("xx"))
53// ```
54func (x *Language) GetSampleString() string {
55
56	cret := xLanguageGetSampleString(x.GoPointer())
57	return cret
58}
59
60var xLanguageGetScripts func(uintptr, *int) uintptr
61
62// Determines the scripts used to to write @language.
63//
64// If nothing is known about the language tag @language,
65// or if @language is %NULL, then %NULL is returned.
66// The list of scripts returned starts with the script that the
67// language uses most and continues to the one it uses least.
68//
69// The value @num_script points at will be set to the number
70// of scripts in the returned array (or zero if %NULL is returned).
71//
72// Most languages use only one script for writing, but there are
73// some that use two (Latin and Cyrillic for example), and a few
74// use three (Japanese for example). Applications should not make
75// any assumptions on the maximum number of scripts returned
76// though, except that it is positive if the return value is not
77// %NULL, and it is a small number.
78//
79// The [method@Pango.Language.includes_script] function uses this
80// function internally.
81//
82// Note: while the return value is declared as `PangoScript`, the
83// returned values are from the `GUnicodeScript` enumeration, which
84// may have more values. Callers need to handle unknown values.
85func (x *Language) GetScripts(NumScriptsVar *int) uintptr {
86
87	cret := xLanguageGetScripts(x.GoPointer(), NumScriptsVar)
88	return cret
89}
90
91var xLanguageIncludesScript func(uintptr, Script) bool
92
93// Determines if @script is one of the scripts used to
94// write @language.
95//
96// The returned value is conservative; if nothing is known about
97// the language tag @language, %TRUE will be returned, since, as
98// far as Pango knows, @script might be used to write @language.
99//
100// This routine is used in Pango's itemization process when
101// determining if a supplied language tag is relevant to
102// a particular section of text. It probably is not useful
103// for applications in most circumstances.
104//
105// This function uses [method@Pango.Language.get_scripts] internally.
106func (x *Language) IncludesScript(ScriptVar Script) bool {
107
108	cret := xLanguageIncludesScript(x.GoPointer(), ScriptVar)
109	return cret
110}
111
112var xLanguageMatches func(uintptr, string) bool
113
114// Checks if a language tag matches one of the elements in a list of
115// language ranges.
116//
117// A language tag is considered to match a range in the list if the
118// range is '*', the range is exactly the tag, or the range is a prefix
119// of the tag, and the character after it in the tag is '-'.
120func (x *Language) Matches(RangeListVar string) bool {
121
122	cret := xLanguageMatches(x.GoPointer(), RangeListVar)
123	return cret
124}
125
126var xLanguageToString func(uintptr) string
127
128// Gets the RFC-3066 format string representing the given language tag.
129//
130// Returns (transfer none): a string representing the language tag
131func (x *Language) ToString() string {
132
133	cret := xLanguageToString(x.GoPointer())
134	return cret
135}
136
137// The `PangoRectangle` structure represents a rectangle.
138//
139// `PangoRectangle` is frequently used to represent the logical or ink
140// extents of a single glyph or section of text. (See, for instance,
141// [method@Pango.Font.get_glyph_extents].)
142type Rectangle struct {
143	_ structs.HostLayout
144
145	X int
146
147	Y int
148
149	Width int
150
151	Height int
152}
153
154func (x *Rectangle) GoPointer() uintptr {
155	return uintptr(unsafe.Pointer(x))
156}
157
158// A `PangoGlyph` represents a single glyph in the output form of a string.
159type Glyph = uint32
160
161const (
162	// The scale between dimensions used for Pango distances and device units.
163	//
164	// The definition of device units is dependent on the output device; it will
165	// typically be pixels for a screen, and points for a printer. %PANGO_SCALE is
166	// currently 1024, but this may be changed in the future.
167	//
168	// When setting font sizes, device units are always considered to be
169	// points (as in "12 point font"), rather than pixels.
170	SCALE int = 1024
171)
172
173var xExtentsToPixels func(*Rectangle, *Rectangle)
174
175// Converts extents from Pango units to device units.
176//
177// The conversion is done by dividing by the %PANGO_SCALE factor and
178// performing rounding.
179//
180// The @inclusive rectangle is converted by flooring the x/y coordinates
181// and extending width/height, such that the final rectangle completely
182// includes the original rectangle.
183//
184// The @nearest rectangle is converted by rounding the coordinates
185// of the rectangle to the nearest device unit (pixel).
186//
187// The rule to which argument to use is: if you want the resulting device-space
188// rectangle to completely contain the original rectangle, pass it in as
189// @inclusive. If you want two touching-but-not-overlapping rectangles stay
190// touching-but-not-overlapping after rounding to device units, pass them in
191// as @nearest.
192func ExtentsToPixels(InclusiveVar *Rectangle, NearestVar *Rectangle) {
193
194	xExtentsToPixels(InclusiveVar, NearestVar)
195
196}
197
198var xUnitsFromDouble func(float64) int
199
200// Converts a floating-point number to Pango units.
201//
202// The conversion is done by multiplying @d by %PANGO_SCALE and
203// rounding the result to nearest integer.
204func UnitsFromDouble(DVar float64) int {
205
206	cret := xUnitsFromDouble(DVar)
207	return cret
208}
209
210var xUnitsToDouble func(int) float64
211
212// Converts a number in Pango units to floating-point.
213//
214// The conversion is done by dividing @i by %PANGO_SCALE.
215func UnitsToDouble(IVar int) float64 {
216
217	cret := xUnitsToDouble(IVar)
218	return cret
219}
220
221func init() {
222	core.SetPackageName("PANGO", "pango")
223	core.SetSharedLibraries("PANGO", []string{"libpango-1.0.so.0"})
224	var libs []uintptr
225	for _, libPath := range core.GetPaths("PANGO") {
226		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
227		if err != nil {
228			panic(err)
229		}
230		libs = append(libs, lib)
231	}
232
233	core.PuregoSafeRegister(&xExtentsToPixels, libs, "pango_extents_to_pixels")
234	core.PuregoSafeRegister(&xUnitsFromDouble, libs, "pango_units_from_double")
235	core.PuregoSafeRegister(&xUnitsToDouble, libs, "pango_units_to_double")
236
237	core.PuregoSafeRegister(&xLanguageGLibType, libs, "pango_language_get_type")
238
239	core.PuregoSafeRegister(&xLanguageGetSampleString, libs, "pango_language_get_sample_string")
240	core.PuregoSafeRegister(&xLanguageGetScripts, libs, "pango_language_get_scripts")
241	core.PuregoSafeRegister(&xLanguageIncludesScript, libs, "pango_language_includes_script")
242	core.PuregoSafeRegister(&xLanguageMatches, libs, "pango_language_matches")
243	core.PuregoSafeRegister(&xLanguageToString, libs, "pango_language_to_string")
244
245}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close