v0.2.1 c0399be

gtklistitem.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 ListItemClass struct {
16	_ structs.HostLayout
17}
18
19func (x *ListItemClass) GoPointer() uintptr {
20	return uintptr(unsafe.Pointer(x))
21}
22
23// Used by list widgets to represent items in a [iface@Gio.ListModel].
24//
25// `GtkListItem` objects are managed by the list widget (with its factory)
26// and cannot be created by applications, but they need to be populated
27// by application code. This is done by calling [method@Gtk.ListItem.set_child].
28//
29// `GtkListItem` objects exist in 2 stages:
30//
31//  1. The unbound stage where the listitem is not currently connected to
32//     an item in the list. In that case, the [property@Gtk.ListItem:item]
33//     property is set to `NULL`.
34//
35//  2. The bound stage where the listitem references an item from the list.
36//     The [property@Gtk.ListItem:item] property is not `NULL`.
37type ListItem struct {
38	gobject.Object
39}
40
41var xListItemGLibType func() types.GType
42
43func ListItemGLibType() types.GType {
44	return xListItemGLibType()
45}
46
47func ListItemNewFromInternalPtr(ptr uintptr) *ListItem {
48	cls := &ListItem{}
49	cls.Ptr = ptr
50	return cls
51}
52
53var xListItemGetAccessibleDescription func(uintptr) string
54
55// Gets the accessible description of @self.
56func (x *ListItem) GetAccessibleDescription() string {
57
58	cret := xListItemGetAccessibleDescription(x.GoPointer())
59	return cret
60}
61
62var xListItemGetAccessibleLabel func(uintptr) string
63
64// Gets the accessible label of @self.
65func (x *ListItem) GetAccessibleLabel() string {
66
67	cret := xListItemGetAccessibleLabel(x.GoPointer())
68	return cret
69}
70
71var xListItemGetActivatable func(uintptr) bool
72
73// Checks if a listitem has been set to be activatable via
74// [method@Gtk.ListItem.set_activatable].
75func (x *ListItem) GetActivatable() bool {
76
77	cret := xListItemGetActivatable(x.GoPointer())
78	return cret
79}
80
81var xListItemGetChild func(uintptr) uintptr
82
83// Gets the child previously set via [method@Gtk.ListItem.set_child]
84// or `NULL` if none was set.
85func (x *ListItem) GetChild() *Widget {
86	var cls *Widget
87
88	cret := xListItemGetChild(x.GoPointer())
89
90	if cret == 0 {
91		return nil
92	}
93	gobject.IncreaseRef(cret)
94	cls = &Widget{}
95	cls.Ptr = cret
96	return cls
97}
98
99var xListItemGetFocusable func(uintptr) bool
100
101// Checks if a listitem has been set to be focusable via
102// [method@Gtk.ListItem.set_focusable].
103func (x *ListItem) GetFocusable() bool {
104
105	cret := xListItemGetFocusable(x.GoPointer())
106	return cret
107}
108
109var xListItemGetItem func(uintptr) uintptr
110
111// Gets the model item that associated with @self.
112//
113// If @self is unbound, this function returns `NULL`.
114func (x *ListItem) GetItem() *gobject.Object {
115	var cls *gobject.Object
116
117	cret := xListItemGetItem(x.GoPointer())
118
119	if cret == 0 {
120		return nil
121	}
122	gobject.IncreaseRef(cret)
123	cls = &gobject.Object{}
124	cls.Ptr = cret
125	return cls
126}
127
128var xListItemGetPosition func(uintptr) uint
129
130// Gets the position in the model that @self currently displays.
131//
132// If @self is unbound, `GTK_INVALID_LIST_POSITION` is returned.
133func (x *ListItem) GetPosition() uint {
134
135	cret := xListItemGetPosition(x.GoPointer())
136	return cret
137}
138
139var xListItemGetSelectable func(uintptr) bool
140
141// Checks if a listitem has been set to be selectable via
142// [method@Gtk.ListItem.set_selectable].
143//
144// Do not confuse this function with [method@Gtk.ListItem.get_selected].
145func (x *ListItem) GetSelectable() bool {
146
147	cret := xListItemGetSelectable(x.GoPointer())
148	return cret
149}
150
151var xListItemGetSelected func(uintptr) bool
152
153// Checks if the item is displayed as selected.
154//
155// The selected state is maintained by the list widget and its model
156// and cannot be set otherwise.
157func (x *ListItem) GetSelected() bool {
158
159	cret := xListItemGetSelected(x.GoPointer())
160	return cret
161}
162
163var xListItemSetAccessibleDescription func(uintptr, string)
164
165// Sets the accessible description for the listitem.
166//
167// The accessible description may be used by e.g. screen readers.
168func (x *ListItem) SetAccessibleDescription(DescriptionVar string) {
169
170	xListItemSetAccessibleDescription(x.GoPointer(), DescriptionVar)
171
172}
173
174var xListItemSetAccessibleLabel func(uintptr, string)
175
176// Sets the accessible label for the listitem.
177//
178// The accessible label may be used by e.g. screen readers.
179func (x *ListItem) SetAccessibleLabel(LabelVar string) {
180
181	xListItemSetAccessibleLabel(x.GoPointer(), LabelVar)
182
183}
184
185var xListItemSetActivatable func(uintptr, bool)
186
187// Sets @self to be activatable.
188//
189// If an item is activatable, double-clicking on the item, using
190// the Return key or calling [method@Gtk.Widget.activate] will activate
191// the item. Activating instructs the containing view to handle
192// activation. `GtkListView` for example will be emitting the
193// [signal@Gtk.ListView::activate] signal.
194//
195// By default, listitems are activatable.
196func (x *ListItem) SetActivatable(ActivatableVar bool) {
197
198	xListItemSetActivatable(x.GoPointer(), ActivatableVar)
199
200}
201
202var xListItemSetChild func(uintptr, uintptr)
203
204// Sets the child to be used for this listitem.
205//
206// This function is typically called by applications when
207// setting up a listitem so that the widget can be reused when
208// binding it multiple times.
209func (x *ListItem) SetChild(ChildVar *Widget) {
210
211	xListItemSetChild(x.GoPointer(), ChildVar.GoPointer())
212
213}
214
215var xListItemSetFocusable func(uintptr, bool)
216
217// Sets @self to be focusable.
218//
219// If an item is focusable, it can be focused using the keyboard.
220// This works similar to [method@Gtk.Widget.set_focusable].
221//
222// Note that if items are not focusable, the keyboard cannot be used to activate
223// them and selecting only works if one of the listitem's children is focusable.
224//
225// By default, listitems are focusable.
226func (x *ListItem) SetFocusable(FocusableVar bool) {
227
228	xListItemSetFocusable(x.GoPointer(), FocusableVar)
229
230}
231
232var xListItemSetSelectable func(uintptr, bool)
233
234// Sets @self to be selectable.
235//
236// If an item is selectable, clicking on the item or using the keyboard
237// will try to select or unselect the item. If this succeeds is up to
238// the model to determine, as it is managing the selected state.
239//
240// Note that this means that making an item non-selectable has no
241// influence on the selected state at all. A non-selectable item
242// may still be selected.
243//
244// By default, listitems are selectable. When rebinding them to
245// a new item, they will also be reset to be selectable by GTK.
246func (x *ListItem) SetSelectable(SelectableVar bool) {
247
248	xListItemSetSelectable(x.GoPointer(), SelectableVar)
249
250}
251
252func (c *ListItem) GoPointer() uintptr {
253	if c == nil {
254		return 0
255	}
256	return c.Ptr
257}
258
259func (c *ListItem) SetGoPointer(ptr uintptr) {
260	c.Ptr = ptr
261}
262
263// SetPropertyAccessibleDescription sets the "accessible-description" property.
264// The accessible description to set on the listitem.
265func (x *ListItem) SetPropertyAccessibleDescription(value string) {
266	var v gobject.Value
267	v.Init(gobject.TypeStringVal)
268	v.SetString(&value)
269	x.SetProperty("accessible-description", &v)
270}
271
272// GetPropertyAccessibleDescription gets the "accessible-description" property.
273// The accessible description to set on the listitem.
274func (x *ListItem) GetPropertyAccessibleDescription() string {
275	var v gobject.Value
276	x.GetProperty("accessible-description", &v)
277	return v.GetString()
278}
279
280// SetPropertyAccessibleLabel sets the "accessible-label" property.
281// The accessible label to set on the listitem.
282func (x *ListItem) SetPropertyAccessibleLabel(value string) {
283	var v gobject.Value
284	v.Init(gobject.TypeStringVal)
285	v.SetString(&value)
286	x.SetProperty("accessible-label", &v)
287}
288
289// GetPropertyAccessibleLabel gets the "accessible-label" property.
290// The accessible label to set on the listitem.
291func (x *ListItem) GetPropertyAccessibleLabel() string {
292	var v gobject.Value
293	x.GetProperty("accessible-label", &v)
294	return v.GetString()
295}
296
297// SetPropertyActivatable sets the "activatable" property.
298// If the item can be activated by the user.
299func (x *ListItem) SetPropertyActivatable(value bool) {
300	var v gobject.Value
301	v.Init(gobject.TypeBooleanVal)
302	v.SetBoolean(value)
303	x.SetProperty("activatable", &v)
304}
305
306// GetPropertyActivatable gets the "activatable" property.
307// If the item can be activated by the user.
308func (x *ListItem) GetPropertyActivatable() bool {
309	var v gobject.Value
310	x.GetProperty("activatable", &v)
311	return v.GetBoolean()
312}
313
314// SetPropertyFocusable sets the "focusable" property.
315// If the item can be focused with the keyboard.
316func (x *ListItem) SetPropertyFocusable(value bool) {
317	var v gobject.Value
318	v.Init(gobject.TypeBooleanVal)
319	v.SetBoolean(value)
320	x.SetProperty("focusable", &v)
321}
322
323// GetPropertyFocusable gets the "focusable" property.
324// If the item can be focused with the keyboard.
325func (x *ListItem) GetPropertyFocusable() bool {
326	var v gobject.Value
327	x.GetProperty("focusable", &v)
328	return v.GetBoolean()
329}
330
331// GetPropertyPosition gets the "position" property.
332// Position of the item.
333func (x *ListItem) GetPropertyPosition() uint {
334	var v gobject.Value
335	x.GetProperty("position", &v)
336	return v.GetUint()
337}
338
339// SetPropertySelectable sets the "selectable" property.
340// If the item can be selected by the user.
341func (x *ListItem) SetPropertySelectable(value bool) {
342	var v gobject.Value
343	v.Init(gobject.TypeBooleanVal)
344	v.SetBoolean(value)
345	x.SetProperty("selectable", &v)
346}
347
348// GetPropertySelectable gets the "selectable" property.
349// If the item can be selected by the user.
350func (x *ListItem) GetPropertySelectable() bool {
351	var v gobject.Value
352	x.GetProperty("selectable", &v)
353	return v.GetBoolean()
354}
355
356// GetPropertySelected gets the "selected" property.
357// If the item is currently selected.
358func (x *ListItem) GetPropertySelected() bool {
359	var v gobject.Value
360	x.GetProperty("selected", &v)
361	return v.GetBoolean()
362}
363
364func init() {
365	core.SetPackageName("GTK", "gtk4")
366	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
367	var libs []uintptr
368	for _, libPath := range core.GetPaths("GTK") {
369		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
370		if err != nil {
371			panic(err)
372		}
373		libs = append(libs, lib)
374	}
375
376	core.PuregoSafeRegister(&xListItemGLibType, libs, "gtk_list_item_get_type")
377
378	core.PuregoSafeRegister(&xListItemGetAccessibleDescription, libs, "gtk_list_item_get_accessible_description")
379	core.PuregoSafeRegister(&xListItemGetAccessibleLabel, libs, "gtk_list_item_get_accessible_label")
380	core.PuregoSafeRegister(&xListItemGetActivatable, libs, "gtk_list_item_get_activatable")
381	core.PuregoSafeRegister(&xListItemGetChild, libs, "gtk_list_item_get_child")
382	core.PuregoSafeRegister(&xListItemGetFocusable, libs, "gtk_list_item_get_focusable")
383	core.PuregoSafeRegister(&xListItemGetItem, libs, "gtk_list_item_get_item")
384	core.PuregoSafeRegister(&xListItemGetPosition, libs, "gtk_list_item_get_position")
385	core.PuregoSafeRegister(&xListItemGetSelectable, libs, "gtk_list_item_get_selectable")
386	core.PuregoSafeRegister(&xListItemGetSelected, libs, "gtk_list_item_get_selected")
387	core.PuregoSafeRegister(&xListItemSetAccessibleDescription, libs, "gtk_list_item_set_accessible_description")
388	core.PuregoSafeRegister(&xListItemSetAccessibleLabel, libs, "gtk_list_item_set_accessible_label")
389	core.PuregoSafeRegister(&xListItemSetActivatable, libs, "gtk_list_item_set_activatable")
390	core.PuregoSafeRegister(&xListItemSetChild, libs, "gtk_list_item_set_child")
391	core.PuregoSafeRegister(&xListItemSetFocusable, libs, "gtk_list_item_set_focusable")
392	core.PuregoSafeRegister(&xListItemSetSelectable, libs, "gtk_list_item_set_selectable")
393
394}

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