1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
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/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14)
15
16type CheckButtonClass struct {
17 _ structs.HostLayout
18
19 ParentClass WidgetClass
20
21 xToggled uintptr
22
23 xActivate uintptr
24
25 Padding [7]uintptr
26}
27
28func (x *CheckButtonClass) GoPointer() uintptr {
29 return uintptr(unsafe.Pointer(x))
30}
31
32// OverrideToggled sets the "toggled" callback function.
33func (x *CheckButtonClass) OverrideToggled(cb func(*CheckButton)) {
34 if cb == nil {
35 x.xToggled = 0
36 } else {
37 x.xToggled = purego.NewCallback(func(CheckButtonVarp uintptr) {
38 cb(CheckButtonNewFromInternalPtr(CheckButtonVarp))
39 })
40 }
41}
42
43// GetToggled gets the "toggled" callback function.
44func (x *CheckButtonClass) GetToggled() func(*CheckButton) {
45 if x.xToggled == 0 {
46 return nil
47 }
48 var rawCallback func(CheckButtonVarp uintptr)
49 purego.RegisterFunc(&rawCallback, x.xToggled)
50 return func(CheckButtonVar *CheckButton) {
51 rawCallback(CheckButtonVar.GoPointer())
52 }
53}
54
55// OverrideActivate sets the "activate" callback function.
56func (x *CheckButtonClass) OverrideActivate(cb func(*CheckButton)) {
57 if cb == nil {
58 x.xActivate = 0
59 } else {
60 x.xActivate = purego.NewCallback(func(CheckButtonVarp uintptr) {
61 cb(CheckButtonNewFromInternalPtr(CheckButtonVarp))
62 })
63 }
64}
65
66// GetActivate gets the "activate" callback function.
67func (x *CheckButtonClass) GetActivate() func(*CheckButton) {
68 if x.xActivate == 0 {
69 return nil
70 }
71 var rawCallback func(CheckButtonVarp uintptr)
72 purego.RegisterFunc(&rawCallback, x.xActivate)
73 return func(CheckButtonVar *CheckButton) {
74 rawCallback(CheckButtonVar.GoPointer())
75 }
76}
77
78// Places a label next to an indicator.
79//
80// <picture>
81//
82// <source srcset="check-button-dark.png" media="(prefers-color-scheme: dark)">
83// <img alt="Example GtkCheckButtons" src="check-button.png">
84//
85// </picture>
86//
87// A `GtkCheckButton` is created by calling either [ctor@Gtk.CheckButton.new]
88// or [ctor@Gtk.CheckButton.new_with_label].
89//
90// The state of a `GtkCheckButton` can be set specifically using
91// [method@Gtk.CheckButton.set_active], and retrieved using
92// [method@Gtk.CheckButton.get_active].
93//
94// # Inconsistent state
95//
96// In addition to "on" and "off", check buttons can be an
97// "in between" state that is neither on nor off. This can be used
98// e.g. when the user has selected a range of elements (such as some
99// text or spreadsheet cells) that are affected by a check button,
100// and the current values in that range are inconsistent.
101//
102// To set a `GtkCheckButton` to inconsistent state, use
103// [method@Gtk.CheckButton.set_inconsistent].
104//
105// # Grouping
106//
107// Check buttons can be grouped together, to form mutually exclusive
108// groups - only one of the buttons can be toggled at a time, and toggling
109// another one will switch the currently toggled one off.
110//
111// Grouped check buttons use a different indicator, and are commonly referred
112// to as *radio buttons*.
113//
114// <picture>
115//
116// <source srcset="radio-button-dark.png" media="(prefers-color-scheme: dark)">
117// <img alt="Example GtkRadioButtons" src="radio-button.png">
118//
119// </picture>
120//
121// To add a `GtkCheckButton` to a group, use [method@Gtk.CheckButton.set_group].
122//
123// When the code must keep track of the state of a group of radio buttons, it
124// is recommended to keep track of such state through a stateful
125// `GAction` with a target for each button. Using the `toggled` signals to keep
126// track of the group changes and state is discouraged.
127//
128// # Shortcuts and Gestures
129//
130// `GtkCheckButton` supports the following keyboard shortcuts:
131//
132// - <kbd>␣</kbd> or <kbd>Enter</kbd> activates the button.
133//
134// # CSS nodes
135//
136// ```
137// checkbutton[.text-button][.grouped]
138// ├── check
139// ╰── [label]
140// ```
141//
142// A `GtkCheckButton` has a main node with name checkbutton. If the
143// [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child]
144// properties are set, it contains a child widget. The indicator node
145// is named check when no group is set, and radio if the checkbutton
146// is grouped together with other checkbuttons.
147//
148// # Accessibility
149//
150// `GtkCheckButton` uses the [enum@Gtk.AccessibleRole.checkbox] role.
151type CheckButton struct {
152 Widget
153}
154
155var xCheckButtonGLibType func() types.GType
156
157func CheckButtonGLibType() types.GType {
158 return xCheckButtonGLibType()
159}
160
161func CheckButtonNewFromInternalPtr(ptr uintptr) *CheckButton {
162 cls := &CheckButton{}
163 cls.Ptr = ptr
164 return cls
165}
166
167var xNewCheckButton func() uintptr
168
169// Creates a new `GtkCheckButton`.
170func NewCheckButton() *CheckButton {
171 var cls *CheckButton
172
173 cret := xNewCheckButton()
174
175 if cret == 0 {
176 return nil
177 }
178 gobject.IncreaseRef(cret)
179 cls = &CheckButton{}
180 cls.Ptr = cret
181 return cls
182}
183
184var xNewCheckButtonWithLabel func(uintptr) uintptr
185
186// Creates a new `GtkCheckButton` with the given text.
187func NewCheckButtonWithLabel(LabelVar *string) *CheckButton {
188 var cls *CheckButton
189
190 LabelVarPtr := core.GStrdupNullable(LabelVar)
191 defer core.GFreeNullable(LabelVarPtr)
192
193 cret := xNewCheckButtonWithLabel(LabelVarPtr)
194
195 if cret == 0 {
196 return nil
197 }
198 gobject.IncreaseRef(cret)
199 cls = &CheckButton{}
200 cls.Ptr = cret
201 return cls
202}
203
204var xNewCheckButtonWithMnemonic func(uintptr) uintptr
205
206// Creates a new `GtkCheckButton` with the given text and a mnemonic.
207func NewCheckButtonWithMnemonic(LabelVar *string) *CheckButton {
208 var cls *CheckButton
209
210 LabelVarPtr := core.GStrdupNullable(LabelVar)
211 defer core.GFreeNullable(LabelVarPtr)
212
213 cret := xNewCheckButtonWithMnemonic(LabelVarPtr)
214
215 if cret == 0 {
216 return nil
217 }
218 gobject.IncreaseRef(cret)
219 cls = &CheckButton{}
220 cls.Ptr = cret
221 return cls
222}
223
224var xCheckButtonGetActive func(uintptr) bool
225
226// Returns whether the check button is active.
227func (x *CheckButton) GetActive() bool {
228
229 cret := xCheckButtonGetActive(x.GoPointer())
230 return cret
231}
232
233var xCheckButtonGetChild func(uintptr) uintptr
234
235// Gets the child widget of @button or `NULL` if [property@CheckButton:label] is set.
236func (x *CheckButton) GetChild() *Widget {
237 var cls *Widget
238
239 cret := xCheckButtonGetChild(x.GoPointer())
240
241 if cret == 0 {
242 return nil
243 }
244 gobject.IncreaseRef(cret)
245 cls = &Widget{}
246 cls.Ptr = cret
247 return cls
248}
249
250var xCheckButtonGetInconsistent func(uintptr) bool
251
252// Returns whether the check button is in an inconsistent state.
253func (x *CheckButton) GetInconsistent() bool {
254
255 cret := xCheckButtonGetInconsistent(x.GoPointer())
256 return cret
257}
258
259var xCheckButtonGetLabel func(uintptr) string
260
261// Returns the label of the check button or `NULL` if [property@CheckButton:child] is set.
262func (x *CheckButton) GetLabel() string {
263
264 cret := xCheckButtonGetLabel(x.GoPointer())
265 return cret
266}
267
268var xCheckButtonGetUseUnderline func(uintptr) bool
269
270// Returns whether underlines in the label indicate mnemonics.
271func (x *CheckButton) GetUseUnderline() bool {
272
273 cret := xCheckButtonGetUseUnderline(x.GoPointer())
274 return cret
275}
276
277var xCheckButtonSetActive func(uintptr, bool)
278
279// Changes the check buttons active state.
280func (x *CheckButton) SetActive(SettingVar bool) {
281
282 xCheckButtonSetActive(x.GoPointer(), SettingVar)
283
284}
285
286var xCheckButtonSetChild func(uintptr, uintptr)
287
288// Sets the child widget of @button.
289//
290// Note that by using this API, you take full responsibility for setting
291// up the proper accessibility label and description information for @button.
292// Most likely, you'll either set the accessibility label or description
293// for @button explicitly, or you'll set a labelled-by or described-by
294// relations from @child to @button.
295func (x *CheckButton) SetChild(ChildVar *Widget) {
296
297 xCheckButtonSetChild(x.GoPointer(), ChildVar.GoPointer())
298
299}
300
301var xCheckButtonSetGroup func(uintptr, uintptr)
302
303// Adds @self to the group of @group.
304//
305// In a group of multiple check buttons, only one button can be active
306// at a time. The behavior of a checkbutton in a group is also commonly
307// known as a *radio button*.
308//
309// Setting the group of a check button also changes the css name of the
310// indicator widget's CSS node to 'radio'.
311//
312// Setting up groups in a cycle leads to undefined behavior.
313//
314// Note that the same effect can be achieved via the [iface@Gtk.Actionable]
315// API, by using the same action with parameter type and state type 's'
316// for all buttons in the group, and giving each button its own target
317// value.
318func (x *CheckButton) SetGroup(GroupVar *CheckButton) {
319
320 xCheckButtonSetGroup(x.GoPointer(), GroupVar.GoPointer())
321
322}
323
324var xCheckButtonSetInconsistent func(uintptr, bool)
325
326// Sets the `GtkCheckButton` to inconsistent state.
327//
328// You should turn off the inconsistent state again if the user checks
329// the check button. This has to be done manually.
330func (x *CheckButton) SetInconsistent(InconsistentVar bool) {
331
332 xCheckButtonSetInconsistent(x.GoPointer(), InconsistentVar)
333
334}
335
336var xCheckButtonSetLabel func(uintptr, uintptr)
337
338// Sets the text of @self.
339//
340// If [property@Gtk.CheckButton:use-underline] is %TRUE, an underscore
341// in @label is interpreted as mnemonic indicator, see
342// [method@Gtk.CheckButton.set_use_underline] for details on this behavior.
343func (x *CheckButton) SetLabel(LabelVar *string) {
344
345 LabelVarPtr := core.GStrdupNullable(LabelVar)
346 defer core.GFreeNullable(LabelVarPtr)
347
348 xCheckButtonSetLabel(x.GoPointer(), LabelVarPtr)
349
350}
351
352var xCheckButtonSetUseUnderline func(uintptr, bool)
353
354// Sets whether underlines in the label indicate mnemonics.
355//
356// If @setting is %TRUE, an underscore character in @self's label
357// indicates a mnemonic accelerator key. This behavior is similar
358// to [property@Gtk.Label:use-underline].
359func (x *CheckButton) SetUseUnderline(SettingVar bool) {
360
361 xCheckButtonSetUseUnderline(x.GoPointer(), SettingVar)
362
363}
364
365func (c *CheckButton) GoPointer() uintptr {
366 if c == nil {
367 return 0
368 }
369 return c.Ptr
370}
371
372func (c *CheckButton) SetGoPointer(ptr uintptr) {
373 c.Ptr = ptr
374}
375
376// SetPropertyActive sets the "active" property.
377// If the check button is active.
378//
379// Setting `active` to %TRUE will add the `:checked:` state to both
380// the check button and the indicator CSS node.
381func (x *CheckButton) SetPropertyActive(value bool) {
382 var v gobject.Value
383 v.Init(gobject.TypeBooleanVal)
384 v.SetBoolean(value)
385 x.SetProperty("active", &v)
386}
387
388// GetPropertyActive gets the "active" property.
389// If the check button is active.
390//
391// Setting `active` to %TRUE will add the `:checked:` state to both
392// the check button and the indicator CSS node.
393func (x *CheckButton) GetPropertyActive() bool {
394 var v gobject.Value
395 x.GetProperty("active", &v)
396 return v.GetBoolean()
397}
398
399// SetPropertyInconsistent sets the "inconsistent" property.
400// If the check button is in an “in between” state.
401//
402// The inconsistent state only affects visual appearance,
403// not the semantics of the button.
404func (x *CheckButton) SetPropertyInconsistent(value bool) {
405 var v gobject.Value
406 v.Init(gobject.TypeBooleanVal)
407 v.SetBoolean(value)
408 x.SetProperty("inconsistent", &v)
409}
410
411// GetPropertyInconsistent gets the "inconsistent" property.
412// If the check button is in an “in between” state.
413//
414// The inconsistent state only affects visual appearance,
415// not the semantics of the button.
416func (x *CheckButton) GetPropertyInconsistent() bool {
417 var v gobject.Value
418 x.GetProperty("inconsistent", &v)
419 return v.GetBoolean()
420}
421
422// SetPropertyLabel sets the "label" property.
423// Text of the label inside the check button, if it contains a label widget.
424func (x *CheckButton) SetPropertyLabel(value string) {
425 var v gobject.Value
426 v.Init(gobject.TypeStringVal)
427 v.SetString(&value)
428 x.SetProperty("label", &v)
429}
430
431// GetPropertyLabel gets the "label" property.
432// Text of the label inside the check button, if it contains a label widget.
433func (x *CheckButton) GetPropertyLabel() string {
434 var v gobject.Value
435 x.GetProperty("label", &v)
436 return v.GetString()
437}
438
439// SetPropertyUseUnderline sets the "use-underline" property.
440// If set, an underline in the text indicates that the following
441// character is to be used as mnemonic.
442func (x *CheckButton) SetPropertyUseUnderline(value bool) {
443 var v gobject.Value
444 v.Init(gobject.TypeBooleanVal)
445 v.SetBoolean(value)
446 x.SetProperty("use-underline", &v)
447}
448
449// GetPropertyUseUnderline gets the "use-underline" property.
450// If set, an underline in the text indicates that the following
451// character is to be used as mnemonic.
452func (x *CheckButton) GetPropertyUseUnderline() bool {
453 var v gobject.Value
454 x.GetProperty("use-underline", &v)
455 return v.GetBoolean()
456}
457
458// Emitted to when the check button is activated.
459//
460// The `::activate` signal on `GtkCheckButton` is an action signal and
461// emitting it causes the button to animate press then release.
462//
463// Applications should never connect to this signal, but use the
464// [signal@Gtk.CheckButton::toggled] signal.
465//
466// The default bindings for this signal are all forms of the
467// <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
468func (x *CheckButton) ConnectActivate(cb *func(CheckButton)) uint {
469 cbPtr := uintptr(unsafe.Pointer(cb))
470 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
471 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
472 glib.SaveHandlerMapping(handlerID, cbPtr)
473 return handlerID
474 }
475
476 fcb := func(clsPtr uintptr) {
477 fa := CheckButton{}
478 fa.Ptr = clsPtr
479 cbFn := *cb
480
481 cbFn(fa)
482
483 }
484 cbRefPtr := purego.NewCallback(fcb)
485 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
486 handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
487 glib.SaveHandlerMapping(handlerID, cbPtr)
488 return handlerID
489}
490
491// Emitted when the buttons's [property@Gtk.CheckButton:active]
492// property changes.
493func (x *CheckButton) ConnectToggled(cb *func(CheckButton)) uint {
494 cbPtr := uintptr(unsafe.Pointer(cb))
495 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
496 handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
497 glib.SaveHandlerMapping(handlerID, cbPtr)
498 return handlerID
499 }
500
501 fcb := func(clsPtr uintptr) {
502 fa := CheckButton{}
503 fa.Ptr = clsPtr
504 cbFn := *cb
505
506 cbFn(fa)
507
508 }
509 cbRefPtr := purego.NewCallback(fcb)
510 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
511 handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
512 glib.SaveHandlerMapping(handlerID, cbPtr)
513 return handlerID
514}
515
516// Requests the user's screen reader to announce the given message.
517//
518// This kind of notification is useful for messages that
519// either have only a visual representation or that are not
520// exposed visually at all, e.g. a notification about a
521// successful operation.
522//
523// Also, by using this API, you can ensure that the message
524// does not interrupts the user's current screen reader output.
525func (x *CheckButton) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
526
527 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
528
529}
530
531// Retrieves the accessible parent for an accessible object.
532//
533// This function returns `NULL` for top level widgets.
534func (x *CheckButton) GetAccessibleParent() *AccessibleBase {
535 var cls *AccessibleBase
536
537 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
538
539 if cret == 0 {
540 return nil
541 }
542 cls = &AccessibleBase{}
543 cls.Ptr = cret
544 return cls
545}
546
547// Retrieves the accessible role of an accessible object.
548func (x *CheckButton) GetAccessibleRole() AccessibleRole {
549
550 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
551 return cret
552}
553
554// Retrieves the implementation for the given accessible object.
555func (x *CheckButton) GetAtContext() *ATContext {
556 var cls *ATContext
557
558 cret := XGtkAccessibleGetAtContext(x.GoPointer())
559
560 if cret == 0 {
561 return nil
562 }
563 cls = &ATContext{}
564 cls.Ptr = cret
565 return cls
566}
567
568// Queries the coordinates and dimensions of this accessible
569//
570// This functionality can be overridden by `GtkAccessible`
571// implementations, e.g. to get the bounds from an ignored
572// child widget.
573func (x *CheckButton) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
574
575 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
576 return cret
577}
578
579// Retrieves the first accessible child of an accessible object.
580func (x *CheckButton) GetFirstAccessibleChild() *AccessibleBase {
581 var cls *AccessibleBase
582
583 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
584
585 if cret == 0 {
586 return nil
587 }
588 cls = &AccessibleBase{}
589 cls.Ptr = cret
590 return cls
591}
592
593// Retrieves the next accessible sibling of an accessible object
594func (x *CheckButton) GetNextAccessibleSibling() *AccessibleBase {
595 var cls *AccessibleBase
596
597 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
598
599 if cret == 0 {
600 return nil
601 }
602 cls = &AccessibleBase{}
603 cls.Ptr = cret
604 return cls
605}
606
607// Queries a platform state, such as focus.
608//
609// This functionality can be overridden by `GtkAccessible`
610// implementations, e.g. to get platform state from an ignored
611// child widget, as is the case for `GtkText` wrappers.
612func (x *CheckButton) GetPlatformState(StateVar AccessiblePlatformState) bool {
613
614 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
615 return cret
616}
617
618// Resets the accessible property to its default value.
619func (x *CheckButton) ResetProperty(PropertyVar AccessibleProperty) {
620
621 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
622
623}
624
625// Resets the accessible relation to its default value.
626func (x *CheckButton) ResetRelation(RelationVar AccessibleRelation) {
627
628 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
629
630}
631
632// Resets the accessible state to its default value.
633func (x *CheckButton) ResetState(StateVar AccessibleState) {
634
635 XGtkAccessibleResetState(x.GoPointer(), StateVar)
636
637}
638
639// Sets the parent and sibling of an accessible object.
640//
641// This function is meant to be used by accessible implementations that are
642// not part of the widget hierarchy, and but act as a logical bridge between
643// widgets. For instance, if a widget creates an object that holds metadata
644// for each child, and you want that object to implement the `GtkAccessible`
645// interface, you will use this function to ensure that the parent of each
646// child widget is the metadata object, and the parent of each metadata
647// object is the container widget.
648func (x *CheckButton) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
649
650 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
651
652}
653
654// Updates the next accessible sibling.
655//
656// That might be useful when a new child of a custom accessible
657// is created, and it needs to be linked to a previous child.
658func (x *CheckButton) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
659
660 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
661
662}
663
664// Informs ATs that the platform state has changed.
665//
666// This function should be used by `GtkAccessible` implementations that
667// have a platform state but are not widgets. Widgets handle platform
668// states automatically.
669func (x *CheckButton) UpdatePlatformState(StateVar AccessiblePlatformState) {
670
671 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
672
673}
674
675// Updates a list of accessible properties.
676//
677// See the [enum@Gtk.AccessibleProperty] documentation for the
678// value types of accessible properties.
679//
680// This function should be called by `GtkWidget` types whenever
681// an accessible property change must be communicated to assistive
682// technologies.
683//
684// Example:
685// ```c
686// value = gtk_adjustment_get_value (adjustment);
687// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
688//
689// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
690// -1);
691//
692// ```
693func (x *CheckButton) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
694
695 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
696
697}
698
699// Updates an array of accessible properties.
700//
701// This function should be called by `GtkWidget` types whenever an accessible
702// property change must be communicated to assistive technologies.
703//
704// This function is meant to be used by language bindings.
705func (x *CheckButton) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
706
707 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
708
709}
710
711// Updates a list of accessible relations.
712//
713// This function should be called by `GtkWidget` types whenever an accessible
714// relation change must be communicated to assistive technologies.
715//
716// If the [enum@Gtk.AccessibleRelation] requires a list of references,
717// you should pass each reference individually, followed by `NULL`, e.g.
718//
719// ```c
720// gtk_accessible_update_relation (accessible,
721//
722// GTK_ACCESSIBLE_RELATION_CONTROLS,
723// ref1, NULL,
724// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
725// ref1, ref2, ref3, NULL,
726// -1);
727//
728// ```
729func (x *CheckButton) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
730
731 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
732
733}
734
735// Updates an array of accessible relations.
736//
737// This function should be called by `GtkWidget` types whenever an accessible
738// relation change must be communicated to assistive technologies.
739//
740// This function is meant to be used by language bindings.
741func (x *CheckButton) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
742
743 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
744
745}
746
747// Updates a list of accessible states.
748//
749// See the [enum@Gtk.AccessibleState] documentation for the
750// value types of accessible states.
751//
752// This function should be called by `GtkWidget` types whenever
753// an accessible state change must be communicated to assistive
754// technologies.
755//
756// Example:
757//
758// ```c
759// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
760// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
761//
762// GTK_ACCESSIBLE_STATE_CHECKED, value,
763// -1);
764//
765// ```
766func (x *CheckButton) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
767
768 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
769
770}
771
772// Updates an array of accessible states.
773//
774// This function should be called by `GtkWidget` types whenever an accessible
775// state change must be communicated to assistive technologies.
776//
777// This function is meant to be used by language bindings.
778func (x *CheckButton) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
779
780 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
781
782}
783
784// Gets the action name for @actionable.
785func (x *CheckButton) GetActionName() string {
786
787 cret := XGtkActionableGetActionName(x.GoPointer())
788 return cret
789}
790
791// Gets the current target value of @actionable.
792func (x *CheckButton) GetActionTargetValue() *glib.Variant {
793
794 cret := XGtkActionableGetActionTargetValue(x.GoPointer())
795 return cret
796}
797
798// Specifies the name of the action with which this widget should be
799// associated.
800//
801// If @action_name is %NULL then the widget will be unassociated from
802// any previous action.
803//
804// Usually this function is used when the widget is located (or will be
805// located) within the hierarchy of a `GtkApplicationWindow`.
806//
807// Names are of the form “win.save” or “app.quit” for actions on the
808// containing [class@ApplicationWindow] or its associated [class@Application],
809// respectively. This is the same form used for actions in the [class@Gio.Menu]
810// associated with the window.
811func (x *CheckButton) SetActionName(ActionNameVar *string) {
812
813 ActionNameVarPtr := core.GStrdupNullable(ActionNameVar)
814 defer core.GFreeNullable(ActionNameVarPtr)
815
816 XGtkActionableSetActionName(x.GoPointer(), ActionNameVarPtr)
817
818}
819
820// Sets the target of an actionable widget.
821//
822// This is a convenience function that calls [ctor@GLib.Variant.new] for
823// @format_string and uses the result to call
824// [method@Gtk.Actionable.set_action_target_value].
825//
826// If you are setting a string-valued target and want to set
827// the action name at the same time, you can use
828// [method@Gtk.Actionable.set_detailed_action_name].
829func (x *CheckButton) SetActionTarget(FormatStringVar string, varArgs ...interface{}) {
830
831 XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...)
832
833}
834
835// Sets the target value of an actionable widget.
836//
837// If @target_value is %NULL then the target value is unset.
838//
839// The target value has two purposes. First, it is used as the parameter
840// to activation of the action associated with the `GtkActionable` widget.
841// Second, it is used to determine if the widget should be rendered as
842// “active” — the widget is active if the state is equal to the given target.
843//
844// Consider the example of associating a set of buttons with a [iface@Gio.Action]
845// with string state in a typical “radio button” situation. Each button
846// will be associated with the same action, but with a different target
847// value for that action. Clicking on a particular button will activate
848// the action with the target of that button, which will typically cause
849// the action’s state to change to that value. Since the action’s state
850// is now equal to the target value of the button, the button will now
851// be rendered as active (and the other buttons, with different targets,
852// rendered inactive).
853func (x *CheckButton) SetActionTargetValue(TargetValueVar *glib.Variant) {
854
855 XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar)
856
857}
858
859// Sets the action-name and associated string target value of an
860// actionable widget.
861//
862// @detailed_action_name is a string in the format accepted by
863// [func@Gio.Action.parse_detailed_name].
864func (x *CheckButton) SetDetailedActionName(DetailedActionNameVar string) {
865
866 XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar)
867
868}
869
870// Gets the ID of the @buildable object.
871//
872// `GtkBuilder` sets the name based on the ID attribute
873// of the `<object>` tag used to construct the @buildable.
874func (x *CheckButton) GetBuildableId() string {
875
876 cret := XGtkBuildableGetBuildableId(x.GoPointer())
877 return cret
878}
879
880func init() {
881 core.SetPackageName("GTK", "gtk4")
882 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
883 var libs []uintptr
884 for _, libPath := range core.GetPaths("GTK") {
885 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
886 if err != nil {
887 panic(err)
888 }
889 libs = append(libs, lib)
890 }
891
892 core.PuregoSafeRegister(&xCheckButtonGLibType, libs, "gtk_check_button_get_type")
893
894 core.PuregoSafeRegister(&xNewCheckButton, libs, "gtk_check_button_new")
895 core.PuregoSafeRegister(&xNewCheckButtonWithLabel, libs, "gtk_check_button_new_with_label")
896 core.PuregoSafeRegister(&xNewCheckButtonWithMnemonic, libs, "gtk_check_button_new_with_mnemonic")
897
898 core.PuregoSafeRegister(&xCheckButtonGetActive, libs, "gtk_check_button_get_active")
899 core.PuregoSafeRegister(&xCheckButtonGetChild, libs, "gtk_check_button_get_child")
900 core.PuregoSafeRegister(&xCheckButtonGetInconsistent, libs, "gtk_check_button_get_inconsistent")
901 core.PuregoSafeRegister(&xCheckButtonGetLabel, libs, "gtk_check_button_get_label")
902 core.PuregoSafeRegister(&xCheckButtonGetUseUnderline, libs, "gtk_check_button_get_use_underline")
903 core.PuregoSafeRegister(&xCheckButtonSetActive, libs, "gtk_check_button_set_active")
904 core.PuregoSafeRegister(&xCheckButtonSetChild, libs, "gtk_check_button_set_child")
905 core.PuregoSafeRegister(&xCheckButtonSetGroup, libs, "gtk_check_button_set_group")
906 core.PuregoSafeRegister(&xCheckButtonSetInconsistent, libs, "gtk_check_button_set_inconsistent")
907 core.PuregoSafeRegister(&xCheckButtonSetLabel, libs, "gtk_check_button_set_label")
908 core.PuregoSafeRegister(&xCheckButtonSetUseUnderline, libs, "gtk_check_button_set_use_underline")
909
910}