1// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gdk
3
4import (
5 "github.com/ebitengine/purego"
6
7 "github.com/bnema/puregotk/pkg/core"
8 "github.com/bnema/puregotk/v4/gobject"
9 "github.com/bnema/puregotk/v4/gobject/types"
10)
11
12// Indicates the specific type of tool being used being a tablet. Such as an
13// airbrush, pencil, etc.
14type DeviceToolType int
15
16var xDeviceToolTypeGLibType func() types.GType
17
18func DeviceToolTypeGLibType() types.GType {
19 return xDeviceToolTypeGLibType()
20}
21
22const (
23
24 // Tool is of an unknown type.
25 DeviceToolTypeUnknownValue DeviceToolType = 0
26 // Tool is a standard tablet stylus.
27 DeviceToolTypePenValue DeviceToolType = 1
28 // Tool is standard tablet eraser.
29 DeviceToolTypeEraserValue DeviceToolType = 2
30 // Tool is a brush stylus.
31 DeviceToolTypeBrushValue DeviceToolType = 3
32 // Tool is a pencil stylus.
33 DeviceToolTypePencilValue DeviceToolType = 4
34 // Tool is an airbrush stylus.
35 DeviceToolTypeAirbrushValue DeviceToolType = 5
36 // Tool is a mouse.
37 DeviceToolTypeMouseValue DeviceToolType = 6
38 // Tool is a lens cursor.
39 DeviceToolTypeLensValue DeviceToolType = 7
40)
41
42// A physical tool associated to a `GdkDevice`.
43type DeviceTool struct {
44 gobject.Object
45}
46
47var xDeviceToolGLibType func() types.GType
48
49func DeviceToolGLibType() types.GType {
50 return xDeviceToolGLibType()
51}
52
53func DeviceToolNewFromInternalPtr(ptr uintptr) *DeviceTool {
54 cls := &DeviceTool{}
55 cls.Ptr = ptr
56 return cls
57}
58
59var xDeviceToolGetAxes func(uintptr) AxisFlags
60
61// Gets the axes of the tool.
62func (x *DeviceTool) GetAxes() AxisFlags {
63
64 cret := xDeviceToolGetAxes(x.GoPointer())
65 return cret
66}
67
68var xDeviceToolGetHardwareId func(uintptr) uint64
69
70// Gets the hardware ID of this tool, or 0 if it's not known.
71//
72// When non-zero, the identifier is unique for the given tool model,
73// meaning that two identical tools will share the same @hardware_id,
74// but will have different serial numbers (see
75// [method@Gdk.DeviceTool.get_serial]).
76//
77// This is a more concrete (and device specific) method to identify
78// a `GdkDeviceTool` than [method@Gdk.DeviceTool.get_tool_type],
79// as a tablet may support multiple devices with the same
80// `GdkDeviceToolType`, but different hardware identifiers.
81func (x *DeviceTool) GetHardwareId() uint64 {
82
83 cret := xDeviceToolGetHardwareId(x.GoPointer())
84 return cret
85}
86
87var xDeviceToolGetSerial func(uintptr) uint64
88
89// Gets the serial number of this tool.
90//
91// This value can be used to identify a physical tool
92// (eg. a tablet pen) across program executions.
93func (x *DeviceTool) GetSerial() uint64 {
94
95 cret := xDeviceToolGetSerial(x.GoPointer())
96 return cret
97}
98
99var xDeviceToolGetToolType func(uintptr) DeviceToolType
100
101// Gets the `GdkDeviceToolType` of the tool.
102func (x *DeviceTool) GetToolType() DeviceToolType {
103
104 cret := xDeviceToolGetToolType(x.GoPointer())
105 return cret
106}
107
108func (c *DeviceTool) GoPointer() uintptr {
109 if c == nil {
110 return 0
111 }
112 return c.Ptr
113}
114
115func (c *DeviceTool) SetGoPointer(ptr uintptr) {
116 c.Ptr = ptr
117}
118
119// SetPropertyHardwareId sets the "hardware-id" property.
120// The hardware ID of the tool.
121func (x *DeviceTool) SetPropertyHardwareId(value uint64) {
122 var v gobject.Value
123 v.Init(gobject.TypeUint64Val)
124 v.SetUint64(value)
125 x.SetProperty("hardware-id", &v)
126}
127
128// GetPropertyHardwareId gets the "hardware-id" property.
129// The hardware ID of the tool.
130func (x *DeviceTool) GetPropertyHardwareId() uint64 {
131 var v gobject.Value
132 x.GetProperty("hardware-id", &v)
133 return v.GetUint64()
134}
135
136// SetPropertySerial sets the "serial" property.
137// The serial number of the tool.
138func (x *DeviceTool) SetPropertySerial(value uint64) {
139 var v gobject.Value
140 v.Init(gobject.TypeUint64Val)
141 v.SetUint64(value)
142 x.SetProperty("serial", &v)
143}
144
145// GetPropertySerial gets the "serial" property.
146// The serial number of the tool.
147func (x *DeviceTool) GetPropertySerial() uint64 {
148 var v gobject.Value
149 x.GetProperty("serial", &v)
150 return v.GetUint64()
151}
152
153func init() {
154 core.SetPackageName("GDK", "gtk4")
155 core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
156 var libs []uintptr
157 for _, libPath := range core.GetPaths("GDK") {
158 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
159 if err != nil {
160 panic(err)
161 }
162 libs = append(libs, lib)
163 }
164
165 core.PuregoSafeRegister(&xDeviceToolTypeGLibType, libs, "gdk_device_tool_type_get_type")
166
167 core.PuregoSafeRegister(&xDeviceToolGLibType, libs, "gdk_device_tool_get_type")
168
169 core.PuregoSafeRegister(&xDeviceToolGetAxes, libs, "gdk_device_tool_get_axes")
170 core.PuregoSafeRegister(&xDeviceToolGetHardwareId, libs, "gdk_device_tool_get_hardware_id")
171 core.PuregoSafeRegister(&xDeviceToolGetSerial, libs, "gdk_device_tool_get_serial")
172 core.PuregoSafeRegister(&xDeviceToolGetToolType, libs, "gdk_device_tool_get_tool_type")
173
174}