miqt/qt6/gen_qpageranges.go

214 lines
5.3 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qpageranges.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QPageRanges struct {
2024-11-19 06:29:06 +00:00
h *C.QPageRanges
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QPageRanges) cPointer() *C.QPageRanges {
if this == nil {
return nil
}
return this.h
}
func (this *QPageRanges) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQPageRanges constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQPageRanges(h *C.QPageRanges) *QPageRanges {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QPageRanges{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQPageRanges constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQPageRanges(h unsafe.Pointer) *QPageRanges {
2024-12-07 04:15:57 +00:00
return newQPageRanges((*C.QPageRanges)(h))
2024-10-20 05:21:03 +00:00
}
// NewQPageRanges constructs a new QPageRanges object.
func NewQPageRanges() *QPageRanges {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPageRanges(C.QPageRanges_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQPageRanges2 constructs a new QPageRanges object.
func NewQPageRanges2(other *QPageRanges) *QPageRanges {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPageRanges(C.QPageRanges_new2(other.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QPageRanges) OperatorAssign(other *QPageRanges) {
C.QPageRanges_OperatorAssign(this.h, other.cPointer())
}
func (this *QPageRanges) Swap(other *QPageRanges) {
C.QPageRanges_Swap(this.h, other.cPointer())
}
func (this *QPageRanges) AddPage(pageNumber int) {
C.QPageRanges_AddPage(this.h, (C.int)(pageNumber))
}
func (this *QPageRanges) AddRange(from int, to int) {
C.QPageRanges_AddRange(this.h, (C.int)(from), (C.int)(to))
}
func (this *QPageRanges) ToRangeList() []QPageRanges__Range {
var _ma C.struct_miqt_array = C.QPageRanges_ToRangeList(this.h)
2024-10-20 05:21:03 +00:00
_ret := make([]QPageRanges__Range, int(_ma.len))
_outCast := (*[0xffff]*C.QPageRanges__Range)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_goptr := newQPageRanges__Range(_outCast[i])
2024-10-20 05:21:03 +00:00
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
func (this *QPageRanges) Clear() {
C.QPageRanges_Clear(this.h)
}
func (this *QPageRanges) ToString() string {
var _ms C.struct_miqt_string = C.QPageRanges_ToString(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QPageRanges_FromString(ranges string) *QPageRanges {
ranges_ms := C.struct_miqt_string{}
ranges_ms.data = C.CString(ranges)
ranges_ms.len = C.size_t(len(ranges))
defer C.free(unsafe.Pointer(ranges_ms.data))
_goptr := newQPageRanges(C.QPageRanges_FromString(ranges_ms))
2024-10-20 05:21:03 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QPageRanges) Contains(pageNumber int) bool {
return (bool)(C.QPageRanges_Contains(this.h, (C.int)(pageNumber)))
}
func (this *QPageRanges) IsEmpty() bool {
return (bool)(C.QPageRanges_IsEmpty(this.h))
}
func (this *QPageRanges) FirstPage() int {
return (int)(C.QPageRanges_FirstPage(this.h))
}
func (this *QPageRanges) LastPage() int {
return (int)(C.QPageRanges_LastPage(this.h))
}
func (this *QPageRanges) Detach() {
C.QPageRanges_Detach(this.h)
}
// Delete this object from C++ memory.
func (this *QPageRanges) Delete() {
2024-11-19 06:29:06 +00:00
C.QPageRanges_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 *QPageRanges) GoGC() {
runtime.SetFinalizer(this, func(this *QPageRanges) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QPageRanges__Range struct {
2024-11-19 06:29:06 +00:00
h *C.QPageRanges__Range
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QPageRanges__Range) cPointer() *C.QPageRanges__Range {
if this == nil {
return nil
}
return this.h
}
func (this *QPageRanges__Range) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQPageRanges__Range constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQPageRanges__Range(h *C.QPageRanges__Range) *QPageRanges__Range {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QPageRanges__Range{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQPageRanges__Range constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQPageRanges__Range(h unsafe.Pointer) *QPageRanges__Range {
2024-12-07 04:15:57 +00:00
return newQPageRanges__Range((*C.QPageRanges__Range)(h))
2024-10-20 05:21:03 +00:00
}
// NewQPageRanges__Range constructs a new QPageRanges::Range object.
func NewQPageRanges__Range() *QPageRanges__Range {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPageRanges__Range(C.QPageRanges__Range_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQPageRanges__Range2 constructs a new QPageRanges::Range object.
func NewQPageRanges__Range2(param1 *QPageRanges__Range) *QPageRanges__Range {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPageRanges__Range(C.QPageRanges__Range_new2(param1.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QPageRanges__Range) Contains(pageNumber int) bool {
return (bool)(C.QPageRanges__Range_Contains(this.h, (C.int)(pageNumber)))
}
// Delete this object from C++ memory.
func (this *QPageRanges__Range) Delete() {
2024-11-19 06:29:06 +00:00
C.QPageRanges__Range_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 *QPageRanges__Range) GoGC() {
runtime.SetFinalizer(this, func(this *QPageRanges__Range) {
this.Delete()
runtime.KeepAlive(this.h)
})
}