miqt/qt6/gen_qshortcut.go

501 lines
16 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qshortcut.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"runtime/cgo"
"unsafe"
)
type QShortcut struct {
2024-11-19 06:29:06 +00:00
h *C.QShortcut
isSubclass bool
2024-10-20 05:21:03 +00:00
*QObject
}
func (this *QShortcut) cPointer() *C.QShortcut {
if this == nil {
return nil
}
return this.h
}
func (this *QShortcut) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQShortcut constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQShortcut(h *C.QShortcut) *QShortcut {
2024-10-20 05:21:03 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QObject *C.QObject = nil
C.QShortcut_virtbase(h, &outptr_QObject)
2024-11-19 06:29:06 +00:00
return &QShortcut{h: h,
2024-12-07 04:15:57 +00:00
QObject: newQObject(outptr_QObject)}
2024-10-20 05:21:03 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQShortcut constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQShortcut(h unsafe.Pointer) *QShortcut {
return newQShortcut((*C.QShortcut)(h))
2024-10-20 05:21:03 +00:00
}
// NewQShortcut constructs a new QShortcut object.
func NewQShortcut(parent *QObject) *QShortcut {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new(parent.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut2 constructs a new QShortcut object.
func NewQShortcut2(key *QKeySequence, parent *QObject) *QShortcut {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new2(key.cPointer(), parent.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut3 constructs a new QShortcut object.
func NewQShortcut3(key QKeySequence__StandardKey, parent *QObject) *QShortcut {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new3((C.int)(key), parent.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut4 constructs a new QShortcut object.
func NewQShortcut4(key *QKeySequence, parent *QObject, member string) *QShortcut {
member_Cstring := C.CString(member)
defer C.free(unsafe.Pointer(member_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new4(key.cPointer(), parent.cPointer(), member_Cstring))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut5 constructs a new QShortcut object.
func NewQShortcut5(key *QKeySequence, parent *QObject, member string, ambiguousMember string) *QShortcut {
member_Cstring := C.CString(member)
defer C.free(unsafe.Pointer(member_Cstring))
ambiguousMember_Cstring := C.CString(ambiguousMember)
defer C.free(unsafe.Pointer(ambiguousMember_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new5(key.cPointer(), parent.cPointer(), member_Cstring, ambiguousMember_Cstring))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut6 constructs a new QShortcut object.
func NewQShortcut6(key *QKeySequence, parent *QObject, member string, ambiguousMember string, context ShortcutContext) *QShortcut {
member_Cstring := C.CString(member)
defer C.free(unsafe.Pointer(member_Cstring))
ambiguousMember_Cstring := C.CString(ambiguousMember)
defer C.free(unsafe.Pointer(ambiguousMember_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new6(key.cPointer(), parent.cPointer(), member_Cstring, ambiguousMember_Cstring, (C.int)(context)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut7 constructs a new QShortcut object.
func NewQShortcut7(key QKeySequence__StandardKey, parent *QObject, member string) *QShortcut {
member_Cstring := C.CString(member)
defer C.free(unsafe.Pointer(member_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new7((C.int)(key), parent.cPointer(), member_Cstring))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut8 constructs a new QShortcut object.
func NewQShortcut8(key QKeySequence__StandardKey, parent *QObject, member string, ambiguousMember string) *QShortcut {
member_Cstring := C.CString(member)
defer C.free(unsafe.Pointer(member_Cstring))
ambiguousMember_Cstring := C.CString(ambiguousMember)
defer C.free(unsafe.Pointer(ambiguousMember_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new8((C.int)(key), parent.cPointer(), member_Cstring, ambiguousMember_Cstring))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQShortcut9 constructs a new QShortcut object.
func NewQShortcut9(key QKeySequence__StandardKey, parent *QObject, member string, ambiguousMember string, context ShortcutContext) *QShortcut {
member_Cstring := C.CString(member)
defer C.free(unsafe.Pointer(member_Cstring))
ambiguousMember_Cstring := C.CString(ambiguousMember)
defer C.free(unsafe.Pointer(ambiguousMember_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQShortcut(C.QShortcut_new9((C.int)(key), parent.cPointer(), member_Cstring, ambiguousMember_Cstring, (C.int)(context)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QShortcut) MetaObject() *QMetaObject {
return newQMetaObject(C.QShortcut_MetaObject(this.h))
2024-10-20 05:21:03 +00:00
}
func (this *QShortcut) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QShortcut_Metacast(this.h, param1_Cstring))
}
func QShortcut_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QShortcut_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QShortcut) SetKey(key *QKeySequence) {
C.QShortcut_SetKey(this.h, key.cPointer())
}
func (this *QShortcut) Key() *QKeySequence {
_goptr := newQKeySequence(C.QShortcut_Key(this.h))
2024-10-20 05:21:03 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QShortcut) SetKeys(key QKeySequence__StandardKey) {
C.QShortcut_SetKeys(this.h, (C.int)(key))
}
func (this *QShortcut) SetKeysWithKeys(keys []QKeySequence) {
keys_CArray := (*[0xffff]*C.QKeySequence)(C.malloc(C.size_t(8 * len(keys))))
defer C.free(unsafe.Pointer(keys_CArray))
for i := range keys {
keys_CArray[i] = keys[i].cPointer()
}
keys_ma := C.struct_miqt_array{len: C.size_t(len(keys)), data: unsafe.Pointer(keys_CArray)}
2024-10-20 05:21:03 +00:00
C.QShortcut_SetKeysWithKeys(this.h, keys_ma)
}
func (this *QShortcut) Keys() []QKeySequence {
var _ma C.struct_miqt_array = C.QShortcut_Keys(this.h)
2024-10-20 05:21:03 +00:00
_ret := make([]QKeySequence, int(_ma.len))
_outCast := (*[0xffff]*C.QKeySequence)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_goptr := newQKeySequence(_outCast[i])
2024-10-20 05:21:03 +00:00
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
func (this *QShortcut) SetEnabled(enable bool) {
C.QShortcut_SetEnabled(this.h, (C.bool)(enable))
}
func (this *QShortcut) IsEnabled() bool {
return (bool)(C.QShortcut_IsEnabled(this.h))
}
func (this *QShortcut) SetContext(context ShortcutContext) {
C.QShortcut_SetContext(this.h, (C.int)(context))
}
func (this *QShortcut) Context() ShortcutContext {
return (ShortcutContext)(C.QShortcut_Context(this.h))
}
func (this *QShortcut) SetAutoRepeat(on bool) {
C.QShortcut_SetAutoRepeat(this.h, (C.bool)(on))
}
func (this *QShortcut) AutoRepeat() bool {
return (bool)(C.QShortcut_AutoRepeat(this.h))
}
func (this *QShortcut) Id() int {
return (int)(C.QShortcut_Id(this.h))
}
func (this *QShortcut) SetWhatsThis(text string) {
text_ms := C.struct_miqt_string{}
text_ms.data = C.CString(text)
text_ms.len = C.size_t(len(text))
defer C.free(unsafe.Pointer(text_ms.data))
C.QShortcut_SetWhatsThis(this.h, text_ms)
}
func (this *QShortcut) WhatsThis() string {
var _ms C.struct_miqt_string = C.QShortcut_WhatsThis(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QShortcut) Activated() {
C.QShortcut_Activated(this.h)
}
func (this *QShortcut) OnActivated(slot func()) {
C.QShortcut_connect_Activated(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_Activated
func miqt_exec_callback_QShortcut_Activated(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QShortcut) ActivatedAmbiguously() {
C.QShortcut_ActivatedAmbiguously(this.h)
}
func (this *QShortcut) OnActivatedAmbiguously(slot func()) {
C.QShortcut_connect_ActivatedAmbiguously(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_ActivatedAmbiguously
func miqt_exec_callback_QShortcut_ActivatedAmbiguously(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func QShortcut_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.QShortcut_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QShortcut_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.QShortcut_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
}
2024-11-19 06:29:06 +00:00
func (this *QShortcut) callVirtualBase_Event(e *QEvent) bool {
return (bool)(C.QShortcut_virtualbase_Event(unsafe.Pointer(this.h), e.cPointer()))
}
func (this *QShortcut) 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.QShortcut_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_Event
func miqt_exec_callback_QShortcut_Event(self *C.QShortcut, 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((&QShortcut{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QShortcut) callVirtualBase_EventFilter(watched *QObject, event *QEvent) bool {
return (bool)(C.QShortcut_virtualbase_EventFilter(unsafe.Pointer(this.h), watched.cPointer(), event.cPointer()))
}
func (this *QShortcut) OnEventFilter(slot func(super func(watched *QObject, event *QEvent) bool, watched *QObject, 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.QShortcut_override_virtual_EventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_EventFilter
func miqt_exec_callback_QShortcut_EventFilter(self *C.QShortcut, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *QObject, event *QEvent) bool, watched *QObject, event *QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQObject(watched)
slotval2 := newQEvent(event)
2024-11-19 06:29:06 +00:00
virtualReturn := gofunc((&QShortcut{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QShortcut) callVirtualBase_TimerEvent(event *QTimerEvent) {
C.QShortcut_virtualbase_TimerEvent(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QShortcut) OnTimerEvent(slot func(super func(event *QTimerEvent), event *QTimerEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QShortcut_override_virtual_TimerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_TimerEvent
func miqt_exec_callback_QShortcut_TimerEvent(self *C.QShortcut, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QTimerEvent), event *QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
2024-12-07 04:15:57 +00:00
slotval1 := newQTimerEvent(event)
2024-11-19 06:29:06 +00:00
gofunc((&QShortcut{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QShortcut) callVirtualBase_ChildEvent(event *QChildEvent) {
C.QShortcut_virtualbase_ChildEvent(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QShortcut) OnChildEvent(slot func(super func(event *QChildEvent), event *QChildEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QShortcut_override_virtual_ChildEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_ChildEvent
func miqt_exec_callback_QShortcut_ChildEvent(self *C.QShortcut, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QChildEvent), event *QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
2024-12-07 04:15:57 +00:00
slotval1 := newQChildEvent(event)
2024-11-19 06:29:06 +00:00
gofunc((&QShortcut{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QShortcut) callVirtualBase_CustomEvent(event *QEvent) {
C.QShortcut_virtualbase_CustomEvent(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QShortcut) OnCustomEvent(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.QShortcut_override_virtual_CustomEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_CustomEvent
func miqt_exec_callback_QShortcut_CustomEvent(self *C.QShortcut, 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((&QShortcut{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QShortcut) callVirtualBase_ConnectNotify(signal *QMetaMethod) {
C.QShortcut_virtualbase_ConnectNotify(unsafe.Pointer(this.h), signal.cPointer())
}
func (this *QShortcut) OnConnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QShortcut_override_virtual_ConnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_ConnectNotify
func miqt_exec_callback_QShortcut_ConnectNotify(self *C.QShortcut, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *QMetaMethod), signal *QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQMetaMethod(signal)
2024-11-19 06:29:06 +00:00
gofunc((&QShortcut{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QShortcut) callVirtualBase_DisconnectNotify(signal *QMetaMethod) {
C.QShortcut_virtualbase_DisconnectNotify(unsafe.Pointer(this.h), signal.cPointer())
}
func (this *QShortcut) OnDisconnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QShortcut_override_virtual_DisconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QShortcut_DisconnectNotify
func miqt_exec_callback_QShortcut_DisconnectNotify(self *C.QShortcut, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *QMetaMethod), signal *QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQMetaMethod(signal)
2024-11-19 06:29:06 +00:00
gofunc((&QShortcut{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
2024-10-20 05:21:03 +00:00
// Delete this object from C++ memory.
func (this *QShortcut) Delete() {
2024-11-19 06:29:06 +00:00
C.QShortcut_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 *QShortcut) GoGC() {
runtime.SetFinalizer(this, func(this *QShortcut) {
this.Delete()
runtime.KeepAlive(this.h)
})
}