mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
62 lines
1.3 KiB
Go
62 lines
1.3 KiB
Go
package multimedia
|
|
|
|
/*
|
|
|
|
#include "gen_qmediabindableinterface.h"
|
|
#include <stdlib.h>
|
|
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"runtime"
|
|
"unsafe"
|
|
)
|
|
|
|
type QMediaBindableInterface struct {
|
|
h *C.QMediaBindableInterface
|
|
}
|
|
|
|
func (this *QMediaBindableInterface) cPointer() *C.QMediaBindableInterface {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return this.h
|
|
}
|
|
|
|
func (this *QMediaBindableInterface) UnsafePointer() unsafe.Pointer {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return unsafe.Pointer(this.h)
|
|
}
|
|
|
|
func newQMediaBindableInterface(h *C.QMediaBindableInterface) *QMediaBindableInterface {
|
|
if h == nil {
|
|
return nil
|
|
}
|
|
return &QMediaBindableInterface{h: h}
|
|
}
|
|
|
|
func UnsafeNewQMediaBindableInterface(h unsafe.Pointer) *QMediaBindableInterface {
|
|
return newQMediaBindableInterface((*C.QMediaBindableInterface)(h))
|
|
}
|
|
|
|
func (this *QMediaBindableInterface) MediaObject() *QMediaObject {
|
|
return UnsafeNewQMediaObject(unsafe.Pointer(C.QMediaBindableInterface_MediaObject(this.h)))
|
|
}
|
|
|
|
// Delete this object from C++ memory.
|
|
func (this *QMediaBindableInterface) Delete() {
|
|
C.QMediaBindableInterface_Delete(this.h)
|
|
}
|
|
|
|
// 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 *QMediaBindableInterface) GoGC() {
|
|
runtime.SetFinalizer(this, func(this *QMediaBindableInterface) {
|
|
this.Delete()
|
|
runtime.KeepAlive(this.h)
|
|
})
|
|
}
|