v0.2.1 c0399be

gtknumericsorter.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 NumericSorterClass struct {
16	_ structs.HostLayout
17
18	ParentClass SorterClass
19}
20
21func (x *NumericSorterClass) GoPointer() uintptr {
22	return uintptr(unsafe.Pointer(x))
23}
24
25// Sorts items numerically.
26//
27// To obtain the numbers to compare, this sorter evaluates a
28// [class@Gtk.Expression].
29type NumericSorter struct {
30	Sorter
31}
32
33var xNumericSorterGLibType func() types.GType
34
35func NumericSorterGLibType() types.GType {
36	return xNumericSorterGLibType()
37}
38
39func NumericSorterNewFromInternalPtr(ptr uintptr) *NumericSorter {
40	cls := &NumericSorter{}
41	cls.Ptr = ptr
42	return cls
43}
44
45var xNewNumericSorter func(uintptr) uintptr
46
47// Creates a new numeric sorter using the given @expression.
48//
49// Smaller numbers will be sorted first. You can call
50// [method@Gtk.NumericSorter.set_sort_order] to change this.
51func NewNumericSorter(ExpressionVar *Expression) *NumericSorter {
52	var cls *NumericSorter
53
54	cret := xNewNumericSorter(ExpressionVar.GoPointer())
55
56	if cret == 0 {
57		return nil
58	}
59	cls = &NumericSorter{}
60	cls.Ptr = cret
61	return cls
62}
63
64var xNumericSorterGetExpression func(uintptr) uintptr
65
66// Gets the expression that is evaluated to obtain numbers from items.
67func (x *NumericSorter) GetExpression() *Expression {
68	var cls *Expression
69
70	cret := xNumericSorterGetExpression(x.GoPointer())
71
72	if cret == 0 {
73		return nil
74	}
75	gobject.IncreaseRef(cret)
76	cls = &Expression{}
77	cls.Ptr = cret
78	return cls
79}
80
81var xNumericSorterGetSortOrder func(uintptr) SortType
82
83// Gets whether this sorter will sort smaller numbers first.
84func (x *NumericSorter) GetSortOrder() SortType {
85
86	cret := xNumericSorterGetSortOrder(x.GoPointer())
87	return cret
88}
89
90var xNumericSorterSetExpression func(uintptr, uintptr)
91
92// Sets the expression that is evaluated to obtain numbers from items.
93//
94// Unless an expression is set on @self, the sorter will always
95// compare items as invalid.
96//
97// The expression must have a return type that can be compared
98// numerically, such as %G_TYPE_INT or %G_TYPE_DOUBLE.
99func (x *NumericSorter) SetExpression(ExpressionVar *Expression) {
100
101	xNumericSorterSetExpression(x.GoPointer(), ExpressionVar.GoPointer())
102
103}
104
105var xNumericSorterSetSortOrder func(uintptr, SortType)
106
107// Sets whether to sort smaller numbers before larger ones.
108func (x *NumericSorter) SetSortOrder(SortOrderVar SortType) {
109
110	xNumericSorterSetSortOrder(x.GoPointer(), SortOrderVar)
111
112}
113
114func (c *NumericSorter) GoPointer() uintptr {
115	if c == nil {
116		return 0
117	}
118	return c.Ptr
119}
120
121func (c *NumericSorter) SetGoPointer(ptr uintptr) {
122	c.Ptr = ptr
123}
124
125func init() {
126	core.SetPackageName("GTK", "gtk4")
127	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
128	var libs []uintptr
129	for _, libPath := range core.GetPaths("GTK") {
130		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
131		if err != nil {
132			panic(err)
133		}
134		libs = append(libs, lib)
135	}
136
137	core.PuregoSafeRegister(&xNumericSorterGLibType, libs, "gtk_numeric_sorter_get_type")
138
139	core.PuregoSafeRegister(&xNewNumericSorter, libs, "gtk_numeric_sorter_new")
140
141	core.PuregoSafeRegister(&xNumericSorterGetExpression, libs, "gtk_numeric_sorter_get_expression")
142	core.PuregoSafeRegister(&xNumericSorterGetSortOrder, libs, "gtk_numeric_sorter_get_sort_order")
143	core.PuregoSafeRegister(&xNumericSorterSetExpression, libs, "gtk_numeric_sorter_set_expression")
144	core.PuregoSafeRegister(&xNumericSorterSetSortOrder, libs, "gtk_numeric_sorter_set_sort_order")
145
146}

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