mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
89 lines
1.9 KiB
Go
89 lines
1.9 KiB
Go
package qt
|
|
|
|
/*
|
|
|
|
#include "gen_qrefcount.h"
|
|
#include <stdlib.h>
|
|
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"runtime"
|
|
"unsafe"
|
|
)
|
|
|
|
type QtPrivate__RefCount struct {
|
|
h *C.QtPrivate__RefCount
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) cPointer() *C.QtPrivate__RefCount {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return this.h
|
|
}
|
|
|
|
func newQtPrivate__RefCount(h *C.QtPrivate__RefCount) *QtPrivate__RefCount {
|
|
if h == nil {
|
|
return nil
|
|
}
|
|
return &QtPrivate__RefCount{h: h}
|
|
}
|
|
|
|
func newQtPrivate__RefCount_U(h unsafe.Pointer) *QtPrivate__RefCount {
|
|
return newQtPrivate__RefCount((*C.QtPrivate__RefCount)(h))
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) Ref() bool {
|
|
_ret := C.QtPrivate__RefCount_Ref(this.h)
|
|
return (bool)(_ret)
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) Deref() bool {
|
|
_ret := C.QtPrivate__RefCount_Deref(this.h)
|
|
return (bool)(_ret)
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) SetSharable(sharable bool) bool {
|
|
_ret := C.QtPrivate__RefCount_SetSharable(this.h, (C.bool)(sharable))
|
|
return (bool)(_ret)
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) IsSharable() bool {
|
|
_ret := C.QtPrivate__RefCount_IsSharable(this.h)
|
|
return (bool)(_ret)
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) IsStatic() bool {
|
|
_ret := C.QtPrivate__RefCount_IsStatic(this.h)
|
|
return (bool)(_ret)
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) IsShared() bool {
|
|
_ret := C.QtPrivate__RefCount_IsShared(this.h)
|
|
return (bool)(_ret)
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) InitializeOwned() {
|
|
C.QtPrivate__RefCount_InitializeOwned(this.h)
|
|
}
|
|
|
|
func (this *QtPrivate__RefCount) InitializeUnsharable() {
|
|
C.QtPrivate__RefCount_InitializeUnsharable(this.h)
|
|
}
|
|
|
|
// Delete this object from C++ memory.
|
|
func (this *QtPrivate__RefCount) Delete() {
|
|
C.QtPrivate__RefCount_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 *QtPrivate__RefCount) GoGC() {
|
|
runtime.SetFinalizer(this, func(this *QtPrivate__RefCount) {
|
|
this.Delete()
|
|
runtime.KeepAlive(this.h)
|
|
})
|
|
}
|