// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gdk" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type GestureSingleClass struct { _ structs.HostLayout } func (x *GestureSingleClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A `GtkGesture` subclass optimized for singe-touch and mouse gestures. // // Under interaction, these gestures stick to the first interacting sequence, // which is accessible through [method@Gtk.GestureSingle.get_current_sequence] // while the gesture is being interacted with. // // By default gestures react to both %GDK_BUTTON_PRIMARY and touch events. // [method@Gtk.GestureSingle.set_touch_only] can be used to change the // touch behavior. Callers may also specify a different mouse button number // to interact with through [method@Gtk.GestureSingle.set_button], or react // to any mouse button by setting it to 0. While the gesture is active, the // button being currently pressed can be known through // [method@Gtk.GestureSingle.get_current_button]. type GestureSingle struct { Gesture } var xGestureSingleGLibType func() types.GType func GestureSingleGLibType() types.GType { return xGestureSingleGLibType() } func GestureSingleNewFromInternalPtr(ptr uintptr) *GestureSingle { cls := &GestureSingle{} cls.Ptr = ptr return cls } var xGestureSingleGetButton func(uintptr) uint // Returns the button number @gesture listens for. // // If this is 0, the gesture reacts to any button press. func (x *GestureSingle) GetButton() uint { cret := xGestureSingleGetButton(x.GoPointer()) return cret } var xGestureSingleGetCurrentButton func(uintptr) uint // Returns the button number currently interacting // with @gesture, or 0 if there is none. func (x *GestureSingle) GetCurrentButton() uint { cret := xGestureSingleGetCurrentButton(x.GoPointer()) return cret } var xGestureSingleGetCurrentSequence func(uintptr) *gdk.EventSequence // Returns the event sequence currently interacting with @gesture. // // This is only meaningful if [method@Gtk.Gesture.is_active] // returns %TRUE. func (x *GestureSingle) GetCurrentSequence() *gdk.EventSequence { cret := xGestureSingleGetCurrentSequence(x.GoPointer()) return cret } var xGestureSingleGetExclusive func(uintptr) bool // Gets whether a gesture is exclusive. // // For more information, see [method@Gtk.GestureSingle.set_exclusive]. func (x *GestureSingle) GetExclusive() bool { cret := xGestureSingleGetExclusive(x.GoPointer()) return cret } var xGestureSingleGetTouchOnly func(uintptr) bool // Returns %TRUE if the gesture is only triggered by touch events. func (x *GestureSingle) GetTouchOnly() bool { cret := xGestureSingleGetTouchOnly(x.GoPointer()) return cret } var xGestureSingleSetButton func(uintptr, uint) // Sets the button number @gesture listens to. // // If non-0, every button press from a different button // number will be ignored. Touch events implicitly match // with button 1. func (x *GestureSingle) SetButton(ButtonVar uint) { xGestureSingleSetButton(x.GoPointer(), ButtonVar) } var xGestureSingleSetExclusive func(uintptr, bool) // Sets whether @gesture is exclusive. // // An exclusive gesture will only handle pointer and "pointer emulated" // touch events, so at any given time, there is only one sequence able // to interact with those. func (x *GestureSingle) SetExclusive(ExclusiveVar bool) { xGestureSingleSetExclusive(x.GoPointer(), ExclusiveVar) } var xGestureSingleSetTouchOnly func(uintptr, bool) // Sets whether to handle only touch events. // // If @touch_only is %TRUE, @gesture will only handle events of type // %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE or %GDK_TOUCH_END. If %FALSE, // mouse events will be handled too. func (x *GestureSingle) SetTouchOnly(TouchOnlyVar bool) { xGestureSingleSetTouchOnly(x.GoPointer(), TouchOnlyVar) } func (c *GestureSingle) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *GestureSingle) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyButton sets the "button" property. // Mouse button number to listen to, or 0 to listen for any button. func (x *GestureSingle) SetPropertyButton(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("button", &v) } // GetPropertyButton gets the "button" property. // Mouse button number to listen to, or 0 to listen for any button. func (x *GestureSingle) GetPropertyButton() uint { var v gobject.Value x.GetProperty("button", &v) return v.GetUint() } // SetPropertyExclusive sets the "exclusive" property. // Whether the gesture is exclusive. // // Exclusive gestures only listen to pointer and pointer emulated events. func (x *GestureSingle) SetPropertyExclusive(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("exclusive", &v) } // GetPropertyExclusive gets the "exclusive" property. // Whether the gesture is exclusive. // // Exclusive gestures only listen to pointer and pointer emulated events. func (x *GestureSingle) GetPropertyExclusive() bool { var v gobject.Value x.GetProperty("exclusive", &v) return v.GetBoolean() } // SetPropertyTouchOnly sets the "touch-only" property. // Whether the gesture handles only touch events. func (x *GestureSingle) SetPropertyTouchOnly(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("touch-only", &v) } // GetPropertyTouchOnly gets the "touch-only" property. // Whether the gesture handles only touch events. func (x *GestureSingle) GetPropertyTouchOnly() bool { var v gobject.Value x.GetProperty("touch-only", &v) return v.GetBoolean() } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xGestureSingleGLibType, libs, "gtk_gesture_single_get_type") core.PuregoSafeRegister(&xGestureSingleGetButton, libs, "gtk_gesture_single_get_button") core.PuregoSafeRegister(&xGestureSingleGetCurrentButton, libs, "gtk_gesture_single_get_current_button") core.PuregoSafeRegister(&xGestureSingleGetCurrentSequence, libs, "gtk_gesture_single_get_current_sequence") core.PuregoSafeRegister(&xGestureSingleGetExclusive, libs, "gtk_gesture_single_get_exclusive") core.PuregoSafeRegister(&xGestureSingleGetTouchOnly, libs, "gtk_gesture_single_get_touch_only") core.PuregoSafeRegister(&xGestureSingleSetButton, libs, "gtk_gesture_single_set_button") core.PuregoSafeRegister(&xGestureSingleSetExclusive, libs, "gtk_gesture_single_set_exclusive") core.PuregoSafeRegister(&xGestureSingleSetTouchOnly, libs, "gtk_gesture_single_set_touch_only") }