// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gdk import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Indicates the specific type of tool being used being a tablet. Such as an // airbrush, pencil, etc. type DeviceToolType int var xDeviceToolTypeGLibType func() types.GType func DeviceToolTypeGLibType() types.GType { return xDeviceToolTypeGLibType() } const ( // Tool is of an unknown type. DeviceToolTypeUnknownValue DeviceToolType = 0 // Tool is a standard tablet stylus. DeviceToolTypePenValue DeviceToolType = 1 // Tool is standard tablet eraser. DeviceToolTypeEraserValue DeviceToolType = 2 // Tool is a brush stylus. DeviceToolTypeBrushValue DeviceToolType = 3 // Tool is a pencil stylus. DeviceToolTypePencilValue DeviceToolType = 4 // Tool is an airbrush stylus. DeviceToolTypeAirbrushValue DeviceToolType = 5 // Tool is a mouse. DeviceToolTypeMouseValue DeviceToolType = 6 // Tool is a lens cursor. DeviceToolTypeLensValue DeviceToolType = 7 ) // A physical tool associated to a `GdkDevice`. type DeviceTool struct { gobject.Object } var xDeviceToolGLibType func() types.GType func DeviceToolGLibType() types.GType { return xDeviceToolGLibType() } func DeviceToolNewFromInternalPtr(ptr uintptr) *DeviceTool { cls := &DeviceTool{} cls.Ptr = ptr return cls } var xDeviceToolGetAxes func(uintptr) AxisFlags // Gets the axes of the tool. func (x *DeviceTool) GetAxes() AxisFlags { cret := xDeviceToolGetAxes(x.GoPointer()) return cret } var xDeviceToolGetHardwareId func(uintptr) uint64 // Gets the hardware ID of this tool, or 0 if it's not known. // // When non-zero, the identifier is unique for the given tool model, // meaning that two identical tools will share the same @hardware_id, // but will have different serial numbers (see // [method@Gdk.DeviceTool.get_serial]). // // This is a more concrete (and device specific) method to identify // a `GdkDeviceTool` than [method@Gdk.DeviceTool.get_tool_type], // as a tablet may support multiple devices with the same // `GdkDeviceToolType`, but different hardware identifiers. func (x *DeviceTool) GetHardwareId() uint64 { cret := xDeviceToolGetHardwareId(x.GoPointer()) return cret } var xDeviceToolGetSerial func(uintptr) uint64 // Gets the serial number of this tool. // // This value can be used to identify a physical tool // (eg. a tablet pen) across program executions. func (x *DeviceTool) GetSerial() uint64 { cret := xDeviceToolGetSerial(x.GoPointer()) return cret } var xDeviceToolGetToolType func(uintptr) DeviceToolType // Gets the `GdkDeviceToolType` of the tool. func (x *DeviceTool) GetToolType() DeviceToolType { cret := xDeviceToolGetToolType(x.GoPointer()) return cret } func (c *DeviceTool) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *DeviceTool) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyHardwareId sets the "hardware-id" property. // The hardware ID of the tool. func (x *DeviceTool) SetPropertyHardwareId(value uint64) { var v gobject.Value v.Init(gobject.TypeUint64Val) v.SetUint64(value) x.SetProperty("hardware-id", &v) } // GetPropertyHardwareId gets the "hardware-id" property. // The hardware ID of the tool. func (x *DeviceTool) GetPropertyHardwareId() uint64 { var v gobject.Value x.GetProperty("hardware-id", &v) return v.GetUint64() } // SetPropertySerial sets the "serial" property. // The serial number of the tool. func (x *DeviceTool) SetPropertySerial(value uint64) { var v gobject.Value v.Init(gobject.TypeUint64Val) v.SetUint64(value) x.SetProperty("serial", &v) } // GetPropertySerial gets the "serial" property. // The serial number of the tool. func (x *DeviceTool) GetPropertySerial() uint64 { var v gobject.Value x.GetProperty("serial", &v) return v.GetUint64() } func init() { core.SetPackageName("GDK", "gtk4") core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GDK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xDeviceToolTypeGLibType, libs, "gdk_device_tool_type_get_type") core.PuregoSafeRegister(&xDeviceToolGLibType, libs, "gdk_device_tool_get_type") core.PuregoSafeRegister(&xDeviceToolGetAxes, libs, "gdk_device_tool_get_axes") core.PuregoSafeRegister(&xDeviceToolGetHardwareId, libs, "gdk_device_tool_get_hardware_id") core.PuregoSafeRegister(&xDeviceToolGetSerial, libs, "gdk_device_tool_get_serial") core.PuregoSafeRegister(&xDeviceToolGetToolType, libs, "gdk_device_tool_get_tool_type") }