v0.2.1 c0399be

gtkstacksidebar.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"github.com/ebitengine/purego"
6
7	"github.com/bnema/puregotk/pkg/core"
8	"github.com/bnema/puregotk/v4/gobject"
9	"github.com/bnema/puregotk/v4/gobject/types"
10)
11
12// Uses a sidebar to switch between `GtkStack` pages.
13//
14// <picture>
15//
16//	<source srcset="sidebar-dark.png" media="(prefers-color-scheme: dark)">
17//	<img alt="An example GtkStackSidebar" src="sidebar.png">
18//
19// </picture>
20//
21// In order to use a `GtkStackSidebar`, you simply use a `GtkStack` to
22// organize your UI flow, and add the sidebar to your sidebar area. You
23// can use [method@Gtk.StackSidebar.set_stack] to connect the `GtkStackSidebar`
24// to the `GtkStack`.
25//
26// # CSS nodes
27//
28// `GtkStackSidebar` has a single CSS node with name stacksidebar and
29// style class .sidebar.
30//
31// When circumstances require it, `GtkStackSidebar` adds the
32// .needs-attention style class to the widgets representing the stack
33// pages.
34type StackSidebar struct {
35	Widget
36}
37
38var xStackSidebarGLibType func() types.GType
39
40func StackSidebarGLibType() types.GType {
41	return xStackSidebarGLibType()
42}
43
44func StackSidebarNewFromInternalPtr(ptr uintptr) *StackSidebar {
45	cls := &StackSidebar{}
46	cls.Ptr = ptr
47	return cls
48}
49
50var xNewStackSidebar func() uintptr
51
52// Creates a new `GtkStackSidebar`.
53func NewStackSidebar() *StackSidebar {
54	var cls *StackSidebar
55
56	cret := xNewStackSidebar()
57
58	if cret == 0 {
59		return nil
60	}
61	gobject.IncreaseRef(cret)
62	cls = &StackSidebar{}
63	cls.Ptr = cret
64	return cls
65}
66
67var xStackSidebarGetStack func(uintptr) uintptr
68
69// Retrieves the stack.
70func (x *StackSidebar) GetStack() *Stack {
71	var cls *Stack
72
73	cret := xStackSidebarGetStack(x.GoPointer())
74
75	if cret == 0 {
76		return nil
77	}
78	gobject.IncreaseRef(cret)
79	cls = &Stack{}
80	cls.Ptr = cret
81	return cls
82}
83
84var xStackSidebarSetStack func(uintptr, uintptr)
85
86// Set the `GtkStack` associated with this `GtkStackSidebar`.
87//
88// The sidebar widget will automatically update according to
89// the order and items within the given `GtkStack`.
90func (x *StackSidebar) SetStack(StackVar *Stack) {
91
92	xStackSidebarSetStack(x.GoPointer(), StackVar.GoPointer())
93
94}
95
96func (c *StackSidebar) GoPointer() uintptr {
97	if c == nil {
98		return 0
99	}
100	return c.Ptr
101}
102
103func (c *StackSidebar) SetGoPointer(ptr uintptr) {
104	c.Ptr = ptr
105}
106
107// Requests the user's screen reader to announce the given message.
108//
109// This kind of notification is useful for messages that
110// either have only a visual representation or that are not
111// exposed visually at all, e.g. a notification about a
112// successful operation.
113//
114// Also, by using this API, you can ensure that the message
115// does not interrupts the user's current screen reader output.
116func (x *StackSidebar) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
117
118	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
119
120}
121
122// Retrieves the accessible parent for an accessible object.
123//
124// This function returns `NULL` for top level widgets.
125func (x *StackSidebar) GetAccessibleParent() *AccessibleBase {
126	var cls *AccessibleBase
127
128	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
129
130	if cret == 0 {
131		return nil
132	}
133	cls = &AccessibleBase{}
134	cls.Ptr = cret
135	return cls
136}
137
138// Retrieves the accessible role of an accessible object.
139func (x *StackSidebar) GetAccessibleRole() AccessibleRole {
140
141	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
142	return cret
143}
144
145// Retrieves the implementation for the given accessible object.
146func (x *StackSidebar) GetAtContext() *ATContext {
147	var cls *ATContext
148
149	cret := XGtkAccessibleGetAtContext(x.GoPointer())
150
151	if cret == 0 {
152		return nil
153	}
154	cls = &ATContext{}
155	cls.Ptr = cret
156	return cls
157}
158
159// Queries the coordinates and dimensions of this accessible
160//
161// This functionality can be overridden by `GtkAccessible`
162// implementations, e.g. to get the bounds from an ignored
163// child widget.
164func (x *StackSidebar) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
165
166	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
167	return cret
168}
169
170// Retrieves the first accessible child of an accessible object.
171func (x *StackSidebar) GetFirstAccessibleChild() *AccessibleBase {
172	var cls *AccessibleBase
173
174	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
175
176	if cret == 0 {
177		return nil
178	}
179	cls = &AccessibleBase{}
180	cls.Ptr = cret
181	return cls
182}
183
184// Retrieves the next accessible sibling of an accessible object
185func (x *StackSidebar) GetNextAccessibleSibling() *AccessibleBase {
186	var cls *AccessibleBase
187
188	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
189
190	if cret == 0 {
191		return nil
192	}
193	cls = &AccessibleBase{}
194	cls.Ptr = cret
195	return cls
196}
197
198// Queries a platform state, such as focus.
199//
200// This functionality can be overridden by `GtkAccessible`
201// implementations, e.g. to get platform state from an ignored
202// child widget, as is the case for `GtkText` wrappers.
203func (x *StackSidebar) GetPlatformState(StateVar AccessiblePlatformState) bool {
204
205	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
206	return cret
207}
208
209// Resets the accessible property to its default value.
210func (x *StackSidebar) ResetProperty(PropertyVar AccessibleProperty) {
211
212	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
213
214}
215
216// Resets the accessible relation to its default value.
217func (x *StackSidebar) ResetRelation(RelationVar AccessibleRelation) {
218
219	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
220
221}
222
223// Resets the accessible state to its default value.
224func (x *StackSidebar) ResetState(StateVar AccessibleState) {
225
226	XGtkAccessibleResetState(x.GoPointer(), StateVar)
227
228}
229
230// Sets the parent and sibling of an accessible object.
231//
232// This function is meant to be used by accessible implementations that are
233// not part of the widget hierarchy, and but act as a logical bridge between
234// widgets. For instance, if a widget creates an object that holds metadata
235// for each child, and you want that object to implement the `GtkAccessible`
236// interface, you will use this function to ensure that the parent of each
237// child widget is the metadata object, and the parent of each metadata
238// object is the container widget.
239func (x *StackSidebar) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
240
241	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
242
243}
244
245// Updates the next accessible sibling.
246//
247// That might be useful when a new child of a custom accessible
248// is created, and it needs to be linked to a previous child.
249func (x *StackSidebar) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
250
251	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
252
253}
254
255// Informs ATs that the platform state has changed.
256//
257// This function should be used by `GtkAccessible` implementations that
258// have a platform state but are not widgets. Widgets handle platform
259// states automatically.
260func (x *StackSidebar) UpdatePlatformState(StateVar AccessiblePlatformState) {
261
262	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
263
264}
265
266// Updates a list of accessible properties.
267//
268// See the [enum@Gtk.AccessibleProperty] documentation for the
269// value types of accessible properties.
270//
271// This function should be called by `GtkWidget` types whenever
272// an accessible property change must be communicated to assistive
273// technologies.
274//
275// Example:
276// ```c
277// value = gtk_adjustment_get_value (adjustment);
278// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
279//
280//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
281//	-1);
282//
283// ```
284func (x *StackSidebar) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
285
286	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
287
288}
289
290// Updates an array of accessible properties.
291//
292// This function should be called by `GtkWidget` types whenever an accessible
293// property change must be communicated to assistive technologies.
294//
295// This function is meant to be used by language bindings.
296func (x *StackSidebar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
297
298	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
299
300}
301
302// Updates a list of accessible relations.
303//
304// This function should be called by `GtkWidget` types whenever an accessible
305// relation change must be communicated to assistive technologies.
306//
307// If the [enum@Gtk.AccessibleRelation] requires a list of references,
308// you should pass each reference individually, followed by `NULL`, e.g.
309//
310// ```c
311// gtk_accessible_update_relation (accessible,
312//
313//	GTK_ACCESSIBLE_RELATION_CONTROLS,
314//	  ref1, NULL,
315//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
316//	  ref1, ref2, ref3, NULL,
317//	-1);
318//
319// ```
320func (x *StackSidebar) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
321
322	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
323
324}
325
326// Updates an array of accessible relations.
327//
328// This function should be called by `GtkWidget` types whenever an accessible
329// relation change must be communicated to assistive technologies.
330//
331// This function is meant to be used by language bindings.
332func (x *StackSidebar) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
333
334	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
335
336}
337
338// Updates a list of accessible states.
339//
340// See the [enum@Gtk.AccessibleState] documentation for the
341// value types of accessible states.
342//
343// This function should be called by `GtkWidget` types whenever
344// an accessible state change must be communicated to assistive
345// technologies.
346//
347// Example:
348//
349// ```c
350// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
351// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
352//
353//	GTK_ACCESSIBLE_STATE_CHECKED, value,
354//	-1);
355//
356// ```
357func (x *StackSidebar) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
358
359	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
360
361}
362
363// Updates an array of accessible states.
364//
365// This function should be called by `GtkWidget` types whenever an accessible
366// state change must be communicated to assistive technologies.
367//
368// This function is meant to be used by language bindings.
369func (x *StackSidebar) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
370
371	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
372
373}
374
375// Gets the ID of the @buildable object.
376//
377// `GtkBuilder` sets the name based on the ID attribute
378// of the `<object>` tag used to construct the @buildable.
379func (x *StackSidebar) GetBuildableId() string {
380
381	cret := XGtkBuildableGetBuildableId(x.GoPointer())
382	return cret
383}
384
385func init() {
386	core.SetPackageName("GTK", "gtk4")
387	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
388	var libs []uintptr
389	for _, libPath := range core.GetPaths("GTK") {
390		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
391		if err != nil {
392			panic(err)
393		}
394		libs = append(libs, lib)
395	}
396
397	core.PuregoSafeRegister(&xStackSidebarGLibType, libs, "gtk_stack_sidebar_get_type")
398
399	core.PuregoSafeRegister(&xNewStackSidebar, libs, "gtk_stack_sidebar_new")
400
401	core.PuregoSafeRegister(&xStackSidebarGetStack, libs, "gtk_stack_sidebar_get_stack")
402	core.PuregoSafeRegister(&xStackSidebarSetStack, libs, "gtk_stack_sidebar_set_stack")
403
404}

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