2024-10-20 05:21:03 +00:00
|
|
|
package qt6
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qgesturerecognizer.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
2024-11-23 06:34:52 +00:00
|
|
|
"runtime/cgo"
|
2024-10-20 05:21:03 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QGestureRecognizer__ResultFlag int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QGestureRecognizer__Ignore QGestureRecognizer__ResultFlag = 1
|
|
|
|
QGestureRecognizer__MayBeGesture QGestureRecognizer__ResultFlag = 2
|
|
|
|
QGestureRecognizer__TriggerGesture QGestureRecognizer__ResultFlag = 4
|
|
|
|
QGestureRecognizer__FinishGesture QGestureRecognizer__ResultFlag = 8
|
|
|
|
QGestureRecognizer__CancelGesture QGestureRecognizer__ResultFlag = 16
|
|
|
|
QGestureRecognizer__ResultState_Mask QGestureRecognizer__ResultFlag = 255
|
|
|
|
QGestureRecognizer__ConsumeEventHint QGestureRecognizer__ResultFlag = 256
|
|
|
|
QGestureRecognizer__ResultHint_Mask QGestureRecognizer__ResultFlag = 65280
|
|
|
|
)
|
|
|
|
|
|
|
|
type QGestureRecognizer struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QGestureRecognizer
|
|
|
|
isSubclass bool
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) cPointer() *C.QGestureRecognizer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQGestureRecognizer constructs the type using only CGO pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func newQGestureRecognizer(h *C.QGestureRecognizer) *QGestureRecognizer {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return &QGestureRecognizer{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQGestureRecognizer constructs the type using only unsafe pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func UnsafeNewQGestureRecognizer(h unsafe.Pointer) *QGestureRecognizer {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QGestureRecognizer{h: (*C.QGestureRecognizer)(h)}
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-11-23 06:34:52 +00:00
|
|
|
// NewQGestureRecognizer constructs a new QGestureRecognizer object.
|
|
|
|
func NewQGestureRecognizer() *QGestureRecognizer {
|
|
|
|
var outptr_QGestureRecognizer *C.QGestureRecognizer = nil
|
|
|
|
|
|
|
|
C.QGestureRecognizer_new(&outptr_QGestureRecognizer)
|
|
|
|
ret := newQGestureRecognizer(outptr_QGestureRecognizer)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
func (this *QGestureRecognizer) Create(target *QObject) *QGesture {
|
2024-11-19 06:29:06 +00:00
|
|
|
return UnsafeNewQGesture(unsafe.Pointer(C.QGestureRecognizer_Create(this.h, target.cPointer())), nil)
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) Recognize(state *QGesture, watched *QObject, event *QEvent) QGestureRecognizer__ResultFlag {
|
|
|
|
return (QGestureRecognizer__ResultFlag)(C.QGestureRecognizer_Recognize(this.h, state.cPointer(), watched.cPointer(), event.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) Reset(state *QGesture) {
|
|
|
|
C.QGestureRecognizer_Reset(this.h, state.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QGestureRecognizer_RegisterRecognizer(recognizer *QGestureRecognizer) GestureType {
|
|
|
|
return (GestureType)(C.QGestureRecognizer_RegisterRecognizer(recognizer.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QGestureRecognizer_UnregisterRecognizer(typeVal GestureType) {
|
|
|
|
C.QGestureRecognizer_UnregisterRecognizer((C.int)(typeVal))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) OperatorAssign(param1 *QGestureRecognizer) {
|
|
|
|
C.QGestureRecognizer_OperatorAssign(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-11-23 06:34:52 +00:00
|
|
|
func (this *QGestureRecognizer) callVirtualBase_Create(target *QObject) *QGesture {
|
|
|
|
|
|
|
|
return UnsafeNewQGesture(unsafe.Pointer(C.QGestureRecognizer_virtualbase_Create(unsafe.Pointer(this.h), target.cPointer())), nil)
|
|
|
|
}
|
|
|
|
func (this *QGestureRecognizer) OnCreate(slot func(super func(target *QObject) *QGesture, target *QObject) *QGesture) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-23 06:34:52 +00:00
|
|
|
C.QGestureRecognizer_override_virtual_Create(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QGestureRecognizer_Create
|
|
|
|
func miqt_exec_callback_QGestureRecognizer_Create(self *C.QGestureRecognizer, cb C.intptr_t, target *C.QObject) *C.QGesture {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(target *QObject) *QGesture, target *QObject) *QGesture)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := UnsafeNewQObject(unsafe.Pointer(target))
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QGestureRecognizer{h: self}).callVirtualBase_Create, slotval1)
|
|
|
|
|
|
|
|
return virtualReturn.cPointer()
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QGestureRecognizer) OnRecognize(slot func(state *QGesture, watched *QObject, event *QEvent) QGestureRecognizer__ResultFlag) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-23 06:34:52 +00:00
|
|
|
C.QGestureRecognizer_override_virtual_Recognize(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QGestureRecognizer_Recognize
|
|
|
|
func miqt_exec_callback_QGestureRecognizer_Recognize(self *C.QGestureRecognizer, cb C.intptr_t, state *C.QGesture, watched *C.QObject, event *C.QEvent) C.int {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(state *QGesture, watched *QObject, event *QEvent) QGestureRecognizer__ResultFlag)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := UnsafeNewQGesture(unsafe.Pointer(state), nil)
|
|
|
|
slotval2 := UnsafeNewQObject(unsafe.Pointer(watched))
|
|
|
|
slotval3 := UnsafeNewQEvent(unsafe.Pointer(event))
|
|
|
|
|
|
|
|
virtualReturn := gofunc(slotval1, slotval2, slotval3)
|
|
|
|
|
|
|
|
return (C.int)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) callVirtualBase_Reset(state *QGesture) {
|
|
|
|
|
|
|
|
C.QGestureRecognizer_virtualbase_Reset(unsafe.Pointer(this.h), state.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QGestureRecognizer) OnReset(slot func(super func(state *QGesture), state *QGesture)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-23 06:34:52 +00:00
|
|
|
C.QGestureRecognizer_override_virtual_Reset(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QGestureRecognizer_Reset
|
|
|
|
func miqt_exec_callback_QGestureRecognizer_Reset(self *C.QGestureRecognizer, cb C.intptr_t, state *C.QGesture) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(state *QGesture), state *QGesture))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := UnsafeNewQGesture(unsafe.Pointer(state), nil)
|
|
|
|
|
|
|
|
gofunc((&QGestureRecognizer{h: self}).callVirtualBase_Reset, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QGestureRecognizer) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QGestureRecognizer_Delete(this.h, C.bool(this.isSubclass))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QGestureRecognizer) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QGestureRecognizer) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|