v0.2.2 9100209

adw-toggle-group.go RawHistoryFolder

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 ToggleClass struct {
17	_ structs.HostLayout
18
19	ParentClass gobject.ObjectClass
20}
21
22func (x *ToggleClass) GoPointer() uintptr {
23	return uintptr(unsafe.Pointer(x))
24}
25
26type ToggleGroupClass struct {
27	_ structs.HostLayout
28
29	ParentClass gtk.WidgetClass
30}
31
32func (x *ToggleGroupClass) GoPointer() uintptr {
33	return uintptr(unsafe.Pointer(x))
34}
35
36// A toggle within [class@ToggleGroup].
37//
38// `AdwToggle` can optionally have a name, set with [property@Toggle:name].
39// If the name is set, [property@ToggleGroup:active-name] can be used to access
40// toggles instead of index.
41type Toggle struct {
42	gobject.Object
43}
44
45var xToggleGLibType func() types.GType
46
47func ToggleGLibType() types.GType {
48	return xToggleGLibType()
49}
50
51func ToggleNewFromInternalPtr(ptr uintptr) *Toggle {
52	cls := &Toggle{}
53	cls.Ptr = ptr
54	return cls
55}
56
57var xNewToggle func() uintptr
58
59// Creates a new `AdwToggle`.
60func NewToggle() *Toggle {
61	var cls *Toggle
62
63	cret := xNewToggle()
64
65	if cret == 0 {
66		return nil
67	}
68	cls = &Toggle{}
69	cls.Ptr = cret
70	return cls
71}
72
73var xToggleGetChild func(uintptr) uintptr
74
75// Gets the child widget of @self.
76func (x *Toggle) GetChild() *gtk.Widget {
77	var cls *gtk.Widget
78
79	cret := xToggleGetChild(x.GoPointer())
80
81	if cret == 0 {
82		return nil
83	}
84	gobject.IncreaseRef(cret)
85	cls = &gtk.Widget{}
86	cls.Ptr = cret
87	return cls
88}
89
90var xToggleGetEnabled func(uintptr) bool
91
92// Gets whether @self is enabled.
93func (x *Toggle) GetEnabled() bool {
94
95	cret := xToggleGetEnabled(x.GoPointer())
96	return cret
97}
98
99var xToggleGetIconName func(uintptr) string
100
101// Gets the icon name of @self.
102func (x *Toggle) GetIconName() string {
103
104	cret := xToggleGetIconName(x.GoPointer())
105	return cret
106}
107
108var xToggleGetIndex func(uintptr) uint
109
110// Gets the index of @self within its toggle group.
111func (x *Toggle) GetIndex() uint {
112
113	cret := xToggleGetIndex(x.GoPointer())
114	return cret
115}
116
117var xToggleGetLabel func(uintptr) string
118
119// Gets the label of @self.
120func (x *Toggle) GetLabel() string {
121
122	cret := xToggleGetLabel(x.GoPointer())
123	return cret
124}
125
126var xToggleGetName func(uintptr) string
127
128// Gets the name of @self.
129func (x *Toggle) GetName() string {
130
131	cret := xToggleGetName(x.GoPointer())
132	return cret
133}
134
135var xToggleGetTooltip func(uintptr) string
136
137// Gets the tooltip of @self.
138func (x *Toggle) GetTooltip() string {
139
140	cret := xToggleGetTooltip(x.GoPointer())
141	return cret
142}
143
144var xToggleGetUseUnderline func(uintptr) bool
145
146// Gets whether @self uses underlines.
147func (x *Toggle) GetUseUnderline() bool {
148
149	cret := xToggleGetUseUnderline(x.GoPointer())
150	return cret
151}
152
153var xToggleSetChild func(uintptr, uintptr)
154
155// Sets the child of @self to @child.
156//
157// When the child is set, icon and label are not displayed.
158//
159// It's recommended to still set the label, as it can still be used by the
160// screen reader.
161func (x *Toggle) SetChild(ChildVar *gtk.Widget) {
162
163	xToggleSetChild(x.GoPointer(), ChildVar.GoPointer())
164
165}
166
167var xToggleSetEnabled func(uintptr, bool)
168
169// Sets whether @self is enabled.
170func (x *Toggle) SetEnabled(EnabledVar bool) {
171
172	xToggleSetEnabled(x.GoPointer(), EnabledVar)
173
174}
175
176var xToggleSetIconName func(uintptr, uintptr)
177
178// Sets the icon name of @self to @icon_name.
179//
180// The icon will be displayed alone or next to the label, unless
181// [property@Toggle:child] is set.
182func (x *Toggle) SetIconName(IconNameVar *string) {
183
184	IconNameVarPtr := core.GStrdupNullable(IconNameVar)
185	defer core.GFreeNullable(IconNameVarPtr)
186
187	xToggleSetIconName(x.GoPointer(), IconNameVarPtr)
188
189}
190
191var xToggleSetLabel func(uintptr, uintptr)
192
193// Sets the label of @self to @label.
194//
195// The label will be displayed alone or next to the icon, unless
196// [property@Toggle:child] is set, but will still be read out by the screen
197// reader.
198func (x *Toggle) SetLabel(LabelVar *string) {
199
200	LabelVarPtr := core.GStrdupNullable(LabelVar)
201	defer core.GFreeNullable(LabelVarPtr)
202
203	xToggleSetLabel(x.GoPointer(), LabelVarPtr)
204
205}
206
207var xToggleSetName func(uintptr, uintptr)
208
209// Sets the name of @self to @name.
210//
211// Allows accessing @self by its name instead of index.
212//
213// See [property@ToggleGroup:active-name].
214func (x *Toggle) SetName(NameVar *string) {
215
216	NameVarPtr := core.GStrdupNullable(NameVar)
217	defer core.GFreeNullable(NameVarPtr)
218
219	xToggleSetName(x.GoPointer(), NameVarPtr)
220
221}
222
223var xToggleSetTooltip func(uintptr, string)
224
225// Sets the tooltip of @self to @tooltip.
226//
227// @tooltip can be marked up with the Pango text markup language.
228func (x *Toggle) SetTooltip(TooltipVar string) {
229
230	xToggleSetTooltip(x.GoPointer(), TooltipVar)
231
232}
233
234var xToggleSetUseUnderline func(uintptr, bool)
235
236// Sets whether an embedded underline in the label indicates a mnemonic.
237//
238// See [property@Toggle:label].
239func (x *Toggle) SetUseUnderline(UseUnderlineVar bool) {
240
241	xToggleSetUseUnderline(x.GoPointer(), UseUnderlineVar)
242
243}
244
245func (c *Toggle) GoPointer() uintptr {
246	if c == nil {
247		return 0
248	}
249	return c.Ptr
250}
251
252func (c *Toggle) SetGoPointer(ptr uintptr) {
253	c.Ptr = ptr
254}
255
256// SetPropertyEnabled sets the "enabled" property.
257// Whether this toggle is enabled.
258func (x *Toggle) SetPropertyEnabled(value bool) {
259	var v gobject.Value
260	v.Init(gobject.TypeBooleanVal)
261	v.SetBoolean(value)
262	x.SetProperty("enabled", &v)
263}
264
265// GetPropertyEnabled gets the "enabled" property.
266// Whether this toggle is enabled.
267func (x *Toggle) GetPropertyEnabled() bool {
268	var v gobject.Value
269	x.GetProperty("enabled", &v)
270	return v.GetBoolean()
271}
272
273// SetPropertyIconName sets the "icon-name" property.
274// The toggle icon name.
275//
276// The icon will be displayed alone or next to the label, unless
277// [property@Toggle:child] is set.
278func (x *Toggle) SetPropertyIconName(value string) {
279	var v gobject.Value
280	v.Init(gobject.TypeStringVal)
281	v.SetString(&value)
282	x.SetProperty("icon-name", &v)
283}
284
285// GetPropertyIconName gets the "icon-name" property.
286// The toggle icon name.
287//
288// The icon will be displayed alone or next to the label, unless
289// [property@Toggle:child] is set.
290func (x *Toggle) GetPropertyIconName() string {
291	var v gobject.Value
292	x.GetProperty("icon-name", &v)
293	return v.GetString()
294}
295
296// SetPropertyLabel sets the "label" property.
297// The toggle label.
298//
299// The label will be displayed alone or next to the icon, unless
300// [property@Toggle:child] is set, but will still be read out by the screen
301// reader.
302func (x *Toggle) SetPropertyLabel(value string) {
303	var v gobject.Value
304	v.Init(gobject.TypeStringVal)
305	v.SetString(&value)
306	x.SetProperty("label", &v)
307}
308
309// GetPropertyLabel gets the "label" property.
310// The toggle label.
311//
312// The label will be displayed alone or next to the icon, unless
313// [property@Toggle:child] is set, but will still be read out by the screen
314// reader.
315func (x *Toggle) GetPropertyLabel() string {
316	var v gobject.Value
317	x.GetProperty("label", &v)
318	return v.GetString()
319}
320
321// SetPropertyName sets the "name" property.
322// The toggle name.
323//
324// Allows accessing the toggle by its name instead of index.
325//
326// See [property@ToggleGroup:active-name].
327func (x *Toggle) SetPropertyName(value string) {
328	var v gobject.Value
329	v.Init(gobject.TypeStringVal)
330	v.SetString(&value)
331	x.SetProperty("name", &v)
332}
333
334// GetPropertyName gets the "name" property.
335// The toggle name.
336//
337// Allows accessing the toggle by its name instead of index.
338//
339// See [property@ToggleGroup:active-name].
340func (x *Toggle) GetPropertyName() string {
341	var v gobject.Value
342	x.GetProperty("name", &v)
343	return v.GetString()
344}
345
346// SetPropertyTooltip sets the "tooltip" property.
347// The tooltip of the toggle.
348//
349// The tooltip can be marked up with the Pango text markup language.
350func (x *Toggle) SetPropertyTooltip(value string) {
351	var v gobject.Value
352	v.Init(gobject.TypeStringVal)
353	v.SetString(&value)
354	x.SetProperty("tooltip", &v)
355}
356
357// GetPropertyTooltip gets the "tooltip" property.
358// The tooltip of the toggle.
359//
360// The tooltip can be marked up with the Pango text markup language.
361func (x *Toggle) GetPropertyTooltip() string {
362	var v gobject.Value
363	x.GetProperty("tooltip", &v)
364	return v.GetString()
365}
366
367// SetPropertyUseUnderline sets the "use-underline" property.
368// Whether an embedded underline in the label indicates a mnemonic.
369//
370// See [property@Toggle:label].
371func (x *Toggle) SetPropertyUseUnderline(value bool) {
372	var v gobject.Value
373	v.Init(gobject.TypeBooleanVal)
374	v.SetBoolean(value)
375	x.SetProperty("use-underline", &v)
376}
377
378// GetPropertyUseUnderline gets the "use-underline" property.
379// Whether an embedded underline in the label indicates a mnemonic.
380//
381// See [property@Toggle:label].
382func (x *Toggle) GetPropertyUseUnderline() bool {
383	var v gobject.Value
384	x.GetProperty("use-underline", &v)
385	return v.GetBoolean()
386}
387
388// A group of exclusive toggles.
389//
390// <picture>
391//
392//	<source srcset="toggle-group-dark.png" media="(prefers-color-scheme: dark)">
393//	<img src="toggle-group.png" alt="toggle-group">
394//
395// </picture>
396//
397// `AdwToggleGroup` presents a set of exclusive toggles, represented as
398// [class@Toggle] objects. Each toggle can display an icon, a label, an icon
399// and a label, or a custom child.
400//
401// Toggles are indexed by their position, with the first toggle being equivalent
402// to 0, and so on. Use the [property@ToggleGroup:active] to get that position.
403//
404// Toggles can also have optional names, set via the [property@Toggle:name]
405// property. The name of the active toggle can be accessed via the
406// [property@ToggleGroup:active-name] property.
407//
408// `AdwToggle` objects can be retrieved via their index or name, using
409// [method@ToggleGroup.get_toggle] or [method@ToggleGroup.get_toggle_by_name]
410// respectively. `AdwToggleGroup` also provides a [iface@Gtk.SelectionModel] of
411// its toggles via the [property@ToggleGroup:toggles] property.
412//
413// `AdwToggleGroup` is orientable, and the toggles can be displayed horizontally
414// or vertically. This is mostly useful for icon-only toggles.
415//
416// Use the [property@ToggleGroup:homogeneous] property to make the toggles take
417// the same size, and the [property@ToggleGroup:can-shrink] to control whether
418// the toggles can ellipsize.
419//
420// Example of an `AdwToggleGroup` UI definition:
421//
422// ```xml
423//
424//	<object class="AdwToggleGroup">
425//	  <property name="active-name">picture</property>
426//	  <child>
427//	    <object class="AdwToggle">
428//	      <property name="icon-name">camera-photo-symbolic</property>
429//	      <property name="tooltip" translatable="yes">Picture Mode</property>
430//	      <property name="name">picture</property>
431//	    </object>
432//	  </child>
433//	  <child>
434//	    <object class="AdwToggle">
435//	      <property name="icon-name">camera-video-symbolic</property>
436//	      <property name="tooltip" translatable="yes">Recording Mode</property>
437//	      <property name="name">recording</property>
438//	    </object>
439//	  </child>
440//	</object>
441//
442// ```
443//
444// See also: [class@InlineViewSwitcher].
445//
446// ## CSS nodes
447//
448// `AdwToggleGroup` has a main CSS node with the name `toggle-group`.
449//
450// Its toggles have CSS nodes with the name `toggle`, and its separators have nodes
451// with the name `separator`.
452//
453// Toggle nodes will have a different style classes depending on their content:
454// `.text-button` for labels, `.image-button` for icons, `.image-text-button`
455// for both or no style class for custom children.
456//
457// The hidden separators use the `.hidden` style class.
458//
459// ## Style classes
460//
461// `AdwToggleGroup` can use the [`.flat`](style-classes.html#flat_1) style class
462// to remove its background and make it look like a group of buttons.
463//
464// <picture>
465//
466//	<source srcset="toggle-group-flat-dark.png" media="(prefers-color-scheme: dark)">
467//	<img src="toggle-group-flat.png" alt="toggle-group-flat">
468//
469// </picture>
470//
471// It can also use the [`.round`](style-classes.html#round) style class to make
472// its toggles and the group itself rounded.
473//
474// <picture>
475//
476//	<source srcset="toggle-group-round-dark.png" media="(prefers-color-scheme: dark)">
477//	<img src="toggle-group-round.png" alt="toggle-group-round">
478//
479// </picture>
480//
481// They can also be combined with each other.
482//
483// <picture>
484//
485//	<source srcset="toggle-group-flat-round-dark.png" media="(prefers-color-scheme: dark)">
486//	<img src="toggle-group-flat-round.png" alt="toggle-group-flat-round">
487//
488// </picture>
489//
490// ## Accessibility
491//
492// `AdwToggleGroup` uses the `GTK_ACCESSIBLE_ROLE_RADIO_GROUP` role. Its toggles
493// use the `GTK_ACCESSIBLE_ROLE_RADIO` role.
494type ToggleGroup struct {
495	gtk.Widget
496}
497
498var xToggleGroupGLibType func() types.GType
499
500func ToggleGroupGLibType() types.GType {
501	return xToggleGroupGLibType()
502}
503
504func ToggleGroupNewFromInternalPtr(ptr uintptr) *ToggleGroup {
505	cls := &ToggleGroup{}
506	cls.Ptr = ptr
507	return cls
508}
509
510var xNewToggleGroup func() uintptr
511
512// Creates a new `AdwToggleGroup`.
513func NewToggleGroup() *ToggleGroup {
514	var cls *ToggleGroup
515
516	cret := xNewToggleGroup()
517
518	if cret == 0 {
519		return nil
520	}
521	gobject.IncreaseRef(cret)
522	cls = &ToggleGroup{}
523	cls.Ptr = cret
524	return cls
525}
526
527var xToggleGroupAdd func(uintptr, uintptr)
528
529// Adds a toggle to @self.
530func (x *ToggleGroup) Add(ToggleVar *Toggle) {
531
532	xToggleGroupAdd(x.GoPointer(), ToggleVar.GoPointer())
533
534}
535
536var xToggleGroupGetActive func(uintptr) uint
537
538// Gets the index of the active toggle in @self.
539//
540// Returns `GTK_INVALID_LIST_POSITION` if no toggle is active.
541func (x *ToggleGroup) GetActive() uint {
542
543	cret := xToggleGroupGetActive(x.GoPointer())
544	return cret
545}
546
547var xToggleGroupGetActiveName func(uintptr) string
548
549// Gets the name of the active toggle in @self.
550//
551// Can be `NULL` if the currently active toggle doesn't have a name.
552//
553// See [property@Toggle:name].
554func (x *ToggleGroup) GetActiveName() string {
555
556	cret := xToggleGroupGetActiveName(x.GoPointer())
557	return cret
558}
559
560var xToggleGroupGetCanShrink func(uintptr) bool
561
562// Gets whether the toggles can be smaller than the natural size of their
563// contents.
564func (x *ToggleGroup) GetCanShrink() bool {
565
566	cret := xToggleGroupGetCanShrink(x.GoPointer())
567	return cret
568}
569
570var xToggleGroupGetHomogeneous func(uintptr) bool
571
572// Gets whether all toggles take the same size.
573func (x *ToggleGroup) GetHomogeneous() bool {
574
575	cret := xToggleGroupGetHomogeneous(x.GoPointer())
576	return cret
577}
578
579var xToggleGroupGetNToggles func(uintptr) uint
580
581// Gets the number of toggles within @self.
582func (x *ToggleGroup) GetNToggles() uint {
583
584	cret := xToggleGroupGetNToggles(x.GoPointer())
585	return cret
586}
587
588var xToggleGroupGetToggle func(uintptr, uint) uintptr
589
590// Gets the toggle with @index from @self.
591func (x *ToggleGroup) GetToggle(IndexVar uint) *Toggle {
592	var cls *Toggle
593
594	cret := xToggleGroupGetToggle(x.GoPointer(), IndexVar)
595
596	if cret == 0 {
597		return nil
598	}
599	gobject.IncreaseRef(cret)
600	cls = &Toggle{}
601	cls.Ptr = cret
602	return cls
603}
604
605var xToggleGroupGetToggleByName func(uintptr, string) uintptr
606
607// Gets the toggle with the name @name from @self.
608func (x *ToggleGroup) GetToggleByName(NameVar string) *Toggle {
609	var cls *Toggle
610
611	cret := xToggleGroupGetToggleByName(x.GoPointer(), NameVar)
612
613	if cret == 0 {
614		return nil
615	}
616	gobject.IncreaseRef(cret)
617	cls = &Toggle{}
618	cls.Ptr = cret
619	return cls
620}
621
622var xToggleGroupGetToggles func(uintptr) uintptr
623
624// Returns a [iface@Gio.ListModel] that contains the toggles of the group.
625//
626// This can be used to keep an up-to-date view. The model also implements
627// [iface@Gtk.SelectionModel] and can be used to track and change the active
628// toggle.
629func (x *ToggleGroup) GetToggles() *gtk.SelectionModelBase {
630	var cls *gtk.SelectionModelBase
631
632	cret := xToggleGroupGetToggles(x.GoPointer())
633
634	if cret == 0 {
635		return nil
636	}
637	cls = &gtk.SelectionModelBase{}
638	cls.Ptr = cret
639	return cls
640}
641
642var xToggleGroupRemove func(uintptr, uintptr)
643
644// Removes @toggle from @self.
645func (x *ToggleGroup) Remove(ToggleVar *Toggle) {
646
647	xToggleGroupRemove(x.GoPointer(), ToggleVar.GoPointer())
648
649}
650
651var xToggleGroupRemoveAll func(uintptr)
652
653// Removes all toggles from @self.
654func (x *ToggleGroup) RemoveAll() {
655
656	xToggleGroupRemoveAll(x.GoPointer())
657
658}
659
660var xToggleGroupSetActive func(uintptr, uint)
661
662// Sets the active toggle for @self.
663//
664// If the index is larger than the number of toggles in @self, unsets the
665// current active toggle.
666func (x *ToggleGroup) SetActive(ActiveVar uint) {
667
668	xToggleGroupSetActive(x.GoPointer(), ActiveVar)
669
670}
671
672var xToggleGroupSetActiveName func(uintptr, uintptr)
673
674// Sets the active toggle for @self.
675//
676// The name can be set via [property@Toggle:name].
677//
678// If @name is `NULL`, unset the current active toggle instead.
679func (x *ToggleGroup) SetActiveName(NameVar *string) {
680
681	NameVarPtr := core.GStrdupNullable(NameVar)
682	defer core.GFreeNullable(NameVarPtr)
683
684	xToggleGroupSetActiveName(x.GoPointer(), NameVarPtr)
685
686}
687
688var xToggleGroupSetCanShrink func(uintptr, bool)
689
690// Sets whether the toggles can be smaller than the natural size of their
691// contents.
692//
693// If @can_shrink is `TRUE`, the toggle labels will ellipsize.
694//
695// See [property@Gtk.Button:can-shrink].
696func (x *ToggleGroup) SetCanShrink(CanShrinkVar bool) {
697
698	xToggleGroupSetCanShrink(x.GoPointer(), CanShrinkVar)
699
700}
701
702var xToggleGroupSetHomogeneous func(uintptr, bool)
703
704// Sets whether all toggles take the same size.
705func (x *ToggleGroup) SetHomogeneous(HomogeneousVar bool) {
706
707	xToggleGroupSetHomogeneous(x.GoPointer(), HomogeneousVar)
708
709}
710
711func (c *ToggleGroup) GoPointer() uintptr {
712	if c == nil {
713		return 0
714	}
715	return c.Ptr
716}
717
718func (c *ToggleGroup) SetGoPointer(ptr uintptr) {
719	c.Ptr = ptr
720}
721
722// SetPropertyActive sets the "active" property.
723// The index of the active toggle.
724//
725// Setting the index to a larger value than the number of toggles in the group
726// unsets the current active toggle.
727//
728// If no toggle is active, the property will be set to
729// [const@Gtk.INVALID_LIST_POSITION].
730func (x *ToggleGroup) SetPropertyActive(value uint) {
731	var v gobject.Value
732	v.Init(gobject.TypeUintVal)
733	v.SetUint(value)
734	x.SetProperty("active", &v)
735}
736
737// GetPropertyActive gets the "active" property.
738// The index of the active toggle.
739//
740// Setting the index to a larger value than the number of toggles in the group
741// unsets the current active toggle.
742//
743// If no toggle is active, the property will be set to
744// [const@Gtk.INVALID_LIST_POSITION].
745func (x *ToggleGroup) GetPropertyActive() uint {
746	var v gobject.Value
747	x.GetProperty("active", &v)
748	return v.GetUint()
749}
750
751// SetPropertyActiveName sets the "active-name" property.
752// The name of the active toggle.
753//
754// The name can be set via [property@Toggle:name]. If the currently active
755// toggle doesn't have a name, the property will be set to `NULL`.
756//
757// Set it to `NULL` to unset the current active toggle.
758func (x *ToggleGroup) SetPropertyActiveName(value string) {
759	var v gobject.Value
760	v.Init(gobject.TypeStringVal)
761	v.SetString(&value)
762	x.SetProperty("active-name", &v)
763}
764
765// GetPropertyActiveName gets the "active-name" property.
766// The name of the active toggle.
767//
768// The name can be set via [property@Toggle:name]. If the currently active
769// toggle doesn't have a name, the property will be set to `NULL`.
770//
771// Set it to `NULL` to unset the current active toggle.
772func (x *ToggleGroup) GetPropertyActiveName() string {
773	var v gobject.Value
774	x.GetProperty("active-name", &v)
775	return v.GetString()
776}
777
778// SetPropertyCanShrink sets the "can-shrink" property.
779// Whether the toggles can be smaller than the natural size of their contents.
780//
781// If set to `TRUE`, the toggle labels will ellipsize.
782//
783// See [property@Gtk.Button:can-shrink].
784func (x *ToggleGroup) SetPropertyCanShrink(value bool) {
785	var v gobject.Value
786	v.Init(gobject.TypeBooleanVal)
787	v.SetBoolean(value)
788	x.SetProperty("can-shrink", &v)
789}
790
791// GetPropertyCanShrink gets the "can-shrink" property.
792// Whether the toggles can be smaller than the natural size of their contents.
793//
794// If set to `TRUE`, the toggle labels will ellipsize.
795//
796// See [property@Gtk.Button:can-shrink].
797func (x *ToggleGroup) GetPropertyCanShrink() bool {
798	var v gobject.Value
799	x.GetProperty("can-shrink", &v)
800	return v.GetBoolean()
801}
802
803// SetPropertyHomogeneous sets the "homogeneous" property.
804// Whether all toggles take the same size.
805func (x *ToggleGroup) SetPropertyHomogeneous(value bool) {
806	var v gobject.Value
807	v.Init(gobject.TypeBooleanVal)
808	v.SetBoolean(value)
809	x.SetProperty("homogeneous", &v)
810}
811
812// GetPropertyHomogeneous gets the "homogeneous" property.
813// Whether all toggles take the same size.
814func (x *ToggleGroup) GetPropertyHomogeneous() bool {
815	var v gobject.Value
816	x.GetProperty("homogeneous", &v)
817	return v.GetBoolean()
818}
819
820// GetPropertyNToggles gets the "n-toggles" property.
821// The number of toggles within the group.
822func (x *ToggleGroup) GetPropertyNToggles() uint {
823	var v gobject.Value
824	x.GetProperty("n-toggles", &v)
825	return v.GetUint()
826}
827
828// Requests the user's screen reader to announce the given message.
829//
830// This kind of notification is useful for messages that
831// either have only a visual representation or that are not
832// exposed visually at all, e.g. a notification about a
833// successful operation.
834//
835// Also, by using this API, you can ensure that the message
836// does not interrupts the user's current screen reader output.
837func (x *ToggleGroup) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
838
839	gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
840
841}
842
843// Retrieves the accessible parent for an accessible object.
844//
845// This function returns `NULL` for top level widgets.
846func (x *ToggleGroup) GetAccessibleParent() *gtk.AccessibleBase {
847	var cls *gtk.AccessibleBase
848
849	cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
850
851	if cret == 0 {
852		return nil
853	}
854	cls = &gtk.AccessibleBase{}
855	cls.Ptr = cret
856	return cls
857}
858
859// Retrieves the accessible role of an accessible object.
860func (x *ToggleGroup) GetAccessibleRole() gtk.AccessibleRole {
861
862	cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
863	return cret
864}
865
866// Retrieves the implementation for the given accessible object.
867func (x *ToggleGroup) GetAtContext() *gtk.ATContext {
868	var cls *gtk.ATContext
869
870	cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
871
872	if cret == 0 {
873		return nil
874	}
875	cls = &gtk.ATContext{}
876	cls.Ptr = cret
877	return cls
878}
879
880// Queries the coordinates and dimensions of this accessible
881//
882// This functionality can be overridden by `GtkAccessible`
883// implementations, e.g. to get the bounds from an ignored
884// child widget.
885func (x *ToggleGroup) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
886
887	cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
888	return cret
889}
890
891// Retrieves the first accessible child of an accessible object.
892func (x *ToggleGroup) GetFirstAccessibleChild() *gtk.AccessibleBase {
893	var cls *gtk.AccessibleBase
894
895	cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
896
897	if cret == 0 {
898		return nil
899	}
900	cls = &gtk.AccessibleBase{}
901	cls.Ptr = cret
902	return cls
903}
904
905// Retrieves the next accessible sibling of an accessible object
906func (x *ToggleGroup) GetNextAccessibleSibling() *gtk.AccessibleBase {
907	var cls *gtk.AccessibleBase
908
909	cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
910
911	if cret == 0 {
912		return nil
913	}
914	cls = &gtk.AccessibleBase{}
915	cls.Ptr = cret
916	return cls
917}
918
919// Queries a platform state, such as focus.
920//
921// This functionality can be overridden by `GtkAccessible`
922// implementations, e.g. to get platform state from an ignored
923// child widget, as is the case for `GtkText` wrappers.
924func (x *ToggleGroup) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
925
926	cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
927	return cret
928}
929
930// Resets the accessible property to its default value.
931func (x *ToggleGroup) ResetProperty(PropertyVar gtk.AccessibleProperty) {
932
933	gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
934
935}
936
937// Resets the accessible relation to its default value.
938func (x *ToggleGroup) ResetRelation(RelationVar gtk.AccessibleRelation) {
939
940	gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
941
942}
943
944// Resets the accessible state to its default value.
945func (x *ToggleGroup) ResetState(StateVar gtk.AccessibleState) {
946
947	gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
948
949}
950
951// Sets the parent and sibling of an accessible object.
952//
953// This function is meant to be used by accessible implementations that are
954// not part of the widget hierarchy, and but act as a logical bridge between
955// widgets. For instance, if a widget creates an object that holds metadata
956// for each child, and you want that object to implement the `GtkAccessible`
957// interface, you will use this function to ensure that the parent of each
958// child widget is the metadata object, and the parent of each metadata
959// object is the container widget.
960func (x *ToggleGroup) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
961
962	gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
963
964}
965
966// Updates the next accessible sibling.
967//
968// That might be useful when a new child of a custom accessible
969// is created, and it needs to be linked to a previous child.
970func (x *ToggleGroup) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
971
972	gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
973
974}
975
976// Informs ATs that the platform state has changed.
977//
978// This function should be used by `GtkAccessible` implementations that
979// have a platform state but are not widgets. Widgets handle platform
980// states automatically.
981func (x *ToggleGroup) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
982
983	gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
984
985}
986
987// Updates a list of accessible properties.
988//
989// See the [enum@Gtk.AccessibleProperty] documentation for the
990// value types of accessible properties.
991//
992// This function should be called by `GtkWidget` types whenever
993// an accessible property change must be communicated to assistive
994// technologies.
995//
996// Example:
997// ```c
998// value = gtk_adjustment_get_value (adjustment);
999// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
1000//
1001//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
1002//	-1);
1003//
1004// ```
1005func (x *ToggleGroup) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
1006
1007	gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
1008
1009}
1010
1011// Updates an array of accessible properties.
1012//
1013// This function should be called by `GtkWidget` types whenever an accessible
1014// property change must be communicated to assistive technologies.
1015//
1016// This function is meant to be used by language bindings.
1017func (x *ToggleGroup) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
1018
1019	gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
1020
1021}
1022
1023// Updates a list of accessible relations.
1024//
1025// This function should be called by `GtkWidget` types whenever an accessible
1026// relation change must be communicated to assistive technologies.
1027//
1028// If the [enum@Gtk.AccessibleRelation] requires a list of references,
1029// you should pass each reference individually, followed by `NULL`, e.g.
1030//
1031// ```c
1032// gtk_accessible_update_relation (accessible,
1033//
1034//	GTK_ACCESSIBLE_RELATION_CONTROLS,
1035//	  ref1, NULL,
1036//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
1037//	  ref1, ref2, ref3, NULL,
1038//	-1);
1039//
1040// ```
1041func (x *ToggleGroup) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
1042
1043	gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
1044
1045}
1046
1047// Updates an array of accessible relations.
1048//
1049// This function should be called by `GtkWidget` types whenever an accessible
1050// relation change must be communicated to assistive technologies.
1051//
1052// This function is meant to be used by language bindings.
1053func (x *ToggleGroup) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
1054
1055	gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
1056
1057}
1058
1059// Updates a list of accessible states.
1060//
1061// See the [enum@Gtk.AccessibleState] documentation for the
1062// value types of accessible states.
1063//
1064// This function should be called by `GtkWidget` types whenever
1065// an accessible state change must be communicated to assistive
1066// technologies.
1067//
1068// Example:
1069//
1070// ```c
1071// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
1072// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
1073//
1074//	GTK_ACCESSIBLE_STATE_CHECKED, value,
1075//	-1);
1076//
1077// ```
1078func (x *ToggleGroup) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
1079
1080	gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
1081
1082}
1083
1084// Updates an array of accessible states.
1085//
1086// This function should be called by `GtkWidget` types whenever an accessible
1087// state change must be communicated to assistive technologies.
1088//
1089// This function is meant to be used by language bindings.
1090func (x *ToggleGroup) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
1091
1092	gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
1093
1094}
1095
1096// Gets the ID of the @buildable object.
1097//
1098// `GtkBuilder` sets the name based on the ID attribute
1099// of the `<object>` tag used to construct the @buildable.
1100func (x *ToggleGroup) GetBuildableId() string {
1101
1102	cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
1103	return cret
1104}
1105
1106// Retrieves the orientation of the @orientable.
1107func (x *ToggleGroup) GetOrientation() gtk.Orientation {
1108
1109	cret := gtk.XGtkOrientableGetOrientation(x.GoPointer())
1110	return cret
1111}
1112
1113// Sets the orientation of the @orientable.
1114func (x *ToggleGroup) SetOrientation(OrientationVar gtk.Orientation) {
1115
1116	gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
1117
1118}
1119
1120func init() {
1121	core.SetPackageName("ADW", "libadwaita-1")
1122	core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
1123	var libs []uintptr
1124	for _, libPath := range core.GetPaths("ADW") {
1125		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1126		if err != nil {
1127			panic(err)
1128		}
1129		libs = append(libs, lib)
1130	}
1131
1132	core.PuregoSafeRegister(&xToggleGLibType, libs, "adw_toggle_get_type")
1133
1134	core.PuregoSafeRegister(&xNewToggle, libs, "adw_toggle_new")
1135
1136	core.PuregoSafeRegister(&xToggleGetChild, libs, "adw_toggle_get_child")
1137	core.PuregoSafeRegister(&xToggleGetEnabled, libs, "adw_toggle_get_enabled")
1138	core.PuregoSafeRegister(&xToggleGetIconName, libs, "adw_toggle_get_icon_name")
1139	core.PuregoSafeRegister(&xToggleGetIndex, libs, "adw_toggle_get_index")
1140	core.PuregoSafeRegister(&xToggleGetLabel, libs, "adw_toggle_get_label")
1141	core.PuregoSafeRegister(&xToggleGetName, libs, "adw_toggle_get_name")
1142	core.PuregoSafeRegister(&xToggleGetTooltip, libs, "adw_toggle_get_tooltip")
1143	core.PuregoSafeRegister(&xToggleGetUseUnderline, libs, "adw_toggle_get_use_underline")
1144	core.PuregoSafeRegister(&xToggleSetChild, libs, "adw_toggle_set_child")
1145	core.PuregoSafeRegister(&xToggleSetEnabled, libs, "adw_toggle_set_enabled")
1146	core.PuregoSafeRegister(&xToggleSetIconName, libs, "adw_toggle_set_icon_name")
1147	core.PuregoSafeRegister(&xToggleSetLabel, libs, "adw_toggle_set_label")
1148	core.PuregoSafeRegister(&xToggleSetName, libs, "adw_toggle_set_name")
1149	core.PuregoSafeRegister(&xToggleSetTooltip, libs, "adw_toggle_set_tooltip")
1150	core.PuregoSafeRegister(&xToggleSetUseUnderline, libs, "adw_toggle_set_use_underline")
1151
1152	core.PuregoSafeRegister(&xToggleGroupGLibType, libs, "adw_toggle_group_get_type")
1153
1154	core.PuregoSafeRegister(&xNewToggleGroup, libs, "adw_toggle_group_new")
1155
1156	core.PuregoSafeRegister(&xToggleGroupAdd, libs, "adw_toggle_group_add")
1157	core.PuregoSafeRegister(&xToggleGroupGetActive, libs, "adw_toggle_group_get_active")
1158	core.PuregoSafeRegister(&xToggleGroupGetActiveName, libs, "adw_toggle_group_get_active_name")
1159	core.PuregoSafeRegister(&xToggleGroupGetCanShrink, libs, "adw_toggle_group_get_can_shrink")
1160	core.PuregoSafeRegister(&xToggleGroupGetHomogeneous, libs, "adw_toggle_group_get_homogeneous")
1161	core.PuregoSafeRegister(&xToggleGroupGetNToggles, libs, "adw_toggle_group_get_n_toggles")
1162	core.PuregoSafeRegister(&xToggleGroupGetToggle, libs, "adw_toggle_group_get_toggle")
1163	core.PuregoSafeRegister(&xToggleGroupGetToggleByName, libs, "adw_toggle_group_get_toggle_by_name")
1164	core.PuregoSafeRegister(&xToggleGroupGetToggles, libs, "adw_toggle_group_get_toggles")
1165	core.PuregoSafeRegister(&xToggleGroupRemove, libs, "adw_toggle_group_remove")
1166	core.PuregoSafeRegister(&xToggleGroupRemoveAll, libs, "adw_toggle_group_remove_all")
1167	core.PuregoSafeRegister(&xToggleGroupSetActive, libs, "adw_toggle_group_set_active")
1168	core.PuregoSafeRegister(&xToggleGroupSetActiveName, libs, "adw_toggle_group_set_active_name")
1169	core.PuregoSafeRegister(&xToggleGroupSetCanShrink, libs, "adw_toggle_group_set_can_shrink")
1170	core.PuregoSafeRegister(&xToggleGroupSetHomogeneous, libs, "adw_toggle_group_set_homogeneous")
1171
1172}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close