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/gdk"
12 "github.com/bnema/puregotk/v4/gio"
13 "github.com/bnema/puregotk/v4/glib"
14 "github.com/bnema/puregotk/v4/gobject"
15 "github.com/bnema/puregotk/v4/gobject/types"
16 "github.com/bnema/puregotk/v4/gtk"
17)
18
19type NavigationPageClass struct {
20 _ structs.HostLayout
21
22 ParentClass gtk.WidgetClass
23
24 xShowing uintptr
25
26 xShown uintptr
27
28 xHiding uintptr
29
30 xHidden uintptr
31
32 Padding [8]uintptr
33}
34
35func (x *NavigationPageClass) GoPointer() uintptr {
36 return uintptr(unsafe.Pointer(x))
37}
38
39// OverrideShowing sets the "showing" callback function.
40func (x *NavigationPageClass) OverrideShowing(cb func(*NavigationPage)) {
41 if cb == nil {
42 x.xShowing = 0
43 } else {
44 x.xShowing = purego.NewCallback(func(SelfVarp uintptr) {
45 cb(NavigationPageNewFromInternalPtr(SelfVarp))
46 })
47 }
48}
49
50// GetShowing gets the "showing" callback function.
51func (x *NavigationPageClass) GetShowing() func(*NavigationPage) {
52 if x.xShowing == 0 {
53 return nil
54 }
55 var rawCallback func(SelfVarp uintptr)
56 purego.RegisterFunc(&rawCallback, x.xShowing)
57 return func(SelfVar *NavigationPage) {
58 rawCallback(SelfVar.GoPointer())
59 }
60}
61
62// OverrideShown sets the "shown" callback function.
63func (x *NavigationPageClass) OverrideShown(cb func(*NavigationPage)) {
64 if cb == nil {
65 x.xShown = 0
66 } else {
67 x.xShown = purego.NewCallback(func(SelfVarp uintptr) {
68 cb(NavigationPageNewFromInternalPtr(SelfVarp))
69 })
70 }
71}
72
73// GetShown gets the "shown" callback function.
74func (x *NavigationPageClass) GetShown() func(*NavigationPage) {
75 if x.xShown == 0 {
76 return nil
77 }
78 var rawCallback func(SelfVarp uintptr)
79 purego.RegisterFunc(&rawCallback, x.xShown)
80 return func(SelfVar *NavigationPage) {
81 rawCallback(SelfVar.GoPointer())
82 }
83}
84
85// OverrideHiding sets the "hiding" callback function.
86func (x *NavigationPageClass) OverrideHiding(cb func(*NavigationPage)) {
87 if cb == nil {
88 x.xHiding = 0
89 } else {
90 x.xHiding = purego.NewCallback(func(SelfVarp uintptr) {
91 cb(NavigationPageNewFromInternalPtr(SelfVarp))
92 })
93 }
94}
95
96// GetHiding gets the "hiding" callback function.
97func (x *NavigationPageClass) GetHiding() func(*NavigationPage) {
98 if x.xHiding == 0 {
99 return nil
100 }
101 var rawCallback func(SelfVarp uintptr)
102 purego.RegisterFunc(&rawCallback, x.xHiding)
103 return func(SelfVar *NavigationPage) {
104 rawCallback(SelfVar.GoPointer())
105 }
106}
107
108// OverrideHidden sets the "hidden" callback function.
109func (x *NavigationPageClass) OverrideHidden(cb func(*NavigationPage)) {
110 if cb == nil {
111 x.xHidden = 0
112 } else {
113 x.xHidden = purego.NewCallback(func(SelfVarp uintptr) {
114 cb(NavigationPageNewFromInternalPtr(SelfVarp))
115 })
116 }
117}
118
119// GetHidden gets the "hidden" callback function.
120func (x *NavigationPageClass) GetHidden() func(*NavigationPage) {
121 if x.xHidden == 0 {
122 return nil
123 }
124 var rawCallback func(SelfVarp uintptr)
125 purego.RegisterFunc(&rawCallback, x.xHidden)
126 return func(SelfVar *NavigationPage) {
127 rawCallback(SelfVar.GoPointer())
128 }
129}
130
131type NavigationViewClass struct {
132 _ structs.HostLayout
133
134 ParentClass gtk.WidgetClass
135}
136
137func (x *NavigationViewClass) GoPointer() uintptr {
138 return uintptr(unsafe.Pointer(x))
139}
140
141// A page within [class@NavigationView] or [class@NavigationSplitView].
142//
143// Each page has a child widget, a title and optionally a tag.
144//
145// The [signal@NavigationPage::showing], [signal@NavigationPage::shown],
146// [signal@NavigationPage::hiding] and [signal@NavigationPage::hidden] signals
147// can be used to track the page's visibility within its `AdwNavigationView`.
148//
149// ## Header Bar Integration
150//
151// When placed inside `AdwNavigationPage`, [class@HeaderBar] will display the
152// page title instead of window title.
153//
154// When used together with [class@NavigationView], it will also display a back
155// button that can be used to go back to the previous page. Set
156// [property@HeaderBar:show-back-button] to `FALSE` to disable that behavior if
157// it's unwanted.
158//
159// ## CSS Nodes
160//
161// `AdwNavigationPage` has a single CSS node with name
162// `navigation-view-page`.
163//
164// ## Accessibility
165//
166// `AdwNavigationPage` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
167type NavigationPage struct {
168 gtk.Widget
169}
170
171var xNavigationPageGLibType func() types.GType
172
173func NavigationPageGLibType() types.GType {
174 return xNavigationPageGLibType()
175}
176
177func NavigationPageNewFromInternalPtr(ptr uintptr) *NavigationPage {
178 cls := &NavigationPage{}
179 cls.Ptr = ptr
180 return cls
181}
182
183var xNewNavigationPage func(uintptr, string) uintptr
184
185// Creates a new `AdwNavigationPage`.
186func NewNavigationPage(ChildVar *gtk.Widget, TitleVar string) *NavigationPage {
187 var cls *NavigationPage
188
189 cret := xNewNavigationPage(ChildVar.GoPointer(), TitleVar)
190
191 if cret == 0 {
192 return nil
193 }
194 gobject.IncreaseRef(cret)
195 cls = &NavigationPage{}
196 cls.Ptr = cret
197 return cls
198}
199
200var xNewNavigationPageWithTag func(uintptr, string, string) uintptr
201
202// Creates a new `AdwNavigationPage` with provided tag.
203func NewNavigationPageWithTag(ChildVar *gtk.Widget, TitleVar string, TagVar string) *NavigationPage {
204 var cls *NavigationPage
205
206 cret := xNewNavigationPageWithTag(ChildVar.GoPointer(), TitleVar, TagVar)
207
208 if cret == 0 {
209 return nil
210 }
211 gobject.IncreaseRef(cret)
212 cls = &NavigationPage{}
213 cls.Ptr = cret
214 return cls
215}
216
217var xNavigationPageGetCanPop func(uintptr) bool
218
219// Gets whether @self can be popped from navigation stack.
220func (x *NavigationPage) GetCanPop() bool {
221
222 cret := xNavigationPageGetCanPop(x.GoPointer())
223 return cret
224}
225
226var xNavigationPageGetChild func(uintptr) uintptr
227
228// Gets the child widget of @self.
229func (x *NavigationPage) GetChild() *gtk.Widget {
230 var cls *gtk.Widget
231
232 cret := xNavigationPageGetChild(x.GoPointer())
233
234 if cret == 0 {
235 return nil
236 }
237 gobject.IncreaseRef(cret)
238 cls = >k.Widget{}
239 cls.Ptr = cret
240 return cls
241}
242
243var xNavigationPageGetTag func(uintptr) string
244
245// Gets the tag of @self.
246func (x *NavigationPage) GetTag() string {
247
248 cret := xNavigationPageGetTag(x.GoPointer())
249 return cret
250}
251
252var xNavigationPageGetTitle func(uintptr) string
253
254// Gets the title of @self.
255func (x *NavigationPage) GetTitle() string {
256
257 cret := xNavigationPageGetTitle(x.GoPointer())
258 return cret
259}
260
261var xNavigationPageSetCanPop func(uintptr, bool)
262
263// Sets whether @self can be popped from navigation stack.
264//
265// Set it to `FALSE` to disable shortcuts and gestures, as well as remove the
266// back button from [class@HeaderBar].
267//
268// Manually calling [method@NavigationView.pop] or using the `navigation.pop`
269// action will still work.
270//
271// See [property@HeaderBar:show-back-button] for removing only the back button,
272// but not shortcuts.
273func (x *NavigationPage) SetCanPop(CanPopVar bool) {
274
275 xNavigationPageSetCanPop(x.GoPointer(), CanPopVar)
276
277}
278
279var xNavigationPageSetChild func(uintptr, uintptr)
280
281// Sets the child widget of @self.
282func (x *NavigationPage) SetChild(ChildVar *gtk.Widget) {
283
284 xNavigationPageSetChild(x.GoPointer(), ChildVar.GoPointer())
285
286}
287
288var xNavigationPageSetTag func(uintptr, uintptr)
289
290// Sets the tag for @self.
291//
292// The tag can be used to retrieve the page with
293// [method@NavigationView.find_page], as well as with
294// [method@NavigationView.push_by_tag], [method@NavigationView.pop_to_tag] or
295// [method@NavigationView.replace_with_tags].
296//
297// Tags must be unique within each [class@NavigationView].
298//
299// The tag also must be set to use the `navigation.push` action.
300func (x *NavigationPage) SetTag(TagVar *string) {
301
302 TagVarPtr := core.GStrdupNullable(TagVar)
303 defer core.GFreeNullable(TagVarPtr)
304
305 xNavigationPageSetTag(x.GoPointer(), TagVarPtr)
306
307}
308
309var xNavigationPageSetTitle func(uintptr, string)
310
311// Sets the title of @self.
312//
313// It's displayed in [class@HeaderBar] instead of the window title, and used as
314// the tooltip on the next page's back button, as well as by screen reader.
315func (x *NavigationPage) SetTitle(TitleVar string) {
316
317 xNavigationPageSetTitle(x.GoPointer(), TitleVar)
318
319}
320
321func (c *NavigationPage) GoPointer() uintptr {
322 if c == nil {
323 return 0
324 }
325 return c.Ptr
326}
327
328func (c *NavigationPage) SetGoPointer(ptr uintptr) {
329 c.Ptr = ptr
330}
331
332// SetPropertyCanPop sets the "can-pop" property.
333// Whether the page can be popped from navigation stack.
334//
335// Set it to `FALSE` to disable shortcuts and gestures, as well as remove the
336// back button from [class@HeaderBar].
337//
338// Manually calling [method@NavigationView.pop] or using the `navigation.pop`
339// action will still work.
340//
341// See [property@HeaderBar:show-back-button] for removing only the back
342// button, but not shortcuts.
343func (x *NavigationPage) SetPropertyCanPop(value bool) {
344 var v gobject.Value
345 v.Init(gobject.TypeBooleanVal)
346 v.SetBoolean(value)
347 x.SetProperty("can-pop", &v)
348}
349
350// GetPropertyCanPop gets the "can-pop" property.
351// Whether the page can be popped from navigation stack.
352//
353// Set it to `FALSE` to disable shortcuts and gestures, as well as remove the
354// back button from [class@HeaderBar].
355//
356// Manually calling [method@NavigationView.pop] or using the `navigation.pop`
357// action will still work.
358//
359// See [property@HeaderBar:show-back-button] for removing only the back
360// button, but not shortcuts.
361func (x *NavigationPage) GetPropertyCanPop() bool {
362 var v gobject.Value
363 x.GetProperty("can-pop", &v)
364 return v.GetBoolean()
365}
366
367// SetPropertyTag sets the "tag" property.
368// The page tag.
369//
370// The tag can be used to retrieve the page with
371// [method@NavigationView.find_page], as well as with
372// [method@NavigationView.push_by_tag], [method@NavigationView.pop_to_tag] or
373// [method@NavigationView.replace_with_tags].
374//
375// Tags must be unique within each [class@NavigationView].
376//
377// The tag also must be set to use the `navigation.push` action.
378func (x *NavigationPage) SetPropertyTag(value string) {
379 var v gobject.Value
380 v.Init(gobject.TypeStringVal)
381 v.SetString(&value)
382 x.SetProperty("tag", &v)
383}
384
385// GetPropertyTag gets the "tag" property.
386// The page tag.
387//
388// The tag can be used to retrieve the page with
389// [method@NavigationView.find_page], as well as with
390// [method@NavigationView.push_by_tag], [method@NavigationView.pop_to_tag] or
391// [method@NavigationView.replace_with_tags].
392//
393// Tags must be unique within each [class@NavigationView].
394//
395// The tag also must be set to use the `navigation.push` action.
396func (x *NavigationPage) GetPropertyTag() string {
397 var v gobject.Value
398 x.GetProperty("tag", &v)
399 return v.GetString()
400}
401
402// SetPropertyTitle sets the "title" property.
403// The page title.
404//
405// It's displayed in [class@HeaderBar] instead of the window title, and used
406// as the tooltip on the next page's back button, as well as by screen reader.
407func (x *NavigationPage) SetPropertyTitle(value string) {
408 var v gobject.Value
409 v.Init(gobject.TypeStringVal)
410 v.SetString(&value)
411 x.SetProperty("title", &v)
412}
413
414// GetPropertyTitle gets the "title" property.
415// The page title.
416//
417// It's displayed in [class@HeaderBar] instead of the window title, and used
418// as the tooltip on the next page's back button, as well as by screen reader.
419func (x *NavigationPage) GetPropertyTitle() string {
420 var v gobject.Value
421 x.GetProperty("title", &v)
422 return v.GetString()
423}
424
425// Emitted when the navigation view transition has been completed and the page
426// is fully hidden.
427//
428// It will always be preceded by [signal@NavigationPage::hiding] or
429// [signal@NavigationPage::showing].
430func (x *NavigationPage) ConnectHidden(cb *func(NavigationPage)) uint {
431 cbPtr := uintptr(unsafe.Pointer(cb))
432 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
433 handlerID := gobject.SignalConnect(x.GoPointer(), "hidden", cbRefPtr)
434 glib.SaveHandlerMapping(handlerID, cbPtr)
435 return handlerID
436 }
437
438 fcb := func(clsPtr uintptr) {
439 fa := NavigationPage{}
440 fa.Ptr = clsPtr
441 cbFn := *cb
442
443 cbFn(fa)
444
445 }
446 cbRefPtr := purego.NewCallback(fcb)
447 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
448 handlerID := gobject.SignalConnect(x.GoPointer(), "hidden", cbRefPtr)
449 glib.SaveHandlerMapping(handlerID, cbPtr)
450 return handlerID
451}
452
453// Emitted when the page starts hiding at the beginning of the navigation view
454// transition.
455//
456// It will always be followed by [signal@NavigationPage::hidden] or
457// [signal@NavigationPage::shown].
458func (x *NavigationPage) ConnectHiding(cb *func(NavigationPage)) uint {
459 cbPtr := uintptr(unsafe.Pointer(cb))
460 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
461 handlerID := gobject.SignalConnect(x.GoPointer(), "hiding", cbRefPtr)
462 glib.SaveHandlerMapping(handlerID, cbPtr)
463 return handlerID
464 }
465
466 fcb := func(clsPtr uintptr) {
467 fa := NavigationPage{}
468 fa.Ptr = clsPtr
469 cbFn := *cb
470
471 cbFn(fa)
472
473 }
474 cbRefPtr := purego.NewCallback(fcb)
475 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
476 handlerID := gobject.SignalConnect(x.GoPointer(), "hiding", cbRefPtr)
477 glib.SaveHandlerMapping(handlerID, cbPtr)
478 return handlerID
479}
480
481// Emitted when the page shows at the beginning of the navigation view
482// transition.
483//
484// It will always be followed by [signal@NavigationPage::shown] or
485// [signal@NavigationPage::hidden].
486func (x *NavigationPage) ConnectShowing(cb *func(NavigationPage)) uint {
487 cbPtr := uintptr(unsafe.Pointer(cb))
488 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
489 handlerID := gobject.SignalConnect(x.GoPointer(), "showing", cbRefPtr)
490 glib.SaveHandlerMapping(handlerID, cbPtr)
491 return handlerID
492 }
493
494 fcb := func(clsPtr uintptr) {
495 fa := NavigationPage{}
496 fa.Ptr = clsPtr
497 cbFn := *cb
498
499 cbFn(fa)
500
501 }
502 cbRefPtr := purego.NewCallback(fcb)
503 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
504 handlerID := gobject.SignalConnect(x.GoPointer(), "showing", cbRefPtr)
505 glib.SaveHandlerMapping(handlerID, cbPtr)
506 return handlerID
507}
508
509// Emitted when the navigation view transition has been completed and the page
510// is fully shown.
511//
512// It will always be preceded by [signal@NavigationPage::showing] or
513// [signal@NavigationPage::hiding].
514func (x *NavigationPage) ConnectShown(cb *func(NavigationPage)) uint {
515 cbPtr := uintptr(unsafe.Pointer(cb))
516 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
517 handlerID := gobject.SignalConnect(x.GoPointer(), "shown", cbRefPtr)
518 glib.SaveHandlerMapping(handlerID, cbPtr)
519 return handlerID
520 }
521
522 fcb := func(clsPtr uintptr) {
523 fa := NavigationPage{}
524 fa.Ptr = clsPtr
525 cbFn := *cb
526
527 cbFn(fa)
528
529 }
530 cbRefPtr := purego.NewCallback(fcb)
531 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
532 handlerID := gobject.SignalConnect(x.GoPointer(), "shown", cbRefPtr)
533 glib.SaveHandlerMapping(handlerID, cbPtr)
534 return handlerID
535}
536
537// Requests the user's screen reader to announce the given message.
538//
539// This kind of notification is useful for messages that
540// either have only a visual representation or that are not
541// exposed visually at all, e.g. a notification about a
542// successful operation.
543//
544// Also, by using this API, you can ensure that the message
545// does not interrupts the user's current screen reader output.
546func (x *NavigationPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
547
548 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
549
550}
551
552// Retrieves the accessible parent for an accessible object.
553//
554// This function returns `NULL` for top level widgets.
555func (x *NavigationPage) GetAccessibleParent() *gtk.AccessibleBase {
556 var cls *gtk.AccessibleBase
557
558 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
559
560 if cret == 0 {
561 return nil
562 }
563 cls = >k.AccessibleBase{}
564 cls.Ptr = cret
565 return cls
566}
567
568// Retrieves the accessible role of an accessible object.
569func (x *NavigationPage) GetAccessibleRole() gtk.AccessibleRole {
570
571 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
572 return cret
573}
574
575// Retrieves the implementation for the given accessible object.
576func (x *NavigationPage) GetAtContext() *gtk.ATContext {
577 var cls *gtk.ATContext
578
579 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
580
581 if cret == 0 {
582 return nil
583 }
584 cls = >k.ATContext{}
585 cls.Ptr = cret
586 return cls
587}
588
589// Queries the coordinates and dimensions of this accessible
590//
591// This functionality can be overridden by `GtkAccessible`
592// implementations, e.g. to get the bounds from an ignored
593// child widget.
594func (x *NavigationPage) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
595
596 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
597 return cret
598}
599
600// Retrieves the first accessible child of an accessible object.
601func (x *NavigationPage) GetFirstAccessibleChild() *gtk.AccessibleBase {
602 var cls *gtk.AccessibleBase
603
604 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
605
606 if cret == 0 {
607 return nil
608 }
609 cls = >k.AccessibleBase{}
610 cls.Ptr = cret
611 return cls
612}
613
614// Retrieves the next accessible sibling of an accessible object
615func (x *NavigationPage) GetNextAccessibleSibling() *gtk.AccessibleBase {
616 var cls *gtk.AccessibleBase
617
618 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
619
620 if cret == 0 {
621 return nil
622 }
623 cls = >k.AccessibleBase{}
624 cls.Ptr = cret
625 return cls
626}
627
628// Queries a platform state, such as focus.
629//
630// This functionality can be overridden by `GtkAccessible`
631// implementations, e.g. to get platform state from an ignored
632// child widget, as is the case for `GtkText` wrappers.
633func (x *NavigationPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
634
635 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
636 return cret
637}
638
639// Resets the accessible property to its default value.
640func (x *NavigationPage) ResetProperty(PropertyVar gtk.AccessibleProperty) {
641
642 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
643
644}
645
646// Resets the accessible relation to its default value.
647func (x *NavigationPage) ResetRelation(RelationVar gtk.AccessibleRelation) {
648
649 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
650
651}
652
653// Resets the accessible state to its default value.
654func (x *NavigationPage) ResetState(StateVar gtk.AccessibleState) {
655
656 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
657
658}
659
660// Sets the parent and sibling of an accessible object.
661//
662// This function is meant to be used by accessible implementations that are
663// not part of the widget hierarchy, and but act as a logical bridge between
664// widgets. For instance, if a widget creates an object that holds metadata
665// for each child, and you want that object to implement the `GtkAccessible`
666// interface, you will use this function to ensure that the parent of each
667// child widget is the metadata object, and the parent of each metadata
668// object is the container widget.
669func (x *NavigationPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
670
671 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
672
673}
674
675// Updates the next accessible sibling.
676//
677// That might be useful when a new child of a custom accessible
678// is created, and it needs to be linked to a previous child.
679func (x *NavigationPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
680
681 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
682
683}
684
685// Informs ATs that the platform state has changed.
686//
687// This function should be used by `GtkAccessible` implementations that
688// have a platform state but are not widgets. Widgets handle platform
689// states automatically.
690func (x *NavigationPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
691
692 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
693
694}
695
696// Updates a list of accessible properties.
697//
698// See the [enum@Gtk.AccessibleProperty] documentation for the
699// value types of accessible properties.
700//
701// This function should be called by `GtkWidget` types whenever
702// an accessible property change must be communicated to assistive
703// technologies.
704//
705// Example:
706// ```c
707// value = gtk_adjustment_get_value (adjustment);
708// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
709//
710// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
711// -1);
712//
713// ```
714func (x *NavigationPage) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
715
716 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
717
718}
719
720// Updates an array of accessible properties.
721//
722// This function should be called by `GtkWidget` types whenever an accessible
723// property change must be communicated to assistive technologies.
724//
725// This function is meant to be used by language bindings.
726func (x *NavigationPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
727
728 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
729
730}
731
732// Updates a list of accessible relations.
733//
734// This function should be called by `GtkWidget` types whenever an accessible
735// relation change must be communicated to assistive technologies.
736//
737// If the [enum@Gtk.AccessibleRelation] requires a list of references,
738// you should pass each reference individually, followed by `NULL`, e.g.
739//
740// ```c
741// gtk_accessible_update_relation (accessible,
742//
743// GTK_ACCESSIBLE_RELATION_CONTROLS,
744// ref1, NULL,
745// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
746// ref1, ref2, ref3, NULL,
747// -1);
748//
749// ```
750func (x *NavigationPage) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
751
752 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
753
754}
755
756// Updates an array of accessible relations.
757//
758// This function should be called by `GtkWidget` types whenever an accessible
759// relation change must be communicated to assistive technologies.
760//
761// This function is meant to be used by language bindings.
762func (x *NavigationPage) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
763
764 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
765
766}
767
768// Updates a list of accessible states.
769//
770// See the [enum@Gtk.AccessibleState] documentation for the
771// value types of accessible states.
772//
773// This function should be called by `GtkWidget` types whenever
774// an accessible state change must be communicated to assistive
775// technologies.
776//
777// Example:
778//
779// ```c
780// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
781// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
782//
783// GTK_ACCESSIBLE_STATE_CHECKED, value,
784// -1);
785//
786// ```
787func (x *NavigationPage) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
788
789 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
790
791}
792
793// Updates an array of accessible states.
794//
795// This function should be called by `GtkWidget` types whenever an accessible
796// state change must be communicated to assistive technologies.
797//
798// This function is meant to be used by language bindings.
799func (x *NavigationPage) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
800
801 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
802
803}
804
805// Gets the ID of the @buildable object.
806//
807// `GtkBuilder` sets the name based on the ID attribute
808// of the `<object>` tag used to construct the @buildable.
809func (x *NavigationPage) GetBuildableId() string {
810
811 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
812 return cret
813}
814
815// A page-based navigation container.
816//
817// <picture>
818//
819// <source srcset="navigation-view-dark.png" media="(prefers-color-scheme: dark)">
820// <img src="navigation-view.png" alt="navigation-view">
821//
822// </picture>
823//
824// `AdwNavigationView` presents one child at a time, similar to
825// [class@Gtk.Stack].
826//
827// `AdwNavigationView` can only contain [class@NavigationPage] children.
828//
829// It maintains a navigation stack that can be controlled with
830// [method@NavigationView.push] and [method@NavigationView.pop]. The whole
831// navigation stack can also be replaced using [method@NavigationView.replace].
832//
833// `AdwNavigationView` allows to manage pages statically or dynamically.
834//
835// Static pages can be added using the [method@NavigationView.add] method. The
836// `AdwNavigationView` will keep a reference to these pages, but they aren't
837// accessible to the user until [method@NavigationView.push] is called (except
838// for the first page, which is pushed automatically). Use the
839// [method@NavigationView.remove] method to remove them. This is useful for
840// applications that have a small number of unique pages and just need
841// navigation between them.
842//
843// Dynamic pages are automatically destroyed once they are popped off the
844// navigation stack. To add a page like this, push it using the
845// [method@NavigationView.push] method without calling
846// [method@NavigationView.add] first.
847//
848// ## Tags
849//
850// Static pages, as well as any pages in the navigation stack, can be accessed
851// by their [property@NavigationPage:tag]. For example,
852// [method@NavigationView.push_by_tag] can be used to push a static page that's
853// not in the navigation stack without having to keep a reference to it manually.
854//
855// ## Header Bar Integration
856//
857// When used inside `AdwNavigationView`, [class@HeaderBar] will automatically
858// display a back button that can be used to go back to the previous page when
859// possible. The button also has a context menu, allowing to pop multiple pages
860// at once, potentially across multiple navigation views.
861//
862// Set [property@HeaderBar:show-back-button] to `FALSE` to disable this behavior
863// in rare scenarios where it's unwanted.
864//
865// `AdwHeaderBar` will also display the title of the `AdwNavigationPage` it's
866// placed into, so most applications shouldn't need to customize it at all.
867//
868// ## Shortcuts and Gestures
869//
870// `AdwNavigationView` supports the following shortcuts for going to the
871// previous page:
872//
873// - <kbd>Escape</kbd> (unless [property@NavigationView:pop-on-escape] is set to
874// `FALSE`)
875// - <kbd>Alt</kbd>+<kbd>←</kbd>
876// - Back mouse button
877//
878// Additionally, it supports interactive gestures:
879//
880// - One-finger swipe towards the right on touchscreens
881// - Scrolling towards the right on touchpads (usually two-finger swipe)
882//
883// These gestures have transitions enabled regardless of the
884// [property@NavigationView:animate-transitions] value.
885//
886// Applications can also enable shortcuts for pushing another page onto the
887// navigation stack via connecting to the [signal@NavigationView::get-next-page]
888// signal, in that case the following shortcuts are supported:
889//
890// - <kbd>Alt</kbd>+<kbd>→</kbd>
891// - Forward mouse button
892// - Swipe/scrolling towards the left
893//
894// For right-to-left locales, the gestures and shortcuts are reversed.
895//
896// [property@NavigationPage:can-pop] can be used to disable them, along with the
897// header bar back buttons.
898//
899// ## Actions
900//
901// `AdwNavigationView` defines actions for controlling the navigation stack.
902// actions for controlling the navigation stack:
903//
904// - `navigation.push` takes a string parameter specifying the tag of the page to
905// push, and is equivalent to calling [method@NavigationView.push_by_tag].
906//
907// - `navigation.pop` doesn't take any parameters and pops the current page from
908// the navigation stack, equivalent to calling [method@NavigationView.pop].
909//
910// ## `AdwNavigationView` as `GtkBuildable`
911//
912// `AdwNavigationView` allows to add pages as children, equivalent to using the
913// [method@NavigationView.add] method.
914//
915// Example of an `AdwNavigationView` UI definition:
916//
917// ```xml
918// <object class="AdwNavigationView">
919//
920// <child>
921// <object class="AdwNavigationPage">
922// <property name="title" translatable="yes">Page 1</property>
923// <property name="child">
924// <object class="AdwToolbarView">
925// <child type="top">
926// <object class="AdwHeaderBar"/>
927// </child>
928// <property name="content">
929// <object class="GtkButton">
930// <property name="label" translatable="yes">Open Page 2</property>
931// <property name="halign">center</property>
932// <property name="valign">center</property>
933// <property name="action-name">navigation.push</property>
934// <property name="action-target">'page-2'</property>
935// <style>
936// <class name="pill"/>
937// </style>
938// </object>
939// </property>
940// </object>
941// </property>
942// </object>
943// </child>
944// <child>
945// <object class="AdwNavigationPage">
946// <property name="title" translatable="yes">Page 2</property>
947// <property name="tag">page-2</property>
948// <property name="child">
949// <object class="AdwToolbarView">
950// <child type="top">
951// <object class="AdwHeaderBar"/>
952// </child>
953// <property name="content">
954// <!-- ... -->
955// </property>
956// </object>
957// </property>
958// </object>
959// </child>
960//
961// </object>
962// ```
963//
964// <picture>
965//
966// <source srcset="navigation-view-example-dark.png" media="(prefers-color-scheme: dark)">
967// <img src="navigation-view-example.png" alt="navigation-view-example">
968//
969// </picture>
970//
971// ## CSS nodes
972//
973// `AdwNavigationView` has a single CSS node with the name `navigation-view`.
974//
975// ## Accessibility
976//
977// `AdwNavigationView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
978type NavigationView struct {
979 gtk.Widget
980}
981
982var xNavigationViewGLibType func() types.GType
983
984func NavigationViewGLibType() types.GType {
985 return xNavigationViewGLibType()
986}
987
988func NavigationViewNewFromInternalPtr(ptr uintptr) *NavigationView {
989 cls := &NavigationView{}
990 cls.Ptr = ptr
991 return cls
992}
993
994var xNewNavigationView func() uintptr
995
996// Creates a new `AdwNavigationView`.
997func NewNavigationView() *NavigationView {
998 var cls *NavigationView
999
1000 cret := xNewNavigationView()
1001
1002 if cret == 0 {
1003 return nil
1004 }
1005 gobject.IncreaseRef(cret)
1006 cls = &NavigationView{}
1007 cls.Ptr = cret
1008 return cls
1009}
1010
1011var xNavigationViewAdd func(uintptr, uintptr)
1012
1013// Permanently adds @page to @self.
1014//
1015// Any page that has been added will stay in @self even after being popped from
1016// the navigation stack.
1017//
1018// Adding a page while no page is visible will automatically push it to the
1019// navigation stack.
1020//
1021// See [method@NavigationView.remove].
1022func (x *NavigationView) Add(PageVar *NavigationPage) {
1023
1024 xNavigationViewAdd(x.GoPointer(), PageVar.GoPointer())
1025
1026}
1027
1028var xNavigationViewFindPage func(uintptr, string) uintptr
1029
1030// Finds a page in @self by its tag.
1031//
1032// See [property@NavigationPage:tag].
1033func (x *NavigationView) FindPage(TagVar string) *NavigationPage {
1034 var cls *NavigationPage
1035
1036 cret := xNavigationViewFindPage(x.GoPointer(), TagVar)
1037
1038 if cret == 0 {
1039 return nil
1040 }
1041 gobject.IncreaseRef(cret)
1042 cls = &NavigationPage{}
1043 cls.Ptr = cret
1044 return cls
1045}
1046
1047var xNavigationViewGetAnimateTransitions func(uintptr) bool
1048
1049// Gets whether @self animates page transitions.
1050func (x *NavigationView) GetAnimateTransitions() bool {
1051
1052 cret := xNavigationViewGetAnimateTransitions(x.GoPointer())
1053 return cret
1054}
1055
1056var xNavigationViewGetHhomogeneous func(uintptr) bool
1057
1058// Gets whether @self is horizontally homogeneous.
1059func (x *NavigationView) GetHhomogeneous() bool {
1060
1061 cret := xNavigationViewGetHhomogeneous(x.GoPointer())
1062 return cret
1063}
1064
1065var xNavigationViewGetNavigationStack func(uintptr) uintptr
1066
1067// Returns a [iface@Gio.ListModel] that contains the pages in navigation stack.
1068//
1069// The pages are sorted from root page to visible page.
1070//
1071// This can be used to keep an up-to-date view.
1072func (x *NavigationView) GetNavigationStack() *gio.ListModelBase {
1073 var cls *gio.ListModelBase
1074
1075 cret := xNavigationViewGetNavigationStack(x.GoPointer())
1076
1077 if cret == 0 {
1078 return nil
1079 }
1080 cls = &gio.ListModelBase{}
1081 cls.Ptr = cret
1082 return cls
1083}
1084
1085var xNavigationViewGetPopOnEscape func(uintptr) bool
1086
1087// Gets whether pressing Escape pops the current page on @self.
1088func (x *NavigationView) GetPopOnEscape() bool {
1089
1090 cret := xNavigationViewGetPopOnEscape(x.GoPointer())
1091 return cret
1092}
1093
1094var xNavigationViewGetPreviousPage func(uintptr, uintptr) uintptr
1095
1096// Gets the previous page for @page.
1097//
1098// If @page is in the navigation stack, returns the page popping @page will
1099// reveal.
1100//
1101// If @page is the root page or is not in the navigation stack, returns `NULL`.
1102func (x *NavigationView) GetPreviousPage(PageVar *NavigationPage) *NavigationPage {
1103 var cls *NavigationPage
1104
1105 cret := xNavigationViewGetPreviousPage(x.GoPointer(), PageVar.GoPointer())
1106
1107 if cret == 0 {
1108 return nil
1109 }
1110 gobject.IncreaseRef(cret)
1111 cls = &NavigationPage{}
1112 cls.Ptr = cret
1113 return cls
1114}
1115
1116var xNavigationViewGetVhomogeneous func(uintptr) bool
1117
1118// Gets whether @self is vertically homogeneous.
1119func (x *NavigationView) GetVhomogeneous() bool {
1120
1121 cret := xNavigationViewGetVhomogeneous(x.GoPointer())
1122 return cret
1123}
1124
1125var xNavigationViewGetVisiblePage func(uintptr) uintptr
1126
1127// Gets the currently visible page in @self.
1128func (x *NavigationView) GetVisiblePage() *NavigationPage {
1129 var cls *NavigationPage
1130
1131 cret := xNavigationViewGetVisiblePage(x.GoPointer())
1132
1133 if cret == 0 {
1134 return nil
1135 }
1136 gobject.IncreaseRef(cret)
1137 cls = &NavigationPage{}
1138 cls.Ptr = cret
1139 return cls
1140}
1141
1142var xNavigationViewGetVisiblePageTag func(uintptr) string
1143
1144// Gets the tag of the currently visible page in @self.
1145func (x *NavigationView) GetVisiblePageTag() string {
1146
1147 cret := xNavigationViewGetVisiblePageTag(x.GoPointer())
1148 return cret
1149}
1150
1151var xNavigationViewPop func(uintptr) bool
1152
1153// Pops the visible page from the navigation stack.
1154//
1155// Does nothing if the navigation stack contains less than two pages.
1156//
1157// If [method@NavigationView.add] hasn't been called, the page is automatically
1158// removed.
1159//
1160// [signal@NavigationView::popped] will be emitted for the current visible page.
1161//
1162// See [method@NavigationView.pop_to_page] and
1163// [method@NavigationView.pop_to_tag].
1164func (x *NavigationView) Pop() bool {
1165
1166 cret := xNavigationViewPop(x.GoPointer())
1167 return cret
1168}
1169
1170var xNavigationViewPopToPage func(uintptr, uintptr) bool
1171
1172// Pops pages from the navigation stack until @page is visible.
1173//
1174// @page must be in the navigation stack.
1175//
1176// If [method@NavigationView.add] hasn't been called for any of the popped pages,
1177// they are automatically removed.
1178//
1179// [signal@NavigationView::popped] will be be emitted for each of the popped
1180// pages.
1181//
1182// See [method@NavigationView.pop] and [method@NavigationView.pop_to_tag].
1183func (x *NavigationView) PopToPage(PageVar *NavigationPage) bool {
1184
1185 cret := xNavigationViewPopToPage(x.GoPointer(), PageVar.GoPointer())
1186 return cret
1187}
1188
1189var xNavigationViewPopToTag func(uintptr, string) bool
1190
1191// Pops pages from the navigation stack until page with the tag @tag is visible.
1192//
1193// The page must be in the navigation stack.
1194//
1195// If [method@NavigationView.add] hasn't been called for any of the popped pages,
1196// they are automatically removed.
1197//
1198// [signal@NavigationView::popped] will be emitted for each of the popped pages.
1199//
1200// See [method@NavigationView.pop_to_page] and [property@NavigationPage:tag].
1201func (x *NavigationView) PopToTag(TagVar string) bool {
1202
1203 cret := xNavigationViewPopToTag(x.GoPointer(), TagVar)
1204 return cret
1205}
1206
1207var xNavigationViewPush func(uintptr, uintptr)
1208
1209// Pushes @page onto the navigation stack.
1210//
1211// If [method@NavigationView.add] hasn't been called, the page is automatically
1212// removed once it's popped.
1213//
1214// [signal@NavigationView::pushed] will be emitted for @page.
1215//
1216// See [method@NavigationView.push_by_tag].
1217func (x *NavigationView) Push(PageVar *NavigationPage) {
1218
1219 xNavigationViewPush(x.GoPointer(), PageVar.GoPointer())
1220
1221}
1222
1223var xNavigationViewPushByTag func(uintptr, string)
1224
1225// Pushes the page with the tag @tag onto the navigation stack.
1226//
1227// If [method@NavigationView.add] hasn't been called, the page is automatically
1228// removed once it's popped.
1229//
1230// [signal@NavigationView::pushed] will be emitted for the page.
1231//
1232// See [method@NavigationView.push] and [property@NavigationPage:tag].
1233func (x *NavigationView) PushByTag(TagVar string) {
1234
1235 xNavigationViewPushByTag(x.GoPointer(), TagVar)
1236
1237}
1238
1239var xNavigationViewRemove func(uintptr, uintptr)
1240
1241// Removes @page from @self.
1242//
1243// If @page is currently in the navigation stack, it will be removed once it's
1244// popped. Otherwise, it's removed immediately.
1245//
1246// See [method@NavigationView.add].
1247func (x *NavigationView) Remove(PageVar *NavigationPage) {
1248
1249 xNavigationViewRemove(x.GoPointer(), PageVar.GoPointer())
1250
1251}
1252
1253var xNavigationViewReplace func(uintptr, uintptr, int)
1254
1255// Replaces the current navigation stack with @pages.
1256//
1257// The last page becomes the visible page.
1258//
1259// Replacing the navigation stack has no animation.
1260//
1261// If [method@NavigationView.add] hasn't been called for any pages that are no
1262// longer in the navigation stack, they are automatically removed.
1263//
1264// @n_pages can be 0, in that case no page will be visible after calling this
1265// method. This can be useful for removing all pages from @self.
1266//
1267// The [signal@NavigationView::replaced] signal will be emitted.
1268//
1269// See [method@NavigationView.replace_with_tags].
1270func (x *NavigationView) Replace(PagesVar uintptr, NPagesVar int) {
1271
1272 xNavigationViewReplace(x.GoPointer(), PagesVar, NPagesVar)
1273
1274}
1275
1276var xNavigationViewReplaceWithTags func(uintptr, []string, int)
1277
1278// Replaces the current navigation stack with pages with the tags @tags.
1279//
1280// The last page becomes the visible page.
1281//
1282// Replacing the navigation stack has no animation.
1283//
1284// If [method@NavigationView.add] hasn't been called for any pages that are no
1285// longer in the navigation stack, they are automatically removed.
1286//
1287// @n_tags can be 0, in that case no page will be visible after calling this
1288// method. This can be useful for removing all pages from @self.
1289//
1290// The [signal@NavigationView::replaced] signal will be emitted.
1291//
1292// See [method@NavigationView.replace] and [property@NavigationPage:tag].
1293func (x *NavigationView) ReplaceWithTags(TagsVar []string, NTagsVar int) {
1294
1295 xNavigationViewReplaceWithTags(x.GoPointer(), TagsVar, NTagsVar)
1296
1297}
1298
1299var xNavigationViewSetAnimateTransitions func(uintptr, bool)
1300
1301// Sets whether @self should animate page transitions.
1302//
1303// Gesture-based transitions are always animated.
1304func (x *NavigationView) SetAnimateTransitions(AnimateTransitionsVar bool) {
1305
1306 xNavigationViewSetAnimateTransitions(x.GoPointer(), AnimateTransitionsVar)
1307
1308}
1309
1310var xNavigationViewSetHhomogeneous func(uintptr, bool)
1311
1312// Sets @self to be horizontally homogeneous or not.
1313//
1314// If the view is horizontally homogeneous, it allocates the same width for
1315// all pages.
1316//
1317// If it's not, the view may change width when a different page becomes visible.
1318func (x *NavigationView) SetHhomogeneous(HhomogeneousVar bool) {
1319
1320 xNavigationViewSetHhomogeneous(x.GoPointer(), HhomogeneousVar)
1321
1322}
1323
1324var xNavigationViewSetPopOnEscape func(uintptr, bool)
1325
1326// Sets whether pressing Escape pops the current page on @self.
1327//
1328// Applications using `AdwNavigationView` to implement a browser may want to
1329// disable it.
1330func (x *NavigationView) SetPopOnEscape(PopOnEscapeVar bool) {
1331
1332 xNavigationViewSetPopOnEscape(x.GoPointer(), PopOnEscapeVar)
1333
1334}
1335
1336var xNavigationViewSetVhomogeneous func(uintptr, bool)
1337
1338// Sets @self to be vertically homogeneous or not.
1339//
1340// If the view is vertically homogeneous, it allocates the same height for
1341// all pages.
1342//
1343// If it's not, the view may change height when a different page becomes
1344// visible.
1345func (x *NavigationView) SetVhomogeneous(VhomogeneousVar bool) {
1346
1347 xNavigationViewSetVhomogeneous(x.GoPointer(), VhomogeneousVar)
1348
1349}
1350
1351func (c *NavigationView) GoPointer() uintptr {
1352 if c == nil {
1353 return 0
1354 }
1355 return c.Ptr
1356}
1357
1358func (c *NavigationView) SetGoPointer(ptr uintptr) {
1359 c.Ptr = ptr
1360}
1361
1362// SetPropertyAnimateTransitions sets the "animate-transitions" property.
1363// Whether to animate page transitions.
1364//
1365// Gesture-based transitions are always animated.
1366func (x *NavigationView) SetPropertyAnimateTransitions(value bool) {
1367 var v gobject.Value
1368 v.Init(gobject.TypeBooleanVal)
1369 v.SetBoolean(value)
1370 x.SetProperty("animate-transitions", &v)
1371}
1372
1373// GetPropertyAnimateTransitions gets the "animate-transitions" property.
1374// Whether to animate page transitions.
1375//
1376// Gesture-based transitions are always animated.
1377func (x *NavigationView) GetPropertyAnimateTransitions() bool {
1378 var v gobject.Value
1379 x.GetProperty("animate-transitions", &v)
1380 return v.GetBoolean()
1381}
1382
1383// SetPropertyHhomogeneous sets the "hhomogeneous" property.
1384// Whether the view is horizontally homogeneous.
1385//
1386// If the view is horizontally homogeneous, it allocates the same width for
1387// all pages.
1388//
1389// If it's not, the page may change width when a different page becomes
1390// visible.
1391func (x *NavigationView) SetPropertyHhomogeneous(value bool) {
1392 var v gobject.Value
1393 v.Init(gobject.TypeBooleanVal)
1394 v.SetBoolean(value)
1395 x.SetProperty("hhomogeneous", &v)
1396}
1397
1398// GetPropertyHhomogeneous gets the "hhomogeneous" property.
1399// Whether the view is horizontally homogeneous.
1400//
1401// If the view is horizontally homogeneous, it allocates the same width for
1402// all pages.
1403//
1404// If it's not, the page may change width when a different page becomes
1405// visible.
1406func (x *NavigationView) GetPropertyHhomogeneous() bool {
1407 var v gobject.Value
1408 x.GetProperty("hhomogeneous", &v)
1409 return v.GetBoolean()
1410}
1411
1412// SetPropertyPopOnEscape sets the "pop-on-escape" property.
1413// Whether pressing Escape pops the current page.
1414//
1415// Applications using `AdwNavigationView` to implement a browser may want to
1416// disable it.
1417func (x *NavigationView) SetPropertyPopOnEscape(value bool) {
1418 var v gobject.Value
1419 v.Init(gobject.TypeBooleanVal)
1420 v.SetBoolean(value)
1421 x.SetProperty("pop-on-escape", &v)
1422}
1423
1424// GetPropertyPopOnEscape gets the "pop-on-escape" property.
1425// Whether pressing Escape pops the current page.
1426//
1427// Applications using `AdwNavigationView` to implement a browser may want to
1428// disable it.
1429func (x *NavigationView) GetPropertyPopOnEscape() bool {
1430 var v gobject.Value
1431 x.GetProperty("pop-on-escape", &v)
1432 return v.GetBoolean()
1433}
1434
1435// SetPropertyVhomogeneous sets the "vhomogeneous" property.
1436// Whether the view is vertically homogeneous.
1437//
1438// If the view is vertically homogeneous, it allocates the same height for
1439// all pages.
1440//
1441// If it's not, the view may change height when a different page becomes
1442// visible.
1443func (x *NavigationView) SetPropertyVhomogeneous(value bool) {
1444 var v gobject.Value
1445 v.Init(gobject.TypeBooleanVal)
1446 v.SetBoolean(value)
1447 x.SetProperty("vhomogeneous", &v)
1448}
1449
1450// GetPropertyVhomogeneous gets the "vhomogeneous" property.
1451// Whether the view is vertically homogeneous.
1452//
1453// If the view is vertically homogeneous, it allocates the same height for
1454// all pages.
1455//
1456// If it's not, the view may change height when a different page becomes
1457// visible.
1458func (x *NavigationView) GetPropertyVhomogeneous() bool {
1459 var v gobject.Value
1460 x.GetProperty("vhomogeneous", &v)
1461 return v.GetBoolean()
1462}
1463
1464// GetPropertyVisiblePageTag gets the "visible-page-tag" property.
1465// The tag of the currently visible page.
1466func (x *NavigationView) GetPropertyVisiblePageTag() string {
1467 var v gobject.Value
1468 x.GetProperty("visible-page-tag", &v)
1469 return v.GetString()
1470}
1471
1472// Emitted when a push shortcut or a gesture is triggered.
1473//
1474// To support the push shortcuts and gestures, the application is expected to
1475// return the page to push in the handler.
1476//
1477// This signal can be emitted multiple times for the gestures, for example
1478// when the gesture is cancelled by the user. As such, the application must
1479// not make any irreversible changes in the handler, such as removing the page
1480// from a forward stack.
1481//
1482// Instead, it should be done in the [signal@NavigationView::pushed] handler.
1483func (x *NavigationView) ConnectGetNextPage(cb *func(NavigationView) NavigationPage) uint {
1484 cbPtr := uintptr(unsafe.Pointer(cb))
1485 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1486 handlerID := gobject.SignalConnect(x.GoPointer(), "get-next-page", cbRefPtr)
1487 glib.SaveHandlerMapping(handlerID, cbPtr)
1488 return handlerID
1489 }
1490
1491 fcb := func(clsPtr uintptr) uintptr {
1492 fa := NavigationView{}
1493 fa.Ptr = clsPtr
1494 cbFn := *cb
1495
1496 GetNextPageCls := cbFn(fa)
1497 return GetNextPageCls.Ptr
1498
1499 }
1500 cbRefPtr := purego.NewCallback(fcb)
1501 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1502 handlerID := gobject.SignalConnect(x.GoPointer(), "get-next-page", cbRefPtr)
1503 glib.SaveHandlerMapping(handlerID, cbPtr)
1504 return handlerID
1505}
1506
1507// Emitted after @page has been popped from the navigation stack.
1508//
1509// See [method@NavigationView.pop].
1510//
1511// When using [method@NavigationView.pop_to_page] or
1512// [method@NavigationView.pop_to_tag], this signal is emitted for each of the
1513// popped pages.
1514func (x *NavigationView) ConnectPopped(cb *func(NavigationView, uintptr)) uint {
1515 cbPtr := uintptr(unsafe.Pointer(cb))
1516 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1517 handlerID := gobject.SignalConnect(x.GoPointer(), "popped", cbRefPtr)
1518 glib.SaveHandlerMapping(handlerID, cbPtr)
1519 return handlerID
1520 }
1521
1522 fcb := func(clsPtr uintptr, PageVarp uintptr) {
1523 fa := NavigationView{}
1524 fa.Ptr = clsPtr
1525 cbFn := *cb
1526
1527 cbFn(fa, PageVarp)
1528
1529 }
1530 cbRefPtr := purego.NewCallback(fcb)
1531 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1532 handlerID := gobject.SignalConnect(x.GoPointer(), "popped", cbRefPtr)
1533 glib.SaveHandlerMapping(handlerID, cbPtr)
1534 return handlerID
1535}
1536
1537// Emitted after a page has been pushed to the navigation stack.
1538//
1539// See [method@NavigationView.push].
1540func (x *NavigationView) ConnectPushed(cb *func(NavigationView)) uint {
1541 cbPtr := uintptr(unsafe.Pointer(cb))
1542 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1543 handlerID := gobject.SignalConnect(x.GoPointer(), "pushed", cbRefPtr)
1544 glib.SaveHandlerMapping(handlerID, cbPtr)
1545 return handlerID
1546 }
1547
1548 fcb := func(clsPtr uintptr) {
1549 fa := NavigationView{}
1550 fa.Ptr = clsPtr
1551 cbFn := *cb
1552
1553 cbFn(fa)
1554
1555 }
1556 cbRefPtr := purego.NewCallback(fcb)
1557 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1558 handlerID := gobject.SignalConnect(x.GoPointer(), "pushed", cbRefPtr)
1559 glib.SaveHandlerMapping(handlerID, cbPtr)
1560 return handlerID
1561}
1562
1563// Emitted after the navigation stack has been replaced.
1564//
1565// See [method@NavigationView.replace].
1566func (x *NavigationView) ConnectReplaced(cb *func(NavigationView)) uint {
1567 cbPtr := uintptr(unsafe.Pointer(cb))
1568 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1569 handlerID := gobject.SignalConnect(x.GoPointer(), "replaced", cbRefPtr)
1570 glib.SaveHandlerMapping(handlerID, cbPtr)
1571 return handlerID
1572 }
1573
1574 fcb := func(clsPtr uintptr) {
1575 fa := NavigationView{}
1576 fa.Ptr = clsPtr
1577 cbFn := *cb
1578
1579 cbFn(fa)
1580
1581 }
1582 cbRefPtr := purego.NewCallback(fcb)
1583 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1584 handlerID := gobject.SignalConnect(x.GoPointer(), "replaced", cbRefPtr)
1585 glib.SaveHandlerMapping(handlerID, cbPtr)
1586 return handlerID
1587}
1588
1589// Gets the progress @self will snap back to after the gesture is canceled.
1590func (x *NavigationView) GetCancelProgress() float64 {
1591
1592 cret := XAdwSwipeableGetCancelProgress(x.GoPointer())
1593 return cret
1594}
1595
1596// Gets the swipe distance of @self.
1597//
1598// This corresponds to how many pixels 1 unit represents.
1599func (x *NavigationView) GetDistance() float64 {
1600
1601 cret := XAdwSwipeableGetDistance(x.GoPointer())
1602 return cret
1603}
1604
1605// Gets the current progress of @self.
1606func (x *NavigationView) GetProgress() float64 {
1607
1608 cret := XAdwSwipeableGetProgress(x.GoPointer())
1609 return cret
1610}
1611
1612// Gets the snap points of @self.
1613//
1614// Each snap point represents a progress value that is considered acceptable to
1615// end the swipe on.
1616func (x *NavigationView) GetSnapPoints(NSnapPointsVar *int) uintptr {
1617
1618 cret := XAdwSwipeableGetSnapPoints(x.GoPointer(), NSnapPointsVar)
1619 return cret
1620}
1621
1622// Gets the area @self can start a swipe from for the given direction and
1623// gesture type.
1624//
1625// This can be used to restrict swipes to only be possible from a certain area,
1626// for example, to only allow edge swipes, or to have a draggable element and
1627// ignore swipes elsewhere.
1628//
1629// If not implemented, the default implementation returns the allocation of
1630// @self, allowing swipes from anywhere.
1631func (x *NavigationView) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVar bool, RectVar *gdk.Rectangle) {
1632
1633 XAdwSwipeableGetSwipeArea(x.GoPointer(), NavigationDirectionVar, IsDragVar, RectVar)
1634
1635}
1636
1637// Requests the user's screen reader to announce the given message.
1638//
1639// This kind of notification is useful for messages that
1640// either have only a visual representation or that are not
1641// exposed visually at all, e.g. a notification about a
1642// successful operation.
1643//
1644// Also, by using this API, you can ensure that the message
1645// does not interrupts the user's current screen reader output.
1646func (x *NavigationView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
1647
1648 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
1649
1650}
1651
1652// Retrieves the accessible parent for an accessible object.
1653//
1654// This function returns `NULL` for top level widgets.
1655func (x *NavigationView) GetAccessibleParent() *gtk.AccessibleBase {
1656 var cls *gtk.AccessibleBase
1657
1658 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
1659
1660 if cret == 0 {
1661 return nil
1662 }
1663 cls = >k.AccessibleBase{}
1664 cls.Ptr = cret
1665 return cls
1666}
1667
1668// Retrieves the accessible role of an accessible object.
1669func (x *NavigationView) GetAccessibleRole() gtk.AccessibleRole {
1670
1671 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
1672 return cret
1673}
1674
1675// Retrieves the implementation for the given accessible object.
1676func (x *NavigationView) GetAtContext() *gtk.ATContext {
1677 var cls *gtk.ATContext
1678
1679 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
1680
1681 if cret == 0 {
1682 return nil
1683 }
1684 cls = >k.ATContext{}
1685 cls.Ptr = cret
1686 return cls
1687}
1688
1689// Queries the coordinates and dimensions of this accessible
1690//
1691// This functionality can be overridden by `GtkAccessible`
1692// implementations, e.g. to get the bounds from an ignored
1693// child widget.
1694func (x *NavigationView) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
1695
1696 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
1697 return cret
1698}
1699
1700// Retrieves the first accessible child of an accessible object.
1701func (x *NavigationView) GetFirstAccessibleChild() *gtk.AccessibleBase {
1702 var cls *gtk.AccessibleBase
1703
1704 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
1705
1706 if cret == 0 {
1707 return nil
1708 }
1709 cls = >k.AccessibleBase{}
1710 cls.Ptr = cret
1711 return cls
1712}
1713
1714// Retrieves the next accessible sibling of an accessible object
1715func (x *NavigationView) GetNextAccessibleSibling() *gtk.AccessibleBase {
1716 var cls *gtk.AccessibleBase
1717
1718 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
1719
1720 if cret == 0 {
1721 return nil
1722 }
1723 cls = >k.AccessibleBase{}
1724 cls.Ptr = cret
1725 return cls
1726}
1727
1728// Queries a platform state, such as focus.
1729//
1730// This functionality can be overridden by `GtkAccessible`
1731// implementations, e.g. to get platform state from an ignored
1732// child widget, as is the case for `GtkText` wrappers.
1733func (x *NavigationView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
1734
1735 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
1736 return cret
1737}
1738
1739// Resets the accessible property to its default value.
1740func (x *NavigationView) ResetProperty(PropertyVar gtk.AccessibleProperty) {
1741
1742 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
1743
1744}
1745
1746// Resets the accessible relation to its default value.
1747func (x *NavigationView) ResetRelation(RelationVar gtk.AccessibleRelation) {
1748
1749 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
1750
1751}
1752
1753// Resets the accessible state to its default value.
1754func (x *NavigationView) ResetState(StateVar gtk.AccessibleState) {
1755
1756 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
1757
1758}
1759
1760// Sets the parent and sibling of an accessible object.
1761//
1762// This function is meant to be used by accessible implementations that are
1763// not part of the widget hierarchy, and but act as a logical bridge between
1764// widgets. For instance, if a widget creates an object that holds metadata
1765// for each child, and you want that object to implement the `GtkAccessible`
1766// interface, you will use this function to ensure that the parent of each
1767// child widget is the metadata object, and the parent of each metadata
1768// object is the container widget.
1769func (x *NavigationView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
1770
1771 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
1772
1773}
1774
1775// Updates the next accessible sibling.
1776//
1777// That might be useful when a new child of a custom accessible
1778// is created, and it needs to be linked to a previous child.
1779func (x *NavigationView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
1780
1781 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
1782
1783}
1784
1785// Informs ATs that the platform state has changed.
1786//
1787// This function should be used by `GtkAccessible` implementations that
1788// have a platform state but are not widgets. Widgets handle platform
1789// states automatically.
1790func (x *NavigationView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
1791
1792 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
1793
1794}
1795
1796// Updates a list of accessible properties.
1797//
1798// See the [enum@Gtk.AccessibleProperty] documentation for the
1799// value types of accessible properties.
1800//
1801// This function should be called by `GtkWidget` types whenever
1802// an accessible property change must be communicated to assistive
1803// technologies.
1804//
1805// Example:
1806// ```c
1807// value = gtk_adjustment_get_value (adjustment);
1808// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
1809//
1810// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
1811// -1);
1812//
1813// ```
1814func (x *NavigationView) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
1815
1816 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
1817
1818}
1819
1820// Updates an array of accessible properties.
1821//
1822// This function should be called by `GtkWidget` types whenever an accessible
1823// property change must be communicated to assistive technologies.
1824//
1825// This function is meant to be used by language bindings.
1826func (x *NavigationView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
1827
1828 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
1829
1830}
1831
1832// Updates a list of accessible relations.
1833//
1834// This function should be called by `GtkWidget` types whenever an accessible
1835// relation change must be communicated to assistive technologies.
1836//
1837// If the [enum@Gtk.AccessibleRelation] requires a list of references,
1838// you should pass each reference individually, followed by `NULL`, e.g.
1839//
1840// ```c
1841// gtk_accessible_update_relation (accessible,
1842//
1843// GTK_ACCESSIBLE_RELATION_CONTROLS,
1844// ref1, NULL,
1845// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
1846// ref1, ref2, ref3, NULL,
1847// -1);
1848//
1849// ```
1850func (x *NavigationView) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
1851
1852 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
1853
1854}
1855
1856// Updates an array of accessible relations.
1857//
1858// This function should be called by `GtkWidget` types whenever an accessible
1859// relation change must be communicated to assistive technologies.
1860//
1861// This function is meant to be used by language bindings.
1862func (x *NavigationView) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
1863
1864 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
1865
1866}
1867
1868// Updates a list of accessible states.
1869//
1870// See the [enum@Gtk.AccessibleState] documentation for the
1871// value types of accessible states.
1872//
1873// This function should be called by `GtkWidget` types whenever
1874// an accessible state change must be communicated to assistive
1875// technologies.
1876//
1877// Example:
1878//
1879// ```c
1880// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
1881// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
1882//
1883// GTK_ACCESSIBLE_STATE_CHECKED, value,
1884// -1);
1885//
1886// ```
1887func (x *NavigationView) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
1888
1889 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
1890
1891}
1892
1893// Updates an array of accessible states.
1894//
1895// This function should be called by `GtkWidget` types whenever an accessible
1896// state change must be communicated to assistive technologies.
1897//
1898// This function is meant to be used by language bindings.
1899func (x *NavigationView) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
1900
1901 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1902
1903}
1904
1905// Gets the ID of the @buildable object.
1906//
1907// `GtkBuilder` sets the name based on the ID attribute
1908// of the `<object>` tag used to construct the @buildable.
1909func (x *NavigationView) GetBuildableId() string {
1910
1911 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
1912 return cret
1913}
1914
1915func init() {
1916 core.SetPackageName("ADW", "libadwaita-1")
1917 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
1918 var libs []uintptr
1919 for _, libPath := range core.GetPaths("ADW") {
1920 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1921 if err != nil {
1922 panic(err)
1923 }
1924 libs = append(libs, lib)
1925 }
1926
1927 core.PuregoSafeRegister(&xNavigationPageGLibType, libs, "adw_navigation_page_get_type")
1928
1929 core.PuregoSafeRegister(&xNewNavigationPage, libs, "adw_navigation_page_new")
1930 core.PuregoSafeRegister(&xNewNavigationPageWithTag, libs, "adw_navigation_page_new_with_tag")
1931
1932 core.PuregoSafeRegister(&xNavigationPageGetCanPop, libs, "adw_navigation_page_get_can_pop")
1933 core.PuregoSafeRegister(&xNavigationPageGetChild, libs, "adw_navigation_page_get_child")
1934 core.PuregoSafeRegister(&xNavigationPageGetTag, libs, "adw_navigation_page_get_tag")
1935 core.PuregoSafeRegister(&xNavigationPageGetTitle, libs, "adw_navigation_page_get_title")
1936 core.PuregoSafeRegister(&xNavigationPageSetCanPop, libs, "adw_navigation_page_set_can_pop")
1937 core.PuregoSafeRegister(&xNavigationPageSetChild, libs, "adw_navigation_page_set_child")
1938 core.PuregoSafeRegister(&xNavigationPageSetTag, libs, "adw_navigation_page_set_tag")
1939 core.PuregoSafeRegister(&xNavigationPageSetTitle, libs, "adw_navigation_page_set_title")
1940
1941 core.PuregoSafeRegister(&xNavigationViewGLibType, libs, "adw_navigation_view_get_type")
1942
1943 core.PuregoSafeRegister(&xNewNavigationView, libs, "adw_navigation_view_new")
1944
1945 core.PuregoSafeRegister(&xNavigationViewAdd, libs, "adw_navigation_view_add")
1946 core.PuregoSafeRegister(&xNavigationViewFindPage, libs, "adw_navigation_view_find_page")
1947 core.PuregoSafeRegister(&xNavigationViewGetAnimateTransitions, libs, "adw_navigation_view_get_animate_transitions")
1948 core.PuregoSafeRegister(&xNavigationViewGetHhomogeneous, libs, "adw_navigation_view_get_hhomogeneous")
1949 core.PuregoSafeRegister(&xNavigationViewGetNavigationStack, libs, "adw_navigation_view_get_navigation_stack")
1950 core.PuregoSafeRegister(&xNavigationViewGetPopOnEscape, libs, "adw_navigation_view_get_pop_on_escape")
1951 core.PuregoSafeRegister(&xNavigationViewGetPreviousPage, libs, "adw_navigation_view_get_previous_page")
1952 core.PuregoSafeRegister(&xNavigationViewGetVhomogeneous, libs, "adw_navigation_view_get_vhomogeneous")
1953 core.PuregoSafeRegister(&xNavigationViewGetVisiblePage, libs, "adw_navigation_view_get_visible_page")
1954 core.PuregoSafeRegister(&xNavigationViewGetVisiblePageTag, libs, "adw_navigation_view_get_visible_page_tag")
1955 core.PuregoSafeRegister(&xNavigationViewPop, libs, "adw_navigation_view_pop")
1956 core.PuregoSafeRegister(&xNavigationViewPopToPage, libs, "adw_navigation_view_pop_to_page")
1957 core.PuregoSafeRegister(&xNavigationViewPopToTag, libs, "adw_navigation_view_pop_to_tag")
1958 core.PuregoSafeRegister(&xNavigationViewPush, libs, "adw_navigation_view_push")
1959 core.PuregoSafeRegister(&xNavigationViewPushByTag, libs, "adw_navigation_view_push_by_tag")
1960 core.PuregoSafeRegister(&xNavigationViewRemove, libs, "adw_navigation_view_remove")
1961 core.PuregoSafeRegister(&xNavigationViewReplace, libs, "adw_navigation_view_replace")
1962 core.PuregoSafeRegister(&xNavigationViewReplaceWithTags, libs, "adw_navigation_view_replace_with_tags")
1963 core.PuregoSafeRegister(&xNavigationViewSetAnimateTransitions, libs, "adw_navigation_view_set_animate_transitions")
1964 core.PuregoSafeRegister(&xNavigationViewSetHhomogeneous, libs, "adw_navigation_view_set_hhomogeneous")
1965 core.PuregoSafeRegister(&xNavigationViewSetPopOnEscape, libs, "adw_navigation_view_set_pop_on_escape")
1966 core.PuregoSafeRegister(&xNavigationViewSetVhomogeneous, libs, "adw_navigation_view_set_vhomogeneous")
1967
1968}