gtkaccessiblerange.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/v4/gobject/types"
11)
12
13type AccessibleRangeInterface struct {
14 _ structs.HostLayout
15
16 GIface uintptr
17
18 xSetCurrentValue uintptr
19}
20
21func (x *AccessibleRangeInterface) GoPointer() uintptr {
22 return uintptr(unsafe.Pointer(x))
23}
24
25// OverrideSetCurrentValue sets the "set_current_value" callback function.
26func (x *AccessibleRangeInterface) OverrideSetCurrentValue(cb func(AccessibleRange, float64) bool) {
27 if cb == nil {
28 x.xSetCurrentValue = 0
29 } else {
30 x.xSetCurrentValue = purego.NewCallback(func(SelfVarp uintptr, ValueVarp float64) bool {
31 return cb(&AccessibleRangeBase{Ptr: SelfVarp}, ValueVarp)
32 })
33 }
34}
35
36// GetSetCurrentValue gets the "set_current_value" callback function.
37func (x *AccessibleRangeInterface) GetSetCurrentValue() func(AccessibleRange, float64) bool {
38 if x.xSetCurrentValue == 0 {
39 return nil
40 }
41 var rawCallback func(SelfVarp uintptr, ValueVarp float64) bool
42 purego.RegisterFunc(&rawCallback, x.xSetCurrentValue)
43 return func(SelfVar AccessibleRange, ValueVar float64) bool {
44 return rawCallback(SelfVar.GoPointer(), ValueVar)
45 }
46}
47
48// An interface for accessible objects containing a numeric value.
49//
50// `GtkAccessibleRange` describes ranged controls for Assistive Technologies.
51//
52// Ranged controls have a single value within an allowed range that can
53// optionally be changed by the user.
54//
55// This interface is expected to be implemented by controls using the
56// following roles:
57//
58// - `GTK_ACCESSIBLE_ROLE_METER`
59// - `GTK_ACCESSIBLE_ROLE_PROGRESS_BAR`
60// - `GTK_ACCESSIBLE_ROLE_SCROLLBAR`
61// - `GTK_ACCESSIBLE_ROLE_SLIDER`
62// - `GTK_ACCESSIBLE_ROLE_SPIN_BUTTON`
63//
64// If that is not the case, a warning will be issued at run time.
65//
66// In addition to this interface, its implementers are expected to provide the
67// correct values for the following properties:
68//
69// - `GTK_ACCESSIBLE_PROPERTY_VALUE_MAX`
70// - `GTK_ACCESSIBLE_PROPERTY_VALUE_MIN`
71// - `GTK_ACCESSIBLE_PROPERTY_VALUE_NOW`
72// - `GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT`
73type AccessibleRange interface {
74 GoPointer() uintptr
75 SetGoPointer(uintptr)
76}
77
78var xAccessibleRangeGLibType func() types.GType
79
80func AccessibleRangeGLibType() types.GType {
81 return xAccessibleRangeGLibType()
82}
83
84type AccessibleRangeBase struct {
85 Ptr uintptr
86}
87
88func (x *AccessibleRangeBase) GoPointer() uintptr {
89 if x == nil {
90 return 0
91 }
92 return x.Ptr
93}
94
95func (x *AccessibleRangeBase) SetGoPointer(ptr uintptr) {
96 x.Ptr = ptr
97}