miqt/qt/multimedia/gen_qimageencodercontrol.go

189 lines
6.1 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qimageencodercontrol.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QImageEncoderControl struct {
2024-11-19 06:29:06 +00:00
h *C.QImageEncoderControl
isSubclass bool
2024-11-04 10:15:32 +00:00
*QMediaControl
}
func (this *QImageEncoderControl) cPointer() *C.QImageEncoderControl {
if this == nil {
return nil
}
return this.h
}
func (this *QImageEncoderControl) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQImageEncoderControl constructs the type using only CGO pointers.
func newQImageEncoderControl(h *C.QImageEncoderControl, h_QMediaControl *C.QMediaControl, h_QObject *C.QObject) *QImageEncoderControl {
2024-11-04 10:15:32 +00:00
if h == nil {
return nil
}
2024-11-19 06:29:06 +00:00
return &QImageEncoderControl{h: h,
QMediaControl: newQMediaControl(h_QMediaControl, h_QObject)}
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQImageEncoderControl constructs the type using only unsafe pointers.
func UnsafeNewQImageEncoderControl(h unsafe.Pointer, h_QMediaControl unsafe.Pointer, h_QObject unsafe.Pointer) *QImageEncoderControl {
if h == nil {
return nil
}
return &QImageEncoderControl{h: (*C.QImageEncoderControl)(h),
QMediaControl: UnsafeNewQMediaControl(h_QMediaControl, h_QObject)}
2024-11-04 10:15:32 +00:00
}
func (this *QImageEncoderControl) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QImageEncoderControl_MetaObject(this.h)))
}
func (this *QImageEncoderControl) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QImageEncoderControl_Metacast(this.h, param1_Cstring))
}
func QImageEncoderControl_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QImageEncoderControl_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QImageEncoderControl_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QImageEncoderControl_TrUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QImageEncoderControl) SupportedImageCodecs() []string {
var _ma C.struct_miqt_array = C.QImageEncoderControl_SupportedImageCodecs(this.h)
_ret := make([]string, int(_ma.len))
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
var _lv_ms C.struct_miqt_string = _outCast[i]
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
C.free(unsafe.Pointer(_lv_ms.data))
_ret[i] = _lv_ret
}
return _ret
}
func (this *QImageEncoderControl) ImageCodecDescription(codec string) string {
codec_ms := C.struct_miqt_string{}
codec_ms.data = C.CString(codec)
codec_ms.len = C.size_t(len(codec))
defer C.free(unsafe.Pointer(codec_ms.data))
var _ms C.struct_miqt_string = C.QImageEncoderControl_ImageCodecDescription(this.h, codec_ms)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
2024-11-19 06:29:06 +00:00
func (this *QImageEncoderControl) SupportedResolutions(settings *QImageEncoderSettings, continuous *bool) []qt.QSize {
var _ma C.struct_miqt_array = C.QImageEncoderControl_SupportedResolutions(this.h, settings.cPointer(), (*C.bool)(unsafe.Pointer(continuous)))
2024-11-04 10:15:32 +00:00
_ret := make([]qt.QSize, int(_ma.len))
_outCast := (*[0xffff]*C.QSize)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_ret := _outCast[i]
_lv_goptr := qt.UnsafeNewQSize(unsafe.Pointer(_lv_ret))
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
func (this *QImageEncoderControl) ImageSettings() *QImageEncoderSettings {
_ret := C.QImageEncoderControl_ImageSettings(this.h)
_goptr := newQImageEncoderSettings(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QImageEncoderControl) SetImageSettings(settings *QImageEncoderSettings) {
C.QImageEncoderControl_SetImageSettings(this.h, settings.cPointer())
}
func QImageEncoderControl_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QImageEncoderControl_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QImageEncoderControl_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QImageEncoderControl_Tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QImageEncoderControl_TrUtf82(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QImageEncoderControl_TrUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QImageEncoderControl_TrUtf83(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QImageEncoderControl_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
// Delete this object from C++ memory.
func (this *QImageEncoderControl) Delete() {
2024-11-19 06:29:06 +00:00
C.QImageEncoderControl_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 *QImageEncoderControl) GoGC() {
runtime.SetFinalizer(this, func(this *QImageEncoderControl) {
this.Delete()
runtime.KeepAlive(this.h)
})
}