mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 00:48:38 +00:00
260 lines
8.3 KiB
Go
260 lines
8.3 KiB
Go
package qt6
|
|
|
|
/*
|
|
|
|
#include "gen_qrasterwindow.h"
|
|
#include <stdlib.h>
|
|
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"runtime"
|
|
"runtime/cgo"
|
|
"unsafe"
|
|
)
|
|
|
|
type QRasterWindow struct {
|
|
h *C.QRasterWindow
|
|
isSubclass bool
|
|
*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)
|
|
}
|
|
|
|
// newQRasterWindow constructs the type using only CGO pointers.
|
|
func newQRasterWindow(h *C.QRasterWindow) *QRasterWindow {
|
|
if h == nil {
|
|
return nil
|
|
}
|
|
var outptr_QPaintDeviceWindow *C.QPaintDeviceWindow = nil
|
|
C.QRasterWindow_virtbase(h, &outptr_QPaintDeviceWindow)
|
|
|
|
return &QRasterWindow{h: h,
|
|
QPaintDeviceWindow: newQPaintDeviceWindow(outptr_QPaintDeviceWindow)}
|
|
}
|
|
|
|
// UnsafeNewQRasterWindow constructs the type using only unsafe pointers.
|
|
func UnsafeNewQRasterWindow(h unsafe.Pointer) *QRasterWindow {
|
|
return newQRasterWindow((*C.QRasterWindow)(h))
|
|
}
|
|
|
|
// NewQRasterWindow constructs a new QRasterWindow object.
|
|
func NewQRasterWindow() *QRasterWindow {
|
|
|
|
ret := newQRasterWindow(C.QRasterWindow_new())
|
|
ret.isSubclass = true
|
|
return ret
|
|
}
|
|
|
|
// NewQRasterWindow2 constructs a new QRasterWindow object.
|
|
func NewQRasterWindow2(parent *QWindow) *QRasterWindow {
|
|
|
|
ret := newQRasterWindow(C.QRasterWindow_new2(parent.cPointer()))
|
|
ret.isSubclass = true
|
|
return ret
|
|
}
|
|
|
|
func (this *QRasterWindow) MetaObject() *QMetaObject {
|
|
return newQMetaObject(C.QRasterWindow_MetaObject(this.h))
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
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")
|
|
}
|
|
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()))
|
|
|
|
}
|
|
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")
|
|
}
|
|
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)
|
|
|
|
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")
|
|
}
|
|
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
|
|
slotval1 := newQExposeEvent(param1)
|
|
|
|
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")
|
|
}
|
|
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
|
|
slotval1 := newQPaintEvent(event)
|
|
|
|
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")
|
|
}
|
|
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)
|
|
|
|
virtualReturn := gofunc((&QRasterWindow{h: self}).callVirtualBase_Event, slotval1)
|
|
|
|
return (C.bool)(virtualReturn)
|
|
|
|
}
|
|
|
|
// Delete this object from C++ memory.
|
|
func (this *QRasterWindow) Delete() {
|
|
C.QRasterWindow_Delete(this.h, C.bool(this.isSubclass))
|
|
}
|
|
|
|
// 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)
|
|
})
|
|
}
|