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/glib"
13 "github.com/bnema/puregotk/v4/gobject"
14 "github.com/bnema/puregotk/v4/gobject/types"
15 "github.com/bnema/puregotk/v4/gtk"
16)
17
18type SplitButtonClass struct {
19 _ structs.HostLayout
20
21 ParentClass gtk.WidgetClass
22}
23
24func (x *SplitButtonClass) GoPointer() uintptr {
25 return uintptr(unsafe.Pointer(x))
26}
27
28// A combined button and dropdown widget.
29//
30// <picture>
31//
32// <source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)">
33// <img src="split-button.png" alt="split-button">
34//
35// </picture>
36//
37// `AdwSplitButton` is typically used to present a set of actions in a menu,
38// but allow access to one of them with a single click.
39//
40// The API is very similar to [class@Gtk.Button] and [class@Gtk.MenuButton], see
41// their documentation for details.
42//
43// ## CSS nodes
44//
45// ```
46// splitbutton[.image-button][.text-button]
47// ├── button
48// │ ╰── <content>
49// ├── separator
50// ╰── menubutton
51//
52// ╰── button.toggle
53// ╰── arrow
54//
55// ```
56//
57// `AdwSplitButton`'s CSS node is called `splitbutton`. It contains the css
58// nodes: `button`, `separator`, `menubutton`. See [class@Gtk.MenuButton]
59// documentation for the `menubutton` contents.
60//
61// The main CSS node will contain the `.image-button` or `.text-button` style
62// classes matching the button contents. The nested button nodes will never
63// contain them.
64//
65// ## Style classes
66//
67// `AdwSplitButton` can use some of the same style classes as [class@Gtk.Button]:
68//
69// - [`.suggested-action`](style-classes.html#suggested-action)
70// - [`.destructive-action`](style-classes.html#destructive-action)
71// - [`.flat`](style-classes.html#flat)
72// - [`.raised`](style-classes.html#raised)
73//
74// Other style classes, like `.pill`, cannot be used.
75//
76// ## Accessibility
77//
78// `AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
79type SplitButton struct {
80 gtk.Widget
81}
82
83var xSplitButtonGLibType func() types.GType
84
85func SplitButtonGLibType() types.GType {
86 return xSplitButtonGLibType()
87}
88
89func SplitButtonNewFromInternalPtr(ptr uintptr) *SplitButton {
90 cls := &SplitButton{}
91 cls.Ptr = ptr
92 return cls
93}
94
95var xNewSplitButton func() uintptr
96
97// Creates a new `AdwSplitButton`.
98func NewSplitButton() *SplitButton {
99 var cls *SplitButton
100
101 cret := xNewSplitButton()
102
103 if cret == 0 {
104 return nil
105 }
106 gobject.IncreaseRef(cret)
107 cls = &SplitButton{}
108 cls.Ptr = cret
109 return cls
110}
111
112var xSplitButtonGetCanShrink func(uintptr) bool
113
114// gets whether the button can be smaller than the natural size of its contents.
115func (x *SplitButton) GetCanShrink() bool {
116
117 cret := xSplitButtonGetCanShrink(x.GoPointer())
118 return cret
119}
120
121var xSplitButtonGetChild func(uintptr) uintptr
122
123// Gets the child widget.
124func (x *SplitButton) GetChild() *gtk.Widget {
125 var cls *gtk.Widget
126
127 cret := xSplitButtonGetChild(x.GoPointer())
128
129 if cret == 0 {
130 return nil
131 }
132 gobject.IncreaseRef(cret)
133 cls = >k.Widget{}
134 cls.Ptr = cret
135 return cls
136}
137
138var xSplitButtonGetDirection func(uintptr) gtk.ArrowType
139
140// Gets the direction in which the popup will be popped up.
141func (x *SplitButton) GetDirection() gtk.ArrowType {
142
143 cret := xSplitButtonGetDirection(x.GoPointer())
144 return cret
145}
146
147var xSplitButtonGetDropdownTooltip func(uintptr) string
148
149// Gets the tooltip of the dropdown button of @self.
150func (x *SplitButton) GetDropdownTooltip() string {
151
152 cret := xSplitButtonGetDropdownTooltip(x.GoPointer())
153 return cret
154}
155
156var xSplitButtonGetIconName func(uintptr) string
157
158// Gets the name of the icon used to automatically populate the button.
159func (x *SplitButton) GetIconName() string {
160
161 cret := xSplitButtonGetIconName(x.GoPointer())
162 return cret
163}
164
165var xSplitButtonGetLabel func(uintptr) string
166
167// Gets the label for @self.
168func (x *SplitButton) GetLabel() string {
169
170 cret := xSplitButtonGetLabel(x.GoPointer())
171 return cret
172}
173
174var xSplitButtonGetMenuModel func(uintptr) uintptr
175
176// Gets the menu model from which the popup will be created.
177func (x *SplitButton) GetMenuModel() *gio.MenuModel {
178 var cls *gio.MenuModel
179
180 cret := xSplitButtonGetMenuModel(x.GoPointer())
181
182 if cret == 0 {
183 return nil
184 }
185 gobject.IncreaseRef(cret)
186 cls = &gio.MenuModel{}
187 cls.Ptr = cret
188 return cls
189}
190
191var xSplitButtonGetPopover func(uintptr) uintptr
192
193// Gets the popover that will be popped up when the dropdown is clicked.
194func (x *SplitButton) GetPopover() *gtk.Popover {
195 var cls *gtk.Popover
196
197 cret := xSplitButtonGetPopover(x.GoPointer())
198
199 if cret == 0 {
200 return nil
201 }
202 gobject.IncreaseRef(cret)
203 cls = >k.Popover{}
204 cls.Ptr = cret
205 return cls
206}
207
208var xSplitButtonGetUseUnderline func(uintptr) bool
209
210// Gets whether an underline in the text indicates a mnemonic.
211func (x *SplitButton) GetUseUnderline() bool {
212
213 cret := xSplitButtonGetUseUnderline(x.GoPointer())
214 return cret
215}
216
217var xSplitButtonPopdown func(uintptr)
218
219// Dismisses the menu.
220func (x *SplitButton) Popdown() {
221
222 xSplitButtonPopdown(x.GoPointer())
223
224}
225
226var xSplitButtonPopup func(uintptr)
227
228// Pops up the menu.
229func (x *SplitButton) Popup() {
230
231 xSplitButtonPopup(x.GoPointer())
232
233}
234
235var xSplitButtonSetCanShrink func(uintptr, bool)
236
237// Sets whether the button can be smaller than the natural size of its contents.
238//
239// If set to `TRUE`, the label will ellipsize.
240//
241// See [method@Gtk.Button.set_can_shrink] and
242// [method@Gtk.MenuButton.set_can_shrink].
243func (x *SplitButton) SetCanShrink(CanShrinkVar bool) {
244
245 xSplitButtonSetCanShrink(x.GoPointer(), CanShrinkVar)
246
247}
248
249var xSplitButtonSetChild func(uintptr, uintptr)
250
251// Sets the child widget.
252//
253// Setting the child widget will set [property@SplitButton:label] and
254// [property@SplitButton:icon-name] to `NULL`.
255func (x *SplitButton) SetChild(ChildVar *gtk.Widget) {
256
257 xSplitButtonSetChild(x.GoPointer(), ChildVar.GoPointer())
258
259}
260
261var xSplitButtonSetDirection func(uintptr, gtk.ArrowType)
262
263// Sets the direction in which the popup will be popped up.
264//
265// The dropdown arrow icon will point at the same direction.
266//
267// If the does not fit in the available space in the given direction, GTK will
268// try its best to keep it inside the screen and fully visible.
269//
270// If you pass `GTK_ARROW_NONE`, it's equivalent to `GTK_ARROW_DOWN`.
271func (x *SplitButton) SetDirection(DirectionVar gtk.ArrowType) {
272
273 xSplitButtonSetDirection(x.GoPointer(), DirectionVar)
274
275}
276
277var xSplitButtonSetDropdownTooltip func(uintptr, string)
278
279// Sets the tooltip of the dropdown button of @self.
280//
281// The tooltip can be marked up with the Pango text markup language.
282func (x *SplitButton) SetDropdownTooltip(TooltipVar string) {
283
284 xSplitButtonSetDropdownTooltip(x.GoPointer(), TooltipVar)
285
286}
287
288var xSplitButtonSetIconName func(uintptr, string)
289
290// Sets the name of the icon used to automatically populate the button.
291//
292// Setting the icon name will set [property@SplitButton:label] and
293// [property@SplitButton:child] to `NULL`.
294func (x *SplitButton) SetIconName(IconNameVar string) {
295
296 xSplitButtonSetIconName(x.GoPointer(), IconNameVar)
297
298}
299
300var xSplitButtonSetLabel func(uintptr, string)
301
302// Sets the label for @self.
303//
304// Setting the label will set [property@SplitButton:icon-name] and
305// [property@SplitButton:child] to `NULL`.
306func (x *SplitButton) SetLabel(LabelVar string) {
307
308 xSplitButtonSetLabel(x.GoPointer(), LabelVar)
309
310}
311
312var xSplitButtonSetMenuModel func(uintptr, uintptr)
313
314// Sets the menu model from which the popup will be created.
315//
316// If the menu model is `NULL`, the dropdown is disabled.
317//
318// A [class@Gtk.Popover] will be created from the menu model with
319// [ctor@Gtk.PopoverMenu.new_from_model]. Actions will be connected as
320// documented for this function.
321//
322// If [property@SplitButton:popover] is already set, it will be dissociated from
323// the button, and the property is set to `NULL`.
324func (x *SplitButton) SetMenuModel(MenuModelVar *gio.MenuModel) {
325
326 xSplitButtonSetMenuModel(x.GoPointer(), MenuModelVar.GoPointer())
327
328}
329
330var xSplitButtonSetPopover func(uintptr, uintptr)
331
332// Sets the popover that will be popped up when the dropdown is clicked.
333//
334// If the popover is `NULL`, the dropdown is disabled.
335//
336// If [property@SplitButton:menu-model] is set, the menu model is dissociated
337// from the button, and the property is set to `NULL`.
338func (x *SplitButton) SetPopover(PopoverVar *gtk.Popover) {
339
340 xSplitButtonSetPopover(x.GoPointer(), PopoverVar.GoPointer())
341
342}
343
344var xSplitButtonSetUseUnderline func(uintptr, bool)
345
346// Sets whether an underline in the text indicates a mnemonic.
347//
348// See [property@SplitButton:label].
349func (x *SplitButton) SetUseUnderline(UseUnderlineVar bool) {
350
351 xSplitButtonSetUseUnderline(x.GoPointer(), UseUnderlineVar)
352
353}
354
355func (c *SplitButton) GoPointer() uintptr {
356 if c == nil {
357 return 0
358 }
359 return c.Ptr
360}
361
362func (c *SplitButton) SetGoPointer(ptr uintptr) {
363 c.Ptr = ptr
364}
365
366// SetPropertyCanShrink sets the "can-shrink" property.
367// Whether the button can be smaller than the natural size of its contents.
368//
369// If set to `TRUE`, the label will ellipsize.
370//
371// See [property@Gtk.Button:can-shrink] and
372// [property@Gtk.MenuButton:can-shrink].
373func (x *SplitButton) SetPropertyCanShrink(value bool) {
374 var v gobject.Value
375 v.Init(gobject.TypeBooleanVal)
376 v.SetBoolean(value)
377 x.SetProperty("can-shrink", &v)
378}
379
380// GetPropertyCanShrink gets the "can-shrink" property.
381// Whether the button can be smaller than the natural size of its contents.
382//
383// If set to `TRUE`, the label will ellipsize.
384//
385// See [property@Gtk.Button:can-shrink] and
386// [property@Gtk.MenuButton:can-shrink].
387func (x *SplitButton) GetPropertyCanShrink() bool {
388 var v gobject.Value
389 x.GetProperty("can-shrink", &v)
390 return v.GetBoolean()
391}
392
393// SetPropertyDropdownTooltip sets the "dropdown-tooltip" property.
394// The tooltip of the dropdown button.
395//
396// The tooltip can be marked up with the Pango text markup language.
397func (x *SplitButton) SetPropertyDropdownTooltip(value string) {
398 var v gobject.Value
399 v.Init(gobject.TypeStringVal)
400 v.SetString(&value)
401 x.SetProperty("dropdown-tooltip", &v)
402}
403
404// GetPropertyDropdownTooltip gets the "dropdown-tooltip" property.
405// The tooltip of the dropdown button.
406//
407// The tooltip can be marked up with the Pango text markup language.
408func (x *SplitButton) GetPropertyDropdownTooltip() string {
409 var v gobject.Value
410 x.GetProperty("dropdown-tooltip", &v)
411 return v.GetString()
412}
413
414// SetPropertyIconName sets the "icon-name" property.
415// The name of the icon used to automatically populate the button.
416//
417// Setting the icon name will set [property@SplitButton:label] and
418// [property@SplitButton:child] to `NULL`.
419func (x *SplitButton) SetPropertyIconName(value string) {
420 var v gobject.Value
421 v.Init(gobject.TypeStringVal)
422 v.SetString(&value)
423 x.SetProperty("icon-name", &v)
424}
425
426// GetPropertyIconName gets the "icon-name" property.
427// The name of the icon used to automatically populate the button.
428//
429// Setting the icon name will set [property@SplitButton:label] and
430// [property@SplitButton:child] to `NULL`.
431func (x *SplitButton) GetPropertyIconName() string {
432 var v gobject.Value
433 x.GetProperty("icon-name", &v)
434 return v.GetString()
435}
436
437// SetPropertyLabel sets the "label" property.
438// The label for the button.
439//
440// Setting the label will set [property@SplitButton:icon-name] and
441// [property@SplitButton:child] to `NULL`.
442func (x *SplitButton) SetPropertyLabel(value string) {
443 var v gobject.Value
444 v.Init(gobject.TypeStringVal)
445 v.SetString(&value)
446 x.SetProperty("label", &v)
447}
448
449// GetPropertyLabel gets the "label" property.
450// The label for the button.
451//
452// Setting the label will set [property@SplitButton:icon-name] and
453// [property@SplitButton:child] to `NULL`.
454func (x *SplitButton) GetPropertyLabel() string {
455 var v gobject.Value
456 x.GetProperty("label", &v)
457 return v.GetString()
458}
459
460// SetPropertyUseUnderline sets the "use-underline" property.
461// Whether an underline in the text indicates a mnemonic.
462//
463// See [property@SplitButton:label].
464func (x *SplitButton) SetPropertyUseUnderline(value bool) {
465 var v gobject.Value
466 v.Init(gobject.TypeBooleanVal)
467 v.SetBoolean(value)
468 x.SetProperty("use-underline", &v)
469}
470
471// GetPropertyUseUnderline gets the "use-underline" property.
472// Whether an underline in the text indicates a mnemonic.
473//
474// See [property@SplitButton:label].
475func (x *SplitButton) GetPropertyUseUnderline() bool {
476 var v gobject.Value
477 x.GetProperty("use-underline", &v)
478 return v.GetBoolean()
479}
480
481// Emitted to animate press then release.
482//
483// This is an action signal. Applications should never connect to this signal,
484// but use the [signal@SplitButton::clicked] signal.
485func (x *SplitButton) ConnectActivate(cb *func(SplitButton)) uint {
486 cbPtr := uintptr(unsafe.Pointer(cb))
487 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
488 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
489 glib.SaveHandlerMapping(handlerID, cbPtr)
490 return handlerID
491 }
492
493 fcb := func(clsPtr uintptr) {
494 fa := SplitButton{}
495 fa.Ptr = clsPtr
496 cbFn := *cb
497
498 cbFn(fa)
499
500 }
501 cbRefPtr := purego.NewCallback(fcb)
502 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
503 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
504 glib.SaveHandlerMapping(handlerID, cbPtr)
505 return handlerID
506}
507
508// Emitted when the button has been activated (pressed and released).
509func (x *SplitButton) ConnectClicked(cb *func(SplitButton)) uint {
510 cbPtr := uintptr(unsafe.Pointer(cb))
511 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
512 handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
513 glib.SaveHandlerMapping(handlerID, cbPtr)
514 return handlerID
515 }
516
517 fcb := func(clsPtr uintptr) {
518 fa := SplitButton{}
519 fa.Ptr = clsPtr
520 cbFn := *cb
521
522 cbFn(fa)
523
524 }
525 cbRefPtr := purego.NewCallback(fcb)
526 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
527 handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
528 glib.SaveHandlerMapping(handlerID, cbPtr)
529 return handlerID
530}
531
532// Requests the user's screen reader to announce the given message.
533//
534// This kind of notification is useful for messages that
535// either have only a visual representation or that are not
536// exposed visually at all, e.g. a notification about a
537// successful operation.
538//
539// Also, by using this API, you can ensure that the message
540// does not interrupts the user's current screen reader output.
541func (x *SplitButton) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
542
543 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
544
545}
546
547// Retrieves the accessible parent for an accessible object.
548//
549// This function returns `NULL` for top level widgets.
550func (x *SplitButton) GetAccessibleParent() *gtk.AccessibleBase {
551 var cls *gtk.AccessibleBase
552
553 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
554
555 if cret == 0 {
556 return nil
557 }
558 cls = >k.AccessibleBase{}
559 cls.Ptr = cret
560 return cls
561}
562
563// Retrieves the accessible role of an accessible object.
564func (x *SplitButton) GetAccessibleRole() gtk.AccessibleRole {
565
566 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
567 return cret
568}
569
570// Retrieves the implementation for the given accessible object.
571func (x *SplitButton) GetAtContext() *gtk.ATContext {
572 var cls *gtk.ATContext
573
574 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
575
576 if cret == 0 {
577 return nil
578 }
579 cls = >k.ATContext{}
580 cls.Ptr = cret
581 return cls
582}
583
584// Queries the coordinates and dimensions of this accessible
585//
586// This functionality can be overridden by `GtkAccessible`
587// implementations, e.g. to get the bounds from an ignored
588// child widget.
589func (x *SplitButton) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
590
591 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
592 return cret
593}
594
595// Retrieves the first accessible child of an accessible object.
596func (x *SplitButton) GetFirstAccessibleChild() *gtk.AccessibleBase {
597 var cls *gtk.AccessibleBase
598
599 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
600
601 if cret == 0 {
602 return nil
603 }
604 cls = >k.AccessibleBase{}
605 cls.Ptr = cret
606 return cls
607}
608
609// Retrieves the next accessible sibling of an accessible object
610func (x *SplitButton) GetNextAccessibleSibling() *gtk.AccessibleBase {
611 var cls *gtk.AccessibleBase
612
613 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
614
615 if cret == 0 {
616 return nil
617 }
618 cls = >k.AccessibleBase{}
619 cls.Ptr = cret
620 return cls
621}
622
623// Queries a platform state, such as focus.
624//
625// This functionality can be overridden by `GtkAccessible`
626// implementations, e.g. to get platform state from an ignored
627// child widget, as is the case for `GtkText` wrappers.
628func (x *SplitButton) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
629
630 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
631 return cret
632}
633
634// Resets the accessible property to its default value.
635func (x *SplitButton) ResetProperty(PropertyVar gtk.AccessibleProperty) {
636
637 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
638
639}
640
641// Resets the accessible relation to its default value.
642func (x *SplitButton) ResetRelation(RelationVar gtk.AccessibleRelation) {
643
644 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
645
646}
647
648// Resets the accessible state to its default value.
649func (x *SplitButton) ResetState(StateVar gtk.AccessibleState) {
650
651 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
652
653}
654
655// Sets the parent and sibling of an accessible object.
656//
657// This function is meant to be used by accessible implementations that are
658// not part of the widget hierarchy, and but act as a logical bridge between
659// widgets. For instance, if a widget creates an object that holds metadata
660// for each child, and you want that object to implement the `GtkAccessible`
661// interface, you will use this function to ensure that the parent of each
662// child widget is the metadata object, and the parent of each metadata
663// object is the container widget.
664func (x *SplitButton) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
665
666 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
667
668}
669
670// Updates the next accessible sibling.
671//
672// That might be useful when a new child of a custom accessible
673// is created, and it needs to be linked to a previous child.
674func (x *SplitButton) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
675
676 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
677
678}
679
680// Informs ATs that the platform state has changed.
681//
682// This function should be used by `GtkAccessible` implementations that
683// have a platform state but are not widgets. Widgets handle platform
684// states automatically.
685func (x *SplitButton) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
686
687 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
688
689}
690
691// Updates a list of accessible properties.
692//
693// See the [enum@Gtk.AccessibleProperty] documentation for the
694// value types of accessible properties.
695//
696// This function should be called by `GtkWidget` types whenever
697// an accessible property change must be communicated to assistive
698// technologies.
699//
700// Example:
701// ```c
702// value = gtk_adjustment_get_value (adjustment);
703// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
704//
705// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
706// -1);
707//
708// ```
709func (x *SplitButton) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
710
711 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
712
713}
714
715// Updates an array of accessible properties.
716//
717// This function should be called by `GtkWidget` types whenever an accessible
718// property change must be communicated to assistive technologies.
719//
720// This function is meant to be used by language bindings.
721func (x *SplitButton) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
722
723 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
724
725}
726
727// Updates a list of accessible relations.
728//
729// This function should be called by `GtkWidget` types whenever an accessible
730// relation change must be communicated to assistive technologies.
731//
732// If the [enum@Gtk.AccessibleRelation] requires a list of references,
733// you should pass each reference individually, followed by `NULL`, e.g.
734//
735// ```c
736// gtk_accessible_update_relation (accessible,
737//
738// GTK_ACCESSIBLE_RELATION_CONTROLS,
739// ref1, NULL,
740// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
741// ref1, ref2, ref3, NULL,
742// -1);
743//
744// ```
745func (x *SplitButton) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
746
747 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
748
749}
750
751// Updates an array of accessible relations.
752//
753// This function should be called by `GtkWidget` types whenever an accessible
754// relation change must be communicated to assistive technologies.
755//
756// This function is meant to be used by language bindings.
757func (x *SplitButton) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
758
759 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
760
761}
762
763// Updates a list of accessible states.
764//
765// See the [enum@Gtk.AccessibleState] documentation for the
766// value types of accessible states.
767//
768// This function should be called by `GtkWidget` types whenever
769// an accessible state change must be communicated to assistive
770// technologies.
771//
772// Example:
773//
774// ```c
775// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
776// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
777//
778// GTK_ACCESSIBLE_STATE_CHECKED, value,
779// -1);
780//
781// ```
782func (x *SplitButton) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
783
784 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
785
786}
787
788// Updates an array of accessible states.
789//
790// This function should be called by `GtkWidget` types whenever an accessible
791// state change must be communicated to assistive technologies.
792//
793// This function is meant to be used by language bindings.
794func (x *SplitButton) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
795
796 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
797
798}
799
800// Gets the action name for @actionable.
801func (x *SplitButton) GetActionName() string {
802
803 cret := gtk.XGtkActionableGetActionName(x.GoPointer())
804 return cret
805}
806
807// Gets the current target value of @actionable.
808func (x *SplitButton) GetActionTargetValue() *glib.Variant {
809
810 cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer())
811 return cret
812}
813
814// Specifies the name of the action with which this widget should be
815// associated.
816//
817// If @action_name is %NULL then the widget will be unassociated from
818// any previous action.
819//
820// Usually this function is used when the widget is located (or will be
821// located) within the hierarchy of a `GtkApplicationWindow`.
822//
823// Names are of the form “win.save” or “app.quit” for actions on the
824// containing [class@ApplicationWindow] or its associated [class@Application],
825// respectively. This is the same form used for actions in the [class@Gio.Menu]
826// associated with the window.
827func (x *SplitButton) SetActionName(ActionNameVar *string) {
828
829 ActionNameVarPtr := core.GStrdupNullable(ActionNameVar)
830 defer core.GFreeNullable(ActionNameVarPtr)
831
832 gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVarPtr)
833
834}
835
836// Sets the target of an actionable widget.
837//
838// This is a convenience function that calls [ctor@GLib.Variant.new] for
839// @format_string and uses the result to call
840// [method@Gtk.Actionable.set_action_target_value].
841//
842// If you are setting a string-valued target and want to set
843// the action name at the same time, you can use
844// [method@Gtk.Actionable.set_detailed_action_name].
845func (x *SplitButton) SetActionTarget(FormatStringVar string, varArgs ...interface{}) {
846
847 gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...)
848
849}
850
851// Sets the target value of an actionable widget.
852//
853// If @target_value is %NULL then the target value is unset.
854//
855// The target value has two purposes. First, it is used as the parameter
856// to activation of the action associated with the `GtkActionable` widget.
857// Second, it is used to determine if the widget should be rendered as
858// “active” — the widget is active if the state is equal to the given target.
859//
860// Consider the example of associating a set of buttons with a [iface@Gio.Action]
861// with string state in a typical “radio button” situation. Each button
862// will be associated with the same action, but with a different target
863// value for that action. Clicking on a particular button will activate
864// the action with the target of that button, which will typically cause
865// the action’s state to change to that value. Since the action’s state
866// is now equal to the target value of the button, the button will now
867// be rendered as active (and the other buttons, with different targets,
868// rendered inactive).
869func (x *SplitButton) SetActionTargetValue(TargetValueVar *glib.Variant) {
870
871 gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar)
872
873}
874
875// Sets the action-name and associated string target value of an
876// actionable widget.
877//
878// @detailed_action_name is a string in the format accepted by
879// [func@Gio.Action.parse_detailed_name].
880func (x *SplitButton) SetDetailedActionName(DetailedActionNameVar string) {
881
882 gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar)
883
884}
885
886// Gets the ID of the @buildable object.
887//
888// `GtkBuilder` sets the name based on the ID attribute
889// of the `<object>` tag used to construct the @buildable.
890func (x *SplitButton) GetBuildableId() string {
891
892 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
893 return cret
894}
895
896func init() {
897 core.SetPackageName("ADW", "libadwaita-1")
898 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
899 var libs []uintptr
900 for _, libPath := range core.GetPaths("ADW") {
901 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
902 if err != nil {
903 panic(err)
904 }
905 libs = append(libs, lib)
906 }
907
908 core.PuregoSafeRegister(&xSplitButtonGLibType, libs, "adw_split_button_get_type")
909
910 core.PuregoSafeRegister(&xNewSplitButton, libs, "adw_split_button_new")
911
912 core.PuregoSafeRegister(&xSplitButtonGetCanShrink, libs, "adw_split_button_get_can_shrink")
913 core.PuregoSafeRegister(&xSplitButtonGetChild, libs, "adw_split_button_get_child")
914 core.PuregoSafeRegister(&xSplitButtonGetDirection, libs, "adw_split_button_get_direction")
915 core.PuregoSafeRegister(&xSplitButtonGetDropdownTooltip, libs, "adw_split_button_get_dropdown_tooltip")
916 core.PuregoSafeRegister(&xSplitButtonGetIconName, libs, "adw_split_button_get_icon_name")
917 core.PuregoSafeRegister(&xSplitButtonGetLabel, libs, "adw_split_button_get_label")
918 core.PuregoSafeRegister(&xSplitButtonGetMenuModel, libs, "adw_split_button_get_menu_model")
919 core.PuregoSafeRegister(&xSplitButtonGetPopover, libs, "adw_split_button_get_popover")
920 core.PuregoSafeRegister(&xSplitButtonGetUseUnderline, libs, "adw_split_button_get_use_underline")
921 core.PuregoSafeRegister(&xSplitButtonPopdown, libs, "adw_split_button_popdown")
922 core.PuregoSafeRegister(&xSplitButtonPopup, libs, "adw_split_button_popup")
923 core.PuregoSafeRegister(&xSplitButtonSetCanShrink, libs, "adw_split_button_set_can_shrink")
924 core.PuregoSafeRegister(&xSplitButtonSetChild, libs, "adw_split_button_set_child")
925 core.PuregoSafeRegister(&xSplitButtonSetDirection, libs, "adw_split_button_set_direction")
926 core.PuregoSafeRegister(&xSplitButtonSetDropdownTooltip, libs, "adw_split_button_set_dropdown_tooltip")
927 core.PuregoSafeRegister(&xSplitButtonSetIconName, libs, "adw_split_button_set_icon_name")
928 core.PuregoSafeRegister(&xSplitButtonSetLabel, libs, "adw_split_button_set_label")
929 core.PuregoSafeRegister(&xSplitButtonSetMenuModel, libs, "adw_split_button_set_menu_model")
930 core.PuregoSafeRegister(&xSplitButtonSetPopover, libs, "adw_split_button_set_popover")
931 core.PuregoSafeRegister(&xSplitButtonSetUseUnderline, libs, "adw_split_button_set_use_underline")
932
933}