1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "fmt"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/glib"
12 "github.com/bnema/puregotk/v4/gobject"
13 "github.com/bnema/puregotk/v4/gobject/types"
14)
15
16const (
17 // The name used for the stock full offset included by `GtkLevelBar`.
18 LEVEL_BAR_OFFSET_FULL string = "full"
19 // The name used for the stock high offset included by `GtkLevelBar`.
20 LEVEL_BAR_OFFSET_HIGH string = "high"
21 // The name used for the stock low offset included by `GtkLevelBar`.
22 LEVEL_BAR_OFFSET_LOW string = "low"
23)
24
25// Shows a level indicator.
26//
27// Typical use cases are displaying the strength of a password, or
28// showing the charge level of a battery.
29//
30// <picture>
31//
32// <source srcset="levelbar-dark.png" media="(prefers-color-scheme: dark)">
33// <img alt="An example GtkLevelBar" src="levelbar.png">
34//
35// </picture>
36//
37// Use [method@Gtk.LevelBar.set_value] to set the current value, and
38// [method@Gtk.LevelBar.add_offset_value] to set the value offsets at which
39// the bar will be considered in a different state. GTK will add a few
40// offsets by default on the level bar: %GTK_LEVEL_BAR_OFFSET_LOW,
41// %GTK_LEVEL_BAR_OFFSET_HIGH and %GTK_LEVEL_BAR_OFFSET_FULL, with
42// values 0.25, 0.75 and 1.0 respectively.
43//
44// Note that it is your responsibility to update preexisting offsets
45// when changing the minimum or maximum value. GTK will simply clamp
46// them to the new range.
47//
48// ## Adding a custom offset on the bar
49//
50// ```c
51// static GtkWidget *
52// create_level_bar (void)
53//
54// {
55// GtkWidget *widget;
56// GtkLevelBar *bar;
57//
58// widget = gtk_level_bar_new ();
59// bar = GTK_LEVEL_BAR (widget);
60//
61// // This changes the value of the default low offset
62//
63// gtk_level_bar_add_offset_value (bar,
64// GTK_LEVEL_BAR_OFFSET_LOW,
65// 0.10);
66//
67// // This adds a new offset to the bar; the application will
68// // be able to change its color CSS like this:
69// //
70// // levelbar block.my-offset {
71// // background-color: magenta;
72// // border-style: solid;
73// // border-color: black;
74// // border-width: 1px;
75// // }
76//
77// gtk_level_bar_add_offset_value (bar, "my-offset", 0.60);
78//
79// return widget;
80// }
81//
82// ```
83//
84// The default interval of values is between zero and one, but it’s possible
85// to modify the interval using [method@Gtk.LevelBar.set_min_value] and
86// [method@Gtk.LevelBar.set_max_value]. The value will be always drawn in
87// proportion to the admissible interval, i.e. a value of 15 with a specified
88// interval between 10 and 20 is equivalent to a value of 0.5 with an interval
89// between 0 and 1. When %GTK_LEVEL_BAR_MODE_DISCRETE is used, the bar level
90// is rendered as a finite number of separated blocks instead of a single one.
91// The number of blocks that will be rendered is equal to the number of units
92// specified by the admissible interval.
93//
94// For instance, to build a bar rendered with five blocks, it’s sufficient to
95// set the minimum value to 0 and the maximum value to 5 after changing the
96// indicator mode to discrete.
97//
98// # GtkLevelBar as GtkBuildable
99//
100// The `GtkLevelBar` implementation of the `GtkBuildable` interface supports a
101// custom `<offsets>` element, which can contain any number of `<offset>` elements,
102// each of which must have "name" and "value" attributes.
103//
104// # CSS nodes
105//
106// ```
107// levelbar[.discrete]
108// ╰── trough
109//
110// ├── block.filled.level-name
111// ┊
112// ├── block.empty
113// ┊
114//
115// ```
116//
117// `GtkLevelBar` has a main CSS node with name levelbar and one of the style
118// classes .discrete or .continuous and a subnode with name trough. Below the
119// trough node are a number of nodes with name block and style class .filled
120// or .empty. In continuous mode, there is exactly one node of each, in discrete
121// mode, the number of filled and unfilled nodes corresponds to blocks that are
122// drawn. The block.filled nodes also get a style class .level-name corresponding
123// to the level for the current value.
124//
125// In horizontal orientation, the nodes are always arranged from left to right,
126// regardless of text direction.
127//
128// # Accessibility
129//
130// `GtkLevelBar` uses the [enum@Gtk.AccessibleRole.meter] role.
131type LevelBar struct {
132 Widget
133}
134
135var xLevelBarGLibType func() types.GType
136
137func LevelBarGLibType() types.GType {
138 return xLevelBarGLibType()
139}
140
141func LevelBarNewFromInternalPtr(ptr uintptr) *LevelBar {
142 cls := &LevelBar{}
143 cls.Ptr = ptr
144 return cls
145}
146
147var xNewLevelBar func() uintptr
148
149// Creates a new `GtkLevelBar`.
150func NewLevelBar() *LevelBar {
151 var cls *LevelBar
152
153 cret := xNewLevelBar()
154
155 if cret == 0 {
156 return nil
157 }
158 gobject.IncreaseRef(cret)
159 cls = &LevelBar{}
160 cls.Ptr = cret
161 return cls
162}
163
164var xNewLevelBarForInterval func(float64, float64) uintptr
165
166// Creates a new `GtkLevelBar` for the specified interval.
167func NewLevelBarForInterval(MinValueVar float64, MaxValueVar float64) *LevelBar {
168 var cls *LevelBar
169
170 cret := xNewLevelBarForInterval(MinValueVar, MaxValueVar)
171
172 if cret == 0 {
173 return nil
174 }
175 gobject.IncreaseRef(cret)
176 cls = &LevelBar{}
177 cls.Ptr = cret
178 return cls
179}
180
181var xLevelBarAddOffsetValue func(uintptr, string, float64)
182
183// Adds a new offset marker on @self at the position specified by @value.
184//
185// When the bar value is in the interval topped by @value (or between @value
186// and [property@Gtk.LevelBar:max-value] in case the offset is the last one
187// on the bar) a style class named `level-`@name will be applied
188// when rendering the level bar fill.
189//
190// If another offset marker named @name exists, its value will be
191// replaced by @value.
192func (x *LevelBar) AddOffsetValue(NameVar string, ValueVar float64) {
193
194 xLevelBarAddOffsetValue(x.GoPointer(), NameVar, ValueVar)
195
196}
197
198var xLevelBarGetInverted func(uintptr) bool
199
200// Returns whether the levelbar is inverted.
201func (x *LevelBar) GetInverted() bool {
202
203 cret := xLevelBarGetInverted(x.GoPointer())
204 return cret
205}
206
207var xLevelBarGetMaxValue func(uintptr) float64
208
209// Returns the `max-value` of the `GtkLevelBar`.
210func (x *LevelBar) GetMaxValue() float64 {
211
212 cret := xLevelBarGetMaxValue(x.GoPointer())
213 return cret
214}
215
216var xLevelBarGetMinValue func(uintptr) float64
217
218// Returns the `min-value` of the `GtkLevelBar`.
219func (x *LevelBar) GetMinValue() float64 {
220
221 cret := xLevelBarGetMinValue(x.GoPointer())
222 return cret
223}
224
225var xLevelBarGetMode func(uintptr) LevelBarMode
226
227// Returns the `mode` of the `GtkLevelBar`.
228func (x *LevelBar) GetMode() LevelBarMode {
229
230 cret := xLevelBarGetMode(x.GoPointer())
231 return cret
232}
233
234var xLevelBarGetOffsetValue func(uintptr, uintptr, *float64) bool
235
236// Fetches the value specified for the offset marker @name in @self.
237func (x *LevelBar) GetOffsetValue(NameVar *string, ValueVar *float64) bool {
238
239 NameVarPtr := core.GStrdupNullable(NameVar)
240 defer core.GFreeNullable(NameVarPtr)
241
242 cret := xLevelBarGetOffsetValue(x.GoPointer(), NameVarPtr, ValueVar)
243 return cret
244}
245
246var xLevelBarGetValue func(uintptr) float64
247
248// Returns the `value` of the `GtkLevelBar`.
249func (x *LevelBar) GetValue() float64 {
250
251 cret := xLevelBarGetValue(x.GoPointer())
252 return cret
253}
254
255var xLevelBarRemoveOffsetValue func(uintptr, uintptr)
256
257// Removes an offset marker from a `GtkLevelBar`.
258//
259// The marker must have been previously added with
260// [method@Gtk.LevelBar.add_offset_value].
261func (x *LevelBar) RemoveOffsetValue(NameVar *string) {
262
263 NameVarPtr := core.GStrdupNullable(NameVar)
264 defer core.GFreeNullable(NameVarPtr)
265
266 xLevelBarRemoveOffsetValue(x.GoPointer(), NameVarPtr)
267
268}
269
270var xLevelBarSetInverted func(uintptr, bool)
271
272// Sets whether the `GtkLevelBar` is inverted.
273func (x *LevelBar) SetInverted(InvertedVar bool) {
274
275 xLevelBarSetInverted(x.GoPointer(), InvertedVar)
276
277}
278
279var xLevelBarSetMaxValue func(uintptr, float64)
280
281// Sets the `max-value` of the `GtkLevelBar`.
282//
283// You probably want to update preexisting level offsets after calling
284// this function.
285func (x *LevelBar) SetMaxValue(ValueVar float64) {
286
287 xLevelBarSetMaxValue(x.GoPointer(), ValueVar)
288
289}
290
291var xLevelBarSetMinValue func(uintptr, float64)
292
293// Sets the `min-value` of the `GtkLevelBar`.
294//
295// You probably want to update preexisting level offsets after calling
296// this function.
297func (x *LevelBar) SetMinValue(ValueVar float64) {
298
299 xLevelBarSetMinValue(x.GoPointer(), ValueVar)
300
301}
302
303var xLevelBarSetMode func(uintptr, LevelBarMode)
304
305// Sets the `mode` of the `GtkLevelBar`.
306func (x *LevelBar) SetMode(ModeVar LevelBarMode) {
307
308 xLevelBarSetMode(x.GoPointer(), ModeVar)
309
310}
311
312var xLevelBarSetValue func(uintptr, float64)
313
314// Sets the value of the `GtkLevelBar`.
315func (x *LevelBar) SetValue(ValueVar float64) {
316
317 xLevelBarSetValue(x.GoPointer(), ValueVar)
318
319}
320
321func (c *LevelBar) GoPointer() uintptr {
322 if c == nil {
323 return 0
324 }
325 return c.Ptr
326}
327
328func (c *LevelBar) SetGoPointer(ptr uintptr) {
329 c.Ptr = ptr
330}
331
332// SetPropertyInverted sets the "inverted" property.
333// Whether the `GtkLeveBar` is inverted.
334//
335// Level bars normally grow from top to bottom or left to right.
336// Inverted level bars grow in the opposite direction.
337func (x *LevelBar) SetPropertyInverted(value bool) {
338 var v gobject.Value
339 v.Init(gobject.TypeBooleanVal)
340 v.SetBoolean(value)
341 x.SetProperty("inverted", &v)
342}
343
344// GetPropertyInverted gets the "inverted" property.
345// Whether the `GtkLeveBar` is inverted.
346//
347// Level bars normally grow from top to bottom or left to right.
348// Inverted level bars grow in the opposite direction.
349func (x *LevelBar) GetPropertyInverted() bool {
350 var v gobject.Value
351 x.GetProperty("inverted", &v)
352 return v.GetBoolean()
353}
354
355// SetPropertyMaxValue sets the "max-value" property.
356// Determines the maximum value of the interval that can be displayed by the bar.
357func (x *LevelBar) SetPropertyMaxValue(value float64) {
358 var v gobject.Value
359 v.Init(gobject.TypeDoubleVal)
360 v.SetDouble(value)
361 x.SetProperty("max-value", &v)
362}
363
364// GetPropertyMaxValue gets the "max-value" property.
365// Determines the maximum value of the interval that can be displayed by the bar.
366func (x *LevelBar) GetPropertyMaxValue() float64 {
367 var v gobject.Value
368 x.GetProperty("max-value", &v)
369 return v.GetDouble()
370}
371
372// SetPropertyMinValue sets the "min-value" property.
373// Determines the minimum value of the interval that can be displayed by the bar.
374func (x *LevelBar) SetPropertyMinValue(value float64) {
375 var v gobject.Value
376 v.Init(gobject.TypeDoubleVal)
377 v.SetDouble(value)
378 x.SetProperty("min-value", &v)
379}
380
381// GetPropertyMinValue gets the "min-value" property.
382// Determines the minimum value of the interval that can be displayed by the bar.
383func (x *LevelBar) GetPropertyMinValue() float64 {
384 var v gobject.Value
385 x.GetProperty("min-value", &v)
386 return v.GetDouble()
387}
388
389// SetPropertyValue sets the "value" property.
390// Determines the currently filled value of the level bar.
391func (x *LevelBar) SetPropertyValue(value float64) {
392 var v gobject.Value
393 v.Init(gobject.TypeDoubleVal)
394 v.SetDouble(value)
395 x.SetProperty("value", &v)
396}
397
398// GetPropertyValue gets the "value" property.
399// Determines the currently filled value of the level bar.
400func (x *LevelBar) GetPropertyValue() float64 {
401 var v gobject.Value
402 x.GetProperty("value", &v)
403 return v.GetDouble()
404}
405
406// Emitted when an offset specified on the bar changes value.
407//
408// This typically is the result of a [method@Gtk.LevelBar.add_offset_value]
409// call.
410//
411// The signal supports detailed connections; you can connect to the
412// detailed signal "changed::x" in order to only receive callbacks when
413// the value of offset "x" changes.
414func (x *LevelBar) ConnectOffsetChanged(cb *func(LevelBar, string)) uint {
415 cbPtr := uintptr(unsafe.Pointer(cb))
416 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
417 handlerID := gobject.SignalConnect(x.GoPointer(), "offset-changed", cbRefPtr)
418 glib.SaveHandlerMapping(handlerID, cbPtr)
419 return handlerID
420 }
421
422 fcb := func(clsPtr uintptr, NameVarp uintptr) {
423 fa := LevelBar{}
424 fa.Ptr = clsPtr
425 cbFn := *cb
426
427 cbFn(fa, core.GoString(NameVarp))
428
429 }
430 cbRefPtr := purego.NewCallback(fcb)
431 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
432 handlerID := gobject.SignalConnect(x.GoPointer(), "offset-changed", cbRefPtr)
433 glib.SaveHandlerMapping(handlerID, cbPtr)
434 return handlerID
435}
436
437// ConnectOffsetChangedWithDetail connects to the "offset-changed" signal with a detail string.
438// The detail is appended as "offset-changed::<detail>".
439func (x *LevelBar) ConnectOffsetChangedWithDetail(detail string, cb *func(LevelBar, string)) uint {
440 cbPtr := uintptr(unsafe.Pointer(cb))
441 signalName := fmt.Sprintf("offset-changed::%s", detail)
442 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
443 handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
444 glib.SaveHandlerMapping(handlerID, cbPtr)
445 return handlerID
446 }
447
448 fcb := func(clsPtr uintptr, NameVarp uintptr) {
449 fa := LevelBar{}
450 fa.Ptr = clsPtr
451 cbFn := *cb
452
453 cbFn(fa, core.GoString(NameVarp))
454
455 }
456 cbRefPtr := purego.NewCallback(fcb)
457 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
458 handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
459 glib.SaveHandlerMapping(handlerID, cbPtr)
460 return handlerID
461}
462
463// Requests the user's screen reader to announce the given message.
464//
465// This kind of notification is useful for messages that
466// either have only a visual representation or that are not
467// exposed visually at all, e.g. a notification about a
468// successful operation.
469//
470// Also, by using this API, you can ensure that the message
471// does not interrupts the user's current screen reader output.
472func (x *LevelBar) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
473
474 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
475
476}
477
478// Retrieves the accessible parent for an accessible object.
479//
480// This function returns `NULL` for top level widgets.
481func (x *LevelBar) GetAccessibleParent() *AccessibleBase {
482 var cls *AccessibleBase
483
484 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
485
486 if cret == 0 {
487 return nil
488 }
489 cls = &AccessibleBase{}
490 cls.Ptr = cret
491 return cls
492}
493
494// Retrieves the accessible role of an accessible object.
495func (x *LevelBar) GetAccessibleRole() AccessibleRole {
496
497 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
498 return cret
499}
500
501// Retrieves the implementation for the given accessible object.
502func (x *LevelBar) GetAtContext() *ATContext {
503 var cls *ATContext
504
505 cret := XGtkAccessibleGetAtContext(x.GoPointer())
506
507 if cret == 0 {
508 return nil
509 }
510 cls = &ATContext{}
511 cls.Ptr = cret
512 return cls
513}
514
515// Queries the coordinates and dimensions of this accessible
516//
517// This functionality can be overridden by `GtkAccessible`
518// implementations, e.g. to get the bounds from an ignored
519// child widget.
520func (x *LevelBar) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
521
522 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
523 return cret
524}
525
526// Retrieves the first accessible child of an accessible object.
527func (x *LevelBar) GetFirstAccessibleChild() *AccessibleBase {
528 var cls *AccessibleBase
529
530 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
531
532 if cret == 0 {
533 return nil
534 }
535 cls = &AccessibleBase{}
536 cls.Ptr = cret
537 return cls
538}
539
540// Retrieves the next accessible sibling of an accessible object
541func (x *LevelBar) GetNextAccessibleSibling() *AccessibleBase {
542 var cls *AccessibleBase
543
544 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
545
546 if cret == 0 {
547 return nil
548 }
549 cls = &AccessibleBase{}
550 cls.Ptr = cret
551 return cls
552}
553
554// Queries a platform state, such as focus.
555//
556// This functionality can be overridden by `GtkAccessible`
557// implementations, e.g. to get platform state from an ignored
558// child widget, as is the case for `GtkText` wrappers.
559func (x *LevelBar) GetPlatformState(StateVar AccessiblePlatformState) bool {
560
561 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
562 return cret
563}
564
565// Resets the accessible property to its default value.
566func (x *LevelBar) ResetProperty(PropertyVar AccessibleProperty) {
567
568 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
569
570}
571
572// Resets the accessible relation to its default value.
573func (x *LevelBar) ResetRelation(RelationVar AccessibleRelation) {
574
575 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
576
577}
578
579// Resets the accessible state to its default value.
580func (x *LevelBar) ResetState(StateVar AccessibleState) {
581
582 XGtkAccessibleResetState(x.GoPointer(), StateVar)
583
584}
585
586// Sets the parent and sibling of an accessible object.
587//
588// This function is meant to be used by accessible implementations that are
589// not part of the widget hierarchy, and but act as a logical bridge between
590// widgets. For instance, if a widget creates an object that holds metadata
591// for each child, and you want that object to implement the `GtkAccessible`
592// interface, you will use this function to ensure that the parent of each
593// child widget is the metadata object, and the parent of each metadata
594// object is the container widget.
595func (x *LevelBar) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
596
597 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
598
599}
600
601// Updates the next accessible sibling.
602//
603// That might be useful when a new child of a custom accessible
604// is created, and it needs to be linked to a previous child.
605func (x *LevelBar) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
606
607 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
608
609}
610
611// Informs ATs that the platform state has changed.
612//
613// This function should be used by `GtkAccessible` implementations that
614// have a platform state but are not widgets. Widgets handle platform
615// states automatically.
616func (x *LevelBar) UpdatePlatformState(StateVar AccessiblePlatformState) {
617
618 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
619
620}
621
622// Updates a list of accessible properties.
623//
624// See the [enum@Gtk.AccessibleProperty] documentation for the
625// value types of accessible properties.
626//
627// This function should be called by `GtkWidget` types whenever
628// an accessible property change must be communicated to assistive
629// technologies.
630//
631// Example:
632// ```c
633// value = gtk_adjustment_get_value (adjustment);
634// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
635//
636// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
637// -1);
638//
639// ```
640func (x *LevelBar) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
641
642 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
643
644}
645
646// Updates an array of accessible properties.
647//
648// This function should be called by `GtkWidget` types whenever an accessible
649// property change must be communicated to assistive technologies.
650//
651// This function is meant to be used by language bindings.
652func (x *LevelBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
653
654 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
655
656}
657
658// Updates a list of accessible relations.
659//
660// This function should be called by `GtkWidget` types whenever an accessible
661// relation change must be communicated to assistive technologies.
662//
663// If the [enum@Gtk.AccessibleRelation] requires a list of references,
664// you should pass each reference individually, followed by `NULL`, e.g.
665//
666// ```c
667// gtk_accessible_update_relation (accessible,
668//
669// GTK_ACCESSIBLE_RELATION_CONTROLS,
670// ref1, NULL,
671// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
672// ref1, ref2, ref3, NULL,
673// -1);
674//
675// ```
676func (x *LevelBar) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
677
678 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
679
680}
681
682// Updates an array of accessible relations.
683//
684// This function should be called by `GtkWidget` types whenever an accessible
685// relation change must be communicated to assistive technologies.
686//
687// This function is meant to be used by language bindings.
688func (x *LevelBar) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
689
690 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
691
692}
693
694// Updates a list of accessible states.
695//
696// See the [enum@Gtk.AccessibleState] documentation for the
697// value types of accessible states.
698//
699// This function should be called by `GtkWidget` types whenever
700// an accessible state change must be communicated to assistive
701// technologies.
702//
703// Example:
704//
705// ```c
706// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
707// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
708//
709// GTK_ACCESSIBLE_STATE_CHECKED, value,
710// -1);
711//
712// ```
713func (x *LevelBar) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
714
715 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
716
717}
718
719// Updates an array of accessible states.
720//
721// This function should be called by `GtkWidget` types whenever an accessible
722// state change must be communicated to assistive technologies.
723//
724// This function is meant to be used by language bindings.
725func (x *LevelBar) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
726
727 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
728
729}
730
731// Gets the ID of the @buildable object.
732//
733// `GtkBuilder` sets the name based on the ID attribute
734// of the `<object>` tag used to construct the @buildable.
735func (x *LevelBar) GetBuildableId() string {
736
737 cret := XGtkBuildableGetBuildableId(x.GoPointer())
738 return cret
739}
740
741// Retrieves the orientation of the @orientable.
742func (x *LevelBar) GetOrientation() Orientation {
743
744 cret := XGtkOrientableGetOrientation(x.GoPointer())
745 return cret
746}
747
748// Sets the orientation of the @orientable.
749func (x *LevelBar) SetOrientation(OrientationVar Orientation) {
750
751 XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
752
753}
754
755func init() {
756 core.SetPackageName("GTK", "gtk4")
757 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
758 var libs []uintptr
759 for _, libPath := range core.GetPaths("GTK") {
760 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
761 if err != nil {
762 panic(err)
763 }
764 libs = append(libs, lib)
765 }
766
767 core.PuregoSafeRegister(&xLevelBarGLibType, libs, "gtk_level_bar_get_type")
768
769 core.PuregoSafeRegister(&xNewLevelBar, libs, "gtk_level_bar_new")
770 core.PuregoSafeRegister(&xNewLevelBarForInterval, libs, "gtk_level_bar_new_for_interval")
771
772 core.PuregoSafeRegister(&xLevelBarAddOffsetValue, libs, "gtk_level_bar_add_offset_value")
773 core.PuregoSafeRegister(&xLevelBarGetInverted, libs, "gtk_level_bar_get_inverted")
774 core.PuregoSafeRegister(&xLevelBarGetMaxValue, libs, "gtk_level_bar_get_max_value")
775 core.PuregoSafeRegister(&xLevelBarGetMinValue, libs, "gtk_level_bar_get_min_value")
776 core.PuregoSafeRegister(&xLevelBarGetMode, libs, "gtk_level_bar_get_mode")
777 core.PuregoSafeRegister(&xLevelBarGetOffsetValue, libs, "gtk_level_bar_get_offset_value")
778 core.PuregoSafeRegister(&xLevelBarGetValue, libs, "gtk_level_bar_get_value")
779 core.PuregoSafeRegister(&xLevelBarRemoveOffsetValue, libs, "gtk_level_bar_remove_offset_value")
780 core.PuregoSafeRegister(&xLevelBarSetInverted, libs, "gtk_level_bar_set_inverted")
781 core.PuregoSafeRegister(&xLevelBarSetMaxValue, libs, "gtk_level_bar_set_max_value")
782 core.PuregoSafeRegister(&xLevelBarSetMinValue, libs, "gtk_level_bar_set_min_value")
783 core.PuregoSafeRegister(&xLevelBarSetMode, libs, "gtk_level_bar_set_mode")
784 core.PuregoSafeRegister(&xLevelBarSetValue, libs, "gtk_level_bar_set_value")
785
786}