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 InlineViewSwitcherClass struct {
17 _ structs.HostLayout
18
19 ParentClass gtk.WidgetClass
20}
21
22func (x *InlineViewSwitcherClass) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26// Describes what [class@InlineViewSwitcher] toggles display.
27//
28// <picture>
29//
30// <source srcset="inline-view-switcher-display-modes-dark.png" media="(prefers-color-scheme: dark)">
31// <img src="inline-view-switcher-display-modes.png" alt="inline-view-switcher-display-modes">
32//
33// </picture>
34type InlineViewSwitcherDisplayMode int
35
36var xInlineViewSwitcherDisplayModeGLibType func() types.GType
37
38func InlineViewSwitcherDisplayModeGLibType() types.GType {
39 return xInlineViewSwitcherDisplayModeGLibType()
40}
41
42const (
43
44 // Toggles only display labels.
45 InlineViewSwitcherLabelsValue InlineViewSwitcherDisplayMode = 0
46 // Toggles only display icons.
47 InlineViewSwitcherIconsValue InlineViewSwitcherDisplayMode = 1
48 // Toggles display both icons and labels.
49 InlineViewSwitcherBothValue InlineViewSwitcherDisplayMode = 2
50)
51
52// A view switcher that uses a toggle group.
53//
54// <picture>
55//
56// <source srcset="inline-view-switcher-dark.png" media="(prefers-color-scheme: dark)">
57// <img src="inline-view-switcher.png" alt="inline-view-switcher">
58//
59// </picture>
60//
61// A view switcher showing pages of an [class@ViewStack] within an
62// [class@ToggleGroup], similar to [class@ViewSwitcher].
63//
64// The toggles can display either an icon, a label or both. Use the
65// [property@InlineViewSwitcher:display-mode] to control this.
66//
67// <picture>
68//
69// <source srcset="inline-view-switcher-display-modes-dark.png" media="(prefers-color-scheme: dark)">
70// <img src="inline-view-switcher-display-modes.png" alt="inline-view-switcher-display-modes">
71//
72// </picture>
73//
74// ## CSS nodes
75//
76// `AdwInlineViewSwitcher` has a single CSS node with the name
77// `inline-view-switcher`.
78//
79// ## Style classes
80//
81// Like `AdwToggleGroup`, it can accept the [`.flat`](style-classes.html#flat_1)
82// and [`.round`](style-classes.html#round) style classes.
83//
84// <picture>
85//
86// <source srcset="inline-view-switcher-style-classes-dark.png" media="(prefers-color-scheme: dark)">
87// <img src="inline-view-switcher-style-classes.png" alt="inline-view-switcher-style-classes">
88//
89// </picture>
90//
91// ## Accessibility
92//
93// The internal toggle group uses the `GTK_ACCESSIBLE_ROLE_TAB_LIST` role. Its
94// toggles use the `GTK_ACCESSIBLE_ROLE_TAB` role.
95type InlineViewSwitcher struct {
96 gtk.Widget
97}
98
99var xInlineViewSwitcherGLibType func() types.GType
100
101func InlineViewSwitcherGLibType() types.GType {
102 return xInlineViewSwitcherGLibType()
103}
104
105func InlineViewSwitcherNewFromInternalPtr(ptr uintptr) *InlineViewSwitcher {
106 cls := &InlineViewSwitcher{}
107 cls.Ptr = ptr
108 return cls
109}
110
111var xNewInlineViewSwitcher func() uintptr
112
113// Creates a new `AdwInlineViewSwitcher`.
114func NewInlineViewSwitcher() *InlineViewSwitcher {
115 var cls *InlineViewSwitcher
116
117 cret := xNewInlineViewSwitcher()
118
119 if cret == 0 {
120 return nil
121 }
122 gobject.IncreaseRef(cret)
123 cls = &InlineViewSwitcher{}
124 cls.Ptr = cret
125 return cls
126}
127
128var xInlineViewSwitcherGetCanShrink func(uintptr) bool
129
130// Gets whether the toggles can be smaller than the natural size of their
131// contents.
132func (x *InlineViewSwitcher) GetCanShrink() bool {
133
134 cret := xInlineViewSwitcherGetCanShrink(x.GoPointer())
135 return cret
136}
137
138var xInlineViewSwitcherGetDisplayMode func(uintptr) InlineViewSwitcherDisplayMode
139
140// Gets the display mode of @self.
141func (x *InlineViewSwitcher) GetDisplayMode() InlineViewSwitcherDisplayMode {
142
143 cret := xInlineViewSwitcherGetDisplayMode(x.GoPointer())
144 return cret
145}
146
147var xInlineViewSwitcherGetHomogeneous func(uintptr) bool
148
149// Gets whether all toggles within @self take the same size.
150func (x *InlineViewSwitcher) GetHomogeneous() bool {
151
152 cret := xInlineViewSwitcherGetHomogeneous(x.GoPointer())
153 return cret
154}
155
156var xInlineViewSwitcherGetStack func(uintptr) uintptr
157
158// Gets the stack @self controls.
159func (x *InlineViewSwitcher) GetStack() *ViewStack {
160 var cls *ViewStack
161
162 cret := xInlineViewSwitcherGetStack(x.GoPointer())
163
164 if cret == 0 {
165 return nil
166 }
167 gobject.IncreaseRef(cret)
168 cls = &ViewStack{}
169 cls.Ptr = cret
170 return cls
171}
172
173var xInlineViewSwitcherSetCanShrink func(uintptr, bool)
174
175// Sets whether the toggles can be smaller than the natural size of their
176// contents.
177//
178// If @can_shrink is `TRUE`, the toggle labels will ellipsize.
179//
180// See [property@ToggleGroup:can-shrink].
181func (x *InlineViewSwitcher) SetCanShrink(CanShrinkVar bool) {
182
183 xInlineViewSwitcherSetCanShrink(x.GoPointer(), CanShrinkVar)
184
185}
186
187var xInlineViewSwitcherSetDisplayMode func(uintptr, InlineViewSwitcherDisplayMode)
188
189// Sets the display mode of @self.
190//
191// Determines what the toggles display: a label, an icon or both.
192//
193// <picture>
194//
195// <source srcset="inline-view-switcher-display-modes-dark.png" media="(prefers-color-scheme: dark)">
196// <img src="inline-view-switcher-display-modes.png" alt="inline-view-switcher-display-modes">
197//
198// </picture>
199func (x *InlineViewSwitcher) SetDisplayMode(ModeVar InlineViewSwitcherDisplayMode) {
200
201 xInlineViewSwitcherSetDisplayMode(x.GoPointer(), ModeVar)
202
203}
204
205var xInlineViewSwitcherSetHomogeneous func(uintptr, bool)
206
207// Sets whether all toggles within @self take the same size.
208func (x *InlineViewSwitcher) SetHomogeneous(HomogeneousVar bool) {
209
210 xInlineViewSwitcherSetHomogeneous(x.GoPointer(), HomogeneousVar)
211
212}
213
214var xInlineViewSwitcherSetStack func(uintptr, uintptr)
215
216// Sets the stack to control.
217func (x *InlineViewSwitcher) SetStack(StackVar *ViewStack) {
218
219 xInlineViewSwitcherSetStack(x.GoPointer(), StackVar.GoPointer())
220
221}
222
223func (c *InlineViewSwitcher) GoPointer() uintptr {
224 if c == nil {
225 return 0
226 }
227 return c.Ptr
228}
229
230func (c *InlineViewSwitcher) SetGoPointer(ptr uintptr) {
231 c.Ptr = ptr
232}
233
234// SetPropertyCanShrink sets the "can-shrink" property.
235// Whether the toggles can be smaller than the natural size of their contents.
236//
237// If set to `TRUE`, the toggle labels will ellipsize.
238//
239// See [property@ToggleGroup:can-shrink].
240func (x *InlineViewSwitcher) SetPropertyCanShrink(value bool) {
241 var v gobject.Value
242 v.Init(gobject.TypeBooleanVal)
243 v.SetBoolean(value)
244 x.SetProperty("can-shrink", &v)
245}
246
247// GetPropertyCanShrink gets the "can-shrink" property.
248// Whether the toggles can be smaller than the natural size of their contents.
249//
250// If set to `TRUE`, the toggle labels will ellipsize.
251//
252// See [property@ToggleGroup:can-shrink].
253func (x *InlineViewSwitcher) GetPropertyCanShrink() bool {
254 var v gobject.Value
255 x.GetProperty("can-shrink", &v)
256 return v.GetBoolean()
257}
258
259// SetPropertyHomogeneous sets the "homogeneous" property.
260// Whether all toggles take the same size.
261func (x *InlineViewSwitcher) SetPropertyHomogeneous(value bool) {
262 var v gobject.Value
263 v.Init(gobject.TypeBooleanVal)
264 v.SetBoolean(value)
265 x.SetProperty("homogeneous", &v)
266}
267
268// GetPropertyHomogeneous gets the "homogeneous" property.
269// Whether all toggles take the same size.
270func (x *InlineViewSwitcher) GetPropertyHomogeneous() bool {
271 var v gobject.Value
272 x.GetProperty("homogeneous", &v)
273 return v.GetBoolean()
274}
275
276// Requests the user's screen reader to announce the given message.
277//
278// This kind of notification is useful for messages that
279// either have only a visual representation or that are not
280// exposed visually at all, e.g. a notification about a
281// successful operation.
282//
283// Also, by using this API, you can ensure that the message
284// does not interrupts the user's current screen reader output.
285func (x *InlineViewSwitcher) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
286
287 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
288
289}
290
291// Retrieves the accessible parent for an accessible object.
292//
293// This function returns `NULL` for top level widgets.
294func (x *InlineViewSwitcher) GetAccessibleParent() *gtk.AccessibleBase {
295 var cls *gtk.AccessibleBase
296
297 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
298
299 if cret == 0 {
300 return nil
301 }
302 cls = >k.AccessibleBase{}
303 cls.Ptr = cret
304 return cls
305}
306
307// Retrieves the accessible role of an accessible object.
308func (x *InlineViewSwitcher) GetAccessibleRole() gtk.AccessibleRole {
309
310 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
311 return cret
312}
313
314// Retrieves the implementation for the given accessible object.
315func (x *InlineViewSwitcher) GetAtContext() *gtk.ATContext {
316 var cls *gtk.ATContext
317
318 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
319
320 if cret == 0 {
321 return nil
322 }
323 cls = >k.ATContext{}
324 cls.Ptr = cret
325 return cls
326}
327
328// Queries the coordinates and dimensions of this accessible
329//
330// This functionality can be overridden by `GtkAccessible`
331// implementations, e.g. to get the bounds from an ignored
332// child widget.
333func (x *InlineViewSwitcher) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
334
335 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
336 return cret
337}
338
339// Retrieves the first accessible child of an accessible object.
340func (x *InlineViewSwitcher) GetFirstAccessibleChild() *gtk.AccessibleBase {
341 var cls *gtk.AccessibleBase
342
343 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
344
345 if cret == 0 {
346 return nil
347 }
348 cls = >k.AccessibleBase{}
349 cls.Ptr = cret
350 return cls
351}
352
353// Retrieves the next accessible sibling of an accessible object
354func (x *InlineViewSwitcher) GetNextAccessibleSibling() *gtk.AccessibleBase {
355 var cls *gtk.AccessibleBase
356
357 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
358
359 if cret == 0 {
360 return nil
361 }
362 cls = >k.AccessibleBase{}
363 cls.Ptr = cret
364 return cls
365}
366
367// Queries a platform state, such as focus.
368//
369// This functionality can be overridden by `GtkAccessible`
370// implementations, e.g. to get platform state from an ignored
371// child widget, as is the case for `GtkText` wrappers.
372func (x *InlineViewSwitcher) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
373
374 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
375 return cret
376}
377
378// Resets the accessible property to its default value.
379func (x *InlineViewSwitcher) ResetProperty(PropertyVar gtk.AccessibleProperty) {
380
381 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
382
383}
384
385// Resets the accessible relation to its default value.
386func (x *InlineViewSwitcher) ResetRelation(RelationVar gtk.AccessibleRelation) {
387
388 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
389
390}
391
392// Resets the accessible state to its default value.
393func (x *InlineViewSwitcher) ResetState(StateVar gtk.AccessibleState) {
394
395 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
396
397}
398
399// Sets the parent and sibling of an accessible object.
400//
401// This function is meant to be used by accessible implementations that are
402// not part of the widget hierarchy, and but act as a logical bridge between
403// widgets. For instance, if a widget creates an object that holds metadata
404// for each child, and you want that object to implement the `GtkAccessible`
405// interface, you will use this function to ensure that the parent of each
406// child widget is the metadata object, and the parent of each metadata
407// object is the container widget.
408func (x *InlineViewSwitcher) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
409
410 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
411
412}
413
414// Updates the next accessible sibling.
415//
416// That might be useful when a new child of a custom accessible
417// is created, and it needs to be linked to a previous child.
418func (x *InlineViewSwitcher) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
419
420 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
421
422}
423
424// Informs ATs that the platform state has changed.
425//
426// This function should be used by `GtkAccessible` implementations that
427// have a platform state but are not widgets. Widgets handle platform
428// states automatically.
429func (x *InlineViewSwitcher) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
430
431 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
432
433}
434
435// Updates a list of accessible properties.
436//
437// See the [enum@Gtk.AccessibleProperty] documentation for the
438// value types of accessible properties.
439//
440// This function should be called by `GtkWidget` types whenever
441// an accessible property change must be communicated to assistive
442// technologies.
443//
444// Example:
445// ```c
446// value = gtk_adjustment_get_value (adjustment);
447// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
448//
449// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
450// -1);
451//
452// ```
453func (x *InlineViewSwitcher) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
454
455 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
456
457}
458
459// Updates an array of accessible properties.
460//
461// This function should be called by `GtkWidget` types whenever an accessible
462// property change must be communicated to assistive technologies.
463//
464// This function is meant to be used by language bindings.
465func (x *InlineViewSwitcher) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
466
467 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
468
469}
470
471// Updates a list of accessible relations.
472//
473// This function should be called by `GtkWidget` types whenever an accessible
474// relation change must be communicated to assistive technologies.
475//
476// If the [enum@Gtk.AccessibleRelation] requires a list of references,
477// you should pass each reference individually, followed by `NULL`, e.g.
478//
479// ```c
480// gtk_accessible_update_relation (accessible,
481//
482// GTK_ACCESSIBLE_RELATION_CONTROLS,
483// ref1, NULL,
484// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
485// ref1, ref2, ref3, NULL,
486// -1);
487//
488// ```
489func (x *InlineViewSwitcher) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
490
491 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
492
493}
494
495// Updates an array of accessible relations.
496//
497// This function should be called by `GtkWidget` types whenever an accessible
498// relation change must be communicated to assistive technologies.
499//
500// This function is meant to be used by language bindings.
501func (x *InlineViewSwitcher) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
502
503 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
504
505}
506
507// Updates a list of accessible states.
508//
509// See the [enum@Gtk.AccessibleState] documentation for the
510// value types of accessible states.
511//
512// This function should be called by `GtkWidget` types whenever
513// an accessible state change must be communicated to assistive
514// technologies.
515//
516// Example:
517//
518// ```c
519// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
520// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
521//
522// GTK_ACCESSIBLE_STATE_CHECKED, value,
523// -1);
524//
525// ```
526func (x *InlineViewSwitcher) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
527
528 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
529
530}
531
532// Updates an array of accessible states.
533//
534// This function should be called by `GtkWidget` types whenever an accessible
535// state change must be communicated to assistive technologies.
536//
537// This function is meant to be used by language bindings.
538func (x *InlineViewSwitcher) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
539
540 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
541
542}
543
544// Gets the ID of the @buildable object.
545//
546// `GtkBuilder` sets the name based on the ID attribute
547// of the `<object>` tag used to construct the @buildable.
548func (x *InlineViewSwitcher) GetBuildableId() string {
549
550 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
551 return cret
552}
553
554// Retrieves the orientation of the @orientable.
555func (x *InlineViewSwitcher) GetOrientation() gtk.Orientation {
556
557 cret := gtk.XGtkOrientableGetOrientation(x.GoPointer())
558 return cret
559}
560
561// Sets the orientation of the @orientable.
562func (x *InlineViewSwitcher) SetOrientation(OrientationVar gtk.Orientation) {
563
564 gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
565
566}
567
568func init() {
569 core.SetPackageName("ADW", "libadwaita-1")
570 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
571 var libs []uintptr
572 for _, libPath := range core.GetPaths("ADW") {
573 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
574 if err != nil {
575 panic(err)
576 }
577 libs = append(libs, lib)
578 }
579
580 core.PuregoSafeRegister(&xInlineViewSwitcherDisplayModeGLibType, libs, "adw_inline_view_switcher_display_mode_get_type")
581
582 core.PuregoSafeRegister(&xInlineViewSwitcherGLibType, libs, "adw_inline_view_switcher_get_type")
583
584 core.PuregoSafeRegister(&xNewInlineViewSwitcher, libs, "adw_inline_view_switcher_new")
585
586 core.PuregoSafeRegister(&xInlineViewSwitcherGetCanShrink, libs, "adw_inline_view_switcher_get_can_shrink")
587 core.PuregoSafeRegister(&xInlineViewSwitcherGetDisplayMode, libs, "adw_inline_view_switcher_get_display_mode")
588 core.PuregoSafeRegister(&xInlineViewSwitcherGetHomogeneous, libs, "adw_inline_view_switcher_get_homogeneous")
589 core.PuregoSafeRegister(&xInlineViewSwitcherGetStack, libs, "adw_inline_view_switcher_get_stack")
590 core.PuregoSafeRegister(&xInlineViewSwitcherSetCanShrink, libs, "adw_inline_view_switcher_set_can_shrink")
591 core.PuregoSafeRegister(&xInlineViewSwitcherSetDisplayMode, libs, "adw_inline_view_switcher_set_display_mode")
592 core.PuregoSafeRegister(&xInlineViewSwitcherSetHomogeneous, libs, "adw_inline_view_switcher_set_homogeneous")
593 core.PuregoSafeRegister(&xInlineViewSwitcherSetStack, libs, "adw_inline_view_switcher_set_stack")
594
595}