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 ShortcutsDialogClass struct {
17 _ structs.HostLayout
18
19 ParentClass DialogClass
20}
21
22func (x *ShortcutsDialogClass) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26// A dialog that displays application's keyboard shortcuts.
27//
28// <picture>
29//
30// <source srcset="shortcuts-dialog-dark.png" media="(prefers-color-scheme: dark)">
31// <img src="shortcuts-dialog.png" alt="shortcuts-dialog">
32//
33// </picture>
34//
35// Shortcuts are grouped into sections, represented by [class@ShortcutsSection]
36// objects. Each section has one or more items, represented by
37// [class@ShortcutsItem] objects.
38//
39// To add a section to the dialog, use [method@ShortcutsDialog.add], or add it
40// as a child when using UI files.
41//
42// Sections without titles can be used to further subdivide each section into
43// groups.
44//
45// Example of an `AdwShortcutsDialog` UI definition:
46//
47// ```xml
48// <object class="AdwShortcutsDialog" id="shortcuts_dialog">
49//
50// <child>
51// <object class="AdwShortcutsSection">
52// <property name="title" translatable="yes">General</property>
53// <child>
54// <object class="AdwShortcutsItem">
55// <property name="title" translatable="yes">Open Menu</property>
56// <property name="accelerator">F10</property>
57// </object>
58// </child>
59// <child>
60// <object class="AdwShortcutsItem">
61// <property name="title" translatable="yes">Quit</property>
62// <property name="action-name">app.quit</property>
63// </object>
64// </child>
65// </object>
66// </child>
67// <child>
68// <object class="AdwShortcutsSection">
69// <child>
70// <object class="AdwShortcutsItem">
71// <property name="title" translatable="yes">Move Tab Left</property>
72// <property name="accelerator">&lt;Shift&gt;&lt;Ctrl&gt;Page_Up</property>
73// <property name="direction">ltr</property>
74// </object>
75// </child>
76// <child>
77// <object class="AdwShortcutsItem">
78// <property name="title" translatable="yes">Move Tab Right</property>
79// <property name="accelerator">&lt;Shift&gt;&lt;Ctrl&gt;Page_Down</property>
80// <property name="direction">ltr</property>
81// </object>
82// </child>
83// <child>
84// <object class="AdwShortcutsItem">
85// <property name="title" translatable="yes">Move Tab Right</property>
86// <property name="accelerator">&lt;Shift&gt;&lt;Ctrl&gt;Page_Up</property>
87// <property name="direction">rtl</property>
88// </object>
89// </child>
90// <child>
91// <object class="AdwShortcutsItem">
92// <property name="title" translatable="yes">Move Tab Left</property>
93// <property name="accelerator">&lt;Shift&gt;&lt;Ctrl&gt;Page_Down</property>
94// <property name="direction">rtl</property>
95// </object>
96// </child>
97// </object>
98// </child>
99//
100// </object>
101// ```
102//
103// If the `app.quit` action has the <kbd>Ctrl</kbd><kbd>Q</kbd> accelerator
104// associated with it, the result will look as follows:
105//
106// <picture>
107//
108// <source srcset="shortcuts-dialog-example-dark.png" media="(prefers-color-scheme: dark)">
109// <img src="shortcuts-dialog-example.png" alt="shortcuts-dialog-example">
110//
111// </picture>
112//
113// The recommended way to use `AdwShortcutsDialog` is via [class@Application]'s
114// automatic resource loading.
115//
116// See also: [class@ShortcutLabel].
117type ShortcutsDialog struct {
118 Dialog
119}
120
121var xShortcutsDialogGLibType func() types.GType
122
123func ShortcutsDialogGLibType() types.GType {
124 return xShortcutsDialogGLibType()
125}
126
127func ShortcutsDialogNewFromInternalPtr(ptr uintptr) *ShortcutsDialog {
128 cls := &ShortcutsDialog{}
129 cls.Ptr = ptr
130 return cls
131}
132
133var xNewShortcutsDialog func() uintptr
134
135// Creates a new `AdwShortcutsDialog`.
136func NewShortcutsDialog() *ShortcutsDialog {
137 var cls *ShortcutsDialog
138
139 cret := xNewShortcutsDialog()
140
141 if cret == 0 {
142 return nil
143 }
144 gobject.IncreaseRef(cret)
145 cls = &ShortcutsDialog{}
146 cls.Ptr = cret
147 return cls
148}
149
150var xShortcutsDialogAdd func(uintptr, uintptr)
151
152// Adds @section to @self.
153func (x *ShortcutsDialog) Add(SectionVar *ShortcutsSection) {
154
155 xShortcutsDialogAdd(x.GoPointer(), SectionVar.GoPointer())
156
157}
158
159func (c *ShortcutsDialog) GoPointer() uintptr {
160 if c == nil {
161 return 0
162 }
163 return c.Ptr
164}
165
166func (c *ShortcutsDialog) SetGoPointer(ptr uintptr) {
167 c.Ptr = ptr
168}
169
170// Requests the user's screen reader to announce the given message.
171//
172// This kind of notification is useful for messages that
173// either have only a visual representation or that are not
174// exposed visually at all, e.g. a notification about a
175// successful operation.
176//
177// Also, by using this API, you can ensure that the message
178// does not interrupts the user's current screen reader output.
179func (x *ShortcutsDialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
180
181 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
182
183}
184
185// Retrieves the accessible parent for an accessible object.
186//
187// This function returns `NULL` for top level widgets.
188func (x *ShortcutsDialog) GetAccessibleParent() *gtk.AccessibleBase {
189 var cls *gtk.AccessibleBase
190
191 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
192
193 if cret == 0 {
194 return nil
195 }
196 cls = >k.AccessibleBase{}
197 cls.Ptr = cret
198 return cls
199}
200
201// Retrieves the accessible role of an accessible object.
202func (x *ShortcutsDialog) GetAccessibleRole() gtk.AccessibleRole {
203
204 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
205 return cret
206}
207
208// Retrieves the implementation for the given accessible object.
209func (x *ShortcutsDialog) GetAtContext() *gtk.ATContext {
210 var cls *gtk.ATContext
211
212 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
213
214 if cret == 0 {
215 return nil
216 }
217 cls = >k.ATContext{}
218 cls.Ptr = cret
219 return cls
220}
221
222// Queries the coordinates and dimensions of this accessible
223//
224// This functionality can be overridden by `GtkAccessible`
225// implementations, e.g. to get the bounds from an ignored
226// child widget.
227func (x *ShortcutsDialog) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
228
229 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
230 return cret
231}
232
233// Retrieves the first accessible child of an accessible object.
234func (x *ShortcutsDialog) GetFirstAccessibleChild() *gtk.AccessibleBase {
235 var cls *gtk.AccessibleBase
236
237 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
238
239 if cret == 0 {
240 return nil
241 }
242 cls = >k.AccessibleBase{}
243 cls.Ptr = cret
244 return cls
245}
246
247// Retrieves the next accessible sibling of an accessible object
248func (x *ShortcutsDialog) GetNextAccessibleSibling() *gtk.AccessibleBase {
249 var cls *gtk.AccessibleBase
250
251 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
252
253 if cret == 0 {
254 return nil
255 }
256 cls = >k.AccessibleBase{}
257 cls.Ptr = cret
258 return cls
259}
260
261// Queries a platform state, such as focus.
262//
263// This functionality can be overridden by `GtkAccessible`
264// implementations, e.g. to get platform state from an ignored
265// child widget, as is the case for `GtkText` wrappers.
266func (x *ShortcutsDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
267
268 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
269 return cret
270}
271
272// Resets the accessible property to its default value.
273func (x *ShortcutsDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) {
274
275 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
276
277}
278
279// Resets the accessible relation to its default value.
280func (x *ShortcutsDialog) ResetRelation(RelationVar gtk.AccessibleRelation) {
281
282 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
283
284}
285
286// Resets the accessible state to its default value.
287func (x *ShortcutsDialog) ResetState(StateVar gtk.AccessibleState) {
288
289 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
290
291}
292
293// Sets the parent and sibling of an accessible object.
294//
295// This function is meant to be used by accessible implementations that are
296// not part of the widget hierarchy, and but act as a logical bridge between
297// widgets. For instance, if a widget creates an object that holds metadata
298// for each child, and you want that object to implement the `GtkAccessible`
299// interface, you will use this function to ensure that the parent of each
300// child widget is the metadata object, and the parent of each metadata
301// object is the container widget.
302func (x *ShortcutsDialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
303
304 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
305
306}
307
308// Updates the next accessible sibling.
309//
310// That might be useful when a new child of a custom accessible
311// is created, and it needs to be linked to a previous child.
312func (x *ShortcutsDialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
313
314 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
315
316}
317
318// Informs ATs that the platform state has changed.
319//
320// This function should be used by `GtkAccessible` implementations that
321// have a platform state but are not widgets. Widgets handle platform
322// states automatically.
323func (x *ShortcutsDialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
324
325 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
326
327}
328
329// Updates a list of accessible properties.
330//
331// See the [enum@Gtk.AccessibleProperty] documentation for the
332// value types of accessible properties.
333//
334// This function should be called by `GtkWidget` types whenever
335// an accessible property change must be communicated to assistive
336// technologies.
337//
338// Example:
339// ```c
340// value = gtk_adjustment_get_value (adjustment);
341// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
342//
343// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
344// -1);
345//
346// ```
347func (x *ShortcutsDialog) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
348
349 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
350
351}
352
353// Updates an array of accessible properties.
354//
355// This function should be called by `GtkWidget` types whenever an accessible
356// property change must be communicated to assistive technologies.
357//
358// This function is meant to be used by language bindings.
359func (x *ShortcutsDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
360
361 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
362
363}
364
365// Updates a list of accessible relations.
366//
367// This function should be called by `GtkWidget` types whenever an accessible
368// relation change must be communicated to assistive technologies.
369//
370// If the [enum@Gtk.AccessibleRelation] requires a list of references,
371// you should pass each reference individually, followed by `NULL`, e.g.
372//
373// ```c
374// gtk_accessible_update_relation (accessible,
375//
376// GTK_ACCESSIBLE_RELATION_CONTROLS,
377// ref1, NULL,
378// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
379// ref1, ref2, ref3, NULL,
380// -1);
381//
382// ```
383func (x *ShortcutsDialog) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
384
385 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
386
387}
388
389// Updates an array of accessible relations.
390//
391// This function should be called by `GtkWidget` types whenever an accessible
392// relation change must be communicated to assistive technologies.
393//
394// This function is meant to be used by language bindings.
395func (x *ShortcutsDialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
396
397 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
398
399}
400
401// Updates a list of accessible states.
402//
403// See the [enum@Gtk.AccessibleState] documentation for the
404// value types of accessible states.
405//
406// This function should be called by `GtkWidget` types whenever
407// an accessible state change must be communicated to assistive
408// technologies.
409//
410// Example:
411//
412// ```c
413// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
414// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
415//
416// GTK_ACCESSIBLE_STATE_CHECKED, value,
417// -1);
418//
419// ```
420func (x *ShortcutsDialog) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
421
422 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
423
424}
425
426// Updates an array of accessible states.
427//
428// This function should be called by `GtkWidget` types whenever an accessible
429// state change must be communicated to assistive technologies.
430//
431// This function is meant to be used by language bindings.
432func (x *ShortcutsDialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
433
434 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
435
436}
437
438// Gets the ID of the @buildable object.
439//
440// `GtkBuilder` sets the name based on the ID attribute
441// of the `<object>` tag used to construct the @buildable.
442func (x *ShortcutsDialog) GetBuildableId() string {
443
444 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
445 return cret
446}
447
448func init() {
449 core.SetPackageName("ADW", "libadwaita-1")
450 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
451 var libs []uintptr
452 for _, libPath := range core.GetPaths("ADW") {
453 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
454 if err != nil {
455 panic(err)
456 }
457 libs = append(libs, lib)
458 }
459
460 core.PuregoSafeRegister(&xShortcutsDialogGLibType, libs, "adw_shortcuts_dialog_get_type")
461
462 core.PuregoSafeRegister(&xNewShortcutsDialog, libs, "adw_shortcuts_dialog_new")
463
464 core.PuregoSafeRegister(&xShortcutsDialogAdd, libs, "adw_shortcuts_dialog_add")
465
466}