2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qgesturerecognizer.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QGestureRecognizer__ResultFlag int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QGestureRecognizer__ResultFlag__Ignore QGestureRecognizer__ResultFlag = 1
|
|
|
|
QGestureRecognizer__ResultFlag__MayBeGesture QGestureRecognizer__ResultFlag = 2
|
|
|
|
QGestureRecognizer__ResultFlag__TriggerGesture QGestureRecognizer__ResultFlag = 4
|
|
|
|
QGestureRecognizer__ResultFlag__FinishGesture QGestureRecognizer__ResultFlag = 8
|
|
|
|
QGestureRecognizer__ResultFlag__CancelGesture QGestureRecognizer__ResultFlag = 16
|
|
|
|
QGestureRecognizer__ResultFlag__ResultState_Mask QGestureRecognizer__ResultFlag = 255
|
|
|
|
QGestureRecognizer__ResultFlag__ConsumeEventHint QGestureRecognizer__ResultFlag = 256
|
|
|
|
QGestureRecognizer__ResultFlag__ResultHint_Mask QGestureRecognizer__ResultFlag = 65280
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QGestureRecognizer struct {
|
|
|
|
h *C.QGestureRecognizer
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) cPointer() *C.QGestureRecognizer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQGestureRecognizer(h *C.QGestureRecognizer) *QGestureRecognizer {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QGestureRecognizer{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQGestureRecognizer_U(h unsafe.Pointer) *QGestureRecognizer {
|
|
|
|
return newQGestureRecognizer((*C.QGestureRecognizer)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QGestureRecognizer) Create(target *QObject) *QGesture {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQGesture_U(unsafe.Pointer(C.QGestureRecognizer_Create(this.h, target.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QGestureRecognizer) Recognize(state *QGesture, watched *QObject, event *QEvent) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QGestureRecognizer_Recognize(this.h, state.cPointer(), watched.cPointer(), event.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QGestureRecognizer) Reset(state *QGesture) {
|
|
|
|
C.QGestureRecognizer_Reset(this.h, state.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QGestureRecognizer_RegisterRecognizer(recognizer *QGestureRecognizer) GestureType {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (GestureType)(C.QGestureRecognizer_RegisterRecognizer(recognizer.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QGestureRecognizer_UnregisterRecognizer(typeVal GestureType) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QGestureRecognizer_UnregisterRecognizer((C.int)(typeVal))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QGestureRecognizer) OperatorAssign(param1 *QGestureRecognizer) {
|
|
|
|
C.QGestureRecognizer_OperatorAssign(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QGestureRecognizer) Delete() {
|
|
|
|
C.QGestureRecognizer_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +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)
|
|
|
|
})
|
|
|
|
}
|