v0.2.1 c0399be

gtkstringsorter.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
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"
12	"github.com/bnema/puregotk/v4/gobject/types"
13)
14
15type StringSorterClass struct {
16	_ structs.HostLayout
17
18	ParentClass SorterClass
19}
20
21func (x *StringSorterClass) GoPointer() uintptr {
22	return uintptr(unsafe.Pointer(x))
23}
24
25// Describes how a [class@Gtk.StringSorter] turns strings into sort keys to
26// compare them.
27//
28// Note that the result of sorting will in general depend on the current locale
29// unless the mode is @GTK_COLLATION_NONE.
30type Collation int
31
32var xCollationGLibType func() types.GType
33
34func CollationGLibType() types.GType {
35	return xCollationGLibType()
36}
37
38const (
39
40	// Don't do any collation
41	CollationNoneValue Collation = 0
42	// Use [func@GLib.utf8_collate_key]
43	CollationUnicodeValue Collation = 1
44	// Use [func@GLib.utf8_collate_key_for_filename]
45	CollationFilenameValue Collation = 2
46)
47
48// Sorts items by comparing strings.
49//
50// To obtain the strings to compare, this sorter evaluates a
51// [class@Gtk.Expression].
52//
53// It does the comparison in a linguistically correct way using the
54// current locale by normalizing Unicode strings and possibly case-folding
55// them before performing the comparison.
56type StringSorter struct {
57	Sorter
58}
59
60var xStringSorterGLibType func() types.GType
61
62func StringSorterGLibType() types.GType {
63	return xStringSorterGLibType()
64}
65
66func StringSorterNewFromInternalPtr(ptr uintptr) *StringSorter {
67	cls := &StringSorter{}
68	cls.Ptr = ptr
69	return cls
70}
71
72var xNewStringSorter func(uintptr) uintptr
73
74// Creates a new string sorter that compares items using the given
75// @expression.
76//
77// Unless an expression is set on it, this sorter will always
78// compare items as invalid.
79func NewStringSorter(ExpressionVar *Expression) *StringSorter {
80	var cls *StringSorter
81
82	cret := xNewStringSorter(ExpressionVar.GoPointer())
83
84	if cret == 0 {
85		return nil
86	}
87	cls = &StringSorter{}
88	cls.Ptr = cret
89	return cls
90}
91
92var xStringSorterGetCollation func(uintptr) Collation
93
94// Gets which collation method the sorter uses.
95func (x *StringSorter) GetCollation() Collation {
96
97	cret := xStringSorterGetCollation(x.GoPointer())
98	return cret
99}
100
101var xStringSorterGetExpression func(uintptr) uintptr
102
103// Gets the expression that is evaluated to obtain strings from items.
104func (x *StringSorter) GetExpression() *Expression {
105	var cls *Expression
106
107	cret := xStringSorterGetExpression(x.GoPointer())
108
109	if cret == 0 {
110		return nil
111	}
112	gobject.IncreaseRef(cret)
113	cls = &Expression{}
114	cls.Ptr = cret
115	return cls
116}
117
118var xStringSorterGetIgnoreCase func(uintptr) bool
119
120// Gets whether the sorter ignores case differences.
121func (x *StringSorter) GetIgnoreCase() bool {
122
123	cret := xStringSorterGetIgnoreCase(x.GoPointer())
124	return cret
125}
126
127var xStringSorterSetCollation func(uintptr, Collation)
128
129// Sets the collation method to use for sorting.
130func (x *StringSorter) SetCollation(CollationVar Collation) {
131
132	xStringSorterSetCollation(x.GoPointer(), CollationVar)
133
134}
135
136var xStringSorterSetExpression func(uintptr, uintptr)
137
138// Sets the expression that is evaluated to obtain strings from items.
139//
140// The expression must have the type %G_TYPE_STRING.
141func (x *StringSorter) SetExpression(ExpressionVar *Expression) {
142
143	xStringSorterSetExpression(x.GoPointer(), ExpressionVar.GoPointer())
144
145}
146
147var xStringSorterSetIgnoreCase func(uintptr, bool)
148
149// Sets whether the sorter will ignore case differences.
150func (x *StringSorter) SetIgnoreCase(IgnoreCaseVar bool) {
151
152	xStringSorterSetIgnoreCase(x.GoPointer(), IgnoreCaseVar)
153
154}
155
156func (c *StringSorter) GoPointer() uintptr {
157	if c == nil {
158		return 0
159	}
160	return c.Ptr
161}
162
163func (c *StringSorter) SetGoPointer(ptr uintptr) {
164	c.Ptr = ptr
165}
166
167// SetPropertyIgnoreCase sets the "ignore-case" property.
168// If sorting is case sensitive.
169func (x *StringSorter) SetPropertyIgnoreCase(value bool) {
170	var v gobject.Value
171	v.Init(gobject.TypeBooleanVal)
172	v.SetBoolean(value)
173	x.SetProperty("ignore-case", &v)
174}
175
176// GetPropertyIgnoreCase gets the "ignore-case" property.
177// If sorting is case sensitive.
178func (x *StringSorter) GetPropertyIgnoreCase() bool {
179	var v gobject.Value
180	x.GetProperty("ignore-case", &v)
181	return v.GetBoolean()
182}
183
184func init() {
185	core.SetPackageName("GTK", "gtk4")
186	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
187	var libs []uintptr
188	for _, libPath := range core.GetPaths("GTK") {
189		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
190		if err != nil {
191			panic(err)
192		}
193		libs = append(libs, lib)
194	}
195
196	core.PuregoSafeRegister(&xCollationGLibType, libs, "gtk_collation_get_type")
197
198	core.PuregoSafeRegister(&xStringSorterGLibType, libs, "gtk_string_sorter_get_type")
199
200	core.PuregoSafeRegister(&xNewStringSorter, libs, "gtk_string_sorter_new")
201
202	core.PuregoSafeRegister(&xStringSorterGetCollation, libs, "gtk_string_sorter_get_collation")
203	core.PuregoSafeRegister(&xStringSorterGetExpression, libs, "gtk_string_sorter_get_expression")
204	core.PuregoSafeRegister(&xStringSorterGetIgnoreCase, libs, "gtk_string_sorter_get_ignore_case")
205	core.PuregoSafeRegister(&xStringSorterSetCollation, libs, "gtk_string_sorter_set_collation")
206	core.PuregoSafeRegister(&xStringSorterSetExpression, libs, "gtk_string_sorter_set_expression")
207	core.PuregoSafeRegister(&xStringSorterSetIgnoreCase, libs, "gtk_string_sorter_set_ignore_case")
208
209}

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