miqt/qt/multimedia/gen_qmediaservice.go

149 lines
4.1 KiB
Go
Raw Permalink Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qmediaservice.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QMediaService struct {
2024-11-19 06:29:06 +00:00
h *C.QMediaService
isSubclass bool
2024-11-04 10:15:32 +00:00
*qt.QObject
}
func (this *QMediaService) cPointer() *C.QMediaService {
if this == nil {
return nil
}
return this.h
}
func (this *QMediaService) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQMediaService constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQMediaService(h *C.QMediaService) *QMediaService {
2024-11-04 10:15:32 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QObject *C.QObject = nil
C.QMediaService_virtbase(h, &outptr_QObject)
2024-11-19 06:29:06 +00:00
return &QMediaService{h: h,
2024-12-07 04:15:57 +00:00
QObject: qt.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQMediaService constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQMediaService(h unsafe.Pointer) *QMediaService {
return newQMediaService((*C.QMediaService)(h))
2024-11-04 10:15:32 +00:00
}
func (this *QMediaService) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QMediaService_MetaObject(this.h)))
}
func (this *QMediaService) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QMediaService_Metacast(this.h, param1_Cstring))
}
func QMediaService_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QMediaService_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QMediaService_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QMediaService_TrUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QMediaService) RequestControl(name string) *QMediaControl {
name_Cstring := C.CString(name)
defer C.free(unsafe.Pointer(name_Cstring))
2024-12-07 04:15:57 +00:00
return newQMediaControl(C.QMediaService_RequestControl(this.h, name_Cstring))
2024-11-04 10:15:32 +00:00
}
func (this *QMediaService) ReleaseControl(control *QMediaControl) {
C.QMediaService_ReleaseControl(this.h, control.cPointer())
}
func QMediaService_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.QMediaService_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QMediaService_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.QMediaService_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 QMediaService_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.QMediaService_TrUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QMediaService_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.QMediaService_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 *QMediaService) Delete() {
2024-11-19 06:29:06 +00:00
C.QMediaService_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 *QMediaService) GoGC() {
runtime.SetFinalizer(this, func(this *QMediaService) {
this.Delete()
runtime.KeepAlive(this.h)
})
}