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/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14 "github.com/bnema/puregotk/v4/gtk"
15)
16
17type SpinRowClass struct {
18 _ structs.HostLayout
19
20 ParentClass ActionRowClass
21}
22
23func (x *SpinRowClass) GoPointer() uintptr {
24 return uintptr(unsafe.Pointer(x))
25}
26
27// An [class@ActionRow] with an embedded spin button.
28//
29// <picture>
30//
31// <source srcset="spin-row-dark.png" media="(prefers-color-scheme: dark)">
32// <img src="spin-row.png" alt="spin-row">
33//
34// </picture>
35//
36// Example of an `AdwSpinRow` UI definition:
37//
38// ```xml
39// <object class="AdwSpinRow">
40//
41// <property name="title" translatable="yes">Spin Row</property>
42// <property name="adjustment">
43// <object class="GtkAdjustment">
44// <property name="lower">0</property>
45// <property name="upper">100</property>
46// <property name="value">50</property>
47// <property name="page-increment">10</property>
48// <property name="step-increment">1</property>
49// </object>
50// </property>
51//
52// </object>
53// ```
54//
55// See [class@Gtk.SpinButton] for details.
56//
57// ## CSS nodes
58//
59// `AdwSpinRow` has the same structure as [class@ActionRow], as well as the
60// `.spin` style class on the main node.
61//
62// ## Accessibility
63//
64// `AdwSpinRow` uses an internal `GtkSpinButton` with the
65// `GTK_ACCESSIBLE_ROLE_SPIN_BUTTON` role.
66type SpinRow struct {
67 ActionRow
68}
69
70var xSpinRowGLibType func() types.GType
71
72func SpinRowGLibType() types.GType {
73 return xSpinRowGLibType()
74}
75
76func SpinRowNewFromInternalPtr(ptr uintptr) *SpinRow {
77 cls := &SpinRow{}
78 cls.Ptr = ptr
79 return cls
80}
81
82var xNewSpinRow func(uintptr, float64, uint) uintptr
83
84// Creates a new `AdwSpinRow`.
85func NewSpinRow(AdjustmentVar *gtk.Adjustment, ClimbRateVar float64, DigitsVar uint) *SpinRow {
86 var cls *SpinRow
87
88 cret := xNewSpinRow(AdjustmentVar.GoPointer(), ClimbRateVar, DigitsVar)
89
90 if cret == 0 {
91 return nil
92 }
93 gobject.IncreaseRef(cret)
94 cls = &SpinRow{}
95 cls.Ptr = cret
96 return cls
97}
98
99var xNewSpinRowWithRange func(float64, float64, float64) uintptr
100
101// Creates a new `AdwSpinRow` with the given properties.
102//
103// This is a convenience constructor that allows creation of a numeric
104// `AdwSpinRow` without manually creating an adjustment. The value is initially
105// set to the minimum value and a page increment of 10 * @step is the default.
106// The precision of the spin row is equivalent to the precisions of @step.
107//
108// ::: note
109//
110// The way in which the precision is derived works best if @step is a power
111// of ten. If the resulting precision is not suitable for your needs, use
112// [method@SpinRow.set_digits] to correct it.
113func NewSpinRowWithRange(MinVar float64, MaxVar float64, StepVar float64) *SpinRow {
114 var cls *SpinRow
115
116 cret := xNewSpinRowWithRange(MinVar, MaxVar, StepVar)
117
118 if cret == 0 {
119 return nil
120 }
121 gobject.IncreaseRef(cret)
122 cls = &SpinRow{}
123 cls.Ptr = cret
124 return cls
125}
126
127var xSpinRowConfigure func(uintptr, uintptr, float64, uint)
128
129// Changes the properties of an existing spin row.
130//
131// The adjustment, climb rate, and number of decimal places are updated
132// accordingly.
133func (x *SpinRow) Configure(AdjustmentVar *gtk.Adjustment, ClimbRateVar float64, DigitsVar uint) {
134
135 xSpinRowConfigure(x.GoPointer(), AdjustmentVar.GoPointer(), ClimbRateVar, DigitsVar)
136
137}
138
139var xSpinRowGetAdjustment func(uintptr) uintptr
140
141// Gets the adjustment that holds the value for the spin row.
142func (x *SpinRow) GetAdjustment() *gtk.Adjustment {
143 var cls *gtk.Adjustment
144
145 cret := xSpinRowGetAdjustment(x.GoPointer())
146
147 if cret == 0 {
148 return nil
149 }
150 gobject.IncreaseRef(cret)
151 cls = >k.Adjustment{}
152 cls.Ptr = cret
153 return cls
154}
155
156var xSpinRowGetClimbRate func(uintptr) float64
157
158// Gets the acceleration rate when you hold down a button or key.
159func (x *SpinRow) GetClimbRate() float64 {
160
161 cret := xSpinRowGetClimbRate(x.GoPointer())
162 return cret
163}
164
165var xSpinRowGetDigits func(uintptr) uint
166
167// Gets the number of decimal places to display.
168func (x *SpinRow) GetDigits() uint {
169
170 cret := xSpinRowGetDigits(x.GoPointer())
171 return cret
172}
173
174var xSpinRowGetNumeric func(uintptr) bool
175
176// Gets whether non-numeric characters should be ignored.
177func (x *SpinRow) GetNumeric() bool {
178
179 cret := xSpinRowGetNumeric(x.GoPointer())
180 return cret
181}
182
183var xSpinRowGetSnapToTicks func(uintptr) bool
184
185// Gets whether invalid values are snapped to nearest step increment.
186func (x *SpinRow) GetSnapToTicks() bool {
187
188 cret := xSpinRowGetSnapToTicks(x.GoPointer())
189 return cret
190}
191
192var xSpinRowGetUpdatePolicy func(uintptr) gtk.SpinButtonUpdatePolicy
193
194// Gets the policy for updating the spin row.
195func (x *SpinRow) GetUpdatePolicy() gtk.SpinButtonUpdatePolicy {
196
197 cret := xSpinRowGetUpdatePolicy(x.GoPointer())
198 return cret
199}
200
201var xSpinRowGetValue func(uintptr) float64
202
203// Gets the current value.
204func (x *SpinRow) GetValue() float64 {
205
206 cret := xSpinRowGetValue(x.GoPointer())
207 return cret
208}
209
210var xSpinRowGetWrap func(uintptr) bool
211
212// Gets whether the spin row should wrap upon reaching its limits.
213func (x *SpinRow) GetWrap() bool {
214
215 cret := xSpinRowGetWrap(x.GoPointer())
216 return cret
217}
218
219var xSpinRowSetAdjustment func(uintptr, uintptr)
220
221// Sets the adjustment that holds the value for the spin row.
222func (x *SpinRow) SetAdjustment(AdjustmentVar *gtk.Adjustment) {
223
224 xSpinRowSetAdjustment(x.GoPointer(), AdjustmentVar.GoPointer())
225
226}
227
228var xSpinRowSetClimbRate func(uintptr, float64)
229
230// Sets the acceleration rate when you hold down a button or key.
231func (x *SpinRow) SetClimbRate(ClimbRateVar float64) {
232
233 xSpinRowSetClimbRate(x.GoPointer(), ClimbRateVar)
234
235}
236
237var xSpinRowSetDigits func(uintptr, uint)
238
239// Sets the number of decimal places to display.
240func (x *SpinRow) SetDigits(DigitsVar uint) {
241
242 xSpinRowSetDigits(x.GoPointer(), DigitsVar)
243
244}
245
246var xSpinRowSetNumeric func(uintptr, bool)
247
248// Sets whether non-numeric characters should be ignored.
249func (x *SpinRow) SetNumeric(NumericVar bool) {
250
251 xSpinRowSetNumeric(x.GoPointer(), NumericVar)
252
253}
254
255var xSpinRowSetRange func(uintptr, float64, float64)
256
257// Sets the minimum and maximum allowable values for @self.
258//
259// If the current value is outside this range, it will be adjusted
260// to fit within the range, otherwise it will remain unchanged.
261func (x *SpinRow) SetRange(MinVar float64, MaxVar float64) {
262
263 xSpinRowSetRange(x.GoPointer(), MinVar, MaxVar)
264
265}
266
267var xSpinRowSetSnapToTicks func(uintptr, bool)
268
269// Sets whether invalid values are snapped to the nearest step increment.
270func (x *SpinRow) SetSnapToTicks(SnapToTicksVar bool) {
271
272 xSpinRowSetSnapToTicks(x.GoPointer(), SnapToTicksVar)
273
274}
275
276var xSpinRowSetUpdatePolicy func(uintptr, gtk.SpinButtonUpdatePolicy)
277
278// Sets the policy for updating the spin row.
279//
280// The options are always, or only when the value is invalid.
281func (x *SpinRow) SetUpdatePolicy(PolicyVar gtk.SpinButtonUpdatePolicy) {
282
283 xSpinRowSetUpdatePolicy(x.GoPointer(), PolicyVar)
284
285}
286
287var xSpinRowSetValue func(uintptr, float64)
288
289// Sets the current value.
290func (x *SpinRow) SetValue(ValueVar float64) {
291
292 xSpinRowSetValue(x.GoPointer(), ValueVar)
293
294}
295
296var xSpinRowSetWrap func(uintptr, bool)
297
298// Sets whether the spin row should wrap upon reaching its limits.
299func (x *SpinRow) SetWrap(WrapVar bool) {
300
301 xSpinRowSetWrap(x.GoPointer(), WrapVar)
302
303}
304
305var xSpinRowUpdate func(uintptr)
306
307// Manually force an update of the spin row.
308func (x *SpinRow) Update() {
309
310 xSpinRowUpdate(x.GoPointer())
311
312}
313
314func (c *SpinRow) GoPointer() uintptr {
315 if c == nil {
316 return 0
317 }
318 return c.Ptr
319}
320
321func (c *SpinRow) SetGoPointer(ptr uintptr) {
322 c.Ptr = ptr
323}
324
325// SetPropertyClimbRate sets the "climb-rate" property.
326// The acceleration rate when you hold down a button or key.
327func (x *SpinRow) SetPropertyClimbRate(value float64) {
328 var v gobject.Value
329 v.Init(gobject.TypeDoubleVal)
330 v.SetDouble(value)
331 x.SetProperty("climb-rate", &v)
332}
333
334// GetPropertyClimbRate gets the "climb-rate" property.
335// The acceleration rate when you hold down a button or key.
336func (x *SpinRow) GetPropertyClimbRate() float64 {
337 var v gobject.Value
338 x.GetProperty("climb-rate", &v)
339 return v.GetDouble()
340}
341
342// SetPropertyDigits sets the "digits" property.
343// The number of decimal places to display.
344func (x *SpinRow) SetPropertyDigits(value uint) {
345 var v gobject.Value
346 v.Init(gobject.TypeUintVal)
347 v.SetUint(value)
348 x.SetProperty("digits", &v)
349}
350
351// GetPropertyDigits gets the "digits" property.
352// The number of decimal places to display.
353func (x *SpinRow) GetPropertyDigits() uint {
354 var v gobject.Value
355 x.GetProperty("digits", &v)
356 return v.GetUint()
357}
358
359// SetPropertyNumeric sets the "numeric" property.
360// Whether non-numeric characters should be ignored.
361func (x *SpinRow) SetPropertyNumeric(value bool) {
362 var v gobject.Value
363 v.Init(gobject.TypeBooleanVal)
364 v.SetBoolean(value)
365 x.SetProperty("numeric", &v)
366}
367
368// GetPropertyNumeric gets the "numeric" property.
369// Whether non-numeric characters should be ignored.
370func (x *SpinRow) GetPropertyNumeric() bool {
371 var v gobject.Value
372 x.GetProperty("numeric", &v)
373 return v.GetBoolean()
374}
375
376// SetPropertySnapToTicks sets the "snap-to-ticks" property.
377// Whether invalid values are snapped to the nearest step increment.
378func (x *SpinRow) SetPropertySnapToTicks(value bool) {
379 var v gobject.Value
380 v.Init(gobject.TypeBooleanVal)
381 v.SetBoolean(value)
382 x.SetProperty("snap-to-ticks", &v)
383}
384
385// GetPropertySnapToTicks gets the "snap-to-ticks" property.
386// Whether invalid values are snapped to the nearest step increment.
387func (x *SpinRow) GetPropertySnapToTicks() bool {
388 var v gobject.Value
389 x.GetProperty("snap-to-ticks", &v)
390 return v.GetBoolean()
391}
392
393// SetPropertyValue sets the "value" property.
394// The current value.
395func (x *SpinRow) SetPropertyValue(value float64) {
396 var v gobject.Value
397 v.Init(gobject.TypeDoubleVal)
398 v.SetDouble(value)
399 x.SetProperty("value", &v)
400}
401
402// GetPropertyValue gets the "value" property.
403// The current value.
404func (x *SpinRow) GetPropertyValue() float64 {
405 var v gobject.Value
406 x.GetProperty("value", &v)
407 return v.GetDouble()
408}
409
410// SetPropertyWrap sets the "wrap" property.
411// Whether the spin row should wrap upon reaching its limits.
412func (x *SpinRow) SetPropertyWrap(value bool) {
413 var v gobject.Value
414 v.Init(gobject.TypeBooleanVal)
415 v.SetBoolean(value)
416 x.SetProperty("wrap", &v)
417}
418
419// GetPropertyWrap gets the "wrap" property.
420// Whether the spin row should wrap upon reaching its limits.
421func (x *SpinRow) GetPropertyWrap() bool {
422 var v gobject.Value
423 x.GetProperty("wrap", &v)
424 return v.GetBoolean()
425}
426
427// Emitted to convert the user's input into a double value.
428//
429// The signal handler is expected to use [method@Gtk.Editable.get_text] to
430// retrieve the text of the spinbutton and set new_value to the new value.
431//
432// The default conversion uses [func@GLib.strtod].
433//
434// See [signal@Gtk.SpinButton::input].
435func (x *SpinRow) ConnectInput(cb *func(SpinRow, *float64) int) uint {
436 cbPtr := uintptr(unsafe.Pointer(cb))
437 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
438 handlerID := gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)
439 glib.SaveHandlerMapping(handlerID, cbPtr)
440 return handlerID
441 }
442
443 fcb := func(clsPtr uintptr, NewValueVarp *float64) int {
444 fa := SpinRow{}
445 fa.Ptr = clsPtr
446 cbFn := *cb
447
448 return cbFn(fa, NewValueVarp)
449
450 }
451 cbRefPtr := purego.NewCallback(fcb)
452 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
453 handlerID := gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)
454 glib.SaveHandlerMapping(handlerID, cbPtr)
455 return handlerID
456}
457
458// Emitted to tweak the formatting of the value for display.
459//
460// See [signal@Gtk.SpinButton::output].
461func (x *SpinRow) ConnectOutput(cb *func(SpinRow) bool) uint {
462 cbPtr := uintptr(unsafe.Pointer(cb))
463 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
464 handlerID := gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)
465 glib.SaveHandlerMapping(handlerID, cbPtr)
466 return handlerID
467 }
468
469 fcb := func(clsPtr uintptr) bool {
470 fa := SpinRow{}
471 fa.Ptr = clsPtr
472 cbFn := *cb
473
474 return cbFn(fa)
475
476 }
477 cbRefPtr := purego.NewCallback(fcb)
478 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
479 handlerID := gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)
480 glib.SaveHandlerMapping(handlerID, cbPtr)
481 return handlerID
482}
483
484// Emitted right after the spinbutton wraps.
485//
486// See [signal@Gtk.SpinButton::wrapped].
487func (x *SpinRow) ConnectWrapped(cb *func(SpinRow)) uint {
488 cbPtr := uintptr(unsafe.Pointer(cb))
489 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
490 handlerID := gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)
491 glib.SaveHandlerMapping(handlerID, cbPtr)
492 return handlerID
493 }
494
495 fcb := func(clsPtr uintptr) {
496 fa := SpinRow{}
497 fa.Ptr = clsPtr
498 cbFn := *cb
499
500 cbFn(fa)
501
502 }
503 cbRefPtr := purego.NewCallback(fcb)
504 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
505 handlerID := gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)
506 glib.SaveHandlerMapping(handlerID, cbPtr)
507 return handlerID
508}
509
510// Requests the user's screen reader to announce the given message.
511//
512// This kind of notification is useful for messages that
513// either have only a visual representation or that are not
514// exposed visually at all, e.g. a notification about a
515// successful operation.
516//
517// Also, by using this API, you can ensure that the message
518// does not interrupts the user's current screen reader output.
519func (x *SpinRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) {
520
521 gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
522
523}
524
525// Retrieves the accessible parent for an accessible object.
526//
527// This function returns `NULL` for top level widgets.
528func (x *SpinRow) GetAccessibleParent() *gtk.AccessibleBase {
529 var cls *gtk.AccessibleBase
530
531 cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer())
532
533 if cret == 0 {
534 return nil
535 }
536 cls = >k.AccessibleBase{}
537 cls.Ptr = cret
538 return cls
539}
540
541// Retrieves the accessible role of an accessible object.
542func (x *SpinRow) GetAccessibleRole() gtk.AccessibleRole {
543
544 cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer())
545 return cret
546}
547
548// Retrieves the implementation for the given accessible object.
549func (x *SpinRow) GetAtContext() *gtk.ATContext {
550 var cls *gtk.ATContext
551
552 cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer())
553
554 if cret == 0 {
555 return nil
556 }
557 cls = >k.ATContext{}
558 cls.Ptr = cret
559 return cls
560}
561
562// Queries the coordinates and dimensions of this accessible
563//
564// This functionality can be overridden by `GtkAccessible`
565// implementations, e.g. to get the bounds from an ignored
566// child widget.
567func (x *SpinRow) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
568
569 cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
570 return cret
571}
572
573// Retrieves the first accessible child of an accessible object.
574func (x *SpinRow) GetFirstAccessibleChild() *gtk.AccessibleBase {
575 var cls *gtk.AccessibleBase
576
577 cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
578
579 if cret == 0 {
580 return nil
581 }
582 cls = >k.AccessibleBase{}
583 cls.Ptr = cret
584 return cls
585}
586
587// Retrieves the next accessible sibling of an accessible object
588func (x *SpinRow) GetNextAccessibleSibling() *gtk.AccessibleBase {
589 var cls *gtk.AccessibleBase
590
591 cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
592
593 if cret == 0 {
594 return nil
595 }
596 cls = >k.AccessibleBase{}
597 cls.Ptr = cret
598 return cls
599}
600
601// Queries a platform state, such as focus.
602//
603// This functionality can be overridden by `GtkAccessible`
604// implementations, e.g. to get platform state from an ignored
605// child widget, as is the case for `GtkText` wrappers.
606func (x *SpinRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool {
607
608 cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
609 return cret
610}
611
612// Resets the accessible property to its default value.
613func (x *SpinRow) ResetProperty(PropertyVar gtk.AccessibleProperty) {
614
615 gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
616
617}
618
619// Resets the accessible relation to its default value.
620func (x *SpinRow) ResetRelation(RelationVar gtk.AccessibleRelation) {
621
622 gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
623
624}
625
626// Resets the accessible state to its default value.
627func (x *SpinRow) ResetState(StateVar gtk.AccessibleState) {
628
629 gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar)
630
631}
632
633// Sets the parent and sibling of an accessible object.
634//
635// This function is meant to be used by accessible implementations that are
636// not part of the widget hierarchy, and but act as a logical bridge between
637// widgets. For instance, if a widget creates an object that holds metadata
638// for each child, and you want that object to implement the `GtkAccessible`
639// interface, you will use this function to ensure that the parent of each
640// child widget is the metadata object, and the parent of each metadata
641// object is the container widget.
642func (x *SpinRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) {
643
644 gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
645
646}
647
648// Updates the next accessible sibling.
649//
650// That might be useful when a new child of a custom accessible
651// is created, and it needs to be linked to a previous child.
652func (x *SpinRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) {
653
654 gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
655
656}
657
658// Informs ATs that the platform state has changed.
659//
660// This function should be used by `GtkAccessible` implementations that
661// have a platform state but are not widgets. Widgets handle platform
662// states automatically.
663func (x *SpinRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) {
664
665 gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
666
667}
668
669// Updates a list of accessible properties.
670//
671// See the [enum@Gtk.AccessibleProperty] documentation for the
672// value types of accessible properties.
673//
674// This function should be called by `GtkWidget` types whenever
675// an accessible property change must be communicated to assistive
676// technologies.
677//
678// Example:
679// ```c
680// value = gtk_adjustment_get_value (adjustment);
681// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
682//
683// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
684// -1);
685//
686// ```
687func (x *SpinRow) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) {
688
689 gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
690
691}
692
693// Updates an array of accessible properties.
694//
695// This function should be called by `GtkWidget` types whenever an accessible
696// property change must be communicated to assistive technologies.
697//
698// This function is meant to be used by language bindings.
699func (x *SpinRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) {
700
701 gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
702
703}
704
705// Updates a list of accessible relations.
706//
707// This function should be called by `GtkWidget` types whenever an accessible
708// relation change must be communicated to assistive technologies.
709//
710// If the [enum@Gtk.AccessibleRelation] requires a list of references,
711// you should pass each reference individually, followed by `NULL`, e.g.
712//
713// ```c
714// gtk_accessible_update_relation (accessible,
715//
716// GTK_ACCESSIBLE_RELATION_CONTROLS,
717// ref1, NULL,
718// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
719// ref1, ref2, ref3, NULL,
720// -1);
721//
722// ```
723func (x *SpinRow) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) {
724
725 gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
726
727}
728
729// Updates an array of accessible relations.
730//
731// This function should be called by `GtkWidget` types whenever an accessible
732// relation change must be communicated to assistive technologies.
733//
734// This function is meant to be used by language bindings.
735func (x *SpinRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) {
736
737 gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
738
739}
740
741// Updates a list of accessible states.
742//
743// See the [enum@Gtk.AccessibleState] documentation for the
744// value types of accessible states.
745//
746// This function should be called by `GtkWidget` types whenever
747// an accessible state change must be communicated to assistive
748// technologies.
749//
750// Example:
751//
752// ```c
753// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
754// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
755//
756// GTK_ACCESSIBLE_STATE_CHECKED, value,
757// -1);
758//
759// ```
760func (x *SpinRow) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) {
761
762 gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
763
764}
765
766// Updates an array of accessible states.
767//
768// This function should be called by `GtkWidget` types whenever an accessible
769// state change must be communicated to assistive technologies.
770//
771// This function is meant to be used by language bindings.
772func (x *SpinRow) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) {
773
774 gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
775
776}
777
778// Gets the action name for @actionable.
779func (x *SpinRow) GetActionName() string {
780
781 cret := gtk.XGtkActionableGetActionName(x.GoPointer())
782 return cret
783}
784
785// Gets the current target value of @actionable.
786func (x *SpinRow) GetActionTargetValue() *glib.Variant {
787
788 cret := gtk.XGtkActionableGetActionTargetValue(x.GoPointer())
789 return cret
790}
791
792// Specifies the name of the action with which this widget should be
793// associated.
794//
795// If @action_name is %NULL then the widget will be unassociated from
796// any previous action.
797//
798// Usually this function is used when the widget is located (or will be
799// located) within the hierarchy of a `GtkApplicationWindow`.
800//
801// Names are of the form “win.save” or “app.quit” for actions on the
802// containing [class@ApplicationWindow] or its associated [class@Application],
803// respectively. This is the same form used for actions in the [class@Gio.Menu]
804// associated with the window.
805func (x *SpinRow) SetActionName(ActionNameVar *string) {
806
807 ActionNameVarPtr := core.GStrdupNullable(ActionNameVar)
808 defer core.GFreeNullable(ActionNameVarPtr)
809
810 gtk.XGtkActionableSetActionName(x.GoPointer(), ActionNameVarPtr)
811
812}
813
814// Sets the target of an actionable widget.
815//
816// This is a convenience function that calls [ctor@GLib.Variant.new] for
817// @format_string and uses the result to call
818// [method@Gtk.Actionable.set_action_target_value].
819//
820// If you are setting a string-valued target and want to set
821// the action name at the same time, you can use
822// [method@Gtk.Actionable.set_detailed_action_name].
823func (x *SpinRow) SetActionTarget(FormatStringVar string, varArgs ...interface{}) {
824
825 gtk.XGtkActionableSetActionTarget(x.GoPointer(), FormatStringVar, varArgs...)
826
827}
828
829// Sets the target value of an actionable widget.
830//
831// If @target_value is %NULL then the target value is unset.
832//
833// The target value has two purposes. First, it is used as the parameter
834// to activation of the action associated with the `GtkActionable` widget.
835// Second, it is used to determine if the widget should be rendered as
836// “active” — the widget is active if the state is equal to the given target.
837//
838// Consider the example of associating a set of buttons with a [iface@Gio.Action]
839// with string state in a typical “radio button” situation. Each button
840// will be associated with the same action, but with a different target
841// value for that action. Clicking on a particular button will activate
842// the action with the target of that button, which will typically cause
843// the action’s state to change to that value. Since the action’s state
844// is now equal to the target value of the button, the button will now
845// be rendered as active (and the other buttons, with different targets,
846// rendered inactive).
847func (x *SpinRow) SetActionTargetValue(TargetValueVar *glib.Variant) {
848
849 gtk.XGtkActionableSetActionTargetValue(x.GoPointer(), TargetValueVar)
850
851}
852
853// Sets the action-name and associated string target value of an
854// actionable widget.
855//
856// @detailed_action_name is a string in the format accepted by
857// [func@Gio.Action.parse_detailed_name].
858func (x *SpinRow) SetDetailedActionName(DetailedActionNameVar string) {
859
860 gtk.XGtkActionableSetDetailedActionName(x.GoPointer(), DetailedActionNameVar)
861
862}
863
864// Gets the ID of the @buildable object.
865//
866// `GtkBuilder` sets the name based on the ID attribute
867// of the `<object>` tag used to construct the @buildable.
868func (x *SpinRow) GetBuildableId() string {
869
870 cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer())
871 return cret
872}
873
874// Retrieves the accessible platform state from the editable delegate.
875//
876// This is an helper function to retrieve the accessible state for
877// `GtkEditable` interface implementations using a delegate pattern.
878//
879// You should call this function in your editable widget implementation
880// of the [vfunc@Gtk.Accessible.get_platform_state] virtual function, for
881// instance:
882//
883// ```c
884// static void
885// accessible_interface_init (GtkAccessibleInterface *iface)
886//
887// {
888// iface->get_platform_state = your_editable_get_accessible_platform_state;
889// }
890//
891// static gboolean
892// your_editable_get_accessible_platform_state (GtkAccessible *accessible,
893//
894// GtkAccessiblePlatformState state)
895//
896// {
897// return gtk_editable_delegate_get_accessible_platform_state (GTK_EDITABLE (accessible), state);
898// }
899//
900// ```
901//
902// Note that the widget which is the delegate *must* be a direct child of
903// this widget, otherwise your implementation of [vfunc@Gtk.Accessible.get_platform_state]
904// might not even be called, as the platform change will originate from
905// the parent of the delegate, and, as a result, will not work properly.
906//
907// So, if you can't ensure the direct child condition, you should give the
908// delegate the %GTK_ACCESSIBLE_ROLE_TEXT_BOX role, or you can
909// change your tree to allow this function to work.
910func (x *SpinRow) DelegateGetAccessiblePlatformState(StateVar gtk.AccessiblePlatformState) bool {
911
912 cret := gtk.XGtkEditableDelegateGetAccessiblePlatformState(x.GoPointer(), StateVar)
913 return cret
914}
915
916// Deletes the currently selected text of the editable.
917//
918// This call doesn’t do anything if there is no selected text.
919func (x *SpinRow) DeleteSelection() {
920
921 gtk.XGtkEditableDeleteSelection(x.GoPointer())
922
923}
924
925// Deletes a sequence of characters.
926//
927// The characters that are deleted are those characters at positions
928// from @start_pos up to, but not including @end_pos. If @end_pos is
929// negative, then the characters deleted are those from @start_pos to
930// the end of the text.
931//
932// Note that the positions are specified in characters, not bytes.
933func (x *SpinRow) DeleteText(StartPosVar int, EndPosVar int) {
934
935 gtk.XGtkEditableDeleteText(x.GoPointer(), StartPosVar, EndPosVar)
936
937}
938
939// Undoes the setup done by [method@Gtk.Editable.init_delegate].
940//
941// This is a helper function that should be called from dispose,
942// before removing the delegate object.
943func (x *SpinRow) FinishDelegate() {
944
945 gtk.XGtkEditableFinishDelegate(x.GoPointer())
946
947}
948
949// Gets the alignment of the editable.
950func (x *SpinRow) GetAlignment() float32 {
951
952 cret := gtk.XGtkEditableGetAlignment(x.GoPointer())
953 return cret
954}
955
956// Retrieves a sequence of characters.
957//
958// The characters that are retrieved are those characters at positions
959// from @start_pos up to, but not including @end_pos. If @end_pos is negative,
960// then the characters retrieved are those characters from @start_pos to
961// the end of the text.
962//
963// Note that positions are specified in characters, not bytes.
964func (x *SpinRow) GetChars(StartPosVar int, EndPosVar int) string {
965
966 cret := gtk.XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar)
967 return cret
968}
969
970// Gets the `GtkEditable` that @editable is delegating its
971// implementation to.
972//
973// Typically, the delegate is a [class@Gtk.Text] widget.
974func (x *SpinRow) GetDelegate() *gtk.EditableBase {
975 var cls *gtk.EditableBase
976
977 cret := gtk.XGtkEditableGetDelegate(x.GoPointer())
978
979 if cret == 0 {
980 return nil
981 }
982 gobject.IncreaseRef(cret)
983 cls = >k.EditableBase{}
984 cls.Ptr = cret
985 return cls
986}
987
988// Retrieves whether @editable is editable.
989func (x *SpinRow) GetEditable() bool {
990
991 cret := gtk.XGtkEditableGetEditable(x.GoPointer())
992 return cret
993}
994
995// Gets if undo/redo actions are enabled for @editable
996func (x *SpinRow) GetEnableUndo() bool {
997
998 cret := gtk.XGtkEditableGetEnableUndo(x.GoPointer())
999 return cret
1000}
1001
1002// Retrieves the desired maximum width of @editable, in characters.
1003func (x *SpinRow) GetMaxWidthChars() int {
1004
1005 cret := gtk.XGtkEditableGetMaxWidthChars(x.GoPointer())
1006 return cret
1007}
1008
1009// Retrieves the current position of the cursor relative
1010// to the start of the content of the editable.
1011//
1012// Note that this position is in characters, not in bytes.
1013func (x *SpinRow) GetPosition() int {
1014
1015 cret := gtk.XGtkEditableGetPosition(x.GoPointer())
1016 return cret
1017}
1018
1019// Retrieves the selection bound of the editable.
1020//
1021// @start_pos will be filled with the start of the selection and
1022// @end_pos with end. If no text was selected both will be identical
1023// and %FALSE will be returned.
1024//
1025// Note that positions are specified in characters, not bytes.
1026func (x *SpinRow) GetSelectionBounds(StartPosVar *int, EndPosVar *int) bool {
1027
1028 cret := gtk.XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar)
1029 return cret
1030}
1031
1032// Retrieves the contents of @editable.
1033//
1034// The returned string is owned by GTK and must not be modified or freed.
1035func (x *SpinRow) GetText() string {
1036
1037 cret := gtk.XGtkEditableGetText(x.GoPointer())
1038 return cret
1039}
1040
1041// Gets the number of characters of space reserved
1042// for the contents of the editable.
1043func (x *SpinRow) GetWidthChars() int {
1044
1045 cret := gtk.XGtkEditableGetWidthChars(x.GoPointer())
1046 return cret
1047}
1048
1049// Sets up a delegate for `GtkEditable`.
1050//
1051// This is assuming that the get_delegate vfunc in the `GtkEditable`
1052// interface has been set up for the @editable's type.
1053//
1054// This is a helper function that should be called in instance init,
1055// after creating the delegate object.
1056func (x *SpinRow) InitDelegate() {
1057
1058 gtk.XGtkEditableInitDelegate(x.GoPointer())
1059
1060}
1061
1062// Inserts @length bytes of @text into the contents of the
1063// widget, at position @position.
1064//
1065// Note that the position is in characters, not in bytes.
1066// The function updates @position to point after the newly
1067// inserted text.
1068func (x *SpinRow) InsertText(TextVar string, LengthVar int, PositionVar *int) {
1069
1070 gtk.XGtkEditableInsertText(x.GoPointer(), TextVar, LengthVar, PositionVar)
1071
1072}
1073
1074// Selects a region of text.
1075//
1076// The characters that are selected are those characters at positions
1077// from @start_pos up to, but not including @end_pos. If @end_pos is
1078// negative, then the characters selected are those characters from
1079// @start_pos to the end of the text.
1080//
1081// Note that positions are specified in characters, not bytes.
1082func (x *SpinRow) SelectRegion(StartPosVar int, EndPosVar int) {
1083
1084 gtk.XGtkEditableSelectRegion(x.GoPointer(), StartPosVar, EndPosVar)
1085
1086}
1087
1088// Sets the alignment for the contents of the editable.
1089//
1090// This controls the horizontal positioning of the contents when
1091// the displayed text is shorter than the width of the editable.
1092func (x *SpinRow) SetAlignment(XalignVar float32) {
1093
1094 gtk.XGtkEditableSetAlignment(x.GoPointer(), XalignVar)
1095
1096}
1097
1098// Determines if the user can edit the text in the editable widget.
1099func (x *SpinRow) SetEditable(IsEditableVar bool) {
1100
1101 gtk.XGtkEditableSetEditable(x.GoPointer(), IsEditableVar)
1102
1103}
1104
1105// If enabled, changes to @editable will be saved for undo/redo
1106// actions.
1107//
1108// This results in an additional copy of text changes and are not
1109// stored in secure memory. As such, undo is forcefully disabled
1110// when [property@Gtk.Text:visibility] is set to %FALSE.
1111func (x *SpinRow) SetEnableUndo(EnableUndoVar bool) {
1112
1113 gtk.XGtkEditableSetEnableUndo(x.GoPointer(), EnableUndoVar)
1114
1115}
1116
1117// Sets the desired maximum width in characters of @editable.
1118func (x *SpinRow) SetMaxWidthChars(NCharsVar int) {
1119
1120 gtk.XGtkEditableSetMaxWidthChars(x.GoPointer(), NCharsVar)
1121
1122}
1123
1124// Sets the cursor position in the editable to the given value.
1125//
1126// The cursor is displayed before the character with the given (base 0)
1127// index in the contents of the editable. The value must be less than
1128// or equal to the number of characters in the editable. A value of -1
1129// indicates that the position should be set after the last character
1130// of the editable. Note that @position is in characters, not in bytes.
1131func (x *SpinRow) SetPosition(PositionVar int) {
1132
1133 gtk.XGtkEditableSetPosition(x.GoPointer(), PositionVar)
1134
1135}
1136
1137// Sets the text in the editable to the given value.
1138//
1139// This is replacing the current contents.
1140func (x *SpinRow) SetText(TextVar string) {
1141
1142 gtk.XGtkEditableSetText(x.GoPointer(), TextVar)
1143
1144}
1145
1146// Changes the size request of the editable to be about the
1147// right size for @n_chars characters.
1148//
1149// Note that it changes the size request, the size can still
1150// be affected by how you pack the widget into containers.
1151// If @n_chars is -1, the size reverts to the default size.
1152func (x *SpinRow) SetWidthChars(NCharsVar int) {
1153
1154 gtk.XGtkEditableSetWidthChars(x.GoPointer(), NCharsVar)
1155
1156}
1157
1158func init() {
1159 core.SetPackageName("ADW", "libadwaita-1")
1160 core.SetSharedLibraries("ADW", []string{"libadwaita-1.so.0"})
1161 var libs []uintptr
1162 for _, libPath := range core.GetPaths("ADW") {
1163 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
1164 if err != nil {
1165 panic(err)
1166 }
1167 libs = append(libs, lib)
1168 }
1169
1170 core.PuregoSafeRegister(&xSpinRowGLibType, libs, "adw_spin_row_get_type")
1171
1172 core.PuregoSafeRegister(&xNewSpinRow, libs, "adw_spin_row_new")
1173 core.PuregoSafeRegister(&xNewSpinRowWithRange, libs, "adw_spin_row_new_with_range")
1174
1175 core.PuregoSafeRegister(&xSpinRowConfigure, libs, "adw_spin_row_configure")
1176 core.PuregoSafeRegister(&xSpinRowGetAdjustment, libs, "adw_spin_row_get_adjustment")
1177 core.PuregoSafeRegister(&xSpinRowGetClimbRate, libs, "adw_spin_row_get_climb_rate")
1178 core.PuregoSafeRegister(&xSpinRowGetDigits, libs, "adw_spin_row_get_digits")
1179 core.PuregoSafeRegister(&xSpinRowGetNumeric, libs, "adw_spin_row_get_numeric")
1180 core.PuregoSafeRegister(&xSpinRowGetSnapToTicks, libs, "adw_spin_row_get_snap_to_ticks")
1181 core.PuregoSafeRegister(&xSpinRowGetUpdatePolicy, libs, "adw_spin_row_get_update_policy")
1182 core.PuregoSafeRegister(&xSpinRowGetValue, libs, "adw_spin_row_get_value")
1183 core.PuregoSafeRegister(&xSpinRowGetWrap, libs, "adw_spin_row_get_wrap")
1184 core.PuregoSafeRegister(&xSpinRowSetAdjustment, libs, "adw_spin_row_set_adjustment")
1185 core.PuregoSafeRegister(&xSpinRowSetClimbRate, libs, "adw_spin_row_set_climb_rate")
1186 core.PuregoSafeRegister(&xSpinRowSetDigits, libs, "adw_spin_row_set_digits")
1187 core.PuregoSafeRegister(&xSpinRowSetNumeric, libs, "adw_spin_row_set_numeric")
1188 core.PuregoSafeRegister(&xSpinRowSetRange, libs, "adw_spin_row_set_range")
1189 core.PuregoSafeRegister(&xSpinRowSetSnapToTicks, libs, "adw_spin_row_set_snap_to_ticks")
1190 core.PuregoSafeRegister(&xSpinRowSetUpdatePolicy, libs, "adw_spin_row_set_update_policy")
1191 core.PuregoSafeRegister(&xSpinRowSetValue, libs, "adw_spin_row_set_value")
1192 core.PuregoSafeRegister(&xSpinRowSetWrap, libs, "adw_spin_row_set_wrap")
1193 core.PuregoSafeRegister(&xSpinRowUpdate, libs, "adw_spin_row_update")
1194
1195}