v0.2.1 c0399be

gtkactionbar.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// Presents contextual actions.
13//
14// <picture>
15//
16//	<source srcset="action-bar-dark.png" media="(prefers-color-scheme: dark)">
17//	<img alt="An example GtkActionBar" src="action-bar.png">
18//
19// </picture>
20//
21// `GtkActionBar` is expected to be displayed below the content and expand
22// horizontally to fill the area.
23//
24// It allows placing children at the start or the end. In addition, it
25// contains an internal centered box which is centered with respect to
26// the full width of the box, even if the children at either side take
27// up different amounts of space.
28//
29// # GtkActionBar as GtkBuildable
30//
31// The `GtkActionBar` implementation of the `GtkBuildable` interface supports
32// adding children at the start or end sides by specifying “start” or “end” as
33// the “type” attribute of a `<child>` element, or setting the center widget
34// by specifying “center” value.
35//
36// # CSS nodes
37//
38// ```
39// actionbar
40// ╰── revealer
41//
42//	╰── box
43//	    ├── box.start
44//	    │   ╰── [start children]
45//	    ├── [center widget]
46//	    ╰── box.end
47//	        ╰── [end children]
48//
49// ```
50//
51// A `GtkActionBar`'s CSS node is called `actionbar`. It contains a `revealer`
52// subnode, which contains a `box` subnode, which contains two `box` subnodes at
53// the start and end of the action bar, with `start` and `end` style classes
54// respectively, as well as a center node that represents the center child.
55//
56// Each of the boxes contains children packed for that side.
57type ActionBar struct {
58	Widget
59}
60
61var xActionBarGLibType func() types.GType
62
63func ActionBarGLibType() types.GType {
64	return xActionBarGLibType()
65}
66
67func ActionBarNewFromInternalPtr(ptr uintptr) *ActionBar {
68	cls := &ActionBar{}
69	cls.Ptr = ptr
70	return cls
71}
72
73var xNewActionBar func() uintptr
74
75// Creates a new action bar widget.
76func NewActionBar() *ActionBar {
77	var cls *ActionBar
78
79	cret := xNewActionBar()
80
81	if cret == 0 {
82		return nil
83	}
84	gobject.IncreaseRef(cret)
85	cls = &ActionBar{}
86	cls.Ptr = cret
87	return cls
88}
89
90var xActionBarGetCenterWidget func(uintptr) uintptr
91
92// Retrieves the center bar widget of the bar.
93func (x *ActionBar) GetCenterWidget() *Widget {
94	var cls *Widget
95
96	cret := xActionBarGetCenterWidget(x.GoPointer())
97
98	if cret == 0 {
99		return nil
100	}
101	gobject.IncreaseRef(cret)
102	cls = &Widget{}
103	cls.Ptr = cret
104	return cls
105}
106
107var xActionBarGetRevealed func(uintptr) bool
108
109// Gets whether the contents of the action bar are revealed.
110func (x *ActionBar) GetRevealed() bool {
111
112	cret := xActionBarGetRevealed(x.GoPointer())
113	return cret
114}
115
116var xActionBarPackEnd func(uintptr, uintptr)
117
118// Adds a child to the action bar, packed with reference to the
119// end of the action bar.
120func (x *ActionBar) PackEnd(ChildVar *Widget) {
121
122	xActionBarPackEnd(x.GoPointer(), ChildVar.GoPointer())
123
124}
125
126var xActionBarPackStart func(uintptr, uintptr)
127
128// Adds a child to the action, packed with reference to the
129// start of the action bar.
130func (x *ActionBar) PackStart(ChildVar *Widget) {
131
132	xActionBarPackStart(x.GoPointer(), ChildVar.GoPointer())
133
134}
135
136var xActionBarRemove func(uintptr, uintptr)
137
138// Removes a child from the action bar.
139func (x *ActionBar) Remove(ChildVar *Widget) {
140
141	xActionBarRemove(x.GoPointer(), ChildVar.GoPointer())
142
143}
144
145var xActionBarSetCenterWidget func(uintptr, uintptr)
146
147// Sets the center widget for the action bar.
148func (x *ActionBar) SetCenterWidget(CenterWidgetVar *Widget) {
149
150	xActionBarSetCenterWidget(x.GoPointer(), CenterWidgetVar.GoPointer())
151
152}
153
154var xActionBarSetRevealed func(uintptr, bool)
155
156// Reveals or conceals the content of the action bar.
157//
158// Note: this does not show or hide the action bar in the
159// [property@Gtk.Widget:visible] sense, so revealing has
160// no effect if the action bar is hidden.
161func (x *ActionBar) SetRevealed(RevealedVar bool) {
162
163	xActionBarSetRevealed(x.GoPointer(), RevealedVar)
164
165}
166
167func (c *ActionBar) GoPointer() uintptr {
168	if c == nil {
169		return 0
170	}
171	return c.Ptr
172}
173
174func (c *ActionBar) SetGoPointer(ptr uintptr) {
175	c.Ptr = ptr
176}
177
178// SetPropertyRevealed sets the "revealed" property.
179// Controls whether the action bar shows its contents.
180func (x *ActionBar) SetPropertyRevealed(value bool) {
181	var v gobject.Value
182	v.Init(gobject.TypeBooleanVal)
183	v.SetBoolean(value)
184	x.SetProperty("revealed", &v)
185}
186
187// GetPropertyRevealed gets the "revealed" property.
188// Controls whether the action bar shows its contents.
189func (x *ActionBar) GetPropertyRevealed() bool {
190	var v gobject.Value
191	x.GetProperty("revealed", &v)
192	return v.GetBoolean()
193}
194
195// Requests the user's screen reader to announce the given message.
196//
197// This kind of notification is useful for messages that
198// either have only a visual representation or that are not
199// exposed visually at all, e.g. a notification about a
200// successful operation.
201//
202// Also, by using this API, you can ensure that the message
203// does not interrupts the user's current screen reader output.
204func (x *ActionBar) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
205
206	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
207
208}
209
210// Retrieves the accessible parent for an accessible object.
211//
212// This function returns `NULL` for top level widgets.
213func (x *ActionBar) GetAccessibleParent() *AccessibleBase {
214	var cls *AccessibleBase
215
216	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
217
218	if cret == 0 {
219		return nil
220	}
221	cls = &AccessibleBase{}
222	cls.Ptr = cret
223	return cls
224}
225
226// Retrieves the accessible role of an accessible object.
227func (x *ActionBar) GetAccessibleRole() AccessibleRole {
228
229	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
230	return cret
231}
232
233// Retrieves the implementation for the given accessible object.
234func (x *ActionBar) GetAtContext() *ATContext {
235	var cls *ATContext
236
237	cret := XGtkAccessibleGetAtContext(x.GoPointer())
238
239	if cret == 0 {
240		return nil
241	}
242	cls = &ATContext{}
243	cls.Ptr = cret
244	return cls
245}
246
247// Queries the coordinates and dimensions of this accessible
248//
249// This functionality can be overridden by `GtkAccessible`
250// implementations, e.g. to get the bounds from an ignored
251// child widget.
252func (x *ActionBar) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
253
254	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
255	return cret
256}
257
258// Retrieves the first accessible child of an accessible object.
259func (x *ActionBar) GetFirstAccessibleChild() *AccessibleBase {
260	var cls *AccessibleBase
261
262	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
263
264	if cret == 0 {
265		return nil
266	}
267	cls = &AccessibleBase{}
268	cls.Ptr = cret
269	return cls
270}
271
272// Retrieves the next accessible sibling of an accessible object
273func (x *ActionBar) GetNextAccessibleSibling() *AccessibleBase {
274	var cls *AccessibleBase
275
276	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
277
278	if cret == 0 {
279		return nil
280	}
281	cls = &AccessibleBase{}
282	cls.Ptr = cret
283	return cls
284}
285
286// Queries a platform state, such as focus.
287//
288// This functionality can be overridden by `GtkAccessible`
289// implementations, e.g. to get platform state from an ignored
290// child widget, as is the case for `GtkText` wrappers.
291func (x *ActionBar) GetPlatformState(StateVar AccessiblePlatformState) bool {
292
293	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
294	return cret
295}
296
297// Resets the accessible property to its default value.
298func (x *ActionBar) ResetProperty(PropertyVar AccessibleProperty) {
299
300	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
301
302}
303
304// Resets the accessible relation to its default value.
305func (x *ActionBar) ResetRelation(RelationVar AccessibleRelation) {
306
307	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
308
309}
310
311// Resets the accessible state to its default value.
312func (x *ActionBar) ResetState(StateVar AccessibleState) {
313
314	XGtkAccessibleResetState(x.GoPointer(), StateVar)
315
316}
317
318// Sets the parent and sibling of an accessible object.
319//
320// This function is meant to be used by accessible implementations that are
321// not part of the widget hierarchy, and but act as a logical bridge between
322// widgets. For instance, if a widget creates an object that holds metadata
323// for each child, and you want that object to implement the `GtkAccessible`
324// interface, you will use this function to ensure that the parent of each
325// child widget is the metadata object, and the parent of each metadata
326// object is the container widget.
327func (x *ActionBar) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
328
329	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
330
331}
332
333// Updates the next accessible sibling.
334//
335// That might be useful when a new child of a custom accessible
336// is created, and it needs to be linked to a previous child.
337func (x *ActionBar) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
338
339	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
340
341}
342
343// Informs ATs that the platform state has changed.
344//
345// This function should be used by `GtkAccessible` implementations that
346// have a platform state but are not widgets. Widgets handle platform
347// states automatically.
348func (x *ActionBar) UpdatePlatformState(StateVar AccessiblePlatformState) {
349
350	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
351
352}
353
354// Updates a list of accessible properties.
355//
356// See the [enum@Gtk.AccessibleProperty] documentation for the
357// value types of accessible properties.
358//
359// This function should be called by `GtkWidget` types whenever
360// an accessible property change must be communicated to assistive
361// technologies.
362//
363// Example:
364// ```c
365// value = gtk_adjustment_get_value (adjustment);
366// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
367//
368//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
369//	-1);
370//
371// ```
372func (x *ActionBar) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
373
374	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
375
376}
377
378// Updates an array of accessible properties.
379//
380// This function should be called by `GtkWidget` types whenever an accessible
381// property change must be communicated to assistive technologies.
382//
383// This function is meant to be used by language bindings.
384func (x *ActionBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
385
386	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
387
388}
389
390// Updates a list of accessible relations.
391//
392// This function should be called by `GtkWidget` types whenever an accessible
393// relation change must be communicated to assistive technologies.
394//
395// If the [enum@Gtk.AccessibleRelation] requires a list of references,
396// you should pass each reference individually, followed by `NULL`, e.g.
397//
398// ```c
399// gtk_accessible_update_relation (accessible,
400//
401//	GTK_ACCESSIBLE_RELATION_CONTROLS,
402//	  ref1, NULL,
403//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
404//	  ref1, ref2, ref3, NULL,
405//	-1);
406//
407// ```
408func (x *ActionBar) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
409
410	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
411
412}
413
414// Updates an array of accessible relations.
415//
416// This function should be called by `GtkWidget` types whenever an accessible
417// relation change must be communicated to assistive technologies.
418//
419// This function is meant to be used by language bindings.
420func (x *ActionBar) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
421
422	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
423
424}
425
426// Updates a list of accessible states.
427//
428// See the [enum@Gtk.AccessibleState] documentation for the
429// value types of accessible states.
430//
431// This function should be called by `GtkWidget` types whenever
432// an accessible state change must be communicated to assistive
433// technologies.
434//
435// Example:
436//
437// ```c
438// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
439// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
440//
441//	GTK_ACCESSIBLE_STATE_CHECKED, value,
442//	-1);
443//
444// ```
445func (x *ActionBar) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
446
447	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
448
449}
450
451// Updates an array of accessible states.
452//
453// This function should be called by `GtkWidget` types whenever an accessible
454// state change must be communicated to assistive technologies.
455//
456// This function is meant to be used by language bindings.
457func (x *ActionBar) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
458
459	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
460
461}
462
463// Gets the ID of the @buildable object.
464//
465// `GtkBuilder` sets the name based on the ID attribute
466// of the `<object>` tag used to construct the @buildable.
467func (x *ActionBar) GetBuildableId() string {
468
469	cret := XGtkBuildableGetBuildableId(x.GoPointer())
470	return cret
471}
472
473func init() {
474	core.SetPackageName("GTK", "gtk4")
475	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
476	var libs []uintptr
477	for _, libPath := range core.GetPaths("GTK") {
478		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
479		if err != nil {
480			panic(err)
481		}
482		libs = append(libs, lib)
483	}
484
485	core.PuregoSafeRegister(&xActionBarGLibType, libs, "gtk_action_bar_get_type")
486
487	core.PuregoSafeRegister(&xNewActionBar, libs, "gtk_action_bar_new")
488
489	core.PuregoSafeRegister(&xActionBarGetCenterWidget, libs, "gtk_action_bar_get_center_widget")
490	core.PuregoSafeRegister(&xActionBarGetRevealed, libs, "gtk_action_bar_get_revealed")
491	core.PuregoSafeRegister(&xActionBarPackEnd, libs, "gtk_action_bar_pack_end")
492	core.PuregoSafeRegister(&xActionBarPackStart, libs, "gtk_action_bar_pack_start")
493	core.PuregoSafeRegister(&xActionBarRemove, libs, "gtk_action_bar_remove")
494	core.PuregoSafeRegister(&xActionBarSetCenterWidget, libs, "gtk_action_bar_set_center_widget")
495	core.PuregoSafeRegister(&xActionBarSetRevealed, libs, "gtk_action_bar_set_revealed")
496
497}

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