miqt/qt/gen_qlinkedlist.go

70 lines
1.4 KiB
Go
Raw Normal View History

package qt
/*
#include "gen_qlinkedlist.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QLinkedListData struct {
2024-11-19 06:29:06 +00:00
h *C.QLinkedListData
isSubclass bool
}
func (this *QLinkedListData) cPointer() *C.QLinkedListData {
if this == nil {
return nil
}
return this.h
}
func (this *QLinkedListData) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQLinkedListData constructs the type using only CGO pointers.
func newQLinkedListData(h *C.QLinkedListData) *QLinkedListData {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
return &QLinkedListData{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQLinkedListData constructs the type using only unsafe pointers.
func UnsafeNewQLinkedListData(h unsafe.Pointer) *QLinkedListData {
2024-12-07 04:15:57 +00:00
return newQLinkedListData((*C.QLinkedListData)(h))
}
// NewQLinkedListData constructs a new QLinkedListData object.
func NewQLinkedListData() *QLinkedListData {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQLinkedListData(C.QLinkedListData_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
}
// Delete this object from C++ memory.
func (this *QLinkedListData) Delete() {
2024-11-19 06:29:06 +00:00
C.QLinkedListData_Delete(this.h, C.bool(this.isSubclass))
}
// 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 *QLinkedListData) GoGC() {
runtime.SetFinalizer(this, func(this *QLinkedListData) {
this.Delete()
runtime.KeepAlive(this.h)
})
}