miqt/qt6/gen_qsavefile.go

550 lines
18 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qsavefile.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 QSaveFile struct {
2024-11-19 06:29:06 +00:00
h *C.QSaveFile
isSubclass bool
2024-10-20 05:21:03 +00:00
*QFileDevice
}
func (this *QSaveFile) cPointer() *C.QSaveFile {
if this == nil {
return nil
}
return this.h
}
func (this *QSaveFile) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQSaveFile constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQSaveFile(h *C.QSaveFile) *QSaveFile {
2024-10-20 05:21:03 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QFileDevice *C.QFileDevice = nil
C.QSaveFile_virtbase(h, &outptr_QFileDevice)
2024-11-19 06:29:06 +00:00
return &QSaveFile{h: h,
2024-12-07 04:15:57 +00:00
QFileDevice: newQFileDevice(outptr_QFileDevice)}
2024-10-20 05:21:03 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQSaveFile constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQSaveFile(h unsafe.Pointer) *QSaveFile {
return newQSaveFile((*C.QSaveFile)(h))
2024-10-20 05:21:03 +00:00
}
// NewQSaveFile constructs a new QSaveFile object.
func NewQSaveFile(name string) *QSaveFile {
name_ms := C.struct_miqt_string{}
name_ms.data = C.CString(name)
name_ms.len = C.size_t(len(name))
defer C.free(unsafe.Pointer(name_ms.data))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSaveFile(C.QSaveFile_new(name_ms))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSaveFile2 constructs a new QSaveFile object.
func NewQSaveFile2() *QSaveFile {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSaveFile(C.QSaveFile_new2())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSaveFile3 constructs a new QSaveFile object.
func NewQSaveFile3(name string, parent *QObject) *QSaveFile {
name_ms := C.struct_miqt_string{}
name_ms.data = C.CString(name)
name_ms.len = C.size_t(len(name))
defer C.free(unsafe.Pointer(name_ms.data))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSaveFile(C.QSaveFile_new3(name_ms, parent.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSaveFile4 constructs a new QSaveFile object.
func NewQSaveFile4(parent *QObject) *QSaveFile {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSaveFile(C.QSaveFile_new4(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 *QSaveFile) MetaObject() *QMetaObject {
return newQMetaObject(C.QSaveFile_MetaObject(this.h))
2024-10-20 05:21:03 +00:00
}
func (this *QSaveFile) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QSaveFile_Metacast(this.h, param1_Cstring))
}
func QSaveFile_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QSaveFile_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QSaveFile) FileName() string {
var _ms C.struct_miqt_string = C.QSaveFile_FileName(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QSaveFile) SetFileName(name string) {
name_ms := C.struct_miqt_string{}
name_ms.data = C.CString(name)
name_ms.len = C.size_t(len(name))
defer C.free(unsafe.Pointer(name_ms.data))
C.QSaveFile_SetFileName(this.h, name_ms)
}
func (this *QSaveFile) Open(flags QIODeviceBase__OpenModeFlag) bool {
return (bool)(C.QSaveFile_Open(this.h, (C.int)(flags)))
}
func (this *QSaveFile) Commit() bool {
return (bool)(C.QSaveFile_Commit(this.h))
}
func (this *QSaveFile) CancelWriting() {
C.QSaveFile_CancelWriting(this.h)
}
func (this *QSaveFile) SetDirectWriteFallback(enabled bool) {
C.QSaveFile_SetDirectWriteFallback(this.h, (C.bool)(enabled))
}
func (this *QSaveFile) DirectWriteFallback() bool {
return (bool)(C.QSaveFile_DirectWriteFallback(this.h))
}
func QSaveFile_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.QSaveFile_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QSaveFile_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.QSaveFile_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 *QSaveFile) callVirtualBase_FileName() string {
var _ms C.struct_miqt_string = C.QSaveFile_virtualbase_FileName(unsafe.Pointer(this.h))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QSaveFile) OnFileName(slot func(super func() string) string) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_FileName(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_FileName
func miqt_exec_callback_QSaveFile_FileName(self *C.QSaveFile, cb C.intptr_t) C.struct_miqt_string {
gofunc, ok := cgo.Handle(cb).Value().(func(super func() string) string)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_FileName)
virtualReturn_ms := C.struct_miqt_string{}
virtualReturn_ms.data = C.CString(virtualReturn)
virtualReturn_ms.len = C.size_t(len(virtualReturn))
defer C.free(unsafe.Pointer(virtualReturn_ms.data))
return virtualReturn_ms
}
func (this *QSaveFile) callVirtualBase_Open(flags QIODeviceBase__OpenModeFlag) bool {
return (bool)(C.QSaveFile_virtualbase_Open(unsafe.Pointer(this.h), (C.int)(flags)))
}
func (this *QSaveFile) OnOpen(slot func(super func(flags QIODeviceBase__OpenModeFlag) bool, flags QIODeviceBase__OpenModeFlag) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_Open(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_Open
func miqt_exec_callback_QSaveFile_Open(self *C.QSaveFile, cb C.intptr_t, flags C.int) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(flags QIODeviceBase__OpenModeFlag) bool, flags QIODeviceBase__OpenModeFlag) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QIODeviceBase__OpenModeFlag)(flags)
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_Open, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_WriteData(data string, lenVal int64) int64 {
data_Cstring := C.CString(data)
defer C.free(unsafe.Pointer(data_Cstring))
return (int64)(C.QSaveFile_virtualbase_WriteData(unsafe.Pointer(this.h), data_Cstring, (C.longlong)(lenVal)))
}
func (this *QSaveFile) OnWriteData(slot func(super func(data string, lenVal int64) int64, data string, lenVal int64) int64) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_WriteData(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_WriteData
func miqt_exec_callback_QSaveFile_WriteData(self *C.QSaveFile, cb C.intptr_t, data *C.const_char, lenVal C.longlong) C.longlong {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(data string, lenVal int64) int64, data string, lenVal int64) int64)
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 := (int64)(lenVal)
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_WriteData, slotval1, slotval2)
return (C.longlong)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_IsSequential() bool {
return (bool)(C.QSaveFile_virtualbase_IsSequential(unsafe.Pointer(this.h)))
}
func (this *QSaveFile) OnIsSequential(slot func(super func() bool) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_IsSequential(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_IsSequential
func miqt_exec_callback_QSaveFile_IsSequential(self *C.QSaveFile, 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((&QSaveFile{h: self}).callVirtualBase_IsSequential)
return (C.bool)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_Pos() int64 {
return (int64)(C.QSaveFile_virtualbase_Pos(unsafe.Pointer(this.h)))
}
func (this *QSaveFile) OnPos(slot func(super func() int64) int64) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_Pos(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_Pos
func miqt_exec_callback_QSaveFile_Pos(self *C.QSaveFile, cb C.intptr_t) C.longlong {
gofunc, ok := cgo.Handle(cb).Value().(func(super func() int64) int64)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_Pos)
return (C.longlong)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_Seek(offset int64) bool {
return (bool)(C.QSaveFile_virtualbase_Seek(unsafe.Pointer(this.h), (C.longlong)(offset)))
}
func (this *QSaveFile) OnSeek(slot func(super func(offset int64) bool, offset int64) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_Seek(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_Seek
func miqt_exec_callback_QSaveFile_Seek(self *C.QSaveFile, cb C.intptr_t, offset C.longlong) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(offset int64) bool, offset int64) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int64)(offset)
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_Seek, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_AtEnd() bool {
return (bool)(C.QSaveFile_virtualbase_AtEnd(unsafe.Pointer(this.h)))
}
func (this *QSaveFile) OnAtEnd(slot func(super func() bool) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_AtEnd(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_AtEnd
func miqt_exec_callback_QSaveFile_AtEnd(self *C.QSaveFile, 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((&QSaveFile{h: self}).callVirtualBase_AtEnd)
return (C.bool)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_Size() int64 {
return (int64)(C.QSaveFile_virtualbase_Size(unsafe.Pointer(this.h)))
}
func (this *QSaveFile) OnSize(slot func(super func() int64) int64) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_Size(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_Size
func miqt_exec_callback_QSaveFile_Size(self *C.QSaveFile, cb C.intptr_t) C.longlong {
gofunc, ok := cgo.Handle(cb).Value().(func(super func() int64) int64)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_Size)
return (C.longlong)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_Resize(sz int64) bool {
return (bool)(C.QSaveFile_virtualbase_Resize(unsafe.Pointer(this.h), (C.longlong)(sz)))
}
func (this *QSaveFile) OnResize(slot func(super func(sz int64) bool, sz int64) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_Resize(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_Resize
func miqt_exec_callback_QSaveFile_Resize(self *C.QSaveFile, cb C.intptr_t, sz C.longlong) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(sz int64) bool, sz int64) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (int64)(sz)
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_Resize, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_Permissions() QFileDevice__Permission {
return (QFileDevice__Permission)(C.QSaveFile_virtualbase_Permissions(unsafe.Pointer(this.h)))
}
func (this *QSaveFile) OnPermissions(slot func(super func() QFileDevice__Permission) QFileDevice__Permission) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_Permissions(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_Permissions
func miqt_exec_callback_QSaveFile_Permissions(self *C.QSaveFile, cb C.intptr_t) C.int {
gofunc, ok := cgo.Handle(cb).Value().(func(super func() QFileDevice__Permission) QFileDevice__Permission)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_Permissions)
return (C.int)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_SetPermissions(permissionSpec QFileDevice__Permission) bool {
return (bool)(C.QSaveFile_virtualbase_SetPermissions(unsafe.Pointer(this.h), (C.int)(permissionSpec)))
}
func (this *QSaveFile) OnSetPermissions(slot func(super func(permissionSpec QFileDevice__Permission) bool, permissionSpec QFileDevice__Permission) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_SetPermissions(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_SetPermissions
func miqt_exec_callback_QSaveFile_SetPermissions(self *C.QSaveFile, cb C.intptr_t, permissionSpec C.int) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(permissionSpec QFileDevice__Permission) bool, permissionSpec QFileDevice__Permission) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QFileDevice__Permission)(permissionSpec)
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_SetPermissions, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_ReadData(data string, maxlen int64) int64 {
data_Cstring := C.CString(data)
defer C.free(unsafe.Pointer(data_Cstring))
return (int64)(C.QSaveFile_virtualbase_ReadData(unsafe.Pointer(this.h), data_Cstring, (C.longlong)(maxlen)))
}
func (this *QSaveFile) OnReadData(slot func(super func(data string, maxlen int64) int64, data string, maxlen int64) int64) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_ReadData(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_ReadData
func miqt_exec_callback_QSaveFile_ReadData(self *C.QSaveFile, cb C.intptr_t, data *C.char, maxlen C.longlong) C.longlong {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(data string, maxlen int64) int64, data string, maxlen int64) int64)
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 := (int64)(maxlen)
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_ReadData, slotval1, slotval2)
return (C.longlong)(virtualReturn)
}
func (this *QSaveFile) callVirtualBase_ReadLineData(data string, maxlen int64) int64 {
data_Cstring := C.CString(data)
defer C.free(unsafe.Pointer(data_Cstring))
return (int64)(C.QSaveFile_virtualbase_ReadLineData(unsafe.Pointer(this.h), data_Cstring, (C.longlong)(maxlen)))
}
func (this *QSaveFile) OnReadLineData(slot func(super func(data string, maxlen int64) int64, data string, maxlen int64) int64) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSaveFile_override_virtual_ReadLineData(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSaveFile_ReadLineData
func miqt_exec_callback_QSaveFile_ReadLineData(self *C.QSaveFile, cb C.intptr_t, data *C.char, maxlen C.longlong) C.longlong {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(data string, maxlen int64) int64, data string, maxlen int64) int64)
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 := (int64)(maxlen)
virtualReturn := gofunc((&QSaveFile{h: self}).callVirtualBase_ReadLineData, slotval1, slotval2)
return (C.longlong)(virtualReturn)
}
2024-10-20 05:21:03 +00:00
// Delete this object from C++ memory.
func (this *QSaveFile) Delete() {
2024-11-19 06:29:06 +00:00
C.QSaveFile_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 *QSaveFile) GoGC() {
runtime.SetFinalizer(this, func(this *QSaveFile) {
this.Delete()
runtime.KeepAlive(this.h)
})
}