miqt/qt6/gen_qrasterwindow.go

260 lines
8.3 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qrasterwindow.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
2024-11-19 06:29:06 +00:00
"runtime/cgo"
2024-10-20 05:21:03 +00:00
"unsafe"
)
type QRasterWindow struct {
2024-11-19 06:29:06 +00:00
h *C.QRasterWindow
isSubclass bool
2024-10-20 05:21:03 +00:00
*QPaintDeviceWindow
}
func (this *QRasterWindow) cPointer() *C.QRasterWindow {
if this == nil {
return nil
}
return this.h
}
func (this *QRasterWindow) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQRasterWindow constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQRasterWindow(h *C.QRasterWindow) *QRasterWindow {
2024-10-20 05:21:03 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QPaintDeviceWindow *C.QPaintDeviceWindow = nil
C.QRasterWindow_virtbase(h, &outptr_QPaintDeviceWindow)
2024-11-19 06:29:06 +00:00
return &QRasterWindow{h: h,
2024-12-07 04:15:57 +00:00
QPaintDeviceWindow: newQPaintDeviceWindow(outptr_QPaintDeviceWindow)}
2024-10-20 05:21:03 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQRasterWindow constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQRasterWindow(h unsafe.Pointer) *QRasterWindow {
return newQRasterWindow((*C.QRasterWindow)(h))
2024-10-20 05:21:03 +00:00
}
// NewQRasterWindow constructs a new QRasterWindow object.
func NewQRasterWindow() *QRasterWindow {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQRasterWindow(C.QRasterWindow_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQRasterWindow2 constructs a new QRasterWindow object.
func NewQRasterWindow2(parent *QWindow) *QRasterWindow {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQRasterWindow(C.QRasterWindow_new2(parent.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QRasterWindow) MetaObject() *QMetaObject {
return newQMetaObject(C.QRasterWindow_MetaObject(this.h))
2024-10-20 05:21:03 +00:00
}
func (this *QRasterWindow) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QRasterWindow_Metacast(this.h, param1_Cstring))
}
func QRasterWindow_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QRasterWindow_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QRasterWindow_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.QRasterWindow_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QRasterWindow_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.QRasterWindow_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 *QRasterWindow) callVirtualBase_Metric(metric QPaintDevice__PaintDeviceMetric) int {
return (int)(C.QRasterWindow_virtualbase_Metric(unsafe.Pointer(this.h), (C.int)(metric)))
}
func (this *QRasterWindow) OnMetric(slot func(super func(metric QPaintDevice__PaintDeviceMetric) int, metric QPaintDevice__PaintDeviceMetric) int) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QRasterWindow_override_virtual_Metric(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QRasterWindow_Metric
func miqt_exec_callback_QRasterWindow_Metric(self *C.QRasterWindow, cb C.intptr_t, metric C.int) C.int {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(metric QPaintDevice__PaintDeviceMetric) int, metric QPaintDevice__PaintDeviceMetric) int)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QPaintDevice__PaintDeviceMetric)(metric)
virtualReturn := gofunc((&QRasterWindow{h: self}).callVirtualBase_Metric, slotval1)
return (C.int)(virtualReturn)
}
func (this *QRasterWindow) callVirtualBase_Redirected(param1 *QPoint) *QPaintDevice {
return newQPaintDevice(C.QRasterWindow_virtualbase_Redirected(unsafe.Pointer(this.h), param1.cPointer()))
2024-11-19 06:29:06 +00:00
}
func (this *QRasterWindow) OnRedirected(slot func(super func(param1 *QPoint) *QPaintDevice, param1 *QPoint) *QPaintDevice) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QRasterWindow_override_virtual_Redirected(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QRasterWindow_Redirected
func miqt_exec_callback_QRasterWindow_Redirected(self *C.QRasterWindow, cb C.intptr_t, param1 *C.QPoint) *C.QPaintDevice {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(param1 *QPoint) *QPaintDevice, param1 *QPoint) *QPaintDevice)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQPoint(param1)
2024-11-19 06:29:06 +00:00
virtualReturn := gofunc((&QRasterWindow{h: self}).callVirtualBase_Redirected, slotval1)
return virtualReturn.cPointer()
}
func (this *QRasterWindow) callVirtualBase_ExposeEvent(param1 *QExposeEvent) {
C.QRasterWindow_virtualbase_ExposeEvent(unsafe.Pointer(this.h), param1.cPointer())
}
func (this *QRasterWindow) OnExposeEvent(slot func(super func(param1 *QExposeEvent), param1 *QExposeEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QRasterWindow_override_virtual_ExposeEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QRasterWindow_ExposeEvent
func miqt_exec_callback_QRasterWindow_ExposeEvent(self *C.QRasterWindow, cb C.intptr_t, param1 *C.QExposeEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(param1 *QExposeEvent), param1 *QExposeEvent))
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 := newQExposeEvent(param1)
2024-11-19 06:29:06 +00:00
gofunc((&QRasterWindow{h: self}).callVirtualBase_ExposeEvent, slotval1)
}
func (this *QRasterWindow) callVirtualBase_PaintEvent(event *QPaintEvent) {
C.QRasterWindow_virtualbase_PaintEvent(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QRasterWindow) OnPaintEvent(slot func(super func(event *QPaintEvent), event *QPaintEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QRasterWindow_override_virtual_PaintEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QRasterWindow_PaintEvent
func miqt_exec_callback_QRasterWindow_PaintEvent(self *C.QRasterWindow, cb C.intptr_t, event *C.QPaintEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QPaintEvent), event *QPaintEvent))
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 := newQPaintEvent(event)
2024-11-19 06:29:06 +00:00
gofunc((&QRasterWindow{h: self}).callVirtualBase_PaintEvent, slotval1)
}
func (this *QRasterWindow) callVirtualBase_Event(event *QEvent) bool {
return (bool)(C.QRasterWindow_virtualbase_Event(unsafe.Pointer(this.h), event.cPointer()))
}
func (this *QRasterWindow) OnEvent(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.QRasterWindow_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QRasterWindow_Event
func miqt_exec_callback_QRasterWindow_Event(self *C.QRasterWindow, 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((&QRasterWindow{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
2024-10-20 05:21:03 +00:00
// Delete this object from C++ memory.
func (this *QRasterWindow) Delete() {
2024-11-19 06:29:06 +00:00
C.QRasterWindow_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 *QRasterWindow) GoGC() {
runtime.SetFinalizer(this, func(this *QRasterWindow) {
this.Delete()
runtime.KeepAlive(this.h)
})
}