2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qoperatingsystemversion.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QOperatingSystemVersion__OSType int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QOperatingSystemVersion__Unknown QOperatingSystemVersion__OSType = 0
|
|
|
|
QOperatingSystemVersion__Windows QOperatingSystemVersion__OSType = 1
|
|
|
|
QOperatingSystemVersion__MacOS QOperatingSystemVersion__OSType = 2
|
|
|
|
QOperatingSystemVersion__IOS QOperatingSystemVersion__OSType = 3
|
|
|
|
QOperatingSystemVersion__TvOS QOperatingSystemVersion__OSType = 4
|
|
|
|
QOperatingSystemVersion__WatchOS QOperatingSystemVersion__OSType = 5
|
|
|
|
QOperatingSystemVersion__Android QOperatingSystemVersion__OSType = 6
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QOperatingSystemVersion struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QOperatingSystemVersion
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOperatingSystemVersion) cPointer() *C.QOperatingSystemVersion {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QOperatingSystemVersion) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQOperatingSystemVersion constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQOperatingSystemVersion(h *C.QOperatingSystemVersion) *QOperatingSystemVersion {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QOperatingSystemVersion{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQOperatingSystemVersion constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQOperatingSystemVersion(h unsafe.Pointer) *QOperatingSystemVersion {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQOperatingSystemVersion((*C.QOperatingSystemVersion)(h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
// NewQOperatingSystemVersion constructs a new QOperatingSystemVersion object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQOperatingSystemVersion(osType QOperatingSystemVersion__OSType, vmajor int) *QOperatingSystemVersion {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQOperatingSystemVersion(C.QOperatingSystemVersion_new((C.int)(osType), (C.int)(vmajor)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQOperatingSystemVersion2 constructs a new QOperatingSystemVersion object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQOperatingSystemVersion2(osType QOperatingSystemVersion__OSType, vmajor int, vminor int) *QOperatingSystemVersion {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQOperatingSystemVersion(C.QOperatingSystemVersion_new2((C.int)(osType), (C.int)(vmajor), (C.int)(vminor)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQOperatingSystemVersion3 constructs a new QOperatingSystemVersion object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQOperatingSystemVersion3(osType QOperatingSystemVersion__OSType, vmajor int, vminor int, vmicro int) *QOperatingSystemVersion {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQOperatingSystemVersion(C.QOperatingSystemVersion_new3((C.int)(osType), (C.int)(vmajor), (C.int)(vminor), (C.int)(vmicro)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QOperatingSystemVersion_Current() *QOperatingSystemVersion {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQOperatingSystemVersion(C.QOperatingSystemVersion_Current())
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QOperatingSystemVersion_CurrentType() QOperatingSystemVersion__OSType {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QOperatingSystemVersion__OSType)(C.QOperatingSystemVersion_CurrentType())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QOperatingSystemVersion) MajorVersion() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QOperatingSystemVersion_MajorVersion(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOperatingSystemVersion) MinorVersion() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QOperatingSystemVersion_MinorVersion(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOperatingSystemVersion) MicroVersion() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QOperatingSystemVersion_MicroVersion(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QOperatingSystemVersion) SegmentCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QOperatingSystemVersion_SegmentCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QOperatingSystemVersion) Type() QOperatingSystemVersion__OSType {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QOperatingSystemVersion__OSType)(C.QOperatingSystemVersion_Type(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QOperatingSystemVersion) Name() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QOperatingSystemVersion_Name(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-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QOperatingSystemVersion) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QOperatingSystemVersion_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 *QOperatingSystemVersion) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QOperatingSystemVersion) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|