2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qpicture.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
2024-11-19 06:29:06 +00:00
|
|
|
"runtime/cgo"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QPicture struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QPicture
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
*QPaintDevice
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) cPointer() *C.QPicture {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QPicture) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQPicture constructs the type using only CGO pointers.
|
|
|
|
func newQPicture(h *C.QPicture, h_QPaintDevice *C.QPaintDevice) *QPicture {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
return &QPicture{h: h,
|
|
|
|
QPaintDevice: newQPaintDevice(h_QPaintDevice)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQPicture constructs the type using only unsafe pointers.
|
|
|
|
func UnsafeNewQPicture(h unsafe.Pointer, h_QPaintDevice unsafe.Pointer) *QPicture {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QPicture{h: (*C.QPicture)(h),
|
|
|
|
QPaintDevice: UnsafeNewQPaintDevice(h_QPaintDevice)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPicture constructs a new QPicture object.
|
|
|
|
func NewQPicture() *QPicture {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QPicture *C.QPicture = nil
|
|
|
|
var outptr_QPaintDevice *C.QPaintDevice = nil
|
|
|
|
|
|
|
|
C.QPicture_new(&outptr_QPicture, &outptr_QPaintDevice)
|
|
|
|
ret := newQPicture(outptr_QPicture, outptr_QPaintDevice)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPicture2 constructs a new QPicture object.
|
|
|
|
func NewQPicture2(param1 *QPicture) *QPicture {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QPicture *C.QPicture = nil
|
|
|
|
var outptr_QPaintDevice *C.QPaintDevice = nil
|
|
|
|
|
|
|
|
C.QPicture_new2(param1.cPointer(), &outptr_QPicture, &outptr_QPaintDevice)
|
|
|
|
ret := newQPicture(outptr_QPicture, outptr_QPaintDevice)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPicture3 constructs a new QPicture object.
|
|
|
|
func NewQPicture3(formatVersion int) *QPicture {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QPicture *C.QPicture = nil
|
|
|
|
var outptr_QPaintDevice *C.QPaintDevice = nil
|
|
|
|
|
|
|
|
C.QPicture_new3((C.int)(formatVersion), &outptr_QPicture, &outptr_QPaintDevice)
|
|
|
|
ret := newQPicture(outptr_QPicture, outptr_QPaintDevice)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) IsNull() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPicture_IsNull(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) DevType() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QPicture_DevType(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Size() uint {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (uint)(C.QPicture_Size(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QPicture) Data() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QPicture_Data(this.h)
|
2024-10-18 23:53:33 +00:00
|
|
|
return C.GoString(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) SetData(data string, size uint) {
|
|
|
|
data_Cstring := C.CString(data)
|
|
|
|
defer C.free(unsafe.Pointer(data_Cstring))
|
|
|
|
C.QPicture_SetData(this.h, data_Cstring, (C.uint)(size))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Play(p *QPainter) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPicture_Play(this.h, p.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Load(dev *QIODevice) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPicture_Load(this.h, dev.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) LoadWithFileName(fileName string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
|
|
|
return (bool)(C.QPicture_LoadWithFileName(this.h, fileName_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Save(dev *QIODevice) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPicture_Save(this.h, dev.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) SaveWithFileName(fileName string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
|
|
|
return (bool)(C.QPicture_SaveWithFileName(this.h, fileName_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) BoundingRect() *QRect {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QPicture_BoundingRect(this.h)
|
|
|
|
_goptr := newQRect(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) SetBoundingRect(r *QRect) {
|
|
|
|
C.QPicture_SetBoundingRect(this.h, r.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) OperatorAssign(p *QPicture) {
|
|
|
|
C.QPicture_OperatorAssign(this.h, p.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Swap(other *QPicture) {
|
|
|
|
C.QPicture_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Detach() {
|
|
|
|
C.QPicture_Detach(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) IsDetached() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPicture_IsDetached(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QPicture_PictureFormat(fileName string) string {
|
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
|
|
|
_ret := C.QPicture_PictureFormat(fileName_ms)
|
|
|
|
return C.GoString(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QPicture_InputFormats() [][]byte {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPicture_InputFormats()
|
2024-10-18 23:53:33 +00:00
|
|
|
_ret := make([][]byte, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_bytearray C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_bytearray.data))
|
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QPicture_OutputFormats() [][]byte {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPicture_OutputFormats()
|
2024-10-18 23:53:33 +00:00
|
|
|
_ret := make([][]byte, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_bytearray C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_bytearray.data))
|
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QPicture_InputFormatList() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPicture_InputFormatList()
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
2024-10-18 23:53:33 +00:00
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
2024-09-17 07:30:27 +00:00
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QPicture_OutputFormatList() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPicture_OutputFormatList()
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
2024-10-18 23:53:33 +00:00
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
2024-09-17 07:30:27 +00:00
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) PaintEngine() *QPaintEngine {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQPaintEngine(unsafe.Pointer(C.QPicture_PaintEngine(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Load2(dev *QIODevice, format string) bool {
|
|
|
|
format_Cstring := C.CString(format)
|
|
|
|
defer C.free(unsafe.Pointer(format_Cstring))
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPicture_Load2(this.h, dev.cPointer(), format_Cstring))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Load22(fileName string, format string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
2024-08-25 04:08:24 +00:00
|
|
|
format_Cstring := C.CString(format)
|
|
|
|
defer C.free(unsafe.Pointer(format_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
return (bool)(C.QPicture_Load22(this.h, fileName_ms, format_Cstring))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Save2(dev *QIODevice, format string) bool {
|
|
|
|
format_Cstring := C.CString(format)
|
|
|
|
defer C.free(unsafe.Pointer(format_Cstring))
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPicture_Save2(this.h, dev.cPointer(), format_Cstring))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) Save22(fileName string, format string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
2024-08-25 04:08:24 +00:00
|
|
|
format_Cstring := C.CString(format)
|
|
|
|
defer C.free(unsafe.Pointer(format_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
return (bool)(C.QPicture_Save22(this.h, fileName_ms, format_Cstring))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
func (this *QPicture) callVirtualBase_DevType() int {
|
|
|
|
|
|
|
|
return (int)(C.QPicture_virtualbase_DevType(unsafe.Pointer(this.h)))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QPicture) OnDevType(slot func(super func() int) int) {
|
|
|
|
C.QPicture_override_virtual_DevType(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QPicture_DevType
|
|
|
|
func miqt_exec_callback_QPicture_DevType(self *C.QPicture, cb C.intptr_t) C.int {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func() int) int)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QPicture{h: self}).callVirtualBase_DevType)
|
|
|
|
|
|
|
|
return (C.int)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) callVirtualBase_SetData(data string, size uint) {
|
|
|
|
data_Cstring := C.CString(data)
|
|
|
|
defer C.free(unsafe.Pointer(data_Cstring))
|
|
|
|
|
|
|
|
C.QPicture_virtualbase_SetData(unsafe.Pointer(this.h), data_Cstring, (C.uint)(size))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QPicture) OnSetData(slot func(super func(data string, size uint), data string, size uint)) {
|
|
|
|
C.QPicture_override_virtual_SetData(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QPicture_SetData
|
|
|
|
func miqt_exec_callback_QPicture_SetData(self *C.QPicture, cb C.intptr_t, data *C.const_char, size C.uint) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(data string, size uint), data string, size uint))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
data_ret := data
|
|
|
|
slotval1 := C.GoString(data_ret)
|
|
|
|
|
|
|
|
slotval2 := (uint)(size)
|
|
|
|
|
|
|
|
gofunc((&QPicture{h: self}).callVirtualBase_SetData, slotval1, slotval2)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) callVirtualBase_PaintEngine() *QPaintEngine {
|
|
|
|
|
|
|
|
return UnsafeNewQPaintEngine(unsafe.Pointer(C.QPicture_virtualbase_PaintEngine(unsafe.Pointer(this.h))))
|
|
|
|
}
|
|
|
|
func (this *QPicture) OnPaintEngine(slot func(super func() *QPaintEngine) *QPaintEngine) {
|
|
|
|
C.QPicture_override_virtual_PaintEngine(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QPicture_PaintEngine
|
|
|
|
func miqt_exec_callback_QPicture_PaintEngine(self *C.QPicture, cb C.intptr_t) *C.QPaintEngine {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func() *QPaintEngine) *QPaintEngine)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QPicture{h: self}).callVirtualBase_PaintEngine)
|
|
|
|
|
|
|
|
return virtualReturn.cPointer()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) callVirtualBase_Metric(m QPaintDevice__PaintDeviceMetric) int {
|
|
|
|
|
|
|
|
return (int)(C.QPicture_virtualbase_Metric(unsafe.Pointer(this.h), (C.int)(m)))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QPicture) OnMetric(slot func(super func(m QPaintDevice__PaintDeviceMetric) int, m QPaintDevice__PaintDeviceMetric) int) {
|
|
|
|
C.QPicture_override_virtual_Metric(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QPicture_Metric
|
|
|
|
func miqt_exec_callback_QPicture_Metric(self *C.QPicture, cb C.intptr_t, m C.int) C.int {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(m QPaintDevice__PaintDeviceMetric) int, m QPaintDevice__PaintDeviceMetric) int)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := (QPaintDevice__PaintDeviceMetric)(m)
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QPicture{h: self}).callVirtualBase_Metric, slotval1)
|
|
|
|
|
|
|
|
return (C.int)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) callVirtualBase_InitPainter(painter *QPainter) {
|
|
|
|
|
|
|
|
C.QPicture_virtualbase_InitPainter(unsafe.Pointer(this.h), painter.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QPicture) OnInitPainter(slot func(super func(painter *QPainter), painter *QPainter)) {
|
|
|
|
C.QPicture_override_virtual_InitPainter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QPicture_InitPainter
|
|
|
|
func miqt_exec_callback_QPicture_InitPainter(self *C.QPicture, cb C.intptr_t, painter *C.QPainter) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(painter *QPainter), painter *QPainter))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := UnsafeNewQPainter(unsafe.Pointer(painter))
|
|
|
|
|
|
|
|
gofunc((&QPicture{h: self}).callVirtualBase_InitPainter, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) callVirtualBase_Redirected(offset *QPoint) *QPaintDevice {
|
|
|
|
|
|
|
|
return UnsafeNewQPaintDevice(unsafe.Pointer(C.QPicture_virtualbase_Redirected(unsafe.Pointer(this.h), offset.cPointer())))
|
|
|
|
}
|
|
|
|
func (this *QPicture) OnRedirected(slot func(super func(offset *QPoint) *QPaintDevice, offset *QPoint) *QPaintDevice) {
|
|
|
|
C.QPicture_override_virtual_Redirected(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QPicture_Redirected
|
|
|
|
func miqt_exec_callback_QPicture_Redirected(self *C.QPicture, cb C.intptr_t, offset *C.QPoint) *C.QPaintDevice {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(offset *QPoint) *QPaintDevice, offset *QPoint) *QPaintDevice)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := UnsafeNewQPoint(unsafe.Pointer(offset))
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QPicture{h: self}).callVirtualBase_Redirected, slotval1)
|
|
|
|
|
|
|
|
return virtualReturn.cPointer()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPicture) callVirtualBase_SharedPainter() *QPainter {
|
|
|
|
|
|
|
|
return UnsafeNewQPainter(unsafe.Pointer(C.QPicture_virtualbase_SharedPainter(unsafe.Pointer(this.h))))
|
|
|
|
}
|
|
|
|
func (this *QPicture) OnSharedPainter(slot func(super func() *QPainter) *QPainter) {
|
|
|
|
C.QPicture_override_virtual_SharedPainter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QPicture_SharedPainter
|
|
|
|
func miqt_exec_callback_QPicture_SharedPainter(self *C.QPicture, cb C.intptr_t) *C.QPainter {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func() *QPainter) *QPainter)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QPicture{h: self}).callVirtualBase_SharedPainter)
|
|
|
|
|
|
|
|
return virtualReturn.cPointer()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QPicture) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QPicture_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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 *QPicture) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QPicture) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QPictureIO struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QPictureIO
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) cPointer() *C.QPictureIO {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QPictureIO) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQPictureIO constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQPictureIO(h *C.QPictureIO) *QPictureIO {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QPictureIO{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQPictureIO constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQPictureIO(h unsafe.Pointer) *QPictureIO {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QPictureIO{h: (*C.QPictureIO)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPictureIO constructs a new QPictureIO object.
|
|
|
|
func NewQPictureIO() *QPictureIO {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QPictureIO *C.QPictureIO = nil
|
|
|
|
|
|
|
|
C.QPictureIO_new(&outptr_QPictureIO)
|
|
|
|
ret := newQPictureIO(outptr_QPictureIO)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPictureIO2 constructs a new QPictureIO object.
|
|
|
|
func NewQPictureIO2(ioDevice *QIODevice, format string) *QPictureIO {
|
|
|
|
format_Cstring := C.CString(format)
|
|
|
|
defer C.free(unsafe.Pointer(format_Cstring))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QPictureIO *C.QPictureIO = nil
|
|
|
|
|
|
|
|
C.QPictureIO_new2(ioDevice.cPointer(), format_Cstring, &outptr_QPictureIO)
|
|
|
|
ret := newQPictureIO(outptr_QPictureIO)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQPictureIO3 constructs a new QPictureIO object.
|
|
|
|
func NewQPictureIO3(fileName string, format string) *QPictureIO {
|
2024-10-18 23:53:33 +00:00
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
2024-08-25 04:08:24 +00:00
|
|
|
format_Cstring := C.CString(format)
|
|
|
|
defer C.free(unsafe.Pointer(format_Cstring))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QPictureIO *C.QPictureIO = nil
|
|
|
|
|
|
|
|
C.QPictureIO_new3(fileName_ms, format_Cstring, &outptr_QPictureIO)
|
|
|
|
ret := newQPictureIO(outptr_QPictureIO)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) Picture() *QPicture {
|
2024-11-19 06:29:06 +00:00
|
|
|
return UnsafeNewQPicture(unsafe.Pointer(C.QPictureIO_Picture(this.h)), nil)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) Status() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QPictureIO_Status(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QPictureIO) Format() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QPictureIO_Format(this.h)
|
2024-10-18 23:53:33 +00:00
|
|
|
return C.GoString(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) IoDevice() *QIODevice {
|
2024-11-19 06:29:06 +00:00
|
|
|
return UnsafeNewQIODevice(unsafe.Pointer(C.QPictureIO_IoDevice(this.h)), nil)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) FileName() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QPictureIO_FileName(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) Quality() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QPictureIO_Quality(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) Description() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QPictureIO_Description(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QPictureIO) Parameters() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QPictureIO_Parameters(this.h)
|
2024-10-18 23:53:33 +00:00
|
|
|
return C.GoString(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) Gamma() float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QPictureIO_Gamma(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetPicture(picture *QPicture) {
|
|
|
|
C.QPictureIO_SetPicture(this.h, picture.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetStatus(status int) {
|
|
|
|
C.QPictureIO_SetStatus(this.h, (C.int)(status))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetFormat(format string) {
|
|
|
|
format_Cstring := C.CString(format)
|
|
|
|
defer C.free(unsafe.Pointer(format_Cstring))
|
|
|
|
C.QPictureIO_SetFormat(this.h, format_Cstring)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetIODevice(iODevice *QIODevice) {
|
|
|
|
C.QPictureIO_SetIODevice(this.h, iODevice.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetFileName(fileName string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
|
|
|
C.QPictureIO_SetFileName(this.h, fileName_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetQuality(quality int) {
|
|
|
|
C.QPictureIO_SetQuality(this.h, (C.int)(quality))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetDescription(description string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
description_ms := C.struct_miqt_string{}
|
|
|
|
description_ms.data = C.CString(description)
|
|
|
|
description_ms.len = C.size_t(len(description))
|
|
|
|
defer C.free(unsafe.Pointer(description_ms.data))
|
|
|
|
C.QPictureIO_SetDescription(this.h, description_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetParameters(parameters string) {
|
|
|
|
parameters_Cstring := C.CString(parameters)
|
|
|
|
defer C.free(unsafe.Pointer(parameters_Cstring))
|
|
|
|
C.QPictureIO_SetParameters(this.h, parameters_Cstring)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) SetGamma(gamma float32) {
|
|
|
|
C.QPictureIO_SetGamma(this.h, (C.float)(gamma))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) Read() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPictureIO_Read(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QPictureIO) Write() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QPictureIO_Write(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QPictureIO_PictureFormat(fileName string) []byte {
|
|
|
|
fileName_ms := C.struct_miqt_string{}
|
|
|
|
fileName_ms.data = C.CString(fileName)
|
|
|
|
fileName_ms.len = C.size_t(len(fileName))
|
|
|
|
defer C.free(unsafe.Pointer(fileName_ms.data))
|
|
|
|
var _bytearray C.struct_miqt_string = C.QPictureIO_PictureFormat(fileName_ms)
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QPictureIO_PictureFormatWithQIODevice(param1 *QIODevice) []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QPictureIO_PictureFormatWithQIODevice(param1.cPointer())
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QPictureIO_InputFormats() [][]byte {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPictureIO_InputFormats()
|
2024-10-18 23:53:33 +00:00
|
|
|
_ret := make([][]byte, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_bytearray C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_bytearray.data))
|
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QPictureIO_OutputFormats() [][]byte {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QPictureIO_OutputFormats()
|
2024-10-18 23:53:33 +00:00
|
|
|
_ret := make([][]byte, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_bytearray C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_bytearray.data))
|
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QPictureIO) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QPictureIO_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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 *QPictureIO) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QPictureIO) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|