miqt/qt/gen_qkeyeventtransition.go

269 lines
8.7 KiB
Go
Raw Permalink Normal View History

package qt
/*
#include "gen_qkeyeventtransition.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
2024-11-19 06:29:06 +00:00
"runtime/cgo"
"unsafe"
)
type QKeyEventTransition struct {
2024-11-19 06:29:06 +00:00
h *C.QKeyEventTransition
isSubclass bool
*QEventTransition
}
func (this *QKeyEventTransition) cPointer() *C.QKeyEventTransition {
if this == nil {
return nil
}
return this.h
}
func (this *QKeyEventTransition) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQKeyEventTransition constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQKeyEventTransition(h *C.QKeyEventTransition) *QKeyEventTransition {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QEventTransition *C.QEventTransition = nil
C.QKeyEventTransition_virtbase(h, &outptr_QEventTransition)
2024-11-19 06:29:06 +00:00
return &QKeyEventTransition{h: h,
2024-12-07 04:15:57 +00:00
QEventTransition: newQEventTransition(outptr_QEventTransition)}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQKeyEventTransition constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQKeyEventTransition(h unsafe.Pointer) *QKeyEventTransition {
return newQKeyEventTransition((*C.QKeyEventTransition)(h))
}
// NewQKeyEventTransition constructs a new QKeyEventTransition object.
func NewQKeyEventTransition() *QKeyEventTransition {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQKeyEventTransition(C.QKeyEventTransition_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
}
// NewQKeyEventTransition2 constructs a new QKeyEventTransition object.
2024-09-04 06:54:22 +00:00
func NewQKeyEventTransition2(object *QObject, typeVal QEvent__Type, key int) *QKeyEventTransition {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQKeyEventTransition(C.QKeyEventTransition_new2(object.cPointer(), (C.int)(typeVal), (C.int)(key)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-08-29 07:01:51 +00:00
}
// NewQKeyEventTransition3 constructs a new QKeyEventTransition object.
func NewQKeyEventTransition3(sourceState *QState) *QKeyEventTransition {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQKeyEventTransition(C.QKeyEventTransition_new3(sourceState.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-08-29 07:01:51 +00:00
}
// NewQKeyEventTransition4 constructs a new QKeyEventTransition object.
2024-09-04 06:54:22 +00:00
func NewQKeyEventTransition4(object *QObject, typeVal QEvent__Type, key int, sourceState *QState) *QKeyEventTransition {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQKeyEventTransition(C.QKeyEventTransition_new4(object.cPointer(), (C.int)(typeVal), (C.int)(key), sourceState.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
}
func (this *QKeyEventTransition) MetaObject() *QMetaObject {
return newQMetaObject(C.QKeyEventTransition_MetaObject(this.h))
}
func (this *QKeyEventTransition) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QKeyEventTransition_Metacast(this.h, param1_Cstring))
}
func QKeyEventTransition_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QKeyEventTransition_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QKeyEventTransition_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QKeyEventTransition_TrUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QKeyEventTransition) Key() int {
return (int)(C.QKeyEventTransition_Key(this.h))
}
func (this *QKeyEventTransition) SetKey(key int) {
C.QKeyEventTransition_SetKey(this.h, (C.int)(key))
}
func (this *QKeyEventTransition) ModifierMask() KeyboardModifier {
return (KeyboardModifier)(C.QKeyEventTransition_ModifierMask(this.h))
2024-08-29 07:01:51 +00:00
}
func (this *QKeyEventTransition) SetModifierMask(modifiers KeyboardModifier) {
C.QKeyEventTransition_SetModifierMask(this.h, (C.int)(modifiers))
2024-08-29 07:01:51 +00:00
}
func QKeyEventTransition_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QKeyEventTransition_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QKeyEventTransition_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QKeyEventTransition_Tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QKeyEventTransition_TrUtf82(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QKeyEventTransition_TrUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QKeyEventTransition_TrUtf83(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QKeyEventTransition_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
2024-11-19 06:29:06 +00:00
func (this *QKeyEventTransition) callVirtualBase_OnTransition(event *QEvent) {
C.QKeyEventTransition_virtualbase_OnTransition(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QKeyEventTransition) OnOnTransition(slot func(super func(event *QEvent), event *QEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QKeyEventTransition_override_virtual_OnTransition(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QKeyEventTransition_OnTransition
func miqt_exec_callback_QKeyEventTransition_OnTransition(self *C.QKeyEventTransition, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QEvent), event *QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQEvent(event)
2024-11-19 06:29:06 +00:00
gofunc((&QKeyEventTransition{h: self}).callVirtualBase_OnTransition, slotval1)
}
func (this *QKeyEventTransition) callVirtualBase_EventTest(event *QEvent) bool {
return (bool)(C.QKeyEventTransition_virtualbase_EventTest(unsafe.Pointer(this.h), event.cPointer()))
}
func (this *QKeyEventTransition) OnEventTest(slot func(super func(event *QEvent) bool, event *QEvent) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QKeyEventTransition_override_virtual_EventTest(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QKeyEventTransition_EventTest
func miqt_exec_callback_QKeyEventTransition_EventTest(self *C.QKeyEventTransition, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QEvent) bool, event *QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQEvent(event)
2024-11-19 06:29:06 +00:00
virtualReturn := gofunc((&QKeyEventTransition{h: self}).callVirtualBase_EventTest, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QKeyEventTransition) callVirtualBase_Event(e *QEvent) bool {
return (bool)(C.QKeyEventTransition_virtualbase_Event(unsafe.Pointer(this.h), e.cPointer()))
}
func (this *QKeyEventTransition) OnEvent(slot func(super func(e *QEvent) bool, e *QEvent) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QKeyEventTransition_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QKeyEventTransition_Event
func miqt_exec_callback_QKeyEventTransition_Event(self *C.QKeyEventTransition, cb C.intptr_t, e *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(e *QEvent) bool, e *QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQEvent(e)
2024-11-19 06:29:06 +00:00
virtualReturn := gofunc((&QKeyEventTransition{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
// Delete this object from C++ memory.
func (this *QKeyEventTransition) Delete() {
2024-11-19 06:29:06 +00:00
C.QKeyEventTransition_Delete(this.h, C.bool(this.isSubclass))
}
// 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 *QKeyEventTransition) GoGC() {
runtime.SetFinalizer(this, func(this *QKeyEventTransition) {
this.Delete()
runtime.KeepAlive(this.h)
})
}