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/gio"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14 "github.com/bnema/puregotk/v4/gtk"
15)
16
17type ViewStackClass struct {
18 _ structs.HostLayout
19
20 ParentClass gtk.WidgetClass
21}
22
23func (x *ViewStackClass) GoPointer() uintptr {
24 return uintptr(unsafe.Pointer(x))
25}
26
27type ViewStackPageClass struct {
28 _ structs.HostLayout
29
30 ParentClass gobject.ObjectClass
31}
32
33func (x *ViewStackPageClass) GoPointer() uintptr {
34 return uintptr(unsafe.Pointer(x))
35}
36
37type ViewStackPagesClass struct {
38 _ structs.HostLayout
39
40 ParentClass gobject.ObjectClass
41}
42
43func (x *ViewStackPagesClass) GoPointer() uintptr {
44 return uintptr(unsafe.Pointer(x))
45}
46
47// A view container for [class@ViewSwitcher].
48//
49// `AdwViewStack` is a container which only shows one page at a time.
50// It is typically used to hold an application's main views.
51//
52// It doesn't provide a way to transition between pages.
53// Instead, a separate widget such as [class@ViewSwitcher] can be used with
54// `AdwViewStack` to provide this functionality.
55//
56// `AdwViewStack` pages can have a title, an icon, an attention request, and a
57// numbered badge that [class@ViewSwitcher] will use to let users identify which
58// page is which. Set them using the [property@ViewStackPage:title],
59// [property@ViewStackPage:icon-name],
60// [property@ViewStackPage:needs-attention], and
61// [property@ViewStackPage:badge-number] properties.
62//
63// Unlike [class@Gtk.Stack], transitions between views can only be animated via
64// a crossfade and size changes are always interpolated. Animations are disabled
65// by default. Use [property@ViewStack:enable-transitions] to enable them.
66//
67// `AdwViewStack` maintains a [class@ViewStackPage] object for each added child,
68// which holds additional per-child properties. You obtain the
69// [class@ViewStackPage] for a child with [method@ViewStack.get_page] and you
70// can obtain a [iface@Gtk.SelectionModel] containing all the pages with
71// [method@ViewStack.get_pages].
72//
73// ## AdwViewStack as GtkBuildable
74//
75// To set child-specific properties in a .ui file, create
76// [class@ViewStackPage] objects explicitly, and set the child widget as a
77// property on it:
78//
79// ```xml
80//
81// <object class="AdwViewStack" id="stack">
82// <child>
83// <object class="AdwViewStackPage">
84// <property name="name">overview</property>
85// <property name="title">Overview</property>
86// <property name="child">
87// <object class="AdwStatusPage">
88// <property name="title">Welcome!</property>
89// </object>
90// </property>
91// </object>
92// </child>
93// </object>
94//
95// ```
96//
97// ## CSS nodes
98//
99// `AdwViewStack` has a single CSS node named `stack`.
100//
101// ## Accessibility
102//
103// `AdwViewStack` uses the `GTK_ACCESSIBLE_ROLE_TAB_PANEL` for the stack pages
104// which are the accessible parent objects of the child widgets.
105type ViewStack struct {
106 gtk.Widget
107}
108
109var xViewStackGLibType func() types.GType
110
111func ViewStackGLibType() types.GType {
112 return xViewStackGLibType()
113}
114
115func ViewStackNewFromInternalPtr(ptr uintptr) *ViewStack {
116 cls := &ViewStack{}
117 cls.Ptr = ptr
118 return cls
119}
120
121var xNewViewStack func() uintptr
122
123// Creates a new `AdwViewStack`.
124func NewViewStack() *ViewStack {
125 var cls *ViewStack
126
127 cret := xNewViewStack()
128
129 if cret == 0 {
130 return nil
131 }
132 gobject.IncreaseRef(cret)
133 cls = &ViewStack{}
134 cls.Ptr = cret
135 return cls
136}
137
138var xViewStackAdd func(uintptr, uintptr) uintptr
139
140// Adds a child to @self.
141func (x *ViewStack) Add(ChildVar *gtk.Widget) *ViewStackPage {
142 var cls *ViewStackPage
143
144 cret := xViewStackAdd(x.GoPointer(), ChildVar.GoPointer())
145
146 if cret == 0 {
147 return nil
148 }
149 gobject.IncreaseRef(cret)
150 cls = &ViewStackPage{}
151 cls.Ptr = cret
152 return cls
153}
154
155var xViewStackAddNamed func(uintptr, uintptr, uintptr) uintptr
156
157// Adds a child to @self.
158//
159// The child is identified by the @name.
160func (x *ViewStack) AddNamed(ChildVar *gtk.Widget, NameVar *string) *ViewStackPage {
161 var cls *ViewStackPage
162
163 NameVarPtr := core.GStrdupNullable(NameVar)
164 defer core.GFreeNullable(NameVarPtr)
165
166 cret := xViewStackAddNamed(x.GoPointer(), ChildVar.GoPointer(), NameVarPtr)
167
168 if cret == 0 {
169 return nil
170 }
171 gobject.IncreaseRef(cret)
172 cls = &ViewStackPage{}
173 cls.Ptr = cret
174 return cls
175}
176
177var xViewStackAddTitled func(uintptr, uintptr, uintptr, string) uintptr
178
179// Adds a child to @self.
180//
181// The child is identified by the @name. The @title will be used by
182// [class@ViewSwitcher] to represent @child, so it should be short.
183func (x *ViewStack) AddTitled(ChildVar *gtk.Widget, NameVar *string, TitleVar string) *ViewStackPage {
184 var cls *ViewStackPage
185
186 NameVarPtr := core.GStrdupNullable(NameVar)
187 defer core.GFreeNullable(NameVarPtr)
188
189 cret := xViewStackAddTitled(x.GoPointer(), ChildVar.GoPointer(), NameVarPtr, TitleVar)
190
191 if cret == 0 {
192 return nil
193 }
194 gobject.IncreaseRef(cret)
195 cls = &ViewStackPage{}
196 cls.Ptr = cret
197 return cls
198}
199
200var xViewStackAddTitledWithIcon func(uintptr, uintptr, uintptr, string, string) uintptr
201
202// Adds a child to @self.
203//
204// The child is identified by the @name. The @title and @icon_name will be used
205// by [class@ViewSwitcher] to represent @child.
206func (x *ViewStack) AddTitledWithIcon(ChildVar *gtk.Widget, NameVar *string, TitleVar string, IconNameVar string) *ViewStackPage {
207 var cls *ViewStackPage
208
209 NameVarPtr := core.GStrdupNullable(NameVar)
210 defer core.GFreeNullable(NameVarPtr)
211
212 cret := xViewStackAddTitledWithIcon(x.GoPointer(), ChildVar.GoPointer(), NameVarPtr, TitleVar, IconNameVar)
213
214 if cret == 0 {
215 return nil
216 }
217 gobject.IncreaseRef(cret)
218 cls = &ViewStackPage{}
219 cls.Ptr = cret
220 return cls
221}
222
223var xViewStackGetChildByName func(uintptr, string) uintptr
224
225// Finds the child with @name in @self.
226func (x *ViewStack) GetChildByName(NameVar string) *gtk.Widget {
227 var cls *gtk.Widget
228
229 cret := xViewStackGetChildByName(x.GoPointer(), NameVar)
230
231 if cret == 0 {
232 return nil
233 }
234 gobject.IncreaseRef(cret)
235 cls = >k.Widget{}
236 cls.Ptr = cret
237 return cls
238}
239
240var xViewStackGetEnableTransitions func(uintptr) bool
241
242// Gets whether @self uses a crossfade transition between pages.
243//
244// Use [property@ViewStack:transition-duration] to control the duration, and
245// [property@ViewStack:transition-running] to know when the transition is
246// running.
247func (x *ViewStack) GetEnableTransitions() bool {
248
249 cret := xViewStackGetEnableTransitions(x.GoPointer())
250 return cret
251}
252
253var xViewStackGetHhomogeneous func(uintptr) bool
254
255// Gets whether @self is horizontally homogeneous.
256func (x *ViewStack) GetHhomogeneous() bool {
257
258 cret := xViewStackGetHhomogeneous(x.GoPointer())
259 return cret
260}
261
262var xViewStackGetPage func(uintptr, uintptr) uintptr
263
264// Gets the [class@ViewStackPage] object for @child.
265func (x *ViewStack) GetPage(ChildVar *gtk.Widget) *ViewStackPage {
266 var cls *ViewStackPage
267
268 cret := xViewStackGetPage(x.GoPointer(), ChildVar.GoPointer())
269
270 if cret == 0 {
271 return nil
272 }
273 gobject.IncreaseRef(cret)
274 cls = &ViewStackPage{}
275 cls.Ptr = cret
276 return cls
277}
278
279var xViewStackGetPages func(uintptr) uintptr
280
281// Returns a [iface@Gio.ListModel] that contains the pages of the stack.
282//
283// This can be used to keep an up-to-date view. The model also implements
284// [iface@Gtk.SelectionModel] and can be used to track and change the visible
285// page.
286func (x *ViewStack) GetPages() *gtk.SelectionModelBase {
287 var cls *gtk.SelectionModelBase
288
289 cret := xViewStackGetPages(x.GoPointer())
290
291 if cret == 0 {
292 return nil
293 }
294 cls = >k.SelectionModelBase{}
295 cls.Ptr = cret
296 return cls
297}
298
299var xViewStackGetTransitionDuration func(uintptr) uint
300
301// Gets the transition animation duration for @self.
302func (x *ViewStack) GetTransitionDuration() uint {
303
304 cret := xViewStackGetTransitionDuration(x.GoPointer())
305 return cret
306}
307
308var xViewStackGetTransitionRunning func(uintptr) bool
309
310// Gets whether a transition is currently running for @self.
311//
312// If a transition is impossible, the property value will be set to `TRUE` and
313// then immediately to `FALSE`, so it's possible to rely on its notifications
314// to know that a transition has happened.
315func (x *ViewStack) GetTransitionRunning() bool {
316
317 cret := xViewStackGetTransitionRunning(x.GoPointer())
318 return cret
319}
320
321var xViewStackGetVhomogeneous func(uintptr) bool
322
323// Gets whether @self is vertically homogeneous.
324func (x *ViewStack) GetVhomogeneous() bool {
325
326 cret := xViewStackGetVhomogeneous(x.GoPointer())
327 return cret
328}
329
330var xViewStackGetVisibleChild func(uintptr) uintptr
331
332// Gets the currently visible child of @self.
333func (x *ViewStack) GetVisibleChild() *gtk.Widget {
334 var cls *gtk.Widget
335
336 cret := xViewStackGetVisibleChild(x.GoPointer())
337
338 if cret == 0 {
339 return nil
340 }
341 gobject.IncreaseRef(cret)
342 cls = >k.Widget{}
343 cls.Ptr = cret
344 return cls
345}
346
347var xViewStackGetVisibleChildName func(uintptr) string
348
349// Returns the name of the currently visible child of @self.
350func (x *ViewStack) GetVisibleChildName() string {
351
352 cret := xViewStackGetVisibleChildName(x.GoPointer())
353 return cret
354}
355
356var xViewStackRemove func(uintptr, uintptr)
357
358// Removes a child widget from @self.
359func (x *ViewStack) Remove(ChildVar *gtk.Widget) {
360
361 xViewStackRemove(x.GoPointer(), ChildVar.GoPointer())
362
363}
364
365var xViewStackSetEnableTransitions func(uintptr, bool)
366
367// Sets whether @self uses a crossfade transition between pages.
368func (x *ViewStack) SetEnableTransitions(EnableTransitionsVar bool) {
369
370 xViewStackSetEnableTransitions(x.GoPointer(), EnableTransitionsVar)
371
372}
373
374var xViewStackSetHhomogeneous func(uintptr, bool)
375
376// Sets @self to be horizontally homogeneous or not.
377//
378// If the stack is horizontally homogeneous, it allocates the same width for
379// all children.
380//
381// If it's `FALSE`, the stack may change width when a different child becomes
382// visible.
383func (x *ViewStack) SetHhomogeneous(HhomogeneousVar bool) {
384
385 xViewStackSetHhomogeneous(x.GoPointer(), HhomogeneousVar)
386
387}
388
389var xViewStackSetTransitionDuration func(uintptr, uint)
390
391// Sets the transition animation duration for @self.
392//
393// Only used when [property@ViewStack:enable-transitions] is set to `TRUE`.
394func (x *ViewStack) SetTransitionDuration(DurationVar uint) {
395
396 xViewStackSetTransitionDuration(x.GoPointer(), DurationVar)
397
398}
399
400var xViewStackSetVhomogeneous func(uintptr, bool)
401
402// Sets @self to be vertically homogeneous or not.
403//
404// If the stack is vertically homogeneous, it allocates the same height for
405// all children.
406//
407// If it's `FALSE`, the stack may change height when a different child becomes
408// visible.
409func (x *ViewStack) SetVhomogeneous(VhomogeneousVar bool) {
410
411 xViewStackSetVhomogeneous(x.GoPointer(), VhomogeneousVar)
412
413}
414
415var xViewStackSetVisibleChild func(uintptr, uintptr)
416
417// Makes @child the visible child of @self.
418func (x *ViewStack) SetVisibleChild(ChildVar *gtk.Widget) {
419
420 xViewStackSetVisibleChild(x.GoPointer(), ChildVar.GoPointer())
421
422}
423
424var xViewStackSetVisibleChildName func(uintptr, string)
425
426// Makes the child with @name visible.
427//
428// See [property@ViewStack:visible-child].
429func (x *ViewStack) SetVisibleChildName(NameVar string) {
430
431 xViewStackSetVisibleChildName(x.GoPointer(), NameVar)
432
433}
434
435func (c *ViewStack) GoPointer() uintptr {
436 if c == nil {
437 return 0
438 }
439 return c.Ptr
440}
441
442func (c *ViewStack) SetGoPointer(ptr uintptr) {
443 c.Ptr = ptr
444}
445
446// SetPropertyEnableTransitions sets the "enable-transitions" property.
447// Whether the stack uses a crossfade transition between pages.
448//
449// Use [property@ViewStack:transition-duration] to control the duration, and
450// [property@ViewStack:transition-running] to know when the transition is
451// running.
452func (x *ViewStack) SetPropertyEnableTransitions(value bool) {
453 var v gobject.Value
454 v.Init(gobject.TypeBooleanVal)
455 v.SetBoolean(value)
456 x.SetProperty("enable-transitions", &v)
457}
458
459// GetPropertyEnableTransitions gets the "enable-transitions" property.
460// Whether the stack uses a crossfade transition between pages.
461//
462// Use [property@ViewStack:transition-duration] to control the duration, and
463// [property@ViewStack:transition-running] to know when the transition is
464// running.
465func (x *ViewStack) GetPropertyEnableTransitions() bool {
466 var v gobject.Value
467 x.GetProperty("enable-transitions", &v)
468 return v.GetBoolean()
469}
470
471// SetPropertyHhomogeneous sets the "hhomogeneous" property.
472// Whether the stack is horizontally homogeneous.
473//
474// If the stack is horizontally homogeneous, it allocates the same width for
475// all children.
476//
477// If it's `FALSE`, the stack may change width when a different child becomes
478// visible.
479func (x *ViewStack) SetPropertyHhomogeneous(value bool) {
480 var v gobject.Value
481 v.Init(gobject.TypeBooleanVal)
482 v.SetBoolean(value)
483 x.SetProperty("hhomogeneous", &v)
484}
485
486// GetPropertyHhomogeneous gets the "hhomogeneous" property.
487// Whether the stack is horizontally homogeneous.
488//
489// If the stack is horizontally homogeneous, it allocates the same width for
490// all children.
491//
492// If it's `FALSE`, the stack may change width when a different child becomes
493// visible.
494func (x *ViewStack) GetPropertyHhomogeneous() bool {
495 var v gobject.Value
496 x.GetProperty("hhomogeneous", &v)
497 return v.GetBoolean()
498}
499
500// SetPropertyTransitionDuration sets the "transition-duration" property.
501// The transition animation duration, in milliseconds.
502//
503// Only used when [property@ViewStack:enable-transitions] is set to `TRUE`.
504func (x *ViewStack) SetPropertyTransitionDuration(value uint) {
505 var v gobject.Value
506 v.Init(gobject.TypeUintVal)
507 v.SetUint(value)
508 x.SetProperty("transition-duration", &v)
509}
510
511// GetPropertyTransitionDuration gets the "transition-duration" property.
512// The transition animation duration, in milliseconds.
513//
514// Only used when [property@ViewStack:enable-transitions] is set to `TRUE`.
515func (x *ViewStack) GetPropertyTransitionDuration() uint {
516 var v gobject.Value
517 x.GetProperty("transition-duration", &v)
518 return v.GetUint()
519}
520
521// GetPropertyTransitionRunning gets the "transition-running" property.
522// Whether a transition is currently running.
523//
524// If a transition is impossible, the property value will be set to `TRUE` and
525// then immediately to `FALSE`, so it's possible to rely on its notifications
526// to know that a transition has happened.
527func (x *ViewStack) GetPropertyTransitionRunning() bool {
528 var v gobject.Value
529 x.GetProperty("transition-running", &v)
530 return v.GetBoolean()
531}
532
533// SetPropertyVhomogeneous sets the "vhomogeneous" property.
534// Whether the stack is vertically homogeneous.
535//
536// If the stack is vertically homogeneous, it allocates the same height for
537// all children.
538//
539// If it's `FALSE`, the stack may change height when a different child becomes
540// visible.
541func (x *ViewStack) SetPropertyVhomogeneous(value bool) {
542 var v gobject.Value
543 v.Init(gobject.TypeBooleanVal)
544 v.SetBoolean(value)
545 x.SetProperty("vhomogeneous", &v)
546}
547
548// GetPropertyVhomogeneous gets the "vhomogeneous" property.
549// Whether the stack is vertically homogeneous.
550//
551// If the stack is vertically homogeneous, it allocates the same height for
552// all children.
553//
554// If it's `FALSE`, the stack may change height when a different child becomes
555// visible.
556func (x *ViewStack) GetPropertyVhomogeneous() bool {
557 var v gobject.Value
558 x.GetProperty("vhomogeneous", &v)
559 return v.GetBoolean()
560}
561
562// SetPropertyVisibleChildName sets the "visible-child-name" property.
563// The name of the widget currently visible in the stack.
564//
565// See [property@ViewStack:visible-child].
566func (x *ViewStack) SetPropertyVisibleChildName(value string) {
567 var v gobject.Value
568 v.Init(gobject.TypeStringVal)
569 v.SetString(&value)
570 x.SetProperty("visible-child-name", &v)
571}
572
573// GetPropertyVisibleChildName gets the "visible-child-name" property.
574// The name of the widget currently visible in the stack.
575//
576// See [property@ViewStack:visible-child].
577func (x *ViewStack) GetPropertyVisibleChildName() string {
578 var v gobject.Value
579 x.GetProperty("visible-child-name", &v)
580 return v.GetString()
581}
582
583// Requests the user's screen reader to announce the given message.
584//
585// This kind of notification is useful for messages that
586// either have only a visual representation or that are not
587// exposed visually at all, e.g. a notification about a
588// successful operation.
589//
590// Also, by using this API, you can ensure that the message
591// does not interrupts the user's current screen reader output.
592func (x *ViewStack) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
593
594 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
595
596}
597
598// Retrieves the accessible parent for an accessible object.
599//
600// This function returns `NULL` for top level widgets.
601func (x *ViewStack) GetAccessibleParent() *gtk.AccessibleBase {
602 var cls *gtk.AccessibleBase
603
604 cret := gtk.XGtkAccessibleGetAccessibleParent(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 accessible role of an accessible object.
615func (x *ViewStack) GetAccessibleRole() gtk.AccessibleRole {
616
617 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
618 return cret
619}
620
621// Retrieves the implementation for the given accessible object.
622func (x *ViewStack) GetAtContext() *gtk.ATContext {
623 var cls *gtk.ATContext
624
625 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
626
627 if cret == 0 {
628 return nil
629 }
630 cls = >k.ATContext{}
631 cls.Ptr = cret
632 return cls
633}
634
635// Queries the coordinates and dimensions of this accessible
636//
637// This functionality can be overridden by `GtkAccessible`
638// implementations, e.g. to get the bounds from an ignored
639// child widget.
640func (x *ViewStack) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
641
642 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
643 return cret
644}
645
646// Retrieves the first accessible child of an accessible object.
647func (x *ViewStack) GetFirstAccessibleChild() *gtk.AccessibleBase {
648 var cls *gtk.AccessibleBase
649
650 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
651
652 if cret == 0 {
653 return nil
654 }
655 cls = >k.AccessibleBase{}
656 cls.Ptr = cret
657 return cls
658}
659
660// Retrieves the next accessible sibling of an accessible object
661func (x *ViewStack) GetNextAccessibleSibling() *gtk.AccessibleBase {
662 var cls *gtk.AccessibleBase
663
664 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
665
666 if cret == 0 {
667 return nil
668 }
669 cls = >k.AccessibleBase{}
670 cls.Ptr = cret
671 return cls
672}
673
674// Queries a platform state, such as focus.
675//
676// This functionality can be overridden by `GtkAccessible`
677// implementations, e.g. to get platform state from an ignored
678// child widget, as is the case for `GtkText` wrappers.
679func (x *ViewStack) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
680
681 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
682 return cret
683}
684
685// Resets the accessible property to its default value.
686func (x *ViewStack) ResetProperty(PropertyVar gtk.AccessibleProperty) {
687
688 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
689
690}
691
692// Resets the accessible relation to its default value.
693func (x *ViewStack) ResetRelation(RelationVar gtk.AccessibleRelation) {
694
695 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
696
697}
698
699// Resets the accessible state to its default value.
700func (x *ViewStack) ResetState(StateVar gtk.AccessibleState) {
701
702 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
703
704}
705
706// Sets the parent and sibling of an accessible object.
707//
708// This function is meant to be used by accessible implementations that are
709// not part of the widget hierarchy, and but act as a logical bridge between
710// widgets. For instance, if a widget creates an object that holds metadata
711// for each child, and you want that object to implement the `GtkAccessible`
712// interface, you will use this function to ensure that the parent of each
713// child widget is the metadata object, and the parent of each metadata
714// object is the container widget.
715func (x *ViewStack) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
716
717 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
718
719}
720
721// Updates the next accessible sibling.
722//
723// That might be useful when a new child of a custom accessible
724// is created, and it needs to be linked to a previous child.
725func (x *ViewStack) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
726
727 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
728
729}
730
731// Informs ATs that the platform state has changed.
732//
733// This function should be used by `GtkAccessible` implementations that
734// have a platform state but are not widgets. Widgets handle platform
735// states automatically.
736func (x *ViewStack) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
737
738 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
739
740}
741
742// Updates a list of accessible properties.
743//
744// See the [enum@Gtk.AccessibleProperty] documentation for the
745// value types of accessible properties.
746//
747// This function should be called by `GtkWidget` types whenever
748// an accessible property change must be communicated to assistive
749// technologies.
750//
751// Example:
752// ```c
753// value = gtk_adjustment_get_value (adjustment);
754// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
755//
756// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
757// -1);
758//
759// ```
760func (x *ViewStack) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
761
762 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
763
764}
765
766// Updates an array of accessible properties.
767//
768// This function should be called by `GtkWidget` types whenever an accessible
769// property change must be communicated to assistive technologies.
770//
771// This function is meant to be used by language bindings.
772func (x *ViewStack) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
773
774 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
775
776}
777
778// Updates a list of accessible relations.
779//
780// This function should be called by `GtkWidget` types whenever an accessible
781// relation change must be communicated to assistive technologies.
782//
783// If the [enum@Gtk.AccessibleRelation] requires a list of references,
784// you should pass each reference individually, followed by `NULL`, e.g.
785//
786// ```c
787// gtk_accessible_update_relation (accessible,
788//
789// GTK_ACCESSIBLE_RELATION_CONTROLS,
790// ref1, NULL,
791// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
792// ref1, ref2, ref3, NULL,
793// -1);
794//
795// ```
796func (x *ViewStack) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
797
798 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
799
800}
801
802// Updates an array of accessible relations.
803//
804// This function should be called by `GtkWidget` types whenever an accessible
805// relation change must be communicated to assistive technologies.
806//
807// This function is meant to be used by language bindings.
808func (x *ViewStack) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
809
810 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
811
812}
813
814// Updates a list of accessible states.
815//
816// See the [enum@Gtk.AccessibleState] documentation for the
817// value types of accessible states.
818//
819// This function should be called by `GtkWidget` types whenever
820// an accessible state change must be communicated to assistive
821// technologies.
822//
823// Example:
824//
825// ```c
826// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
827// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
828//
829// GTK_ACCESSIBLE_STATE_CHECKED, value,
830// -1);
831//
832// ```
833func (x *ViewStack) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
834
835 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
836
837}
838
839// Updates an array of accessible states.
840//
841// This function should be called by `GtkWidget` types whenever an accessible
842// state change must be communicated to assistive technologies.
843//
844// This function is meant to be used by language bindings.
845func (x *ViewStack) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
846
847 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
848
849}
850
851// Gets the ID of the @buildable object.
852//
853// `GtkBuilder` sets the name based on the ID attribute
854// of the `<object>` tag used to construct the @buildable.
855func (x *ViewStack) GetBuildableId() string {
856
857 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
858 return cret
859}
860
861// An auxiliary class used by [class@ViewStack].
862type ViewStackPage struct {
863 gobject.Object
864}
865
866var xViewStackPageGLibType func() types.GType
867
868func ViewStackPageGLibType() types.GType {
869 return xViewStackPageGLibType()
870}
871
872func ViewStackPageNewFromInternalPtr(ptr uintptr) *ViewStackPage {
873 cls := &ViewStackPage{}
874 cls.Ptr = ptr
875 return cls
876}
877
878var xViewStackPageGetBadgeNumber func(uintptr) uint
879
880// Gets the badge number for this page.
881func (x *ViewStackPage) GetBadgeNumber() uint {
882
883 cret := xViewStackPageGetBadgeNumber(x.GoPointer())
884 return cret
885}
886
887var xViewStackPageGetChild func(uintptr) uintptr
888
889// Gets the stack child to which @self belongs.
890func (x *ViewStackPage) GetChild() *gtk.Widget {
891 var cls *gtk.Widget
892
893 cret := xViewStackPageGetChild(x.GoPointer())
894
895 if cret == 0 {
896 return nil
897 }
898 gobject.IncreaseRef(cret)
899 cls = >k.Widget{}
900 cls.Ptr = cret
901 return cls
902}
903
904var xViewStackPageGetIconName func(uintptr) string
905
906// Gets the icon name of the page.
907func (x *ViewStackPage) GetIconName() string {
908
909 cret := xViewStackPageGetIconName(x.GoPointer())
910 return cret
911}
912
913var xViewStackPageGetName func(uintptr) string
914
915// Gets the name of the page.
916func (x *ViewStackPage) GetName() string {
917
918 cret := xViewStackPageGetName(x.GoPointer())
919 return cret
920}
921
922var xViewStackPageGetNeedsAttention func(uintptr) bool
923
924// Gets whether the page requires the user attention.
925func (x *ViewStackPage) GetNeedsAttention() bool {
926
927 cret := xViewStackPageGetNeedsAttention(x.GoPointer())
928 return cret
929}
930
931var xViewStackPageGetTitle func(uintptr) string
932
933// Gets the page title.
934func (x *ViewStackPage) GetTitle() string {
935
936 cret := xViewStackPageGetTitle(x.GoPointer())
937 return cret
938}
939
940var xViewStackPageGetUseUnderline func(uintptr) bool
941
942// Gets whether underlines in the page title indicate mnemonics.
943func (x *ViewStackPage) GetUseUnderline() bool {
944
945 cret := xViewStackPageGetUseUnderline(x.GoPointer())
946 return cret
947}
948
949var xViewStackPageGetVisible func(uintptr) bool
950
951// Gets whether @self is visible in its `AdwViewStack`.
952//
953// This is independent from the [property@Gtk.Widget:visible]
954// property of its widget.
955func (x *ViewStackPage) GetVisible() bool {
956
957 cret := xViewStackPageGetVisible(x.GoPointer())
958 return cret
959}
960
961var xViewStackPageSetBadgeNumber func(uintptr, uint)
962
963// Sets the badge number for this page.
964//
965// [class@ViewSwitcher] can display it as a badge next to the page icon. It is
966// commonly used to display a number of unread items within the page.
967//
968// It can be used together with [property@ViewStack{age}:needs-attention].
969func (x *ViewStackPage) SetBadgeNumber(BadgeNumberVar uint) {
970
971 xViewStackPageSetBadgeNumber(x.GoPointer(), BadgeNumberVar)
972
973}
974
975var xViewStackPageSetIconName func(uintptr, uintptr)
976
977// Sets the icon name of the page.
978func (x *ViewStackPage) SetIconName(IconNameVar *string) {
979
980 IconNameVarPtr := core.GStrdupNullable(IconNameVar)
981 defer core.GFreeNullable(IconNameVarPtr)
982
983 xViewStackPageSetIconName(x.GoPointer(), IconNameVarPtr)
984
985}
986
987var xViewStackPageSetName func(uintptr, uintptr)
988
989// Sets the name of the page.
990func (x *ViewStackPage) SetName(NameVar *string) {
991
992 NameVarPtr := core.GStrdupNullable(NameVar)
993 defer core.GFreeNullable(NameVarPtr)
994
995 xViewStackPageSetName(x.GoPointer(), NameVarPtr)
996
997}
998
999var xViewStackPageSetNeedsAttention func(uintptr, bool)
1000
1001// Sets whether the page requires the user attention.
1002//
1003// [class@ViewSwitcher] will display it as a dot next to the page icon.
1004func (x *ViewStackPage) SetNeedsAttention(NeedsAttentionVar bool) {
1005
1006 xViewStackPageSetNeedsAttention(x.GoPointer(), NeedsAttentionVar)
1007
1008}
1009
1010var xViewStackPageSetTitle func(uintptr, uintptr)
1011
1012// Sets the page title.
1013func (x *ViewStackPage) SetTitle(TitleVar *string) {
1014
1015 TitleVarPtr := core.GStrdupNullable(TitleVar)
1016 defer core.GFreeNullable(TitleVarPtr)
1017
1018 xViewStackPageSetTitle(x.GoPointer(), TitleVarPtr)
1019
1020}
1021
1022var xViewStackPageSetUseUnderline func(uintptr, bool)
1023
1024// Sets whether underlines in the page title indicate mnemonics.
1025func (x *ViewStackPage) SetUseUnderline(UseUnderlineVar bool) {
1026
1027 xViewStackPageSetUseUnderline(x.GoPointer(), UseUnderlineVar)
1028
1029}
1030
1031var xViewStackPageSetVisible func(uintptr, bool)
1032
1033// Sets whether @page is visible in its `AdwViewStack`.
1034//
1035// This is independent from the [property@Gtk.Widget:visible] property of
1036// [property@ViewStackPage:child].
1037func (x *ViewStackPage) SetVisible(VisibleVar bool) {
1038
1039 xViewStackPageSetVisible(x.GoPointer(), VisibleVar)
1040
1041}
1042
1043func (c *ViewStackPage) GoPointer() uintptr {
1044 if c == nil {
1045 return 0
1046 }
1047 return c.Ptr
1048}
1049
1050func (c *ViewStackPage) SetGoPointer(ptr uintptr) {
1051 c.Ptr = ptr
1052}
1053
1054// SetPropertyBadgeNumber sets the "badge-number" property.
1055// The badge number for this page.
1056//
1057// [class@ViewSwitcher] can display it as a badge next to the page icon. It is
1058// commonly used to display a number of unread items within the page.
1059//
1060// It can be used together with [property@ViewStack{age}:needs-attention].
1061func (x *ViewStackPage) SetPropertyBadgeNumber(value uint) {
1062 var v gobject.Value
1063 v.Init(gobject.TypeUintVal)
1064 v.SetUint(value)
1065 x.SetProperty("badge-number", &v)
1066}
1067
1068// GetPropertyBadgeNumber gets the "badge-number" property.
1069// The badge number for this page.
1070//
1071// [class@ViewSwitcher] can display it as a badge next to the page icon. It is
1072// commonly used to display a number of unread items within the page.
1073//
1074// It can be used together with [property@ViewStack{age}:needs-attention].
1075func (x *ViewStackPage) GetPropertyBadgeNumber() uint {
1076 var v gobject.Value
1077 x.GetProperty("badge-number", &v)
1078 return v.GetUint()
1079}
1080
1081// SetPropertyIconName sets the "icon-name" property.
1082// The icon name of the child page.
1083func (x *ViewStackPage) SetPropertyIconName(value string) {
1084 var v gobject.Value
1085 v.Init(gobject.TypeStringVal)
1086 v.SetString(&value)
1087 x.SetProperty("icon-name", &v)
1088}
1089
1090// GetPropertyIconName gets the "icon-name" property.
1091// The icon name of the child page.
1092func (x *ViewStackPage) GetPropertyIconName() string {
1093 var v gobject.Value
1094 x.GetProperty("icon-name", &v)
1095 return v.GetString()
1096}
1097
1098// SetPropertyName sets the "name" property.
1099// The name of the child page.
1100func (x *ViewStackPage) SetPropertyName(value string) {
1101 var v gobject.Value
1102 v.Init(gobject.TypeStringVal)
1103 v.SetString(&value)
1104 x.SetProperty("name", &v)
1105}
1106
1107// GetPropertyName gets the "name" property.
1108// The name of the child page.
1109func (x *ViewStackPage) GetPropertyName() string {
1110 var v gobject.Value
1111 x.GetProperty("name", &v)
1112 return v.GetString()
1113}
1114
1115// SetPropertyNeedsAttention sets the "needs-attention" property.
1116// Whether the page requires the user attention.
1117//
1118// [class@ViewSwitcher] will display it as a dot next to the page icon.
1119func (x *ViewStackPage) SetPropertyNeedsAttention(value bool) {
1120 var v gobject.Value
1121 v.Init(gobject.TypeBooleanVal)
1122 v.SetBoolean(value)
1123 x.SetProperty("needs-attention", &v)
1124}
1125
1126// GetPropertyNeedsAttention gets the "needs-attention" property.
1127// Whether the page requires the user attention.
1128//
1129// [class@ViewSwitcher] will display it as a dot next to the page icon.
1130func (x *ViewStackPage) GetPropertyNeedsAttention() bool {
1131 var v gobject.Value
1132 x.GetProperty("needs-attention", &v)
1133 return v.GetBoolean()
1134}
1135
1136// SetPropertyTitle sets the "title" property.
1137// The title of the child page.
1138func (x *ViewStackPage) SetPropertyTitle(value string) {
1139 var v gobject.Value
1140 v.Init(gobject.TypeStringVal)
1141 v.SetString(&value)
1142 x.SetProperty("title", &v)
1143}
1144
1145// GetPropertyTitle gets the "title" property.
1146// The title of the child page.
1147func (x *ViewStackPage) GetPropertyTitle() string {
1148 var v gobject.Value
1149 x.GetProperty("title", &v)
1150 return v.GetString()
1151}
1152
1153// SetPropertyUseUnderline sets the "use-underline" property.
1154// Whether an embedded underline in the title indicates a mnemonic.
1155func (x *ViewStackPage) SetPropertyUseUnderline(value bool) {
1156 var v gobject.Value
1157 v.Init(gobject.TypeBooleanVal)
1158 v.SetBoolean(value)
1159 x.SetProperty("use-underline", &v)
1160}
1161
1162// GetPropertyUseUnderline gets the "use-underline" property.
1163// Whether an embedded underline in the title indicates a mnemonic.
1164func (x *ViewStackPage) GetPropertyUseUnderline() bool {
1165 var v gobject.Value
1166 x.GetProperty("use-underline", &v)
1167 return v.GetBoolean()
1168}
1169
1170// SetPropertyVisible sets the "visible" property.
1171// Whether this page is visible.
1172//
1173// This is independent from the [property@Gtk.Widget:visible] property of
1174// [property@ViewStackPage:child].
1175func (x *ViewStackPage) SetPropertyVisible(value bool) {
1176 var v gobject.Value
1177 v.Init(gobject.TypeBooleanVal)
1178 v.SetBoolean(value)
1179 x.SetProperty("visible", &v)
1180}
1181
1182// GetPropertyVisible gets the "visible" property.
1183// Whether this page is visible.
1184//
1185// This is independent from the [property@Gtk.Widget:visible] property of
1186// [property@ViewStackPage:child].
1187func (x *ViewStackPage) GetPropertyVisible() bool {
1188 var v gobject.Value
1189 x.GetProperty("visible", &v)
1190 return v.GetBoolean()
1191}
1192
1193// Requests the user's screen reader to announce the given message.
1194//
1195// This kind of notification is useful for messages that
1196// either have only a visual representation or that are not
1197// exposed visually at all, e.g. a notification about a
1198// successful operation.
1199//
1200// Also, by using this API, you can ensure that the message
1201// does not interrupts the user's current screen reader output.
1202func (x *ViewStackPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
1203
1204 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
1205
1206}
1207
1208// Retrieves the accessible parent for an accessible object.
1209//
1210// This function returns `NULL` for top level widgets.
1211func (x *ViewStackPage) GetAccessibleParent() *gtk.AccessibleBase {
1212 var cls *gtk.AccessibleBase
1213
1214 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
1215
1216 if cret == 0 {
1217 return nil
1218 }
1219 cls = >k.AccessibleBase{}
1220 cls.Ptr = cret
1221 return cls
1222}
1223
1224// Retrieves the accessible role of an accessible object.
1225func (x *ViewStackPage) GetAccessibleRole() gtk.AccessibleRole {
1226
1227 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
1228 return cret
1229}
1230
1231// Retrieves the implementation for the given accessible object.
1232func (x *ViewStackPage) GetAtContext() *gtk.ATContext {
1233 var cls *gtk.ATContext
1234
1235 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
1236
1237 if cret == 0 {
1238 return nil
1239 }
1240 cls = >k.ATContext{}
1241 cls.Ptr = cret
1242 return cls
1243}
1244
1245// Queries the coordinates and dimensions of this accessible
1246//
1247// This functionality can be overridden by `GtkAccessible`
1248// implementations, e.g. to get the bounds from an ignored
1249// child widget.
1250func (x *ViewStackPage) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
1251
1252 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
1253 return cret
1254}
1255
1256// Retrieves the first accessible child of an accessible object.
1257func (x *ViewStackPage) GetFirstAccessibleChild() *gtk.AccessibleBase {
1258 var cls *gtk.AccessibleBase
1259
1260 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
1261
1262 if cret == 0 {
1263 return nil
1264 }
1265 cls = >k.AccessibleBase{}
1266 cls.Ptr = cret
1267 return cls
1268}
1269
1270// Retrieves the next accessible sibling of an accessible object
1271func (x *ViewStackPage) GetNextAccessibleSibling() *gtk.AccessibleBase {
1272 var cls *gtk.AccessibleBase
1273
1274 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
1275
1276 if cret == 0 {
1277 return nil
1278 }
1279 cls = >k.AccessibleBase{}
1280 cls.Ptr = cret
1281 return cls
1282}
1283
1284// Queries a platform state, such as focus.
1285//
1286// This functionality can be overridden by `GtkAccessible`
1287// implementations, e.g. to get platform state from an ignored
1288// child widget, as is the case for `GtkText` wrappers.
1289func (x *ViewStackPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
1290
1291 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
1292 return cret
1293}
1294
1295// Resets the accessible property to its default value.
1296func (x *ViewStackPage) ResetProperty(PropertyVar gtk.AccessibleProperty) {
1297
1298 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
1299
1300}
1301
1302// Resets the accessible relation to its default value.
1303func (x *ViewStackPage) ResetRelation(RelationVar gtk.AccessibleRelation) {
1304
1305 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
1306
1307}
1308
1309// Resets the accessible state to its default value.
1310func (x *ViewStackPage) ResetState(StateVar gtk.AccessibleState) {
1311
1312 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
1313
1314}
1315
1316// Sets the parent and sibling of an accessible object.
1317//
1318// This function is meant to be used by accessible implementations that are
1319// not part of the widget hierarchy, and but act as a logical bridge between
1320// widgets. For instance, if a widget creates an object that holds metadata
1321// for each child, and you want that object to implement the `GtkAccessible`
1322// interface, you will use this function to ensure that the parent of each
1323// child widget is the metadata object, and the parent of each metadata
1324// object is the container widget.
1325func (x *ViewStackPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
1326
1327 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
1328
1329}
1330
1331// Updates the next accessible sibling.
1332//
1333// That might be useful when a new child of a custom accessible
1334// is created, and it needs to be linked to a previous child.
1335func (x *ViewStackPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
1336
1337 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
1338
1339}
1340
1341// Informs ATs that the platform state has changed.
1342//
1343// This function should be used by `GtkAccessible` implementations that
1344// have a platform state but are not widgets. Widgets handle platform
1345// states automatically.
1346func (x *ViewStackPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
1347
1348 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
1349
1350}
1351
1352// Updates a list of accessible properties.
1353//
1354// See the [enum@Gtk.AccessibleProperty] documentation for the
1355// value types of accessible properties.
1356//
1357// This function should be called by `GtkWidget` types whenever
1358// an accessible property change must be communicated to assistive
1359// technologies.
1360//
1361// Example:
1362// ```c
1363// value = gtk_adjustment_get_value (adjustment);
1364// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
1365//
1366// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
1367// -1);
1368//
1369// ```
1370func (x *ViewStackPage) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
1371
1372 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
1373
1374}
1375
1376// Updates an array of accessible properties.
1377//
1378// This function should be called by `GtkWidget` types whenever an accessible
1379// property change must be communicated to assistive technologies.
1380//
1381// This function is meant to be used by language bindings.
1382func (x *ViewStackPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
1383
1384 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
1385
1386}
1387
1388// Updates a list of accessible relations.
1389//
1390// This function should be called by `GtkWidget` types whenever an accessible
1391// relation change must be communicated to assistive technologies.
1392//
1393// If the [enum@Gtk.AccessibleRelation] requires a list of references,
1394// you should pass each reference individually, followed by `NULL`, e.g.
1395//
1396// ```c
1397// gtk_accessible_update_relation (accessible,
1398//
1399// GTK_ACCESSIBLE_RELATION_CONTROLS,
1400// ref1, NULL,
1401// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
1402// ref1, ref2, ref3, NULL,
1403// -1);
1404//
1405// ```
1406func (x *ViewStackPage) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
1407
1408 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
1409
1410}
1411
1412// Updates an array of accessible relations.
1413//
1414// This function should be called by `GtkWidget` types whenever an accessible
1415// relation change must be communicated to assistive technologies.
1416//
1417// This function is meant to be used by language bindings.
1418func (x *ViewStackPage) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
1419
1420 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
1421
1422}
1423
1424// Updates a list of accessible states.
1425//
1426// See the [enum@Gtk.AccessibleState] documentation for the
1427// value types of accessible states.
1428//
1429// This function should be called by `GtkWidget` types whenever
1430// an accessible state change must be communicated to assistive
1431// technologies.
1432//
1433// Example:
1434//
1435// ```c
1436// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
1437// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
1438//
1439// GTK_ACCESSIBLE_STATE_CHECKED, value,
1440// -1);
1441//
1442// ```
1443func (x *ViewStackPage) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
1444
1445 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
1446
1447}
1448
1449// Updates an array of accessible states.
1450//
1451// This function should be called by `GtkWidget` types whenever an accessible
1452// state change must be communicated to assistive technologies.
1453//
1454// This function is meant to be used by language bindings.
1455func (x *ViewStackPage) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
1456
1457 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1458
1459}
1460
1461// An auxiliary class used by [class@ViewStack].
1462//
1463// See [property@ViewStack:pages].
1464type ViewStackPages struct {
1465 gobject.Object
1466}
1467
1468var xViewStackPagesGLibType func() types.GType
1469
1470func ViewStackPagesGLibType() types.GType {
1471 return xViewStackPagesGLibType()
1472}
1473
1474func ViewStackPagesNewFromInternalPtr(ptr uintptr) *ViewStackPages {
1475 cls := &ViewStackPages{}
1476 cls.Ptr = ptr
1477 return cls
1478}
1479
1480var xViewStackPagesGetSelectedPage func(uintptr) uintptr
1481
1482// Gets the [class@ViewStackPage] for the visible child of a view stack
1483//
1484// Gets the [class@ViewStackPage] for the visible child of the associated stack.
1485//
1486// Returns `NULL` if there's no selected page.
1487func (x *ViewStackPages) GetSelectedPage() *ViewStackPage {
1488 var cls *ViewStackPage
1489
1490 cret := xViewStackPagesGetSelectedPage(x.GoPointer())
1491
1492 if cret == 0 {
1493 return nil
1494 }
1495 gobject.IncreaseRef(cret)
1496 cls = &ViewStackPage{}
1497 cls.Ptr = cret
1498 return cls
1499}
1500
1501var xViewStackPagesSetSelectedPage func(uintptr, uintptr)
1502
1503// Sets the visible child in the associated [class@ViewStack].
1504//
1505// See [property@ViewStack:visible-child].
1506func (x *ViewStackPages) SetSelectedPage(PageVar *ViewStackPage) {
1507
1508 xViewStackPagesSetSelectedPage(x.GoPointer(), PageVar.GoPointer())
1509
1510}
1511
1512func (c *ViewStackPages) GoPointer() uintptr {
1513 if c == nil {
1514 return 0
1515 }
1516 return c.Ptr
1517}
1518
1519func (c *ViewStackPages) SetGoPointer(ptr uintptr) {
1520 c.Ptr = ptr
1521}
1522
1523// Get the item at @position.
1524//
1525// If @position is greater than the number of items in @list, %NULL is
1526// returned.
1527//
1528// %NULL is never returned for an index that is smaller than the length
1529// of the list.
1530//
1531// See also: g_list_model_get_n_items()
1532func (x *ViewStackPages) GetItem(PositionVar uint) uintptr {
1533
1534 cret := gio.XGListModelGetItem(x.GoPointer(), PositionVar)
1535 return cret
1536}
1537
1538// Gets the type of the items in @list.
1539//
1540// All items returned from g_list_model_get_item() are of the type
1541// returned by this function, or a subtype, or if the type is an
1542// interface, they are an implementation of that interface.
1543//
1544// The item type of a #GListModel can not change during the life of the
1545// model.
1546func (x *ViewStackPages) GetItemType() types.GType {
1547
1548 cret := gio.XGListModelGetItemType(x.GoPointer())
1549 return cret
1550}
1551
1552// Gets the number of items in @list.
1553//
1554// Depending on the model implementation, calling this function may be
1555// less efficient than iterating the list with increasing values for
1556// @position until g_list_model_get_item() returns %NULL.
1557func (x *ViewStackPages) GetNItems() uint {
1558
1559 cret := gio.XGListModelGetNItems(x.GoPointer())
1560 return cret
1561}
1562
1563// Get the item at @position.
1564//
1565// If @position is greater than the number of items in @list, %NULL is
1566// returned.
1567//
1568// %NULL is never returned for an index that is smaller than the length
1569// of the list.
1570//
1571// This function is meant to be used by language bindings in place
1572// of g_list_model_get_item().
1573//
1574// See also: g_list_model_get_n_items()
1575func (x *ViewStackPages) GetObject(PositionVar uint) *gobject.Object {
1576 var cls *gobject.Object
1577
1578 cret := gio.XGListModelGetObject(x.GoPointer(), PositionVar)
1579
1580 if cret == 0 {
1581 return nil
1582 }
1583 cls = &gobject.Object{}
1584 cls.Ptr = cret
1585 return cls
1586}
1587
1588// Emits the #GListModel::items-changed signal on @list.
1589//
1590// This function should only be called by classes implementing
1591// #GListModel. It has to be called after the internal representation
1592// of @list has been updated, because handlers connected to this signal
1593// might query the new state of the list.
1594//
1595// Implementations must only make changes to the model (as visible to
1596// its consumer) in places that will not cause problems for that
1597// consumer. For models that are driven directly by a write API (such
1598// as #GListStore), changes can be reported in response to uses of that
1599// API. For models that represent remote data, changes should only be
1600// made from a fresh mainloop dispatch. It is particularly not
1601// permitted to make changes in response to a call to the #GListModel
1602// consumer API.
1603//
1604// Stated another way: in general, it is assumed that code making a
1605// series of accesses to the model via the API, without returning to the
1606// mainloop, and without calling other code, will continue to view the
1607// same contents of the model.
1608func (x *ViewStackPages) ItemsChanged(PositionVar uint, RemovedVar uint, AddedVar uint) {
1609
1610 gio.XGListModelItemsChanged(x.GoPointer(), PositionVar, RemovedVar, AddedVar)
1611
1612}
1613
1614// Gets the set containing all currently selected items in the model.
1615//
1616// This function may be slow, so if you are only interested in single item,
1617// consider using [method@Gtk.SelectionModel.is_selected] or if you are only
1618// interested in a few, consider [method@Gtk.SelectionModel.get_selection_in_range].
1619func (x *ViewStackPages) GetSelection() *gtk.Bitset {
1620
1621 cret := gtk.XGtkSelectionModelGetSelection(x.GoPointer())
1622 return cret
1623}
1624
1625// Gets the set of selected items in a range.
1626//
1627// This function is an optimization for
1628// [method@Gtk.SelectionModel.get_selection] when you are only
1629// interested in part of the model's selected state. A common use
1630// case is in response to the [signal@Gtk.SelectionModel::selection-changed]
1631// signal.
1632func (x *ViewStackPages) GetSelectionInRange(PositionVar uint, NItemsVar uint) *gtk.Bitset {
1633
1634 cret := gtk.XGtkSelectionModelGetSelectionInRange(x.GoPointer(), PositionVar, NItemsVar)
1635 return cret
1636}
1637
1638// Checks if the given item is selected.
1639func (x *ViewStackPages) IsSelected(PositionVar uint) bool {
1640
1641 cret := gtk.XGtkSelectionModelIsSelected(x.GoPointer(), PositionVar)
1642 return cret
1643}
1644
1645// Requests to select all items in the model.
1646func (x *ViewStackPages) SelectAll() bool {
1647
1648 cret := gtk.XGtkSelectionModelSelectAll(x.GoPointer())
1649 return cret
1650}
1651
1652// Requests to select an item in the model.
1653func (x *ViewStackPages) SelectItem(PositionVar uint, UnselectRestVar bool) bool {
1654
1655 cret := gtk.XGtkSelectionModelSelectItem(x.GoPointer(), PositionVar, UnselectRestVar)
1656 return cret
1657}
1658
1659// Requests to select a range of items in the model.
1660func (x *ViewStackPages) SelectRange(PositionVar uint, NItemsVar uint, UnselectRestVar bool) bool {
1661
1662 cret := gtk.XGtkSelectionModelSelectRange(x.GoPointer(), PositionVar, NItemsVar, UnselectRestVar)
1663 return cret
1664}
1665
1666// Helper function for implementations of `GtkSelectionModel`.
1667//
1668// Call this when the selection changes to emit the
1669// [signal@Gtk.SelectionModel::selection-changed] signal.
1670func (x *ViewStackPages) SelectionChanged(PositionVar uint, NItemsVar uint) {
1671
1672 gtk.XGtkSelectionModelSelectionChanged(x.GoPointer(), PositionVar, NItemsVar)
1673
1674}
1675
1676// Make selection changes.
1677//
1678// This is the most advanced selection updating method that allows
1679// the most fine-grained control over selection changes. If you can,
1680// you should try the simpler versions, as implementations are more
1681// likely to implement support for those.
1682//
1683// Requests that the selection state of all positions set in @mask
1684// be updated to the respective value in the @selected bitmask.
1685//
1686// In pseudocode, it would look something like this:
1687//
1688// ```c
1689// for (i = 0; i < n_items; i++)
1690//
1691// {
1692// // don't change values not in the mask
1693// if (!gtk_bitset_contains (mask, i))
1694// continue;
1695//
1696// if (gtk_bitset_contains (selected, i))
1697// select_item (i);
1698// else
1699// unselect_item (i);
1700// }
1701//
1702// gtk_selection_model_selection_changed (model,
1703//
1704// first_changed_item,
1705// n_changed_items);
1706//
1707// ```
1708//
1709// @mask and @selected must not be modified. They may refer to the
1710// same bitset, which would mean that every item in the set should
1711// be selected.
1712func (x *ViewStackPages) SetSelection(SelectedVar *gtk.Bitset, MaskVar *gtk.Bitset) bool {
1713
1714 cret := gtk.XGtkSelectionModelSetSelection(x.GoPointer(), SelectedVar, MaskVar)
1715 return cret
1716}
1717
1718// Requests to unselect all items in the model.
1719func (x *ViewStackPages) UnselectAll() bool {
1720
1721 cret := gtk.XGtkSelectionModelUnselectAll(x.GoPointer())
1722 return cret
1723}
1724
1725// Requests to unselect an item in the model.
1726func (x *ViewStackPages) UnselectItem(PositionVar uint) bool {
1727
1728 cret := gtk.XGtkSelectionModelUnselectItem(x.GoPointer(), PositionVar)
1729 return cret
1730}
1731
1732// Requests to unselect a range of items in the model.
1733func (x *ViewStackPages) UnselectRange(PositionVar uint, NItemsVar uint) bool {
1734
1735 cret := gtk.XGtkSelectionModelUnselectRange(x.GoPointer(), PositionVar, NItemsVar)
1736 return cret
1737}
1738
1739func init() {
1740 core.SetPackageName("ADW", "libadwaita-1")
1741 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
1742 var libs []uintptr
1743 for _, libPath := range core.GetPaths("ADW") {
1744 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1745 if err != nil {
1746 panic(err)
1747 }
1748 libs = append(libs, lib)
1749 }
1750
1751 core.PuregoSafeRegister(&xViewStackGLibType, libs, "adw_view_stack_get_type")
1752
1753 core.PuregoSafeRegister(&xNewViewStack, libs, "adw_view_stack_new")
1754
1755 core.PuregoSafeRegister(&xViewStackAdd, libs, "adw_view_stack_add")
1756 core.PuregoSafeRegister(&xViewStackAddNamed, libs, "adw_view_stack_add_named")
1757 core.PuregoSafeRegister(&xViewStackAddTitled, libs, "adw_view_stack_add_titled")
1758 core.PuregoSafeRegister(&xViewStackAddTitledWithIcon, libs, "adw_view_stack_add_titled_with_icon")
1759 core.PuregoSafeRegister(&xViewStackGetChildByName, libs, "adw_view_stack_get_child_by_name")
1760 core.PuregoSafeRegister(&xViewStackGetEnableTransitions, libs, "adw_view_stack_get_enable_transitions")
1761 core.PuregoSafeRegister(&xViewStackGetHhomogeneous, libs, "adw_view_stack_get_hhomogeneous")
1762 core.PuregoSafeRegister(&xViewStackGetPage, libs, "adw_view_stack_get_page")
1763 core.PuregoSafeRegister(&xViewStackGetPages, libs, "adw_view_stack_get_pages")
1764 core.PuregoSafeRegister(&xViewStackGetTransitionDuration, libs, "adw_view_stack_get_transition_duration")
1765 core.PuregoSafeRegister(&xViewStackGetTransitionRunning, libs, "adw_view_stack_get_transition_running")
1766 core.PuregoSafeRegister(&xViewStackGetVhomogeneous, libs, "adw_view_stack_get_vhomogeneous")
1767 core.PuregoSafeRegister(&xViewStackGetVisibleChild, libs, "adw_view_stack_get_visible_child")
1768 core.PuregoSafeRegister(&xViewStackGetVisibleChildName, libs, "adw_view_stack_get_visible_child_name")
1769 core.PuregoSafeRegister(&xViewStackRemove, libs, "adw_view_stack_remove")
1770 core.PuregoSafeRegister(&xViewStackSetEnableTransitions, libs, "adw_view_stack_set_enable_transitions")
1771 core.PuregoSafeRegister(&xViewStackSetHhomogeneous, libs, "adw_view_stack_set_hhomogeneous")
1772 core.PuregoSafeRegister(&xViewStackSetTransitionDuration, libs, "adw_view_stack_set_transition_duration")
1773 core.PuregoSafeRegister(&xViewStackSetVhomogeneous, libs, "adw_view_stack_set_vhomogeneous")
1774 core.PuregoSafeRegister(&xViewStackSetVisibleChild, libs, "adw_view_stack_set_visible_child")
1775 core.PuregoSafeRegister(&xViewStackSetVisibleChildName, libs, "adw_view_stack_set_visible_child_name")
1776
1777 core.PuregoSafeRegister(&xViewStackPageGLibType, libs, "adw_view_stack_page_get_type")
1778
1779 core.PuregoSafeRegister(&xViewStackPageGetBadgeNumber, libs, "adw_view_stack_page_get_badge_number")
1780 core.PuregoSafeRegister(&xViewStackPageGetChild, libs, "adw_view_stack_page_get_child")
1781 core.PuregoSafeRegister(&xViewStackPageGetIconName, libs, "adw_view_stack_page_get_icon_name")
1782 core.PuregoSafeRegister(&xViewStackPageGetName, libs, "adw_view_stack_page_get_name")
1783 core.PuregoSafeRegister(&xViewStackPageGetNeedsAttention, libs, "adw_view_stack_page_get_needs_attention")
1784 core.PuregoSafeRegister(&xViewStackPageGetTitle, libs, "adw_view_stack_page_get_title")
1785 core.PuregoSafeRegister(&xViewStackPageGetUseUnderline, libs, "adw_view_stack_page_get_use_underline")
1786 core.PuregoSafeRegister(&xViewStackPageGetVisible, libs, "adw_view_stack_page_get_visible")
1787 core.PuregoSafeRegister(&xViewStackPageSetBadgeNumber, libs, "adw_view_stack_page_set_badge_number")
1788 core.PuregoSafeRegister(&xViewStackPageSetIconName, libs, "adw_view_stack_page_set_icon_name")
1789 core.PuregoSafeRegister(&xViewStackPageSetName, libs, "adw_view_stack_page_set_name")
1790 core.PuregoSafeRegister(&xViewStackPageSetNeedsAttention, libs, "adw_view_stack_page_set_needs_attention")
1791 core.PuregoSafeRegister(&xViewStackPageSetTitle, libs, "adw_view_stack_page_set_title")
1792 core.PuregoSafeRegister(&xViewStackPageSetUseUnderline, libs, "adw_view_stack_page_set_use_underline")
1793 core.PuregoSafeRegister(&xViewStackPageSetVisible, libs, "adw_view_stack_page_set_visible")
1794
1795 core.PuregoSafeRegister(&xViewStackPagesGLibType, libs, "adw_view_stack_pages_get_type")
1796
1797 core.PuregoSafeRegister(&xViewStackPagesGetSelectedPage, libs, "adw_view_stack_pages_get_selected_page")
1798 core.PuregoSafeRegister(&xViewStackPagesSetSelectedPage, libs, "adw_view_stack_pages_set_selected_page")
1799
1800}