miqt/qt/multimedia/gen_qgraphicsvideoitem.go

226 lines
7.4 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qgraphicsvideoitem.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"runtime/cgo"
"unsafe"
)
type QGraphicsVideoItem struct {
h *C.QGraphicsVideoItem
*qt.QGraphicsObject
*QMediaBindableInterface
}
func (this *QGraphicsVideoItem) cPointer() *C.QGraphicsVideoItem {
if this == nil {
return nil
}
return this.h
}
func (this *QGraphicsVideoItem) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
func newQGraphicsVideoItem(h *C.QGraphicsVideoItem) *QGraphicsVideoItem {
if h == nil {
return nil
}
return &QGraphicsVideoItem{h: h, QGraphicsObject: qt.UnsafeNewQGraphicsObject(unsafe.Pointer(h)), QMediaBindableInterface: UnsafeNewQMediaBindableInterface(unsafe.Pointer(h))}
}
func UnsafeNewQGraphicsVideoItem(h unsafe.Pointer) *QGraphicsVideoItem {
return newQGraphicsVideoItem((*C.QGraphicsVideoItem)(h))
}
// NewQGraphicsVideoItem constructs a new QGraphicsVideoItem object.
func NewQGraphicsVideoItem() *QGraphicsVideoItem {
ret := C.QGraphicsVideoItem_new()
return newQGraphicsVideoItem(ret)
}
// NewQGraphicsVideoItem2 constructs a new QGraphicsVideoItem object.
func NewQGraphicsVideoItem2(parent *qt.QGraphicsItem) *QGraphicsVideoItem {
ret := C.QGraphicsVideoItem_new2((*C.QGraphicsItem)(parent.UnsafePointer()))
return newQGraphicsVideoItem(ret)
}
func (this *QGraphicsVideoItem) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsVideoItem_MetaObject(this.h)))
}
func (this *QGraphicsVideoItem) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QGraphicsVideoItem_Metacast(this.h, param1_Cstring))
}
func QGraphicsVideoItem_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QGraphicsVideoItem_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QGraphicsVideoItem_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QGraphicsVideoItem_TrUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QGraphicsVideoItem) MediaObject() *QMediaObject {
return UnsafeNewQMediaObject(unsafe.Pointer(C.QGraphicsVideoItem_MediaObject(this.h)))
}
func (this *QGraphicsVideoItem) VideoSurface() *QAbstractVideoSurface {
return UnsafeNewQAbstractVideoSurface(unsafe.Pointer(C.QGraphicsVideoItem_VideoSurface(this.h)))
}
func (this *QGraphicsVideoItem) AspectRatioMode() qt.AspectRatioMode {
return (qt.AspectRatioMode)(C.QGraphicsVideoItem_AspectRatioMode(this.h))
}
func (this *QGraphicsVideoItem) SetAspectRatioMode(mode qt.AspectRatioMode) {
C.QGraphicsVideoItem_SetAspectRatioMode(this.h, (C.int)(mode))
}
func (this *QGraphicsVideoItem) Offset() *qt.QPointF {
_ret := C.QGraphicsVideoItem_Offset(this.h)
_goptr := qt.UnsafeNewQPointF(unsafe.Pointer(_ret))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QGraphicsVideoItem) SetOffset(offset *qt.QPointF) {
C.QGraphicsVideoItem_SetOffset(this.h, (*C.QPointF)(offset.UnsafePointer()))
}
func (this *QGraphicsVideoItem) Size() *qt.QSizeF {
_ret := C.QGraphicsVideoItem_Size(this.h)
_goptr := qt.UnsafeNewQSizeF(unsafe.Pointer(_ret))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QGraphicsVideoItem) SetSize(size *qt.QSizeF) {
C.QGraphicsVideoItem_SetSize(this.h, (*C.QSizeF)(size.UnsafePointer()))
}
func (this *QGraphicsVideoItem) NativeSize() *qt.QSizeF {
_ret := C.QGraphicsVideoItem_NativeSize(this.h)
_goptr := qt.UnsafeNewQSizeF(unsafe.Pointer(_ret))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QGraphicsVideoItem) BoundingRect() *qt.QRectF {
_ret := C.QGraphicsVideoItem_BoundingRect(this.h)
_goptr := qt.UnsafeNewQRectF(unsafe.Pointer(_ret))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QGraphicsVideoItem) Paint(painter *qt.QPainter, option *qt.QStyleOptionGraphicsItem) {
C.QGraphicsVideoItem_Paint(this.h, (*C.QPainter)(painter.UnsafePointer()), (*C.QStyleOptionGraphicsItem)(option.UnsafePointer()))
}
func (this *QGraphicsVideoItem) NativeSizeChanged(size *qt.QSizeF) {
C.QGraphicsVideoItem_NativeSizeChanged(this.h, (*C.QSizeF)(size.UnsafePointer()))
}
func (this *QGraphicsVideoItem) OnNativeSizeChanged(slot func(size *qt.QSizeF)) {
C.QGraphicsVideoItem_connect_NativeSizeChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsVideoItem_NativeSizeChanged
func miqt_exec_callback_QGraphicsVideoItem_NativeSizeChanged(cb C.intptr_t, size *C.QSizeF) {
gofunc, ok := cgo.Handle(cb).Value().(func(size *qt.QSizeF))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQSizeF(unsafe.Pointer(size))
gofunc(slotval1)
}
func QGraphicsVideoItem_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.QGraphicsVideoItem_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QGraphicsVideoItem_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.QGraphicsVideoItem_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 QGraphicsVideoItem_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.QGraphicsVideoItem_TrUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QGraphicsVideoItem_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.QGraphicsVideoItem_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
}
func (this *QGraphicsVideoItem) Paint3(painter *qt.QPainter, option *qt.QStyleOptionGraphicsItem, widget *qt.QWidget) {
C.QGraphicsVideoItem_Paint3(this.h, (*C.QPainter)(painter.UnsafePointer()), (*C.QStyleOptionGraphicsItem)(option.UnsafePointer()), (*C.QWidget)(widget.UnsafePointer()))
}
// Delete this object from C++ memory.
func (this *QGraphicsVideoItem) Delete() {
C.QGraphicsVideoItem_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 *QGraphicsVideoItem) GoGC() {
runtime.SetFinalizer(this, func(this *QGraphicsVideoItem) {
this.Delete()
runtime.KeepAlive(this.h)
})
}