1// Package adw was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package adw
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gobject"
12 "github.com/bnema/puregotk/v4/gobject/types"
13 "github.com/bnema/puregotk/v4/gtk"
14)
15
16type ViewSwitcherBarClass struct {
17 _ structs.HostLayout
18
19 ParentClass gtk.WidgetClass
20}
21
22func (x *ViewSwitcherBarClass) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26// A view switcher action bar.
27//
28// <picture>
29//
30// <source srcset="view-switcher-bar-dark.png" media="(prefers-color-scheme: dark)">
31// <img src="view-switcher-bar.png" alt="view-switcher-bar">
32//
33// </picture>
34//
35// An action bar letting you switch between multiple views contained in a
36// [class@ViewStack], via an [class@ViewSwitcher]. It is designed to be put at
37// the bottom of a window and to be revealed only on really narrow windows, e.g.
38// on mobile phones. It can't be revealed if there are less than two pages.
39//
40// `AdwViewSwitcherBar` is intended to be used together with
41// `AdwViewSwitcher` in a header bar, and a [class@Breakpoint] showing the view
42// switcher bar on narrow sizes, while removing the view switcher from the
43// header bar, as follows:
44//
45// ```xml
46// <object class="AdwWindow">
47//
48// <child>
49// <object class="AdwBreakpoint">
50// <condition>max-width: 550sp</condition>
51// <setter object="switcher_bar" property="reveal">True</setter>
52// <setter object="header_bar" property="title-widget"/>
53// </object>
54// </child>
55// <property name="content">
56// <object class="AdwToolbarView">
57// <child type="top">
58// <object class="AdwHeaderBar" id="header_bar">
59// <property name="title-widget">
60// <object class="AdwViewSwitcher">
61// <property name="stack">stack</property>
62// <property name="policy">wide</property>
63// </object>
64// </property>
65// </object>
66// </child>
67// <property name="content">
68// <object class="AdwViewStack" id="stack"/>
69// </property>
70// <child type="bottom">
71// <object class="AdwViewSwitcherBar" id="switcher_bar">
72// <property name="stack">stack</property>
73// </object>
74// </child>
75// </object>
76// </property>
77//
78// </object>
79// ```
80//
81// It's recommended to set [property@ViewSwitcher:policy] to
82// `ADW_VIEW_SWITCHER_POLICY_WIDE` in this case.
83//
84// You may have to adjust the breakpoint condition for your specific pages.
85//
86// ## CSS nodes
87//
88// `AdwViewSwitcherBar` has a single CSS node with name` viewswitcherbar`.
89type ViewSwitcherBar struct {
90 gtk.Widget
91}
92
93var xViewSwitcherBarGLibType func() types.GType
94
95func ViewSwitcherBarGLibType() types.GType {
96 return xViewSwitcherBarGLibType()
97}
98
99func ViewSwitcherBarNewFromInternalPtr(ptr uintptr) *ViewSwitcherBar {
100 cls := &ViewSwitcherBar{}
101 cls.Ptr = ptr
102 return cls
103}
104
105var xNewViewSwitcherBar func() uintptr
106
107// Creates a new `AdwViewSwitcherBar`.
108func NewViewSwitcherBar() *ViewSwitcherBar {
109 var cls *ViewSwitcherBar
110
111 cret := xNewViewSwitcherBar()
112
113 if cret == 0 {
114 return nil
115 }
116 gobject.IncreaseRef(cret)
117 cls = &ViewSwitcherBar{}
118 cls.Ptr = cret
119 return cls
120}
121
122var xViewSwitcherBarGetReveal func(uintptr) bool
123
124// Gets whether @self should be revealed or hidden.
125func (x *ViewSwitcherBar) GetReveal() bool {
126
127 cret := xViewSwitcherBarGetReveal(x.GoPointer())
128 return cret
129}
130
131var xViewSwitcherBarGetStack func(uintptr) uintptr
132
133// Gets the stack controlled by @self.
134func (x *ViewSwitcherBar) GetStack() *ViewStack {
135 var cls *ViewStack
136
137 cret := xViewSwitcherBarGetStack(x.GoPointer())
138
139 if cret == 0 {
140 return nil
141 }
142 gobject.IncreaseRef(cret)
143 cls = &ViewStack{}
144 cls.Ptr = cret
145 return cls
146}
147
148var xViewSwitcherBarSetReveal func(uintptr, bool)
149
150// Sets whether @self should be revealed or hidden.
151func (x *ViewSwitcherBar) SetReveal(RevealVar bool) {
152
153 xViewSwitcherBarSetReveal(x.GoPointer(), RevealVar)
154
155}
156
157var xViewSwitcherBarSetStack func(uintptr, uintptr)
158
159// Sets the stack controlled by @self.
160func (x *ViewSwitcherBar) SetStack(StackVar *ViewStack) {
161
162 xViewSwitcherBarSetStack(x.GoPointer(), StackVar.GoPointer())
163
164}
165
166func (c *ViewSwitcherBar) GoPointer() uintptr {
167 if c == nil {
168 return 0
169 }
170 return c.Ptr
171}
172
173func (c *ViewSwitcherBar) SetGoPointer(ptr uintptr) {
174 c.Ptr = ptr
175}
176
177// SetPropertyReveal sets the "reveal" property.
178// Whether the bar should be revealed or hidden.
179func (x *ViewSwitcherBar) SetPropertyReveal(value bool) {
180 var v gobject.Value
181 v.Init(gobject.TypeBooleanVal)
182 v.SetBoolean(value)
183 x.SetProperty("reveal", &v)
184}
185
186// GetPropertyReveal gets the "reveal" property.
187// Whether the bar should be revealed or hidden.
188func (x *ViewSwitcherBar) GetPropertyReveal() bool {
189 var v gobject.Value
190 x.GetProperty("reveal", &v)
191 return v.GetBoolean()
192}
193
194// Requests the user's screen reader to announce the given message.
195//
196// This kind of notification is useful for messages that
197// either have only a visual representation or that are not
198// exposed visually at all, e.g. a notification about a
199// successful operation.
200//
201// Also, by using this API, you can ensure that the message
202// does not interrupts the user's current screen reader output.
203func (x *ViewSwitcherBar) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
204
205 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
206
207}
208
209// Retrieves the accessible parent for an accessible object.
210//
211// This function returns `NULL` for top level widgets.
212func (x *ViewSwitcherBar) GetAccessibleParent() *gtk.AccessibleBase {
213 var cls *gtk.AccessibleBase
214
215 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
216
217 if cret == 0 {
218 return nil
219 }
220 cls = >k.AccessibleBase{}
221 cls.Ptr = cret
222 return cls
223}
224
225// Retrieves the accessible role of an accessible object.
226func (x *ViewSwitcherBar) GetAccessibleRole() gtk.AccessibleRole {
227
228 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
229 return cret
230}
231
232// Retrieves the implementation for the given accessible object.
233func (x *ViewSwitcherBar) GetAtContext() *gtk.ATContext {
234 var cls *gtk.ATContext
235
236 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
237
238 if cret == 0 {
239 return nil
240 }
241 cls = >k.ATContext{}
242 cls.Ptr = cret
243 return cls
244}
245
246// Queries the coordinates and dimensions of this accessible
247//
248// This functionality can be overridden by `GtkAccessible`
249// implementations, e.g. to get the bounds from an ignored
250// child widget.
251func (x *ViewSwitcherBar) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
252
253 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
254 return cret
255}
256
257// Retrieves the first accessible child of an accessible object.
258func (x *ViewSwitcherBar) GetFirstAccessibleChild() *gtk.AccessibleBase {
259 var cls *gtk.AccessibleBase
260
261 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
262
263 if cret == 0 {
264 return nil
265 }
266 cls = >k.AccessibleBase{}
267 cls.Ptr = cret
268 return cls
269}
270
271// Retrieves the next accessible sibling of an accessible object
272func (x *ViewSwitcherBar) GetNextAccessibleSibling() *gtk.AccessibleBase {
273 var cls *gtk.AccessibleBase
274
275 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
276
277 if cret == 0 {
278 return nil
279 }
280 cls = >k.AccessibleBase{}
281 cls.Ptr = cret
282 return cls
283}
284
285// Queries a platform state, such as focus.
286//
287// This functionality can be overridden by `GtkAccessible`
288// implementations, e.g. to get platform state from an ignored
289// child widget, as is the case for `GtkText` wrappers.
290func (x *ViewSwitcherBar) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
291
292 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
293 return cret
294}
295
296// Resets the accessible property to its default value.
297func (x *ViewSwitcherBar) ResetProperty(PropertyVar gtk.AccessibleProperty) {
298
299 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
300
301}
302
303// Resets the accessible relation to its default value.
304func (x *ViewSwitcherBar) ResetRelation(RelationVar gtk.AccessibleRelation) {
305
306 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
307
308}
309
310// Resets the accessible state to its default value.
311func (x *ViewSwitcherBar) ResetState(StateVar gtk.AccessibleState) {
312
313 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
314
315}
316
317// Sets the parent and sibling of an accessible object.
318//
319// This function is meant to be used by accessible implementations that are
320// not part of the widget hierarchy, and but act as a logical bridge between
321// widgets. For instance, if a widget creates an object that holds metadata
322// for each child, and you want that object to implement the `GtkAccessible`
323// interface, you will use this function to ensure that the parent of each
324// child widget is the metadata object, and the parent of each metadata
325// object is the container widget.
326func (x *ViewSwitcherBar) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
327
328 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
329
330}
331
332// Updates the next accessible sibling.
333//
334// That might be useful when a new child of a custom accessible
335// is created, and it needs to be linked to a previous child.
336func (x *ViewSwitcherBar) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
337
338 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
339
340}
341
342// Informs ATs that the platform state has changed.
343//
344// This function should be used by `GtkAccessible` implementations that
345// have a platform state but are not widgets. Widgets handle platform
346// states automatically.
347func (x *ViewSwitcherBar) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
348
349 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
350
351}
352
353// Updates a list of accessible properties.
354//
355// See the [enum@Gtk.AccessibleProperty] documentation for the
356// value types of accessible properties.
357//
358// This function should be called by `GtkWidget` types whenever
359// an accessible property change must be communicated to assistive
360// technologies.
361//
362// Example:
363// ```c
364// value = gtk_adjustment_get_value (adjustment);
365// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
366//
367// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
368// -1);
369//
370// ```
371func (x *ViewSwitcherBar) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
372
373 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
374
375}
376
377// Updates an array of accessible properties.
378//
379// This function should be called by `GtkWidget` types whenever an accessible
380// property change must be communicated to assistive technologies.
381//
382// This function is meant to be used by language bindings.
383func (x *ViewSwitcherBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
384
385 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
386
387}
388
389// Updates a list of accessible relations.
390//
391// This function should be called by `GtkWidget` types whenever an accessible
392// relation change must be communicated to assistive technologies.
393//
394// If the [enum@Gtk.AccessibleRelation] requires a list of references,
395// you should pass each reference individually, followed by `NULL`, e.g.
396//
397// ```c
398// gtk_accessible_update_relation (accessible,
399//
400// GTK_ACCESSIBLE_RELATION_CONTROLS,
401// ref1, NULL,
402// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
403// ref1, ref2, ref3, NULL,
404// -1);
405//
406// ```
407func (x *ViewSwitcherBar) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
408
409 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
410
411}
412
413// Updates an array of accessible relations.
414//
415// This function should be called by `GtkWidget` types whenever an accessible
416// relation change must be communicated to assistive technologies.
417//
418// This function is meant to be used by language bindings.
419func (x *ViewSwitcherBar) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
420
421 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
422
423}
424
425// Updates a list of accessible states.
426//
427// See the [enum@Gtk.AccessibleState] documentation for the
428// value types of accessible states.
429//
430// This function should be called by `GtkWidget` types whenever
431// an accessible state change must be communicated to assistive
432// technologies.
433//
434// Example:
435//
436// ```c
437// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
438// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
439//
440// GTK_ACCESSIBLE_STATE_CHECKED, value,
441// -1);
442//
443// ```
444func (x *ViewSwitcherBar) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
445
446 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
447
448}
449
450// Updates an array of accessible states.
451//
452// This function should be called by `GtkWidget` types whenever an accessible
453// state change must be communicated to assistive technologies.
454//
455// This function is meant to be used by language bindings.
456func (x *ViewSwitcherBar) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
457
458 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
459
460}
461
462// Gets the ID of the @buildable object.
463//
464// `GtkBuilder` sets the name based on the ID attribute
465// of the `<object>` tag used to construct the @buildable.
466func (x *ViewSwitcherBar) GetBuildableId() string {
467
468 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
469 return cret
470}
471
472func init() {
473 core.SetPackageName("ADW", "libadwaita-1")
474 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
475 var libs []uintptr
476 for _, libPath := range core.GetPaths("ADW") {
477 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
478 if err != nil {
479 panic(err)
480 }
481 libs = append(libs, lib)
482 }
483
484 core.PuregoSafeRegister(&xViewSwitcherBarGLibType, libs, "adw_view_switcher_bar_get_type")
485
486 core.PuregoSafeRegister(&xNewViewSwitcherBar, libs, "adw_view_switcher_bar_new")
487
488 core.PuregoSafeRegister(&xViewSwitcherBarGetReveal, libs, "adw_view_switcher_bar_get_reveal")
489 core.PuregoSafeRegister(&xViewSwitcherBarGetStack, libs, "adw_view_switcher_bar_get_stack")
490 core.PuregoSafeRegister(&xViewSwitcherBarSetReveal, libs, "adw_view_switcher_bar_set_reveal")
491 core.PuregoSafeRegister(&xViewSwitcherBarSetStack, libs, "adw_view_switcher_bar_set_stack")
492
493}