1// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gdk
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/gobject/types"
12)
13
14type DevicePadInterface struct {
15 _ structs.HostLayout
16}
17
18func (x *DevicePadInterface) GoPointer() uintptr {
19 return uintptr(unsafe.Pointer(x))
20}
21
22// An interface for tablet pad devices.
23//
24// It allows querying the features provided by the pad device.
25//
26// Tablet pads may contain one or more groups, each containing a subset
27// of the buttons/rings/strips available. [method@Gdk.DevicePad.get_n_groups]
28// can be used to obtain the number of groups, [method@Gdk.DevicePad.get_n_features]
29// and [method@Gdk.DevicePad.get_feature_group] can be combined to find out
30// the number of buttons/rings/strips the device has, and how are they grouped.
31//
32// Each of those groups have different modes, which may be used to map each
33// individual pad feature to multiple actions. Only one mode is effective
34// (current) for each given group, different groups may have different
35// current modes. The number of available modes in a group can be found
36// out through [method@Gdk.DevicePad.get_group_n_modes], and the current mode
37// for a given group will be notified through events of type `GDK_PAD_GROUP_MODE`.
38type DevicePad interface {
39 GoPointer() uintptr
40 SetGoPointer(uintptr)
41 GetFeatureGroup(FeatureVar DevicePadFeature, FeatureIdxVar int) int
42 GetGroupNModes(GroupIdxVar int) int
43 GetNFeatures(FeatureVar DevicePadFeature) int
44 GetNGroups() int
45}
46
47var xDevicePadGLibType func() types.GType
48
49func DevicePadGLibType() types.GType {
50 return xDevicePadGLibType()
51}
52
53type DevicePadBase struct {
54 Ptr uintptr
55}
56
57func (x *DevicePadBase) GoPointer() uintptr {
58 if x == nil {
59 return 0
60 }
61 return x.Ptr
62}
63
64func (x *DevicePadBase) SetGoPointer(ptr uintptr) {
65 x.Ptr = ptr
66}
67
68// Returns the group the given @feature and @idx belong to.
69//
70// f the feature or index do not exist in @pad, -1 is returned.
71func (x *DevicePadBase) GetFeatureGroup(FeatureVar DevicePadFeature, FeatureIdxVar int) int {
72
73 cret := XGdkDevicePadGetFeatureGroup(x.GoPointer(), FeatureVar, FeatureIdxVar)
74 return cret
75}
76
77// Returns the number of modes that @group may have.
78func (x *DevicePadBase) GetGroupNModes(GroupIdxVar int) int {
79
80 cret := XGdkDevicePadGetGroupNModes(x.GoPointer(), GroupIdxVar)
81 return cret
82}
83
84// Returns the number of features a tablet pad has.
85func (x *DevicePadBase) GetNFeatures(FeatureVar DevicePadFeature) int {
86
87 cret := XGdkDevicePadGetNFeatures(x.GoPointer(), FeatureVar)
88 return cret
89}
90
91// Returns the number of groups this pad device has.
92//
93// Pads have at least one group. A pad group is a subcollection of
94// buttons/strip/rings that is affected collectively by a same
95// current mode.
96func (x *DevicePadBase) GetNGroups() int {
97
98 cret := XGdkDevicePadGetNGroups(x.GoPointer())
99 return cret
100}
101
102var XGdkDevicePadGetFeatureGroup func(uintptr, DevicePadFeature, int) int
103var XGdkDevicePadGetGroupNModes func(uintptr, int) int
104var XGdkDevicePadGetNFeatures func(uintptr, DevicePadFeature) int
105var XGdkDevicePadGetNGroups func(uintptr) int
106
107// A pad feature.
108type DevicePadFeature int
109
110var xDevicePadFeatureGLibType func() types.GType
111
112func DevicePadFeatureGLibType() types.GType {
113 return xDevicePadFeatureGLibType()
114}
115
116const (
117
118 // a button
119 DevicePadFeatureButtonValue DevicePadFeature = 0
120 // a ring-shaped interactive area
121 DevicePadFeatureRingValue DevicePadFeature = 1
122 // a straight interactive area
123 DevicePadFeatureStripValue DevicePadFeature = 2
124)
125
126func init() {
127 core.SetPackageName("GDK", "gtk4")
128 core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
129 var libs []uintptr
130 for _, libPath := range core.GetPaths("GDK") {
131 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
132 if err != nil {
133 panic(err)
134 }
135 libs = append(libs, lib)
136 }
137
138 core.PuregoSafeRegister(&xDevicePadFeatureGLibType, libs, "gdk_device_pad_feature_get_type")
139
140 core.PuregoSafeRegister(&xDevicePadGLibType, libs, "gdk_device_pad_get_type")
141
142 core.PuregoSafeRegister(&XGdkDevicePadGetFeatureGroup, libs, "gdk_device_pad_get_feature_group")
143 core.PuregoSafeRegister(&XGdkDevicePadGetGroupNModes, libs, "gdk_device_pad_get_group_n_modes")
144 core.PuregoSafeRegister(&XGdkDevicePadGetNFeatures, libs, "gdk_device_pad_get_n_features")
145 core.PuregoSafeRegister(&XGdkDevicePadGetNGroups, libs, "gdk_device_pad_get_n_groups")
146
147}