mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
192 lines
5.6 KiB
Go
192 lines
5.6 KiB
Go
package qt6
|
|
|
|
/*
|
|
|
|
#include "gen_qvariantanimation.h"
|
|
#include <stdlib.h>
|
|
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"runtime"
|
|
"runtime/cgo"
|
|
"unsafe"
|
|
)
|
|
|
|
type QVariantAnimation struct {
|
|
h *C.QVariantAnimation
|
|
*QAbstractAnimation
|
|
}
|
|
|
|
func (this *QVariantAnimation) cPointer() *C.QVariantAnimation {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return this.h
|
|
}
|
|
|
|
func (this *QVariantAnimation) UnsafePointer() unsafe.Pointer {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return unsafe.Pointer(this.h)
|
|
}
|
|
|
|
func newQVariantAnimation(h *C.QVariantAnimation) *QVariantAnimation {
|
|
if h == nil {
|
|
return nil
|
|
}
|
|
return &QVariantAnimation{h: h, QAbstractAnimation: UnsafeNewQAbstractAnimation(unsafe.Pointer(h))}
|
|
}
|
|
|
|
func UnsafeNewQVariantAnimation(h unsafe.Pointer) *QVariantAnimation {
|
|
return newQVariantAnimation((*C.QVariantAnimation)(h))
|
|
}
|
|
|
|
// NewQVariantAnimation constructs a new QVariantAnimation object.
|
|
func NewQVariantAnimation() *QVariantAnimation {
|
|
ret := C.QVariantAnimation_new()
|
|
return newQVariantAnimation(ret)
|
|
}
|
|
|
|
// NewQVariantAnimation2 constructs a new QVariantAnimation object.
|
|
func NewQVariantAnimation2(parent *QObject) *QVariantAnimation {
|
|
ret := C.QVariantAnimation_new2(parent.cPointer())
|
|
return newQVariantAnimation(ret)
|
|
}
|
|
|
|
func (this *QVariantAnimation) MetaObject() *QMetaObject {
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QVariantAnimation_MetaObject(this.h)))
|
|
}
|
|
|
|
func (this *QVariantAnimation) Metacast(param1 string) unsafe.Pointer {
|
|
param1_Cstring := C.CString(param1)
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
|
return (unsafe.Pointer)(C.QVariantAnimation_Metacast(this.h, param1_Cstring))
|
|
}
|
|
|
|
func QVariantAnimation_Tr(s string) string {
|
|
s_Cstring := C.CString(s)
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
var _ms C.struct_miqt_string = C.QVariantAnimation_Tr(s_Cstring)
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
return _ret
|
|
}
|
|
|
|
func (this *QVariantAnimation) StartValue() *QVariant {
|
|
_ret := C.QVariantAnimation_StartValue(this.h)
|
|
_goptr := newQVariant(_ret)
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
return _goptr
|
|
}
|
|
|
|
func (this *QVariantAnimation) SetStartValue(value *QVariant) {
|
|
C.QVariantAnimation_SetStartValue(this.h, value.cPointer())
|
|
}
|
|
|
|
func (this *QVariantAnimation) EndValue() *QVariant {
|
|
_ret := C.QVariantAnimation_EndValue(this.h)
|
|
_goptr := newQVariant(_ret)
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
return _goptr
|
|
}
|
|
|
|
func (this *QVariantAnimation) SetEndValue(value *QVariant) {
|
|
C.QVariantAnimation_SetEndValue(this.h, value.cPointer())
|
|
}
|
|
|
|
func (this *QVariantAnimation) KeyValueAt(step float64) *QVariant {
|
|
_ret := C.QVariantAnimation_KeyValueAt(this.h, (C.double)(step))
|
|
_goptr := newQVariant(_ret)
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
return _goptr
|
|
}
|
|
|
|
func (this *QVariantAnimation) SetKeyValueAt(step float64, value *QVariant) {
|
|
C.QVariantAnimation_SetKeyValueAt(this.h, (C.double)(step), value.cPointer())
|
|
}
|
|
|
|
func (this *QVariantAnimation) CurrentValue() *QVariant {
|
|
_ret := C.QVariantAnimation_CurrentValue(this.h)
|
|
_goptr := newQVariant(_ret)
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
return _goptr
|
|
}
|
|
|
|
func (this *QVariantAnimation) Duration() int {
|
|
return (int)(C.QVariantAnimation_Duration(this.h))
|
|
}
|
|
|
|
func (this *QVariantAnimation) SetDuration(msecs int) {
|
|
C.QVariantAnimation_SetDuration(this.h, (C.int)(msecs))
|
|
}
|
|
|
|
func (this *QVariantAnimation) EasingCurve() *QEasingCurve {
|
|
_ret := C.QVariantAnimation_EasingCurve(this.h)
|
|
_goptr := newQEasingCurve(_ret)
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
return _goptr
|
|
}
|
|
|
|
func (this *QVariantAnimation) SetEasingCurve(easing *QEasingCurve) {
|
|
C.QVariantAnimation_SetEasingCurve(this.h, easing.cPointer())
|
|
}
|
|
|
|
func (this *QVariantAnimation) ValueChanged(value *QVariant) {
|
|
C.QVariantAnimation_ValueChanged(this.h, value.cPointer())
|
|
}
|
|
func (this *QVariantAnimation) OnValueChanged(slot func(value *QVariant)) {
|
|
C.QVariantAnimation_connect_ValueChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
|
}
|
|
|
|
//export miqt_exec_callback_QVariantAnimation_ValueChanged
|
|
func miqt_exec_callback_QVariantAnimation_ValueChanged(cb C.intptr_t, value *C.QVariant) {
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(value *QVariant))
|
|
if !ok {
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
}
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
slotval1 := UnsafeNewQVariant(unsafe.Pointer(value))
|
|
|
|
gofunc(slotval1)
|
|
}
|
|
|
|
func QVariantAnimation_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.QVariantAnimation_Tr2(s_Cstring, c_Cstring)
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
return _ret
|
|
}
|
|
|
|
func QVariantAnimation_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.QVariantAnimation_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
|
|
}
|
|
|
|
// Delete this object from C++ memory.
|
|
func (this *QVariantAnimation) Delete() {
|
|
C.QVariantAnimation_Delete(this.h)
|
|
}
|
|
|
|
// 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 *QVariantAnimation) GoGC() {
|
|
runtime.SetFinalizer(this, func(this *QVariantAnimation) {
|
|
this.Delete()
|
|
runtime.KeepAlive(this.h)
|
|
})
|
|
}
|