miqt/qt6/gen_qversionnumber.go

282 lines
7.6 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qversionnumber.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QVersionNumber struct {
2024-11-19 06:29:06 +00:00
h *C.QVersionNumber
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QVersionNumber) cPointer() *C.QVersionNumber {
if this == nil {
return nil
}
return this.h
}
func (this *QVersionNumber) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQVersionNumber constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQVersionNumber(h *C.QVersionNumber) *QVersionNumber {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QVersionNumber{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQVersionNumber constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQVersionNumber(h unsafe.Pointer) *QVersionNumber {
2024-12-07 04:15:57 +00:00
return newQVersionNumber((*C.QVersionNumber)(h))
2024-10-20 05:21:03 +00:00
}
// NewQVersionNumber constructs a new QVersionNumber object.
func NewQVersionNumber() *QVersionNumber {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQVersionNumber(C.QVersionNumber_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQVersionNumber2 constructs a new QVersionNumber object.
func NewQVersionNumber2(seg []int) *QVersionNumber {
seg_CArray := (*[0xffff]C.int)(C.malloc(C.size_t(8 * len(seg))))
defer C.free(unsafe.Pointer(seg_CArray))
for i := range seg {
seg_CArray[i] = (C.int)(seg[i])
}
seg_ma := C.struct_miqt_array{len: C.size_t(len(seg)), data: unsafe.Pointer(seg_CArray)}
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQVersionNumber(C.QVersionNumber_new2(seg_ma))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQVersionNumber3 constructs a new QVersionNumber object.
func NewQVersionNumber3(maj int) *QVersionNumber {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQVersionNumber(C.QVersionNumber_new3((C.int)(maj)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQVersionNumber4 constructs a new QVersionNumber object.
func NewQVersionNumber4(maj int, min int) *QVersionNumber {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQVersionNumber(C.QVersionNumber_new4((C.int)(maj), (C.int)(min)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQVersionNumber5 constructs a new QVersionNumber object.
func NewQVersionNumber5(maj int, min int, mic int) *QVersionNumber {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQVersionNumber(C.QVersionNumber_new5((C.int)(maj), (C.int)(min), (C.int)(mic)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQVersionNumber6 constructs a new QVersionNumber object.
func NewQVersionNumber6(param1 *QVersionNumber) *QVersionNumber {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQVersionNumber(C.QVersionNumber_new6(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 *QVersionNumber) IsNull() bool {
return (bool)(C.QVersionNumber_IsNull(this.h))
}
func (this *QVersionNumber) IsNormalized() bool {
return (bool)(C.QVersionNumber_IsNormalized(this.h))
}
func (this *QVersionNumber) MajorVersion() int {
return (int)(C.QVersionNumber_MajorVersion(this.h))
}
func (this *QVersionNumber) MinorVersion() int {
return (int)(C.QVersionNumber_MinorVersion(this.h))
}
func (this *QVersionNumber) MicroVersion() int {
return (int)(C.QVersionNumber_MicroVersion(this.h))
}
func (this *QVersionNumber) Normalized() *QVersionNumber {
_goptr := newQVersionNumber(C.QVersionNumber_Normalized(this.h))
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 *QVersionNumber) Segments() []int {
var _ma C.struct_miqt_array = C.QVersionNumber_Segments(this.h)
2024-10-20 05:21:03 +00:00
_ret := make([]int, int(_ma.len))
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_ret[i] = (int)(_outCast[i])
}
return _ret
}
func (this *QVersionNumber) SegmentAt(index int64) int {
return (int)(C.QVersionNumber_SegmentAt(this.h, (C.ptrdiff_t)(index)))
}
func (this *QVersionNumber) SegmentCount() int64 {
return (int64)(C.QVersionNumber_SegmentCount(this.h))
}
func (this *QVersionNumber) IsPrefixOf(other *QVersionNumber) bool {
return (bool)(C.QVersionNumber_IsPrefixOf(this.h, other.cPointer()))
}
func QVersionNumber_Compare(v1 *QVersionNumber, v2 *QVersionNumber) int {
return (int)(C.QVersionNumber_Compare(v1.cPointer(), v2.cPointer()))
}
func QVersionNumber_CommonPrefix(v1 *QVersionNumber, v2 *QVersionNumber) *QVersionNumber {
_goptr := newQVersionNumber(C.QVersionNumber_CommonPrefix(v1.cPointer(), v2.cPointer()))
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 *QVersionNumber) ToString() string {
var _ms C.struct_miqt_string = C.QVersionNumber_ToString(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QVersionNumber_FromString(stringVal QAnyStringView) *QVersionNumber {
_goptr := newQVersionNumber(C.QVersionNumber_FromString(stringVal.cPointer()))
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 QVersionNumber_FromString2(stringVal QAnyStringView, suffixIndex *int64) *QVersionNumber {
_goptr := newQVersionNumber(C.QVersionNumber_FromString2(stringVal.cPointer(), (*C.ptrdiff_t)(unsafe.Pointer(suffixIndex))))
2024-10-20 05:21:03 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
// Delete this object from C++ memory.
func (this *QVersionNumber) Delete() {
2024-11-19 06:29:06 +00:00
C.QVersionNumber_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 *QVersionNumber) GoGC() {
runtime.SetFinalizer(this, func(this *QVersionNumber) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QTypeRevision struct {
2024-11-19 06:29:06 +00:00
h *C.QTypeRevision
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QTypeRevision) cPointer() *C.QTypeRevision {
if this == nil {
return nil
}
return this.h
}
func (this *QTypeRevision) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQTypeRevision constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQTypeRevision(h *C.QTypeRevision) *QTypeRevision {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QTypeRevision{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQTypeRevision constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQTypeRevision(h unsafe.Pointer) *QTypeRevision {
2024-12-07 04:15:57 +00:00
return newQTypeRevision((*C.QTypeRevision)(h))
2024-10-20 05:21:03 +00:00
}
// NewQTypeRevision constructs a new QTypeRevision object.
func NewQTypeRevision() *QTypeRevision {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQTypeRevision(C.QTypeRevision_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQTypeRevision2 constructs a new QTypeRevision object.
func NewQTypeRevision2(param1 *QTypeRevision) *QTypeRevision {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQTypeRevision(C.QTypeRevision_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 QTypeRevision_Zero() *QTypeRevision {
_goptr := newQTypeRevision(C.QTypeRevision_Zero())
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 *QTypeRevision) HasMajorVersion() bool {
return (bool)(C.QTypeRevision_HasMajorVersion(this.h))
}
func (this *QTypeRevision) MajorVersion() byte {
return (byte)(C.QTypeRevision_MajorVersion(this.h))
}
func (this *QTypeRevision) HasMinorVersion() bool {
return (bool)(C.QTypeRevision_HasMinorVersion(this.h))
}
func (this *QTypeRevision) MinorVersion() byte {
return (byte)(C.QTypeRevision_MinorVersion(this.h))
}
func (this *QTypeRevision) IsValid() bool {
return (bool)(C.QTypeRevision_IsValid(this.h))
}
// Delete this object from C++ memory.
func (this *QTypeRevision) Delete() {
2024-11-19 06:29:06 +00:00
C.QTypeRevision_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 *QTypeRevision) GoGC() {
runtime.SetFinalizer(this, func(this *QTypeRevision) {
this.Delete()
runtime.KeepAlive(this.h)
})
}