miqt/qt/multimedia/gen_qcamerainfo.go

165 lines
4.3 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qcamerainfo.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QCameraInfo struct {
2024-11-19 06:29:06 +00:00
h *C.QCameraInfo
isSubclass bool
2024-11-04 10:15:32 +00:00
}
func (this *QCameraInfo) cPointer() *C.QCameraInfo {
if this == nil {
return nil
}
return this.h
}
func (this *QCameraInfo) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQCameraInfo constructs the type using only CGO pointers.
2024-11-04 10:15:32 +00:00
func newQCameraInfo(h *C.QCameraInfo) *QCameraInfo {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-11-04 10:15:32 +00:00
return &QCameraInfo{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQCameraInfo constructs the type using only unsafe pointers.
2024-11-04 10:15:32 +00:00
func UnsafeNewQCameraInfo(h unsafe.Pointer) *QCameraInfo {
2024-12-07 04:15:57 +00:00
return newQCameraInfo((*C.QCameraInfo)(h))
2024-11-04 10:15:32 +00:00
}
// NewQCameraInfo constructs a new QCameraInfo object.
func NewQCameraInfo() *QCameraInfo {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQCameraInfo(C.QCameraInfo_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQCameraInfo2 constructs a new QCameraInfo object.
func NewQCameraInfo2(camera *QCamera) *QCameraInfo {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQCameraInfo(C.QCameraInfo_new2(camera.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQCameraInfo3 constructs a new QCameraInfo object.
func NewQCameraInfo3(other *QCameraInfo) *QCameraInfo {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQCameraInfo(C.QCameraInfo_new3(other.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQCameraInfo4 constructs a new QCameraInfo object.
func NewQCameraInfo4(name []byte) *QCameraInfo {
name_alias := C.struct_miqt_string{}
name_alias.data = (*C.char)(unsafe.Pointer(&name[0]))
name_alias.len = C.size_t(len(name))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQCameraInfo(C.QCameraInfo_new4(name_alias))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
func (this *QCameraInfo) OperatorAssign(other *QCameraInfo) {
C.QCameraInfo_OperatorAssign(this.h, other.cPointer())
}
func (this *QCameraInfo) OperatorEqual(other *QCameraInfo) bool {
return (bool)(C.QCameraInfo_OperatorEqual(this.h, other.cPointer()))
}
func (this *QCameraInfo) OperatorNotEqual(other *QCameraInfo) bool {
return (bool)(C.QCameraInfo_OperatorNotEqual(this.h, other.cPointer()))
}
func (this *QCameraInfo) IsNull() bool {
return (bool)(C.QCameraInfo_IsNull(this.h))
}
func (this *QCameraInfo) DeviceName() string {
var _ms C.struct_miqt_string = C.QCameraInfo_DeviceName(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QCameraInfo) Description() string {
var _ms C.struct_miqt_string = C.QCameraInfo_Description(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QCameraInfo) Position() QCamera__Position {
return (QCamera__Position)(C.QCameraInfo_Position(this.h))
}
func (this *QCameraInfo) Orientation() int {
return (int)(C.QCameraInfo_Orientation(this.h))
}
func QCameraInfo_DefaultCamera() *QCameraInfo {
_goptr := newQCameraInfo(C.QCameraInfo_DefaultCamera())
2024-11-04 10:15:32 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCameraInfo_AvailableCameras() []QCameraInfo {
var _ma C.struct_miqt_array = C.QCameraInfo_AvailableCameras()
_ret := make([]QCameraInfo, int(_ma.len))
_outCast := (*[0xffff]*C.QCameraInfo)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_goptr := newQCameraInfo(_outCast[i])
2024-11-04 10:15:32 +00:00
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
func QCameraInfo_AvailableCameras1(position QCamera__Position) []QCameraInfo {
var _ma C.struct_miqt_array = C.QCameraInfo_AvailableCameras1((C.int)(position))
_ret := make([]QCameraInfo, int(_ma.len))
_outCast := (*[0xffff]*C.QCameraInfo)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_goptr := newQCameraInfo(_outCast[i])
2024-11-04 10:15:32 +00:00
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
// Delete this object from C++ memory.
func (this *QCameraInfo) Delete() {
2024-11-19 06:29:06 +00:00
C.QCameraInfo_Delete(this.h, C.bool(this.isSubclass))
2024-11-04 10:15:32 +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 *QCameraInfo) GoGC() {
runtime.SetFinalizer(this, func(this *QCameraInfo) {
this.Delete()
runtime.KeepAlive(this.h)
})
}