v0.2.1 c0399be

gtkrange.go RawHistoryFolder

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/gdk"
12	"github.com/bnema/puregotk/v4/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15)
16
17type RangeClass struct {
18	_ structs.HostLayout
19
20	ParentClass WidgetClass
21
22	xValueChanged uintptr
23
24	xAdjustBounds uintptr
25
26	xMoveSlider uintptr
27
28	xGetRangeBorder uintptr
29
30	xChangeValue uintptr
31
32	Padding [8]uintptr
33}
34
35func (x *RangeClass) GoPointer() uintptr {
36	return uintptr(unsafe.Pointer(x))
37}
38
39// OverrideValueChanged sets the "value_changed" callback function.
40func (x *RangeClass) OverrideValueChanged(cb func(*Range)) {
41	if cb == nil {
42		x.xValueChanged = 0
43	} else {
44		x.xValueChanged = purego.NewCallback(func(RangeVarp uintptr) {
45			cb(RangeNewFromInternalPtr(RangeVarp))
46		})
47	}
48}
49
50// GetValueChanged gets the "value_changed" callback function.
51func (x *RangeClass) GetValueChanged() func(*Range) {
52	if x.xValueChanged == 0 {
53		return nil
54	}
55	var rawCallback func(RangeVarp uintptr)
56	purego.RegisterFunc(&rawCallback, x.xValueChanged)
57	return func(RangeVar *Range) {
58		rawCallback(RangeVar.GoPointer())
59	}
60}
61
62// OverrideAdjustBounds sets the "adjust_bounds" callback function.
63func (x *RangeClass) OverrideAdjustBounds(cb func(*Range, float64)) {
64	if cb == nil {
65		x.xAdjustBounds = 0
66	} else {
67		x.xAdjustBounds = purego.NewCallback(func(RangeVarp uintptr, NewValueVarp float64) {
68			cb(RangeNewFromInternalPtr(RangeVarp), NewValueVarp)
69		})
70	}
71}
72
73// GetAdjustBounds gets the "adjust_bounds" callback function.
74func (x *RangeClass) GetAdjustBounds() func(*Range, float64) {
75	if x.xAdjustBounds == 0 {
76		return nil
77	}
78	var rawCallback func(RangeVarp uintptr, NewValueVarp float64)
79	purego.RegisterFunc(&rawCallback, x.xAdjustBounds)
80	return func(RangeVar *Range, NewValueVar float64) {
81		rawCallback(RangeVar.GoPointer(), NewValueVar)
82	}
83}
84
85// OverrideMoveSlider sets the "move_slider" callback function.
86func (x *RangeClass) OverrideMoveSlider(cb func(*Range, ScrollType)) {
87	if cb == nil {
88		x.xMoveSlider = 0
89	} else {
90		x.xMoveSlider = purego.NewCallback(func(RangeVarp uintptr, ScrollVarp ScrollType) {
91			cb(RangeNewFromInternalPtr(RangeVarp), ScrollVarp)
92		})
93	}
94}
95
96// GetMoveSlider gets the "move_slider" callback function.
97func (x *RangeClass) GetMoveSlider() func(*Range, ScrollType) {
98	if x.xMoveSlider == 0 {
99		return nil
100	}
101	var rawCallback func(RangeVarp uintptr, ScrollVarp ScrollType)
102	purego.RegisterFunc(&rawCallback, x.xMoveSlider)
103	return func(RangeVar *Range, ScrollVar ScrollType) {
104		rawCallback(RangeVar.GoPointer(), ScrollVar)
105	}
106}
107
108// OverrideGetRangeBorder sets the "get_range_border" callback function.
109func (x *RangeClass) OverrideGetRangeBorder(cb func(*Range, *Border)) {
110	if cb == nil {
111		x.xGetRangeBorder = 0
112	} else {
113		x.xGetRangeBorder = purego.NewCallback(func(RangeVarp uintptr, BorderVarp *Border) {
114			cb(RangeNewFromInternalPtr(RangeVarp), BorderVarp)
115		})
116	}
117}
118
119// GetGetRangeBorder gets the "get_range_border" callback function.
120func (x *RangeClass) GetGetRangeBorder() func(*Range, *Border) {
121	if x.xGetRangeBorder == 0 {
122		return nil
123	}
124	var rawCallback func(RangeVarp uintptr, BorderVarp *Border)
125	purego.RegisterFunc(&rawCallback, x.xGetRangeBorder)
126	return func(RangeVar *Range, BorderVar *Border) {
127		rawCallback(RangeVar.GoPointer(), BorderVar)
128	}
129}
130
131// OverrideChangeValue sets the "change_value" callback function.
132func (x *RangeClass) OverrideChangeValue(cb func(*Range, ScrollType, float64) bool) {
133	if cb == nil {
134		x.xChangeValue = 0
135	} else {
136		x.xChangeValue = purego.NewCallback(func(RangeVarp uintptr, ScrollVarp ScrollType, NewValueVarp float64) bool {
137			return cb(RangeNewFromInternalPtr(RangeVarp), ScrollVarp, NewValueVarp)
138		})
139	}
140}
141
142// GetChangeValue gets the "change_value" callback function.
143func (x *RangeClass) GetChangeValue() func(*Range, ScrollType, float64) bool {
144	if x.xChangeValue == 0 {
145		return nil
146	}
147	var rawCallback func(RangeVarp uintptr, ScrollVarp ScrollType, NewValueVarp float64) bool
148	purego.RegisterFunc(&rawCallback, x.xChangeValue)
149	return func(RangeVar *Range, ScrollVar ScrollType, NewValueVar float64) bool {
150		return rawCallback(RangeVar.GoPointer(), ScrollVar, NewValueVar)
151	}
152}
153
154// Base class for widgets which visualize an adjustment.
155//
156// Widgets that are derived from `GtkRange` include
157// [class@Gtk.Scale] and [class@Gtk.Scrollbar].
158//
159// Apart from signals for monitoring the parameters of the adjustment,
160// `GtkRange` provides properties and methods for setting a
161// “fill level” on range widgets. See [method@Gtk.Range.set_fill_level].
162//
163// # Shortcuts and Gestures
164//
165// The `GtkRange` slider is draggable. Holding the <kbd>Shift</kbd> key while
166// dragging, or initiating the drag with a long-press will enable the
167// fine-tuning mode.
168type Range struct {
169	Widget
170}
171
172var xRangeGLibType func() types.GType
173
174func RangeGLibType() types.GType {
175	return xRangeGLibType()
176}
177
178func RangeNewFromInternalPtr(ptr uintptr) *Range {
179	cls := &Range{}
180	cls.Ptr = ptr
181	return cls
182}
183
184var xRangeGetAdjustment func(uintptr) uintptr
185
186// Get the adjustment which is the “model” object for `GtkRange`.
187func (x *Range) GetAdjustment() *Adjustment {
188	var cls *Adjustment
189
190	cret := xRangeGetAdjustment(x.GoPointer())
191
192	if cret == 0 {
193		return nil
194	}
195	gobject.IncreaseRef(cret)
196	cls = &Adjustment{}
197	cls.Ptr = cret
198	return cls
199}
200
201var xRangeGetFillLevel func(uintptr) float64
202
203// Gets the current position of the fill level indicator.
204func (x *Range) GetFillLevel() float64 {
205
206	cret := xRangeGetFillLevel(x.GoPointer())
207	return cret
208}
209
210var xRangeGetFlippable func(uintptr) bool
211
212// Gets whether the `GtkRange` respects text direction.
213//
214// See [method@Gtk.Range.set_flippable].
215func (x *Range) GetFlippable() bool {
216
217	cret := xRangeGetFlippable(x.GoPointer())
218	return cret
219}
220
221var xRangeGetInverted func(uintptr) bool
222
223// Gets whether the range is inverted.
224//
225// See [method@Gtk.Range.set_inverted].
226func (x *Range) GetInverted() bool {
227
228	cret := xRangeGetInverted(x.GoPointer())
229	return cret
230}
231
232var xRangeGetRangeRect func(uintptr, *gdk.Rectangle)
233
234// This function returns the area that contains the range’s trough,
235// in coordinates relative to @range's origin.
236//
237// This function is useful mainly for `GtkRange` subclasses.
238func (x *Range) GetRangeRect(RangeRectVar *gdk.Rectangle) {
239
240	xRangeGetRangeRect(x.GoPointer(), RangeRectVar)
241
242}
243
244var xRangeGetRestrictToFillLevel func(uintptr) bool
245
246// Gets whether the range is restricted to the fill level.
247func (x *Range) GetRestrictToFillLevel() bool {
248
249	cret := xRangeGetRestrictToFillLevel(x.GoPointer())
250	return cret
251}
252
253var xRangeGetRoundDigits func(uintptr) int
254
255// Gets the number of digits to round the value to when
256// it changes.
257//
258// See [signal@Gtk.Range::change-value].
259func (x *Range) GetRoundDigits() int {
260
261	cret := xRangeGetRoundDigits(x.GoPointer())
262	return cret
263}
264
265var xRangeGetShowFillLevel func(uintptr) bool
266
267// Gets whether the range displays the fill level graphically.
268func (x *Range) GetShowFillLevel() bool {
269
270	cret := xRangeGetShowFillLevel(x.GoPointer())
271	return cret
272}
273
274var xRangeGetSliderRange func(uintptr, *int, *int)
275
276// This function returns sliders range along the long dimension,
277// in widget->window coordinates.
278//
279// This function is useful mainly for `GtkRange` subclasses.
280func (x *Range) GetSliderRange(SliderStartVar *int, SliderEndVar *int) {
281
282	xRangeGetSliderRange(x.GoPointer(), SliderStartVar, SliderEndVar)
283
284}
285
286var xRangeGetSliderSizeFixed func(uintptr) bool
287
288// This function is useful mainly for `GtkRange` subclasses.
289//
290// See [method@Gtk.Range.set_slider_size_fixed].
291func (x *Range) GetSliderSizeFixed() bool {
292
293	cret := xRangeGetSliderSizeFixed(x.GoPointer())
294	return cret
295}
296
297var xRangeGetValue func(uintptr) float64
298
299// Gets the current value of the range.
300func (x *Range) GetValue() float64 {
301
302	cret := xRangeGetValue(x.GoPointer())
303	return cret
304}
305
306var xRangeSetAdjustment func(uintptr, uintptr)
307
308// Sets the adjustment to be used as the “model” object for the `GtkRange`
309//
310// The adjustment indicates the current range value, the minimum and
311// maximum range values, the step/page increments used for keybindings
312// and scrolling, and the page size.
313//
314// The page size is normally 0 for `GtkScale` and nonzero for `GtkScrollbar`,
315// and indicates the size of the visible area of the widget being scrolled.
316// The page size affects the size of the scrollbar slider.
317func (x *Range) SetAdjustment(AdjustmentVar *Adjustment) {
318
319	xRangeSetAdjustment(x.GoPointer(), AdjustmentVar.GoPointer())
320
321}
322
323var xRangeSetFillLevel func(uintptr, float64)
324
325// Set the new position of the fill level indicator.
326//
327// The “fill level” is probably best described by its most prominent
328// use case, which is an indicator for the amount of pre-buffering in
329// a streaming media player. In that use case, the value of the range
330// would indicate the current play position, and the fill level would
331// be the position up to which the file/stream has been downloaded.
332//
333// This amount of prebuffering can be displayed on the range’s trough
334// and is themeable separately from the trough. To enable fill level
335// display, use [method@Gtk.Range.set_show_fill_level]. The range defaults
336// to not showing the fill level.
337//
338// Additionally, it’s possible to restrict the range’s slider position
339// to values which are smaller than the fill level. This is controlled
340// by [method@Gtk.Range.set_restrict_to_fill_level] and is by default
341// enabled.
342func (x *Range) SetFillLevel(FillLevelVar float64) {
343
344	xRangeSetFillLevel(x.GoPointer(), FillLevelVar)
345
346}
347
348var xRangeSetFlippable func(uintptr, bool)
349
350// Sets whether the `GtkRange` respects text direction.
351//
352// If a range is flippable, it will switch its direction
353// if it is horizontal and its direction is %GTK_TEXT_DIR_RTL.
354//
355// See [method@Gtk.Widget.get_direction].
356func (x *Range) SetFlippable(FlippableVar bool) {
357
358	xRangeSetFlippable(x.GoPointer(), FlippableVar)
359
360}
361
362var xRangeSetIncrements func(uintptr, float64, float64)
363
364// Sets the step and page sizes for the range.
365//
366// The step size is used when the user clicks the `GtkScrollbar`
367// arrows or moves a `GtkScale` via arrow keys. The page size
368// is used for example when moving via Page Up or Page Down keys.
369func (x *Range) SetIncrements(StepVar float64, PageVar float64) {
370
371	xRangeSetIncrements(x.GoPointer(), StepVar, PageVar)
372
373}
374
375var xRangeSetInverted func(uintptr, bool)
376
377// Sets whether to invert the range.
378//
379// Ranges normally move from lower to higher values as the
380// slider moves from top to bottom or left to right. Inverted
381// ranges have higher values at the top or on the right rather
382// than on the bottom or left.
383func (x *Range) SetInverted(SettingVar bool) {
384
385	xRangeSetInverted(x.GoPointer(), SettingVar)
386
387}
388
389var xRangeSetRange func(uintptr, float64, float64)
390
391// Sets the allowable values in the `GtkRange`.
392//
393// The range value is clamped to be between @min and @max.
394// (If the range has a non-zero page size, it is clamped
395// between @min and @max - page-size.)
396func (x *Range) SetRange(MinVar float64, MaxVar float64) {
397
398	xRangeSetRange(x.GoPointer(), MinVar, MaxVar)
399
400}
401
402var xRangeSetRestrictToFillLevel func(uintptr, bool)
403
404// Sets whether the slider is restricted to the fill level.
405//
406// See [method@Gtk.Range.set_fill_level] for a general description
407// of the fill level concept.
408func (x *Range) SetRestrictToFillLevel(RestrictToFillLevelVar bool) {
409
410	xRangeSetRestrictToFillLevel(x.GoPointer(), RestrictToFillLevelVar)
411
412}
413
414var xRangeSetRoundDigits func(uintptr, int)
415
416// Sets the number of digits to round the value to when
417// it changes.
418//
419// See [signal@Gtk.Range::change-value].
420func (x *Range) SetRoundDigits(RoundDigitsVar int) {
421
422	xRangeSetRoundDigits(x.GoPointer(), RoundDigitsVar)
423
424}
425
426var xRangeSetShowFillLevel func(uintptr, bool)
427
428// Sets whether a graphical fill level is show on the trough.
429//
430// See [method@Gtk.Range.set_fill_level] for a general description
431// of the fill level concept.
432func (x *Range) SetShowFillLevel(ShowFillLevelVar bool) {
433
434	xRangeSetShowFillLevel(x.GoPointer(), ShowFillLevelVar)
435
436}
437
438var xRangeSetSliderSizeFixed func(uintptr, bool)
439
440// Sets whether the range’s slider has a fixed size, or a size that
441// depends on its adjustment’s page size.
442//
443// This function is useful mainly for `GtkRange` subclasses.
444func (x *Range) SetSliderSizeFixed(SizeFixedVar bool) {
445
446	xRangeSetSliderSizeFixed(x.GoPointer(), SizeFixedVar)
447
448}
449
450var xRangeSetValue func(uintptr, float64)
451
452// Sets the current value of the range.
453//
454// If the value is outside the minimum or maximum range values,
455// it will be clamped to fit inside them. The range emits the
456// [signal@Gtk.Range::value-changed] signal if the value changes.
457func (x *Range) SetValue(ValueVar float64) {
458
459	xRangeSetValue(x.GoPointer(), ValueVar)
460
461}
462
463func (c *Range) GoPointer() uintptr {
464	if c == nil {
465		return 0
466	}
467	return c.Ptr
468}
469
470func (c *Range) SetGoPointer(ptr uintptr) {
471	c.Ptr = ptr
472}
473
474// SetPropertyFillLevel sets the "fill-level" property.
475// The fill level (e.g. prebuffering of a network stream).
476func (x *Range) SetPropertyFillLevel(value float64) {
477	var v gobject.Value
478	v.Init(gobject.TypeDoubleVal)
479	v.SetDouble(value)
480	x.SetProperty("fill-level", &v)
481}
482
483// GetPropertyFillLevel gets the "fill-level" property.
484// The fill level (e.g. prebuffering of a network stream).
485func (x *Range) GetPropertyFillLevel() float64 {
486	var v gobject.Value
487	x.GetProperty("fill-level", &v)
488	return v.GetDouble()
489}
490
491// SetPropertyInverted sets the "inverted" property.
492// If %TRUE, the direction in which the slider moves is inverted.
493func (x *Range) SetPropertyInverted(value bool) {
494	var v gobject.Value
495	v.Init(gobject.TypeBooleanVal)
496	v.SetBoolean(value)
497	x.SetProperty("inverted", &v)
498}
499
500// GetPropertyInverted gets the "inverted" property.
501// If %TRUE, the direction in which the slider moves is inverted.
502func (x *Range) GetPropertyInverted() bool {
503	var v gobject.Value
504	x.GetProperty("inverted", &v)
505	return v.GetBoolean()
506}
507
508// SetPropertyRestrictToFillLevel sets the "restrict-to-fill-level" property.
509// Controls whether slider movement is restricted to an
510// upper boundary set by the fill level.
511func (x *Range) SetPropertyRestrictToFillLevel(value bool) {
512	var v gobject.Value
513	v.Init(gobject.TypeBooleanVal)
514	v.SetBoolean(value)
515	x.SetProperty("restrict-to-fill-level", &v)
516}
517
518// GetPropertyRestrictToFillLevel gets the "restrict-to-fill-level" property.
519// Controls whether slider movement is restricted to an
520// upper boundary set by the fill level.
521func (x *Range) GetPropertyRestrictToFillLevel() bool {
522	var v gobject.Value
523	x.GetProperty("restrict-to-fill-level", &v)
524	return v.GetBoolean()
525}
526
527// SetPropertyRoundDigits sets the "round-digits" property.
528// The number of digits to round the value to when
529// it changes.
530//
531// See [signal@Gtk.Range::change-value].
532func (x *Range) SetPropertyRoundDigits(value int) {
533	var v gobject.Value
534	v.Init(gobject.TypeIntVal)
535	v.SetInt(value)
536	x.SetProperty("round-digits", &v)
537}
538
539// GetPropertyRoundDigits gets the "round-digits" property.
540// The number of digits to round the value to when
541// it changes.
542//
543// See [signal@Gtk.Range::change-value].
544func (x *Range) GetPropertyRoundDigits() int {
545	var v gobject.Value
546	x.GetProperty("round-digits", &v)
547	return v.GetInt()
548}
549
550// SetPropertyShowFillLevel sets the "show-fill-level" property.
551// Controls whether fill level indicator graphics are displayed
552// on the trough.
553func (x *Range) SetPropertyShowFillLevel(value bool) {
554	var v gobject.Value
555	v.Init(gobject.TypeBooleanVal)
556	v.SetBoolean(value)
557	x.SetProperty("show-fill-level", &v)
558}
559
560// GetPropertyShowFillLevel gets the "show-fill-level" property.
561// Controls whether fill level indicator graphics are displayed
562// on the trough.
563func (x *Range) GetPropertyShowFillLevel() bool {
564	var v gobject.Value
565	x.GetProperty("show-fill-level", &v)
566	return v.GetBoolean()
567}
568
569// Emitted before clamping a value, to give the application a
570// chance to adjust the bounds.
571func (x *Range) ConnectAdjustBounds(cb *func(Range, float64)) uint {
572	cbPtr := uintptr(unsafe.Pointer(cb))
573	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
574		handlerID := gobject.SignalConnect(x.GoPointer(), "adjust-bounds", cbRefPtr)
575		glib.SaveHandlerMapping(handlerID, cbPtr)
576		return handlerID
577	}
578
579	fcb := func(clsPtr uintptr, ValueVarp float64) {
580		fa := Range{}
581		fa.Ptr = clsPtr
582		cbFn := *cb
583
584		cbFn(fa, ValueVarp)
585
586	}
587	cbRefPtr := purego.NewCallback(fcb)
588	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
589	handlerID := gobject.SignalConnect(x.GoPointer(), "adjust-bounds", cbRefPtr)
590	glib.SaveHandlerMapping(handlerID, cbPtr)
591	return handlerID
592}
593
594// Emitted when a scroll action is performed on a range.
595//
596// It allows an application to determine the type of scroll event
597// that occurred and the resultant new value. The application can
598// handle the event itself and return %TRUE to prevent further
599// processing. Or, by returning %FALSE, it can pass the event to
600// other handlers until the default GTK handler is reached.
601//
602// The value parameter is unrounded. An application that overrides
603// the ::change-value signal is responsible for clamping the value
604// to the desired number of decimal digits; the default GTK
605// handler clamps the value based on [property@Gtk.Range:round-digits].
606func (x *Range) ConnectChangeValue(cb *func(Range, ScrollType, float64) bool) uint {
607	cbPtr := uintptr(unsafe.Pointer(cb))
608	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
609		handlerID := gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)
610		glib.SaveHandlerMapping(handlerID, cbPtr)
611		return handlerID
612	}
613
614	fcb := func(clsPtr uintptr, ScrollVarp ScrollType, ValueVarp float64) bool {
615		fa := Range{}
616		fa.Ptr = clsPtr
617		cbFn := *cb
618
619		return cbFn(fa, ScrollVarp, ValueVarp)
620
621	}
622	cbRefPtr := purego.NewCallback(fcb)
623	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
624	handlerID := gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)
625	glib.SaveHandlerMapping(handlerID, cbPtr)
626	return handlerID
627}
628
629// Virtual function that moves the slider.
630//
631// Used for keybindings.
632func (x *Range) ConnectMoveSlider(cb *func(Range, ScrollType)) uint {
633	cbPtr := uintptr(unsafe.Pointer(cb))
634	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
635		handlerID := gobject.SignalConnect(x.GoPointer(), "move-slider", cbRefPtr)
636		glib.SaveHandlerMapping(handlerID, cbPtr)
637		return handlerID
638	}
639
640	fcb := func(clsPtr uintptr, StepVarp ScrollType) {
641		fa := Range{}
642		fa.Ptr = clsPtr
643		cbFn := *cb
644
645		cbFn(fa, StepVarp)
646
647	}
648	cbRefPtr := purego.NewCallback(fcb)
649	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
650	handlerID := gobject.SignalConnect(x.GoPointer(), "move-slider", cbRefPtr)
651	glib.SaveHandlerMapping(handlerID, cbPtr)
652	return handlerID
653}
654
655// Emitted when the range value changes.
656func (x *Range) ConnectValueChanged(cb *func(Range)) uint {
657	cbPtr := uintptr(unsafe.Pointer(cb))
658	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
659		handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
660		glib.SaveHandlerMapping(handlerID, cbPtr)
661		return handlerID
662	}
663
664	fcb := func(clsPtr uintptr) {
665		fa := Range{}
666		fa.Ptr = clsPtr
667		cbFn := *cb
668
669		cbFn(fa)
670
671	}
672	cbRefPtr := purego.NewCallback(fcb)
673	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
674	handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
675	glib.SaveHandlerMapping(handlerID, cbPtr)
676	return handlerID
677}
678
679// Requests the user's screen reader to announce the given message.
680//
681// This kind of notification is useful for messages that
682// either have only a visual representation or that are not
683// exposed visually at all, e.g. a notification about a
684// successful operation.
685//
686// Also, by using this API, you can ensure that the message
687// does not interrupts the user's current screen reader output.
688func (x *Range) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
689
690	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
691
692}
693
694// Retrieves the accessible parent for an accessible object.
695//
696// This function returns `NULL` for top level widgets.
697func (x *Range) GetAccessibleParent() *AccessibleBase {
698	var cls *AccessibleBase
699
700	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
701
702	if cret == 0 {
703		return nil
704	}
705	cls = &AccessibleBase{}
706	cls.Ptr = cret
707	return cls
708}
709
710// Retrieves the accessible role of an accessible object.
711func (x *Range) GetAccessibleRole() AccessibleRole {
712
713	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
714	return cret
715}
716
717// Retrieves the implementation for the given accessible object.
718func (x *Range) GetAtContext() *ATContext {
719	var cls *ATContext
720
721	cret := XGtkAccessibleGetAtContext(x.GoPointer())
722
723	if cret == 0 {
724		return nil
725	}
726	cls = &ATContext{}
727	cls.Ptr = cret
728	return cls
729}
730
731// Queries the coordinates and dimensions of this accessible
732//
733// This functionality can be overridden by `GtkAccessible`
734// implementations, e.g. to get the bounds from an ignored
735// child widget.
736func (x *Range) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
737
738	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
739	return cret
740}
741
742// Retrieves the first accessible child of an accessible object.
743func (x *Range) GetFirstAccessibleChild() *AccessibleBase {
744	var cls *AccessibleBase
745
746	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
747
748	if cret == 0 {
749		return nil
750	}
751	cls = &AccessibleBase{}
752	cls.Ptr = cret
753	return cls
754}
755
756// Retrieves the next accessible sibling of an accessible object
757func (x *Range) GetNextAccessibleSibling() *AccessibleBase {
758	var cls *AccessibleBase
759
760	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
761
762	if cret == 0 {
763		return nil
764	}
765	cls = &AccessibleBase{}
766	cls.Ptr = cret
767	return cls
768}
769
770// Queries a platform state, such as focus.
771//
772// This functionality can be overridden by `GtkAccessible`
773// implementations, e.g. to get platform state from an ignored
774// child widget, as is the case for `GtkText` wrappers.
775func (x *Range) GetPlatformState(StateVar AccessiblePlatformState) bool {
776
777	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
778	return cret
779}
780
781// Resets the accessible property to its default value.
782func (x *Range) ResetProperty(PropertyVar AccessibleProperty) {
783
784	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
785
786}
787
788// Resets the accessible relation to its default value.
789func (x *Range) ResetRelation(RelationVar AccessibleRelation) {
790
791	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
792
793}
794
795// Resets the accessible state to its default value.
796func (x *Range) ResetState(StateVar AccessibleState) {
797
798	XGtkAccessibleResetState(x.GoPointer(), StateVar)
799
800}
801
802// Sets the parent and sibling of an accessible object.
803//
804// This function is meant to be used by accessible implementations that are
805// not part of the widget hierarchy, and but act as a logical bridge between
806// widgets. For instance, if a widget creates an object that holds metadata
807// for each child, and you want that object to implement the `GtkAccessible`
808// interface, you will use this function to ensure that the parent of each
809// child widget is the metadata object, and the parent of each metadata
810// object is the container widget.
811func (x *Range) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
812
813	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
814
815}
816
817// Updates the next accessible sibling.
818//
819// That might be useful when a new child of a custom accessible
820// is created, and it needs to be linked to a previous child.
821func (x *Range) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
822
823	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
824
825}
826
827// Informs ATs that the platform state has changed.
828//
829// This function should be used by `GtkAccessible` implementations that
830// have a platform state but are not widgets. Widgets handle platform
831// states automatically.
832func (x *Range) UpdatePlatformState(StateVar AccessiblePlatformState) {
833
834	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
835
836}
837
838// Updates a list of accessible properties.
839//
840// See the [enum@Gtk.AccessibleProperty] documentation for the
841// value types of accessible properties.
842//
843// This function should be called by `GtkWidget` types whenever
844// an accessible property change must be communicated to assistive
845// technologies.
846//
847// Example:
848// ```c
849// value = gtk_adjustment_get_value (adjustment);
850// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
851//
852//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
853//	-1);
854//
855// ```
856func (x *Range) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
857
858	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
859
860}
861
862// Updates an array of accessible properties.
863//
864// This function should be called by `GtkWidget` types whenever an accessible
865// property change must be communicated to assistive technologies.
866//
867// This function is meant to be used by language bindings.
868func (x *Range) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
869
870	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
871
872}
873
874// Updates a list of accessible relations.
875//
876// This function should be called by `GtkWidget` types whenever an accessible
877// relation change must be communicated to assistive technologies.
878//
879// If the [enum@Gtk.AccessibleRelation] requires a list of references,
880// you should pass each reference individually, followed by `NULL`, e.g.
881//
882// ```c
883// gtk_accessible_update_relation (accessible,
884//
885//	GTK_ACCESSIBLE_RELATION_CONTROLS,
886//	  ref1, NULL,
887//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
888//	  ref1, ref2, ref3, NULL,
889//	-1);
890//
891// ```
892func (x *Range) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
893
894	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
895
896}
897
898// Updates an array of accessible relations.
899//
900// This function should be called by `GtkWidget` types whenever an accessible
901// relation change must be communicated to assistive technologies.
902//
903// This function is meant to be used by language bindings.
904func (x *Range) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
905
906	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
907
908}
909
910// Updates a list of accessible states.
911//
912// See the [enum@Gtk.AccessibleState] documentation for the
913// value types of accessible states.
914//
915// This function should be called by `GtkWidget` types whenever
916// an accessible state change must be communicated to assistive
917// technologies.
918//
919// Example:
920//
921// ```c
922// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
923// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
924//
925//	GTK_ACCESSIBLE_STATE_CHECKED, value,
926//	-1);
927//
928// ```
929func (x *Range) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
930
931	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
932
933}
934
935// Updates an array of accessible states.
936//
937// This function should be called by `GtkWidget` types whenever an accessible
938// state change must be communicated to assistive technologies.
939//
940// This function is meant to be used by language bindings.
941func (x *Range) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
942
943	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
944
945}
946
947// Gets the ID of the @buildable object.
948//
949// `GtkBuilder` sets the name based on the ID attribute
950// of the `<object>` tag used to construct the @buildable.
951func (x *Range) GetBuildableId() string {
952
953	cret := XGtkBuildableGetBuildableId(x.GoPointer())
954	return cret
955}
956
957// Retrieves the orientation of the @orientable.
958func (x *Range) GetOrientation() Orientation {
959
960	cret := XGtkOrientableGetOrientation(x.GoPointer())
961	return cret
962}
963
964// Sets the orientation of the @orientable.
965func (x *Range) SetOrientation(OrientationVar Orientation) {
966
967	XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar)
968
969}
970
971func init() {
972	core.SetPackageName("GTK", "gtk4")
973	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
974	var libs []uintptr
975	for _, libPath := range core.GetPaths("GTK") {
976		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
977		if err != nil {
978			panic(err)
979		}
980		libs = append(libs, lib)
981	}
982
983	core.PuregoSafeRegister(&xRangeGLibType, libs, "gtk_range_get_type")
984
985	core.PuregoSafeRegister(&xRangeGetAdjustment, libs, "gtk_range_get_adjustment")
986	core.PuregoSafeRegister(&xRangeGetFillLevel, libs, "gtk_range_get_fill_level")
987	core.PuregoSafeRegister(&xRangeGetFlippable, libs, "gtk_range_get_flippable")
988	core.PuregoSafeRegister(&xRangeGetInverted, libs, "gtk_range_get_inverted")
989	core.PuregoSafeRegister(&xRangeGetRangeRect, libs, "gtk_range_get_range_rect")
990	core.PuregoSafeRegister(&xRangeGetRestrictToFillLevel, libs, "gtk_range_get_restrict_to_fill_level")
991	core.PuregoSafeRegister(&xRangeGetRoundDigits, libs, "gtk_range_get_round_digits")
992	core.PuregoSafeRegister(&xRangeGetShowFillLevel, libs, "gtk_range_get_show_fill_level")
993	core.PuregoSafeRegister(&xRangeGetSliderRange, libs, "gtk_range_get_slider_range")
994	core.PuregoSafeRegister(&xRangeGetSliderSizeFixed, libs, "gtk_range_get_slider_size_fixed")
995	core.PuregoSafeRegister(&xRangeGetValue, libs, "gtk_range_get_value")
996	core.PuregoSafeRegister(&xRangeSetAdjustment, libs, "gtk_range_set_adjustment")
997	core.PuregoSafeRegister(&xRangeSetFillLevel, libs, "gtk_range_set_fill_level")
998	core.PuregoSafeRegister(&xRangeSetFlippable, libs, "gtk_range_set_flippable")
999	core.PuregoSafeRegister(&xRangeSetIncrements, libs, "gtk_range_set_increments")
1000	core.PuregoSafeRegister(&xRangeSetInverted, libs, "gtk_range_set_inverted")
1001	core.PuregoSafeRegister(&xRangeSetRange, libs, "gtk_range_set_range")
1002	core.PuregoSafeRegister(&xRangeSetRestrictToFillLevel, libs, "gtk_range_set_restrict_to_fill_level")
1003	core.PuregoSafeRegister(&xRangeSetRoundDigits, libs, "gtk_range_set_round_digits")
1004	core.PuregoSafeRegister(&xRangeSetShowFillLevel, libs, "gtk_range_set_show_fill_level")
1005	core.PuregoSafeRegister(&xRangeSetSliderSizeFixed, libs, "gtk_range_set_slider_size_fixed")
1006	core.PuregoSafeRegister(&xRangeSetValue, libs, "gtk_range_set_value")
1007
1008}

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