v0.2.1 c0399be

adw-preferences-dialog.go RawHistoryFolder

1// Package adw was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package adw
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	"github.com/bnema/puregotk/v4/gtk"
14)
15
16type PreferencesDialogClass struct {
17	_ structs.HostLayout
18
19	ParentClass DialogClass
20
21	Padding [4]uintptr
22}
23
24func (x *PreferencesDialogClass) GoPointer() uintptr {
25	return uintptr(unsafe.Pointer(x))
26}
27
28// A dialog showing application's preferences.
29//
30// <picture>
31//
32//	<source srcset="preferences-dialog-dark.png" media="(prefers-color-scheme: dark)">
33//	<img src="preferences-dialog.png" alt="preferences-dialog">
34//
35// </picture>
36//
37// The `AdwPreferencesDialog` widget presents an application's preferences
38// gathered into pages and groups. The preferences are searchable by the user.
39//
40// ## Actions
41//
42// `AdwPrefencesDialog` defines the `navigation.pop` action, it doesn't take any
43// parameters and pops the current subpage from the navigation stack, equivalent
44// to calling [method@PreferencesDialog.pop_subpage].
45//
46// ## CSS nodes
47//
48// `AdwPreferencesDialog` has a main CSS node with the name `dialog` and the
49// style class `.preferences`.
50type PreferencesDialog struct {
51	Dialog
52}
53
54var xPreferencesDialogGLibType func() types.GType
55
56func PreferencesDialogGLibType() types.GType {
57	return xPreferencesDialogGLibType()
58}
59
60func PreferencesDialogNewFromInternalPtr(ptr uintptr) *PreferencesDialog {
61	cls := &PreferencesDialog{}
62	cls.Ptr = ptr
63	return cls
64}
65
66var xNewPreferencesDialog func() uintptr
67
68// Creates a new `AdwPreferencesDialog`.
69func NewPreferencesDialog() *PreferencesDialog {
70	var cls *PreferencesDialog
71
72	cret := xNewPreferencesDialog()
73
74	if cret == 0 {
75		return nil
76	}
77	gobject.IncreaseRef(cret)
78	cls = &PreferencesDialog{}
79	cls.Ptr = cret
80	return cls
81}
82
83var xPreferencesDialogAdd func(uintptr, uintptr)
84
85// Adds a preferences page to @self.
86func (x *PreferencesDialog) Add(PageVar *PreferencesPage) {
87
88	xPreferencesDialogAdd(x.GoPointer(), PageVar.GoPointer())
89
90}
91
92var xPreferencesDialogAddToast func(uintptr, uintptr)
93
94// Displays @toast.
95//
96// See [method@ToastOverlay.add_toast].
97func (x *PreferencesDialog) AddToast(ToastVar *Toast) {
98
99	xPreferencesDialogAddToast(x.GoPointer(), ToastVar.GoPointer())
100
101}
102
103var xPreferencesDialogGetSearchEnabled func(uintptr) bool
104
105// Gets whether search is enabled for @self.
106func (x *PreferencesDialog) GetSearchEnabled() bool {
107
108	cret := xPreferencesDialogGetSearchEnabled(x.GoPointer())
109	return cret
110}
111
112var xPreferencesDialogGetVisiblePage func(uintptr) uintptr
113
114// Gets the currently visible page of @self.
115func (x *PreferencesDialog) GetVisiblePage() *PreferencesPage {
116	var cls *PreferencesPage
117
118	cret := xPreferencesDialogGetVisiblePage(x.GoPointer())
119
120	if cret == 0 {
121		return nil
122	}
123	gobject.IncreaseRef(cret)
124	cls = &PreferencesPage{}
125	cls.Ptr = cret
126	return cls
127}
128
129var xPreferencesDialogGetVisiblePageName func(uintptr) string
130
131// Gets the name of currently visible page of @self.
132func (x *PreferencesDialog) GetVisiblePageName() string {
133
134	cret := xPreferencesDialogGetVisiblePageName(x.GoPointer())
135	return cret
136}
137
138var xPreferencesDialogPopSubpage func(uintptr) bool
139
140// Pop the visible page from the subpage stack of @self.
141func (x *PreferencesDialog) PopSubpage() bool {
142
143	cret := xPreferencesDialogPopSubpage(x.GoPointer())
144	return cret
145}
146
147var xPreferencesDialogPushSubpage func(uintptr, uintptr)
148
149// Pushes @page onto the subpage stack of @self.
150//
151// The page will be automatically removed when popped.
152func (x *PreferencesDialog) PushSubpage(PageVar *NavigationPage) {
153
154	xPreferencesDialogPushSubpage(x.GoPointer(), PageVar.GoPointer())
155
156}
157
158var xPreferencesDialogRemove func(uintptr, uintptr)
159
160// Removes a page from @self.
161func (x *PreferencesDialog) Remove(PageVar *PreferencesPage) {
162
163	xPreferencesDialogRemove(x.GoPointer(), PageVar.GoPointer())
164
165}
166
167var xPreferencesDialogSetSearchEnabled func(uintptr, bool)
168
169// Sets whether search is enabled for @self.
170func (x *PreferencesDialog) SetSearchEnabled(SearchEnabledVar bool) {
171
172	xPreferencesDialogSetSearchEnabled(x.GoPointer(), SearchEnabledVar)
173
174}
175
176var xPreferencesDialogSetVisiblePage func(uintptr, uintptr)
177
178// Makes @page the visible page of @self.
179func (x *PreferencesDialog) SetVisiblePage(PageVar *PreferencesPage) {
180
181	xPreferencesDialogSetVisiblePage(x.GoPointer(), PageVar.GoPointer())
182
183}
184
185var xPreferencesDialogSetVisiblePageName func(uintptr, string)
186
187// Makes the page with the given name visible.
188//
189// See [property@PreferencesDialog:visible-page].
190func (x *PreferencesDialog) SetVisiblePageName(NameVar string) {
191
192	xPreferencesDialogSetVisiblePageName(x.GoPointer(), NameVar)
193
194}
195
196func (c *PreferencesDialog) GoPointer() uintptr {
197	if c == nil {
198		return 0
199	}
200	return c.Ptr
201}
202
203func (c *PreferencesDialog) SetGoPointer(ptr uintptr) {
204	c.Ptr = ptr
205}
206
207// SetPropertySearchEnabled sets the "search-enabled" property.
208// Whether search is enabled.
209func (x *PreferencesDialog) SetPropertySearchEnabled(value bool) {
210	var v gobject.Value
211	v.Init(gobject.TypeBooleanVal)
212	v.SetBoolean(value)
213	x.SetProperty("search-enabled", &v)
214}
215
216// GetPropertySearchEnabled gets the "search-enabled" property.
217// Whether search is enabled.
218func (x *PreferencesDialog) GetPropertySearchEnabled() bool {
219	var v gobject.Value
220	x.GetProperty("search-enabled", &v)
221	return v.GetBoolean()
222}
223
224// SetPropertyVisiblePageName sets the "visible-page-name" property.
225// The name of the currently visible page.
226//
227// See [property@AdwPreferencesDialog:visible-page].
228func (x *PreferencesDialog) SetPropertyVisiblePageName(value string) {
229	var v gobject.Value
230	v.Init(gobject.TypeStringVal)
231	v.SetString(&value)
232	x.SetProperty("visible-page-name", &v)
233}
234
235// GetPropertyVisiblePageName gets the "visible-page-name" property.
236// The name of the currently visible page.
237//
238// See [property@AdwPreferencesDialog:visible-page].
239func (x *PreferencesDialog) GetPropertyVisiblePageName() string {
240	var v gobject.Value
241	x.GetProperty("visible-page-name", &v)
242	return v.GetString()
243}
244
245// Requests the user's screen reader to announce the given message.
246//
247// This kind of notification is useful for messages that
248// either have only a visual representation or that are not
249// exposed visually at all, e.g. a notification about a
250// successful operation.
251//
252// Also, by using this API, you can ensure that the message
253// does not interrupts the user's current screen reader output.
254func (x *PreferencesDialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
255
256	gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
257
258}
259
260// Retrieves the accessible parent for an accessible object.
261//
262// This function returns `NULL` for top level widgets.
263func (x *PreferencesDialog) GetAccessibleParent() *gtk.AccessibleBase {
264	var cls *gtk.AccessibleBase
265
266	cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
267
268	if cret == 0 {
269		return nil
270	}
271	cls = &gtk.AccessibleBase{}
272	cls.Ptr = cret
273	return cls
274}
275
276// Retrieves the accessible role of an accessible object.
277func (x *PreferencesDialog) GetAccessibleRole() gtk.AccessibleRole {
278
279	cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
280	return cret
281}
282
283// Retrieves the implementation for the given accessible object.
284func (x *PreferencesDialog) GetAtContext() *gtk.ATContext {
285	var cls *gtk.ATContext
286
287	cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
288
289	if cret == 0 {
290		return nil
291	}
292	cls = &gtk.ATContext{}
293	cls.Ptr = cret
294	return cls
295}
296
297// Queries the coordinates and dimensions of this accessible
298//
299// This functionality can be overridden by `GtkAccessible`
300// implementations, e.g. to get the bounds from an ignored
301// child widget.
302func (x *PreferencesDialog) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
303
304	cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
305	return cret
306}
307
308// Retrieves the first accessible child of an accessible object.
309func (x *PreferencesDialog) GetFirstAccessibleChild() *gtk.AccessibleBase {
310	var cls *gtk.AccessibleBase
311
312	cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
313
314	if cret == 0 {
315		return nil
316	}
317	cls = &gtk.AccessibleBase{}
318	cls.Ptr = cret
319	return cls
320}
321
322// Retrieves the next accessible sibling of an accessible object
323func (x *PreferencesDialog) GetNextAccessibleSibling() *gtk.AccessibleBase {
324	var cls *gtk.AccessibleBase
325
326	cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
327
328	if cret == 0 {
329		return nil
330	}
331	cls = &gtk.AccessibleBase{}
332	cls.Ptr = cret
333	return cls
334}
335
336// Queries a platform state, such as focus.
337//
338// This functionality can be overridden by `GtkAccessible`
339// implementations, e.g. to get platform state from an ignored
340// child widget, as is the case for `GtkText` wrappers.
341func (x *PreferencesDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
342
343	cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
344	return cret
345}
346
347// Resets the accessible property to its default value.
348func (x *PreferencesDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) {
349
350	gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
351
352}
353
354// Resets the accessible relation to its default value.
355func (x *PreferencesDialog) ResetRelation(RelationVar gtk.AccessibleRelation) {
356
357	gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
358
359}
360
361// Resets the accessible state to its default value.
362func (x *PreferencesDialog) ResetState(StateVar gtk.AccessibleState) {
363
364	gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
365
366}
367
368// Sets the parent and sibling of an accessible object.
369//
370// This function is meant to be used by accessible implementations that are
371// not part of the widget hierarchy, and but act as a logical bridge between
372// widgets. For instance, if a widget creates an object that holds metadata
373// for each child, and you want that object to implement the `GtkAccessible`
374// interface, you will use this function to ensure that the parent of each
375// child widget is the metadata object, and the parent of each metadata
376// object is the container widget.
377func (x *PreferencesDialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
378
379	gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
380
381}
382
383// Updates the next accessible sibling.
384//
385// That might be useful when a new child of a custom accessible
386// is created, and it needs to be linked to a previous child.
387func (x *PreferencesDialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
388
389	gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
390
391}
392
393// Informs ATs that the platform state has changed.
394//
395// This function should be used by `GtkAccessible` implementations that
396// have a platform state but are not widgets. Widgets handle platform
397// states automatically.
398func (x *PreferencesDialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
399
400	gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
401
402}
403
404// Updates a list of accessible properties.
405//
406// See the [enum@Gtk.AccessibleProperty] documentation for the
407// value types of accessible properties.
408//
409// This function should be called by `GtkWidget` types whenever
410// an accessible property change must be communicated to assistive
411// technologies.
412//
413// Example:
414// ```c
415// value = gtk_adjustment_get_value (adjustment);
416// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
417//
418//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
419//	-1);
420//
421// ```
422func (x *PreferencesDialog) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
423
424	gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
425
426}
427
428// Updates an array of accessible properties.
429//
430// This function should be called by `GtkWidget` types whenever an accessible
431// property change must be communicated to assistive technologies.
432//
433// This function is meant to be used by language bindings.
434func (x *PreferencesDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
435
436	gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
437
438}
439
440// Updates a list of accessible relations.
441//
442// This function should be called by `GtkWidget` types whenever an accessible
443// relation change must be communicated to assistive technologies.
444//
445// If the [enum@Gtk.AccessibleRelation] requires a list of references,
446// you should pass each reference individually, followed by `NULL`, e.g.
447//
448// ```c
449// gtk_accessible_update_relation (accessible,
450//
451//	GTK_ACCESSIBLE_RELATION_CONTROLS,
452//	  ref1, NULL,
453//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
454//	  ref1, ref2, ref3, NULL,
455//	-1);
456//
457// ```
458func (x *PreferencesDialog) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
459
460	gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
461
462}
463
464// Updates an array of accessible relations.
465//
466// This function should be called by `GtkWidget` types whenever an accessible
467// relation change must be communicated to assistive technologies.
468//
469// This function is meant to be used by language bindings.
470func (x *PreferencesDialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
471
472	gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
473
474}
475
476// Updates a list of accessible states.
477//
478// See the [enum@Gtk.AccessibleState] documentation for the
479// value types of accessible states.
480//
481// This function should be called by `GtkWidget` types whenever
482// an accessible state change must be communicated to assistive
483// technologies.
484//
485// Example:
486//
487// ```c
488// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
489// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
490//
491//	GTK_ACCESSIBLE_STATE_CHECKED, value,
492//	-1);
493//
494// ```
495func (x *PreferencesDialog) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
496
497	gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
498
499}
500
501// Updates an array of accessible states.
502//
503// This function should be called by `GtkWidget` types whenever an accessible
504// state change must be communicated to assistive technologies.
505//
506// This function is meant to be used by language bindings.
507func (x *PreferencesDialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
508
509	gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
510
511}
512
513// Gets the ID of the @buildable object.
514//
515// `GtkBuilder` sets the name based on the ID attribute
516// of the `<object>` tag used to construct the @buildable.
517func (x *PreferencesDialog) GetBuildableId() string {
518
519	cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
520	return cret
521}
522
523func init() {
524	core.SetPackageName("ADW", "libadwaita-1")
525	core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
526	var libs []uintptr
527	for _, libPath := range core.GetPaths("ADW") {
528		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
529		if err != nil {
530			panic(err)
531		}
532		libs = append(libs, lib)
533	}
534
535	core.PuregoSafeRegister(&xPreferencesDialogGLibType, libs, "adw_preferences_dialog_get_type")
536
537	core.PuregoSafeRegister(&xNewPreferencesDialog, libs, "adw_preferences_dialog_new")
538
539	core.PuregoSafeRegister(&xPreferencesDialogAdd, libs, "adw_preferences_dialog_add")
540	core.PuregoSafeRegister(&xPreferencesDialogAddToast, libs, "adw_preferences_dialog_add_toast")
541	core.PuregoSafeRegister(&xPreferencesDialogGetSearchEnabled, libs, "adw_preferences_dialog_get_search_enabled")
542	core.PuregoSafeRegister(&xPreferencesDialogGetVisiblePage, libs, "adw_preferences_dialog_get_visible_page")
543	core.PuregoSafeRegister(&xPreferencesDialogGetVisiblePageName, libs, "adw_preferences_dialog_get_visible_page_name")
544	core.PuregoSafeRegister(&xPreferencesDialogPopSubpage, libs, "adw_preferences_dialog_pop_subpage")
545	core.PuregoSafeRegister(&xPreferencesDialogPushSubpage, libs, "adw_preferences_dialog_push_subpage")
546	core.PuregoSafeRegister(&xPreferencesDialogRemove, libs, "adw_preferences_dialog_remove")
547	core.PuregoSafeRegister(&xPreferencesDialogSetSearchEnabled, libs, "adw_preferences_dialog_set_search_enabled")
548	core.PuregoSafeRegister(&xPreferencesDialogSetVisiblePage, libs, "adw_preferences_dialog_set_visible_page")
549	core.PuregoSafeRegister(&xPreferencesDialogSetVisiblePageName, libs, "adw_preferences_dialog_set_visible_page_name")
550
551}

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