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 "github.com/bnema/puregotk/v4/pango"
15)
16
17// Function that formats the value of a scale.
18//
19// See [method@Gtk.Scale.set_format_value_func].
20type ScaleFormatValueFunc func(uintptr, float64, uintptr) string
21
22type ScaleClass struct {
23 _ structs.HostLayout
24
25 ParentClass RangeClass
26
27 xGetLayoutOffsets uintptr
28
29 Padding [8]uintptr
30}
31
32func (x *ScaleClass) GoPointer() uintptr {
33 return uintptr(unsafe.Pointer(x))
34}
35
36// OverrideGetLayoutOffsets sets the "get_layout_offsets" callback function.
37func (x *ScaleClass) OverrideGetLayoutOffsets(cb func(*Scale, *int, *int)) {
38 if cb == nil {
39 x.xGetLayoutOffsets = 0
40 } else {
41 x.xGetLayoutOffsets = purego.NewCallback(func(ScaleVarp uintptr, XVarp *int, YVarp *int) {
42 cb(ScaleNewFromInternalPtr(ScaleVarp), XVarp, YVarp)
43 })
44 }
45}
46
47// GetGetLayoutOffsets gets the "get_layout_offsets" callback function.
48func (x *ScaleClass) GetGetLayoutOffsets() func(*Scale, *int, *int) {
49 if x.xGetLayoutOffsets == 0 {
50 return nil
51 }
52 var rawCallback func(ScaleVarp uintptr, XVarp *int, YVarp *int)
53 purego.RegisterFunc(&rawCallback, x.xGetLayoutOffsets)
54 return func(ScaleVar *Scale, XVar *int, YVar *int) {
55 rawCallback(ScaleVar.GoPointer(), XVar, YVar)
56 }
57}
58
59// Allows to select a numeric value with a slider control.
60//
61// <picture>
62//
63// <source srcset="scales-dark.png" media="(prefers-color-scheme: dark)">
64// <img alt="An example GtkScale" src="scales.png">
65//
66// </picture>
67//
68// To use it, you’ll probably want to investigate the methods on its base
69// class, [class@Gtk.Range], in addition to the methods for `GtkScale` itself.
70// To set the value of a scale, you would normally use [method@Gtk.Range.set_value].
71// To detect changes to the value, you would normally use the
72// [signal@Gtk.Range::value-changed] signal.
73//
74// Note that using the same upper and lower bounds for the `GtkScale` (through
75// the `GtkRange` methods) will hide the slider itself. This is useful for
76// applications that want to show an undeterminate value on the scale, without
77// changing the layout of the application (such as movie or music players).
78//
79// # GtkScale as GtkBuildable
80//
81// `GtkScale` supports a custom `<marks>` element, which can contain multiple
82// `<mark\>` elements. The “value” and “position” attributes have the same
83// meaning as [method@Gtk.Scale.add_mark] parameters of the same name. If
84// the element is not empty, its content is taken as the markup to show at
85// the mark. It can be translated with the usual ”translatable” and
86// “context” attributes.
87//
88// # Shortcuts and Gestures
89//
90// `GtkPopoverMenu` supports the following keyboard shortcuts:
91//
92// - Arrow keys, <kbd>+</kbd> and <kbd>-</kbd> will increment or decrement
93// by step, or by page when combined with <kbd>Ctrl</kbd>.
94// - <kbd>PgUp</kbd> and <kbd>PgDn</kbd> will increment or decrement by page.
95// - <kbd>Home</kbd> and <kbd>End</kbd> will set the minimum or maximum value.
96//
97// # CSS nodes
98//
99// ```
100// scale[.fine-tune][.marks-before][.marks-after]
101// ├── [value][.top][.right][.bottom][.left]
102// ├── marks.top
103// │ ├── mark
104// │ ┊ ├── [label]
105// │ ┊ ╰── indicator
106// ┊ ┊
107// │ ╰── mark
108// ├── marks.bottom
109// │ ├── mark
110// │ ┊ ├── indicator
111// │ ┊ ╰── [label]
112// ┊ ┊
113// │ ╰── mark
114// ╰── trough
115//
116// ├── [fill]
117// ├── [highlight]
118// ╰── slider
119//
120// ```
121//
122// `GtkScale` has a main CSS node with name scale and a subnode for its contents,
123// with subnodes named trough and slider.
124//
125// The main node gets the style class .fine-tune added when the scale is in
126// 'fine-tuning' mode.
127//
128// If the scale has an origin (see [method@Gtk.Scale.set_has_origin]), there is
129// a subnode with name highlight below the trough node that is used for rendering
130// the highlighted part of the trough.
131//
132// If the scale is showing a fill level (see [method@Gtk.Range.set_show_fill_level]),
133// there is a subnode with name fill below the trough node that is used for
134// rendering the filled in part of the trough.
135//
136// If marks are present, there is a marks subnode before or after the trough
137// node, below which each mark gets a node with name mark. The marks nodes get
138// either the .top or .bottom style class.
139//
140// The mark node has a subnode named indicator. If the mark has text, it also
141// has a subnode named label. When the mark is either above or left of the
142// scale, the label subnode is the first when present. Otherwise, the indicator
143// subnode is the first.
144//
145// The main CSS node gets the 'marks-before' and/or 'marks-after' style classes
146// added depending on what marks are present.
147//
148// If the scale is displaying the value (see [property@Gtk.Scale:draw-value]),
149// there is subnode with name value. This node will get the .top or .bottom style
150// classes similar to the marks node.
151//
152// # Accessibility
153//
154// `GtkScale` uses the [enum@Gtk.AccessibleRole.slider] role.
155type Scale struct {
156 Range
157}
158
159var xScaleGLibType func() types.GType
160
161func ScaleGLibType() types.GType {
162 return xScaleGLibType()
163}
164
165func ScaleNewFromInternalPtr(ptr uintptr) *Scale {
166 cls := &Scale{}
167 cls.Ptr = ptr
168 return cls
169}
170
171var xNewScale func(Orientation, uintptr) uintptr
172
173// Creates a new `GtkScale`.
174func NewScale(OrientationVar Orientation, AdjustmentVar *Adjustment) *Scale {
175 var cls *Scale
176
177 cret := xNewScale(OrientationVar, AdjustmentVar.GoPointer())
178
179 if cret == 0 {
180 return nil
181 }
182 gobject.IncreaseRef(cret)
183 cls = &Scale{}
184 cls.Ptr = cret
185 return cls
186}
187
188var xNewScaleWithRange func(Orientation, float64, float64, float64) uintptr
189
190// Creates a new scale widget with a range from @min to @max.
191//
192// The returns scale will have the given orientation and will let the
193// user input a number between @min and @max (including @min and @max)
194// with the increment @step. @step must be nonzero; it’s the distance
195// the slider moves when using the arrow keys to adjust the scale
196// value.
197//
198// Note that the way in which the precision is derived works best if
199// @step is a power of ten. If the resulting precision is not suitable
200// for your needs, use [method@Gtk.Scale.set_digits] to correct it.
201func NewScaleWithRange(OrientationVar Orientation, MinVar float64, MaxVar float64, StepVar float64) *Scale {
202 var cls *Scale
203
204 cret := xNewScaleWithRange(OrientationVar, MinVar, MaxVar, StepVar)
205
206 if cret == 0 {
207 return nil
208 }
209 gobject.IncreaseRef(cret)
210 cls = &Scale{}
211 cls.Ptr = cret
212 return cls
213}
214
215var xScaleAddMark func(uintptr, float64, PositionType, uintptr)
216
217// Adds a mark at @value.
218//
219// A mark is indicated visually by drawing a tick mark next to the scale,
220// and GTK makes it easy for the user to position the scale exactly at the
221// marks value.
222//
223// If @markup is not %NULL, text is shown next to the tick mark.
224//
225// To remove marks from a scale, use [method@Gtk.Scale.clear_marks].
226func (x *Scale) AddMark(ValueVar float64, PositionVar PositionType, MarkupVar *string) {
227
228 MarkupVarPtr := core.GStrdupNullable(MarkupVar)
229 defer core.GFreeNullable(MarkupVarPtr)
230
231 xScaleAddMark(x.GoPointer(), ValueVar, PositionVar, MarkupVarPtr)
232
233}
234
235var xScaleClearMarks func(uintptr)
236
237// Removes any marks that have been added.
238func (x *Scale) ClearMarks() {
239
240 xScaleClearMarks(x.GoPointer())
241
242}
243
244var xScaleGetDigits func(uintptr) int
245
246// Gets the number of decimal places that are displayed in the value.
247func (x *Scale) GetDigits() int {
248
249 cret := xScaleGetDigits(x.GoPointer())
250 return cret
251}
252
253var xScaleGetDrawValue func(uintptr) bool
254
255// Returns whether the current value is displayed as a string
256// next to the slider.
257func (x *Scale) GetDrawValue() bool {
258
259 cret := xScaleGetDrawValue(x.GoPointer())
260 return cret
261}
262
263var xScaleGetHasOrigin func(uintptr) bool
264
265// Returns whether the scale has an origin.
266func (x *Scale) GetHasOrigin() bool {
267
268 cret := xScaleGetHasOrigin(x.GoPointer())
269 return cret
270}
271
272var xScaleGetLayout func(uintptr) uintptr
273
274// Gets the `PangoLayout` used to display the scale.
275//
276// The returned object is owned by the scale so does not need
277// to be freed by the caller.
278func (x *Scale) GetLayout() *pango.Layout {
279 var cls *pango.Layout
280
281 cret := xScaleGetLayout(x.GoPointer())
282
283 if cret == 0 {
284 return nil
285 }
286 gobject.IncreaseRef(cret)
287 cls = &pango.Layout{}
288 cls.Ptr = cret
289 return cls
290}
291
292var xScaleGetLayoutOffsets func(uintptr, *int, *int)
293
294// Obtains the coordinates where the scale will draw the
295// `PangoLayout` representing the text in the scale.
296//
297// Remember when using the `PangoLayout` function you need to
298// convert to and from pixels using `PANGO_PIXELS()` or `PANGO_SCALE`.
299//
300// If the [property@Gtk.Scale:draw-value] property is %FALSE, the return
301// values are undefined.
302func (x *Scale) GetLayoutOffsets(XVar *int, YVar *int) {
303
304 xScaleGetLayoutOffsets(x.GoPointer(), XVar, YVar)
305
306}
307
308var xScaleGetValuePos func(uintptr) PositionType
309
310// Gets the position in which the current value is displayed.
311func (x *Scale) GetValuePos() PositionType {
312
313 cret := xScaleGetValuePos(x.GoPointer())
314 return cret
315}
316
317var xScaleSetDigits func(uintptr, int)
318
319// Sets the number of decimal places that are displayed in the value.
320//
321// Also causes the value of the adjustment to be rounded to this number
322// of digits, so the retrieved value matches the displayed one, if
323// [property@Gtk.Scale:draw-value] is %TRUE when the value changes. If
324// you want to enforce rounding the value when [property@Gtk.Scale:draw-value]
325// is %FALSE, you can set [property@Gtk.Range:round-digits] instead.
326//
327// Note that rounding to a small number of digits can interfere with
328// the smooth autoscrolling that is built into `GtkScale`. As an alternative,
329// you can use [method@Gtk.Scale.set_format_value_func] to format the displayed
330// value yourself.
331func (x *Scale) SetDigits(DigitsVar int) {
332
333 xScaleSetDigits(x.GoPointer(), DigitsVar)
334
335}
336
337var xScaleSetDrawValue func(uintptr, bool)
338
339// Specifies whether the current value is displayed as a string next
340// to the slider.
341func (x *Scale) SetDrawValue(DrawValueVar bool) {
342
343 xScaleSetDrawValue(x.GoPointer(), DrawValueVar)
344
345}
346
347var xScaleSetFormatValueFunc func(uintptr, uintptr, uintptr, uintptr)
348
349// @func allows you to change how the scale value is displayed.
350//
351// The given function will return an allocated string representing
352// @value. That string will then be used to display the scale's value.
353//
354// If #NULL is passed as @func, the value will be displayed on
355// its own, rounded according to the value of the
356// [property@Gtk.Scale:digits] property.
357func (x *Scale) SetFormatValueFunc(FuncVar *ScaleFormatValueFunc, UserDataVar uintptr, DestroyNotifyVar *glib.DestroyNotify) {
358
359 var FuncVarRef uintptr
360 if FuncVar != nil {
361 FuncVarPtr := uintptr(unsafe.Pointer(FuncVar))
362 if cbRefPtr, ok := glib.GetCallback(FuncVarPtr); ok {
363 FuncVarRef = cbRefPtr
364 } else {
365 fcb := func(arg0 uintptr, arg1 float64, arg2 uintptr) string {
366 cbFn := *FuncVar
367 return cbFn(arg0, arg1, arg2)
368 }
369 FuncVarRef = purego.NewCallback(fcb)
370 glib.SaveCallbackWithClosure(FuncVarPtr, FuncVarRef, FuncVar)
371 }
372 }
373
374 var DestroyNotifyVarRef uintptr
375 if DestroyNotifyVar != nil {
376 DestroyNotifyVarPtr := uintptr(unsafe.Pointer(DestroyNotifyVar))
377 if cbRefPtr, ok := glib.GetCallback(DestroyNotifyVarPtr); ok {
378 DestroyNotifyVarRef = cbRefPtr
379 } else {
380 fcb := func(arg0 uintptr) {
381 cbFn := *DestroyNotifyVar
382 cbFn(arg0)
383 }
384 DestroyNotifyVarRef = purego.NewCallback(fcb)
385 glib.SaveCallbackWithClosure(DestroyNotifyVarPtr, DestroyNotifyVarRef, DestroyNotifyVar)
386 }
387 }
388
389 xScaleSetFormatValueFunc(x.GoPointer(), FuncVarRef, UserDataVar, DestroyNotifyVarRef)
390
391}
392
393var xScaleSetHasOrigin func(uintptr, bool)
394
395// Sets whether the scale has an origin.
396//
397// If [property@Gtk.Scale:has-origin] is set to %TRUE (the default),
398// the scale will highlight the part of the trough between the origin
399// (bottom or left side) and the current value.
400func (x *Scale) SetHasOrigin(HasOriginVar bool) {
401
402 xScaleSetHasOrigin(x.GoPointer(), HasOriginVar)
403
404}
405
406var xScaleSetValuePos func(uintptr, PositionType)
407
408// Sets the position in which the current value is displayed.
409func (x *Scale) SetValuePos(PosVar PositionType) {
410
411 xScaleSetValuePos(x.GoPointer(), PosVar)
412
413}
414
415func (c *Scale) GoPointer() uintptr {
416 if c == nil {
417 return 0
418 }
419 return c.Ptr
420}
421
422func (c *Scale) SetGoPointer(ptr uintptr) {
423 c.Ptr = ptr
424}
425
426// SetPropertyDigits sets the "digits" property.
427// The number of decimal places that are displayed in the value.
428func (x *Scale) SetPropertyDigits(value int) {
429 var v gobject.Value
430 v.Init(gobject.TypeIntVal)
431 v.SetInt(value)
432 x.SetProperty("digits", &v)
433}
434
435// GetPropertyDigits gets the "digits" property.
436// The number of decimal places that are displayed in the value.
437func (x *Scale) GetPropertyDigits() int {
438 var v gobject.Value
439 x.GetProperty("digits", &v)
440 return v.GetInt()
441}
442
443// SetPropertyDrawValue sets the "draw-value" property.
444// Whether the current value is displayed as a string next to the slider.
445func (x *Scale) SetPropertyDrawValue(value bool) {
446 var v gobject.Value
447 v.Init(gobject.TypeBooleanVal)
448 v.SetBoolean(value)
449 x.SetProperty("draw-value", &v)
450}
451
452// GetPropertyDrawValue gets the "draw-value" property.
453// Whether the current value is displayed as a string next to the slider.
454func (x *Scale) GetPropertyDrawValue() bool {
455 var v gobject.Value
456 x.GetProperty("draw-value", &v)
457 return v.GetBoolean()
458}
459
460// SetPropertyHasOrigin sets the "has-origin" property.
461// Whether the scale has an origin.
462func (x *Scale) SetPropertyHasOrigin(value bool) {
463 var v gobject.Value
464 v.Init(gobject.TypeBooleanVal)
465 v.SetBoolean(value)
466 x.SetProperty("has-origin", &v)
467}
468
469// GetPropertyHasOrigin gets the "has-origin" property.
470// Whether the scale has an origin.
471func (x *Scale) GetPropertyHasOrigin() bool {
472 var v gobject.Value
473 x.GetProperty("has-origin", &v)
474 return v.GetBoolean()
475}
476
477// Requests the user's screen reader to announce the given message.
478//
479// This kind of notification is useful for messages that
480// either have only a visual representation or that are not
481// exposed visually at all, e.g. a notification about a
482// successful operation.
483//
484// Also, by using this API, you can ensure that the message
485// does not interrupts the user's current screen reader output.
486func (x *Scale) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
487
488 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
489
490}
491
492// Retrieves the accessible parent for an accessible object.
493//
494// This function returns `NULL` for top level widgets.
495func (x *Scale) GetAccessibleParent() *AccessibleBase {
496 var cls *AccessibleBase
497
498 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
499
500 if cret == 0 {
501 return nil
502 }
503 cls = &AccessibleBase{}
504 cls.Ptr = cret
505 return cls
506}
507
508// Retrieves the accessible role of an accessible object.
509func (x *Scale) GetAccessibleRole() AccessibleRole {
510
511 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
512 return cret
513}
514
515// Retrieves the implementation for the given accessible object.
516func (x *Scale) GetAtContext() *ATContext {
517 var cls *ATContext
518
519 cret := XGtkAccessibleGetAtContext(x.GoPointer())
520
521 if cret == 0 {
522 return nil
523 }
524 cls = &ATContext{}
525 cls.Ptr = cret
526 return cls
527}
528
529// Queries the coordinates and dimensions of this accessible
530//
531// This functionality can be overridden by `GtkAccessible`
532// implementations, e.g. to get the bounds from an ignored
533// child widget.
534func (x *Scale) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
535
536 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
537 return cret
538}
539
540// Retrieves the first accessible child of an accessible object.
541func (x *Scale) GetFirstAccessibleChild() *AccessibleBase {
542 var cls *AccessibleBase
543
544 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
545
546 if cret == 0 {
547 return nil
548 }
549 cls = &AccessibleBase{}
550 cls.Ptr = cret
551 return cls
552}
553
554// Retrieves the next accessible sibling of an accessible object
555func (x *Scale) GetNextAccessibleSibling() *AccessibleBase {
556 var cls *AccessibleBase
557
558 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
559
560 if cret == 0 {
561 return nil
562 }
563 cls = &AccessibleBase{}
564 cls.Ptr = cret
565 return cls
566}
567
568// Queries a platform state, such as focus.
569//
570// This functionality can be overridden by `GtkAccessible`
571// implementations, e.g. to get platform state from an ignored
572// child widget, as is the case for `GtkText` wrappers.
573func (x *Scale) GetPlatformState(StateVar AccessiblePlatformState) bool {
574
575 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
576 return cret
577}
578
579// Resets the accessible property to its default value.
580func (x *Scale) ResetProperty(PropertyVar AccessibleProperty) {
581
582 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
583
584}
585
586// Resets the accessible relation to its default value.
587func (x *Scale) ResetRelation(RelationVar AccessibleRelation) {
588
589 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
590
591}
592
593// Resets the accessible state to its default value.
594func (x *Scale) ResetState(StateVar AccessibleState) {
595
596 XGtkAccessibleResetState(x.GoPointer(), StateVar)
597
598}
599
600// Sets the parent and sibling of an accessible object.
601//
602// This function is meant to be used by accessible implementations that are
603// not part of the widget hierarchy, and but act as a logical bridge between
604// widgets. For instance, if a widget creates an object that holds metadata
605// for each child, and you want that object to implement the `GtkAccessible`
606// interface, you will use this function to ensure that the parent of each
607// child widget is the metadata object, and the parent of each metadata
608// object is the container widget.
609func (x *Scale) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
610
611 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
612
613}
614
615// Updates the next accessible sibling.
616//
617// That might be useful when a new child of a custom accessible
618// is created, and it needs to be linked to a previous child.
619func (x *Scale) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
620
621 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
622
623}
624
625// Informs ATs that the platform state has changed.
626//
627// This function should be used by `GtkAccessible` implementations that
628// have a platform state but are not widgets. Widgets handle platform
629// states automatically.
630func (x *Scale) UpdatePlatformState(StateVar AccessiblePlatformState) {
631
632 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
633
634}
635
636// Updates a list of accessible properties.
637//
638// See the [enum@Gtk.AccessibleProperty] documentation for the
639// value types of accessible properties.
640//
641// This function should be called by `GtkWidget` types whenever
642// an accessible property change must be communicated to assistive
643// technologies.
644//
645// Example:
646// ```c
647// value = gtk_adjustment_get_value (adjustment);
648// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
649//
650// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
651// -1);
652//
653// ```
654func (x *Scale) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
655
656 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
657
658}
659
660// Updates an array of accessible properties.
661//
662// This function should be called by `GtkWidget` types whenever an accessible
663// property change must be communicated to assistive technologies.
664//
665// This function is meant to be used by language bindings.
666func (x *Scale) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
667
668 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
669
670}
671
672// Updates a list of accessible relations.
673//
674// This function should be called by `GtkWidget` types whenever an accessible
675// relation change must be communicated to assistive technologies.
676//
677// If the [enum@Gtk.AccessibleRelation] requires a list of references,
678// you should pass each reference individually, followed by `NULL`, e.g.
679//
680// ```c
681// gtk_accessible_update_relation (accessible,
682//
683// GTK_ACCESSIBLE_RELATION_CONTROLS,
684// ref1, NULL,
685// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
686// ref1, ref2, ref3, NULL,
687// -1);
688//
689// ```
690func (x *Scale) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
691
692 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
693
694}
695
696// Updates an array of accessible relations.
697//
698// This function should be called by `GtkWidget` types whenever an accessible
699// relation change must be communicated to assistive technologies.
700//
701// This function is meant to be used by language bindings.
702func (x *Scale) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
703
704 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
705
706}
707
708// Updates a list of accessible states.
709//
710// See the [enum@Gtk.AccessibleState] documentation for the
711// value types of accessible states.
712//
713// This function should be called by `GtkWidget` types whenever
714// an accessible state change must be communicated to assistive
715// technologies.
716//
717// Example:
718//
719// ```c
720// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
721// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
722//
723// GTK_ACCESSIBLE_STATE_CHECKED, value,
724// -1);
725//
726// ```
727func (x *Scale) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
728
729 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
730
731}
732
733// Updates an array of accessible states.
734//
735// This function should be called by `GtkWidget` types whenever an accessible
736// state change must be communicated to assistive technologies.
737//
738// This function is meant to be used by language bindings.
739func (x *Scale) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
740
741 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
742
743}
744
745// Gets the ID of the @buildable object.
746//
747// `GtkBuilder` sets the name based on the ID attribute
748// of the `<object>` tag used to construct the @buildable.
749func (x *Scale) GetBuildableId() string {
750
751 cret := XGtkBuildableGetBuildableId(x.GoPointer())
752 return cret
753}
754
755// Retrieves the orientation of the @orientable.
756func (x *Scale) GetOrientation() Orientation {
757
758 cret := XGtkOrientableGetOrientation(x.GoPointer())
759 return cret
760}
761
762// Sets the orientation of the @orientable.
763func (x *Scale) SetOrientation(OrientationVar Orientation) {
764
765 XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
766
767}
768
769func init() {
770 core.SetPackageName("GTK", "gtk4")
771 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
772 var libs []uintptr
773 for _, libPath := range core.GetPaths("GTK") {
774 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
775 if err != nil {
776 panic(err)
777 }
778 libs = append(libs, lib)
779 }
780
781 core.PuregoSafeRegister(&xScaleGLibType, libs, "gtk_scale_get_type")
782
783 core.PuregoSafeRegister(&xNewScale, libs, "gtk_scale_new")
784 core.PuregoSafeRegister(&xNewScaleWithRange, libs, "gtk_scale_new_with_range")
785
786 core.PuregoSafeRegister(&xScaleAddMark, libs, "gtk_scale_add_mark")
787 core.PuregoSafeRegister(&xScaleClearMarks, libs, "gtk_scale_clear_marks")
788 core.PuregoSafeRegister(&xScaleGetDigits, libs, "gtk_scale_get_digits")
789 core.PuregoSafeRegister(&xScaleGetDrawValue, libs, "gtk_scale_get_draw_value")
790 core.PuregoSafeRegister(&xScaleGetHasOrigin, libs, "gtk_scale_get_has_origin")
791 core.PuregoSafeRegister(&xScaleGetLayout, libs, "gtk_scale_get_layout")
792 core.PuregoSafeRegister(&xScaleGetLayoutOffsets, libs, "gtk_scale_get_layout_offsets")
793 core.PuregoSafeRegister(&xScaleGetValuePos, libs, "gtk_scale_get_value_pos")
794 core.PuregoSafeRegister(&xScaleSetDigits, libs, "gtk_scale_set_digits")
795 core.PuregoSafeRegister(&xScaleSetDrawValue, libs, "gtk_scale_set_draw_value")
796 core.PuregoSafeRegister(&xScaleSetFormatValueFunc, libs, "gtk_scale_set_format_value_func")
797 core.PuregoSafeRegister(&xScaleSetHasOrigin, libs, "gtk_scale_set_has_origin")
798 core.PuregoSafeRegister(&xScaleSetValuePos, libs, "gtk_scale_set_value_pos")
799
800}