miqt/qt6/gen_qgraphicslayout.go

371 lines
12 KiB
Go
Raw Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qgraphicslayout.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"runtime/cgo"
2024-10-20 05:21:03 +00:00
"unsafe"
)
type QGraphicsLayout struct {
2024-11-19 06:29:06 +00:00
h *C.QGraphicsLayout
isSubclass bool
2024-10-20 05:21:03 +00:00
*QGraphicsLayoutItem
}
func (this *QGraphicsLayout) cPointer() *C.QGraphicsLayout {
if this == nil {
return nil
}
return this.h
}
func (this *QGraphicsLayout) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQGraphicsLayout constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQGraphicsLayout(h *C.QGraphicsLayout) *QGraphicsLayout {
2024-10-20 05:21:03 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QGraphicsLayoutItem *C.QGraphicsLayoutItem = nil
C.QGraphicsLayout_virtbase(h, &outptr_QGraphicsLayoutItem)
2024-11-19 06:29:06 +00:00
return &QGraphicsLayout{h: h,
2024-12-07 04:15:57 +00:00
QGraphicsLayoutItem: newQGraphicsLayoutItem(outptr_QGraphicsLayoutItem)}
2024-10-20 05:21:03 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQGraphicsLayout constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQGraphicsLayout(h unsafe.Pointer) *QGraphicsLayout {
return newQGraphicsLayout((*C.QGraphicsLayout)(h))
2024-10-20 05:21:03 +00:00
}
// NewQGraphicsLayout constructs a new QGraphicsLayout object.
func NewQGraphicsLayout() *QGraphicsLayout {
2024-12-07 04:15:57 +00:00
ret := newQGraphicsLayout(C.QGraphicsLayout_new())
ret.isSubclass = true
return ret
}
// NewQGraphicsLayout2 constructs a new QGraphicsLayout object.
func NewQGraphicsLayout2(parent *QGraphicsLayoutItem) *QGraphicsLayout {
2024-12-07 04:15:57 +00:00
ret := newQGraphicsLayout(C.QGraphicsLayout_new2(parent.cPointer()))
ret.isSubclass = true
return ret
}
2024-10-20 05:21:03 +00:00
func (this *QGraphicsLayout) SetContentsMargins(left float64, top float64, right float64, bottom float64) {
C.QGraphicsLayout_SetContentsMargins(this.h, (C.double)(left), (C.double)(top), (C.double)(right), (C.double)(bottom))
}
func (this *QGraphicsLayout) GetContentsMargins(left *float64, top *float64, right *float64, bottom *float64) {
C.QGraphicsLayout_GetContentsMargins(this.h, (*C.double)(unsafe.Pointer(left)), (*C.double)(unsafe.Pointer(top)), (*C.double)(unsafe.Pointer(right)), (*C.double)(unsafe.Pointer(bottom)))
}
func (this *QGraphicsLayout) Activate() {
C.QGraphicsLayout_Activate(this.h)
}
func (this *QGraphicsLayout) IsActivated() bool {
return (bool)(C.QGraphicsLayout_IsActivated(this.h))
}
func (this *QGraphicsLayout) Invalidate() {
C.QGraphicsLayout_Invalidate(this.h)
}
func (this *QGraphicsLayout) UpdateGeometry() {
C.QGraphicsLayout_UpdateGeometry(this.h)
}
func (this *QGraphicsLayout) WidgetEvent(e *QEvent) {
C.QGraphicsLayout_WidgetEvent(this.h, e.cPointer())
}
func (this *QGraphicsLayout) Count() int {
return (int)(C.QGraphicsLayout_Count(this.h))
}
func (this *QGraphicsLayout) ItemAt(i int) *QGraphicsLayoutItem {
return newQGraphicsLayoutItem(C.QGraphicsLayout_ItemAt(this.h, (C.int)(i)))
2024-10-20 05:21:03 +00:00
}
func (this *QGraphicsLayout) RemoveAt(index int) {
C.QGraphicsLayout_RemoveAt(this.h, (C.int)(index))
}
func QGraphicsLayout_SetInstantInvalidatePropagation(enable bool) {
C.QGraphicsLayout_SetInstantInvalidatePropagation((C.bool)(enable))
}
func QGraphicsLayout_InstantInvalidatePropagation() bool {
return (bool)(C.QGraphicsLayout_InstantInvalidatePropagation())
}
func (this *QGraphicsLayout) callVirtualBase_GetContentsMargins(left *float64, top *float64, right *float64, bottom *float64) {
C.QGraphicsLayout_virtualbase_GetContentsMargins(unsafe.Pointer(this.h), (*C.double)(unsafe.Pointer(left)), (*C.double)(unsafe.Pointer(top)), (*C.double)(unsafe.Pointer(right)), (*C.double)(unsafe.Pointer(bottom)))
}
func (this *QGraphicsLayout) OnGetContentsMargins(slot func(super func(left *float64, top *float64, right *float64, bottom *float64), left *float64, top *float64, right *float64, bottom *float64)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_GetContentsMargins(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_GetContentsMargins
func miqt_exec_callback_QGraphicsLayout_GetContentsMargins(self *C.QGraphicsLayout, cb C.intptr_t, left *C.double, top *C.double, right *C.double, bottom *C.double) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(left *float64, top *float64, right *float64, bottom *float64), left *float64, top *float64, right *float64, bottom *float64))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (*float64)(unsafe.Pointer(left))
slotval2 := (*float64)(unsafe.Pointer(top))
slotval3 := (*float64)(unsafe.Pointer(right))
slotval4 := (*float64)(unsafe.Pointer(bottom))
gofunc((&QGraphicsLayout{h: self}).callVirtualBase_GetContentsMargins, slotval1, slotval2, slotval3, slotval4)
}
func (this *QGraphicsLayout) callVirtualBase_Invalidate() {
C.QGraphicsLayout_virtualbase_Invalidate(unsafe.Pointer(this.h))
}
func (this *QGraphicsLayout) OnInvalidate(slot func(super func())) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_Invalidate(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_Invalidate
func miqt_exec_callback_QGraphicsLayout_Invalidate(self *C.QGraphicsLayout, cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func()))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc((&QGraphicsLayout{h: self}).callVirtualBase_Invalidate)
}
func (this *QGraphicsLayout) callVirtualBase_UpdateGeometry() {
C.QGraphicsLayout_virtualbase_UpdateGeometry(unsafe.Pointer(this.h))
}
func (this *QGraphicsLayout) OnUpdateGeometry(slot func(super func())) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_UpdateGeometry(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_UpdateGeometry
func miqt_exec_callback_QGraphicsLayout_UpdateGeometry(self *C.QGraphicsLayout, cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func()))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc((&QGraphicsLayout{h: self}).callVirtualBase_UpdateGeometry)
}
func (this *QGraphicsLayout) callVirtualBase_WidgetEvent(e *QEvent) {
C.QGraphicsLayout_virtualbase_WidgetEvent(unsafe.Pointer(this.h), e.cPointer())
}
func (this *QGraphicsLayout) OnWidgetEvent(slot func(super func(e *QEvent), e *QEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_WidgetEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_WidgetEvent
func miqt_exec_callback_QGraphicsLayout_WidgetEvent(self *C.QGraphicsLayout, cb C.intptr_t, e *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(e *QEvent), e *QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQEvent(e)
gofunc((&QGraphicsLayout{h: self}).callVirtualBase_WidgetEvent, slotval1)
}
func (this *QGraphicsLayout) OnCount(slot func() int) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_Count(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_Count
func miqt_exec_callback_QGraphicsLayout_Count(self *C.QGraphicsLayout, cb C.intptr_t) C.int {
gofunc, ok := cgo.Handle(cb).Value().(func() int)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc()
return (C.int)(virtualReturn)
}
func (this *QGraphicsLayout) OnItemAt(slot func(i int) *QGraphicsLayoutItem) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_ItemAt(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_ItemAt
func miqt_exec_callback_QGraphicsLayout_ItemAt(self *C.QGraphicsLayout, cb C.intptr_t, i C.int) *C.QGraphicsLayoutItem {
gofunc, ok := cgo.Handle(cb).Value().(func(i int) *QGraphicsLayoutItem)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(i)
virtualReturn := gofunc(slotval1)
return virtualReturn.cPointer()
}
func (this *QGraphicsLayout) OnRemoveAt(slot func(index int)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_RemoveAt(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_RemoveAt
func miqt_exec_callback_QGraphicsLayout_RemoveAt(self *C.QGraphicsLayout, cb C.intptr_t, index C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(index int))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int)(index)
gofunc(slotval1)
}
func (this *QGraphicsLayout) callVirtualBase_SetGeometry(rect *QRectF) {
C.QGraphicsLayout_virtualbase_SetGeometry(unsafe.Pointer(this.h), rect.cPointer())
}
func (this *QGraphicsLayout) OnSetGeometry(slot func(super func(rect *QRectF), rect *QRectF)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_SetGeometry(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_SetGeometry
func miqt_exec_callback_QGraphicsLayout_SetGeometry(self *C.QGraphicsLayout, cb C.intptr_t, rect *C.QRectF) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(rect *QRectF), rect *QRectF))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQRectF(rect)
gofunc((&QGraphicsLayout{h: self}).callVirtualBase_SetGeometry, slotval1)
}
func (this *QGraphicsLayout) callVirtualBase_IsEmpty() bool {
return (bool)(C.QGraphicsLayout_virtualbase_IsEmpty(unsafe.Pointer(this.h)))
}
func (this *QGraphicsLayout) OnIsEmpty(slot func(super func() bool) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_IsEmpty(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_IsEmpty
func miqt_exec_callback_QGraphicsLayout_IsEmpty(self *C.QGraphicsLayout, cb C.intptr_t) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func() bool) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc((&QGraphicsLayout{h: self}).callVirtualBase_IsEmpty)
return (C.bool)(virtualReturn)
}
func (this *QGraphicsLayout) OnSizeHint(slot func(which SizeHint, constraint *QSizeF) *QSizeF) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
C.QGraphicsLayout_override_virtual_SizeHint(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QGraphicsLayout_SizeHint
func miqt_exec_callback_QGraphicsLayout_SizeHint(self *C.QGraphicsLayout, cb C.intptr_t, which C.int, constraint *C.QSizeF) *C.QSizeF {
gofunc, ok := cgo.Handle(cb).Value().(func(which SizeHint, constraint *QSizeF) *QSizeF)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (SizeHint)(which)
slotval2 := newQSizeF(constraint)
virtualReturn := gofunc(slotval1, slotval2)
return virtualReturn.cPointer()
}
2024-10-20 05:21:03 +00:00
// Delete this object from C++ memory.
func (this *QGraphicsLayout) Delete() {
2024-11-19 06:29:06 +00:00
C.QGraphicsLayout_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 *QGraphicsLayout) GoGC() {
runtime.SetFinalizer(this, func(this *QGraphicsLayout) {
this.Delete()
runtime.KeepAlive(this.h)
})
}