2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qarraydata.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QArrayData__AllocationOption int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QArrayData__CapacityReserved QArrayData__AllocationOption = 1
|
|
|
|
QArrayData__Unsharable QArrayData__AllocationOption = 2
|
|
|
|
QArrayData__RawData QArrayData__AllocationOption = 4
|
|
|
|
QArrayData__Grow QArrayData__AllocationOption = 8
|
|
|
|
QArrayData__Default QArrayData__AllocationOption = 0
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QtPrivate__QContainerImplHelper__CutResult int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QtPrivate__QContainerImplHelper__Null QtPrivate__QContainerImplHelper__CutResult = 0
|
|
|
|
QtPrivate__QContainerImplHelper__Empty QtPrivate__QContainerImplHelper__CutResult = 1
|
|
|
|
QtPrivate__QContainerImplHelper__Full QtPrivate__QContainerImplHelper__CutResult = 2
|
|
|
|
QtPrivate__QContainerImplHelper__Subset QtPrivate__QContainerImplHelper__CutResult = 3
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QArrayData struct {
|
|
|
|
h *C.QArrayData
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QArrayData) cPointer() *C.QArrayData {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QArrayData) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQArrayData(h *C.QArrayData) *QArrayData {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QArrayData{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQArrayData(h unsafe.Pointer) *QArrayData {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQArrayData((*C.QArrayData)(h))
|
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QArrayData) Data() unsafe.Pointer {
|
2024-10-18 23:53:33 +00:00
|
|
|
return (unsafe.Pointer)(C.QArrayData_Data(this.h))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QArrayData) Data2() unsafe.Pointer {
|
2024-10-18 23:53:33 +00:00
|
|
|
return (unsafe.Pointer)(C.QArrayData_Data2(this.h))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QArrayData) IsMutable() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QArrayData_IsMutable(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QArrayData) DetachCapacity(newSize uint64) uint64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (uint64)(C.QArrayData_DetachCapacity(this.h, (C.size_t)(newSize)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QArrayData) DetachFlags() QArrayData__AllocationOption {
|
|
|
|
return (QArrayData__AllocationOption)(C.QArrayData_DetachFlags(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QArrayData) CloneFlags() QArrayData__AllocationOption {
|
|
|
|
return (QArrayData__AllocationOption)(C.QArrayData_CloneFlags(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QArrayData_Allocate(objectSize uint64, alignment uint64, capacity uint64) *QArrayData {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_Allocate((C.size_t)(objectSize), (C.size_t)(alignment), (C.size_t)(capacity))))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QArrayData_ReallocateUnaligned(data *QArrayData, objectSize uint64, newCapacity uint64) *QArrayData {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_ReallocateUnaligned(data.cPointer(), (C.size_t)(objectSize), (C.size_t)(newCapacity))))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QArrayData_Deallocate(data *QArrayData, objectSize uint64, alignment uint64) {
|
|
|
|
C.QArrayData_Deallocate(data.cPointer(), (C.size_t)(objectSize), (C.size_t)(alignment))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QArrayData_SharedNull() *QArrayData {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_SharedNull()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func QArrayData_Allocate4(objectSize uint64, alignment uint64, capacity uint64, options QArrayData__AllocationOption) *QArrayData {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_Allocate4((C.size_t)(objectSize), (C.size_t)(alignment), (C.size_t)(capacity), (C.int)(options))))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func QArrayData_ReallocateUnaligned4(data *QArrayData, objectSize uint64, newCapacity uint64, newOptions QArrayData__AllocationOption) *QArrayData {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_ReallocateUnaligned4(data.cPointer(), (C.size_t)(objectSize), (C.size_t)(newCapacity), (C.int)(newOptions))))
|
2024-08-29 07:01:51 +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 *QArrayData) Delete() {
|
|
|
|
C.QArrayData_Delete(this.h)
|
|
|
|
}
|
2024-08-29 07:01:51 +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 *QArrayData) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QArrayData) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
type QtPrivate__QContainerImplHelper struct {
|
|
|
|
h *C.QtPrivate__QContainerImplHelper
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QtPrivate__QContainerImplHelper) cPointer() *C.QtPrivate__QContainerImplHelper {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QtPrivate__QContainerImplHelper) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func newQtPrivate__QContainerImplHelper(h *C.QtPrivate__QContainerImplHelper) *QtPrivate__QContainerImplHelper {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
return &QtPrivate__QContainerImplHelper{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQtPrivate__QContainerImplHelper(h unsafe.Pointer) *QtPrivate__QContainerImplHelper {
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQtPrivate__QContainerImplHelper((*C.QtPrivate__QContainerImplHelper)(h))
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QtPrivate__QContainerImplHelper) Delete() {
|
|
|
|
C.QtPrivate__QContainerImplHelper_Delete(this.h)
|
|
|
|
}
|
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 *QtPrivate__QContainerImplHelper) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QtPrivate__QContainerImplHelper) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|