miqt/qt/gen_qpixmapcache.go

215 lines
5.5 KiB
Go
Raw Permalink Normal View History

package qt
/*
#include "gen_qpixmapcache.h"
#include <stdlib.h>
*/
import "C"
import (
2024-08-29 07:01:51 +00:00
"runtime"
"unsafe"
)
type QPixmapCache struct {
2024-11-19 06:29:06 +00:00
h *C.QPixmapCache
isSubclass bool
}
func (this *QPixmapCache) cPointer() *C.QPixmapCache {
if this == nil {
return nil
}
return this.h
}
func (this *QPixmapCache) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQPixmapCache constructs the type using only CGO pointers.
func newQPixmapCache(h *C.QPixmapCache) *QPixmapCache {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
return &QPixmapCache{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQPixmapCache constructs the type using only unsafe pointers.
func UnsafeNewQPixmapCache(h unsafe.Pointer) *QPixmapCache {
2024-12-07 04:15:57 +00:00
return newQPixmapCache((*C.QPixmapCache)(h))
}
func QPixmapCache_CacheLimit() int {
return (int)(C.QPixmapCache_CacheLimit())
}
func QPixmapCache_SetCacheLimit(cacheLimit int) {
C.QPixmapCache_SetCacheLimit((C.int)(cacheLimit))
}
func QPixmapCache_Find(key string) *QPixmap {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
2024-12-07 04:15:57 +00:00
return newQPixmap(C.QPixmapCache_Find(key_ms))
}
func QPixmapCache_Find2(key string, pixmap *QPixmap) bool {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
return (bool)(C.QPixmapCache_Find2(key_ms, pixmap.cPointer()))
}
func QPixmapCache_Find3(key string, pixmap *QPixmap) bool {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
return (bool)(C.QPixmapCache_Find3(key_ms, pixmap.cPointer()))
}
2024-08-29 07:01:51 +00:00
func QPixmapCache_Find4(key *QPixmapCache__Key, pixmap *QPixmap) bool {
return (bool)(C.QPixmapCache_Find4(key.cPointer(), pixmap.cPointer()))
2024-08-29 07:01:51 +00:00
}
func QPixmapCache_Insert(key string, pixmap *QPixmap) bool {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
return (bool)(C.QPixmapCache_Insert(key_ms, pixmap.cPointer()))
}
2024-08-29 07:01:51 +00:00
func QPixmapCache_InsertWithPixmap(pixmap *QPixmap) *QPixmapCache__Key {
_goptr := newQPixmapCache__Key(C.QPixmapCache_InsertWithPixmap(pixmap.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
2024-08-29 07:01:51 +00:00
}
func QPixmapCache_Replace(key *QPixmapCache__Key, pixmap *QPixmap) bool {
return (bool)(C.QPixmapCache_Replace(key.cPointer(), pixmap.cPointer()))
2024-08-29 07:01:51 +00:00
}
func QPixmapCache_Remove(key string) {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
C.QPixmapCache_Remove(key_ms)
}
2024-08-29 07:01:51 +00:00
func QPixmapCache_RemoveWithKey(key *QPixmapCache__Key) {
C.QPixmapCache_RemoveWithKey(key.cPointer())
}
func QPixmapCache_Clear() {
C.QPixmapCache_Clear()
}
// Delete this object from C++ memory.
func (this *QPixmapCache) Delete() {
2024-11-19 06:29:06 +00:00
C.QPixmapCache_Delete(this.h, C.bool(this.isSubclass))
}
2024-08-29 07:01:51 +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 *QPixmapCache) GoGC() {
runtime.SetFinalizer(this, func(this *QPixmapCache) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
2024-08-29 07:01:51 +00:00
type QPixmapCache__Key struct {
2024-11-19 06:29:06 +00:00
h *C.QPixmapCache__Key
isSubclass bool
2024-08-29 07:01:51 +00:00
}
func (this *QPixmapCache__Key) cPointer() *C.QPixmapCache__Key {
if this == nil {
return nil
}
return this.h
}
func (this *QPixmapCache__Key) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQPixmapCache__Key constructs the type using only CGO pointers.
2024-08-29 07:01:51 +00:00
func newQPixmapCache__Key(h *C.QPixmapCache__Key) *QPixmapCache__Key {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-08-29 07:01:51 +00:00
return &QPixmapCache__Key{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQPixmapCache__Key constructs the type using only unsafe pointers.
func UnsafeNewQPixmapCache__Key(h unsafe.Pointer) *QPixmapCache__Key {
2024-12-07 04:15:57 +00:00
return newQPixmapCache__Key((*C.QPixmapCache__Key)(h))
2024-08-29 07:01:51 +00:00
}
// NewQPixmapCache__Key constructs a new QPixmapCache::Key object.
func NewQPixmapCache__Key() *QPixmapCache__Key {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPixmapCache__Key(C.QPixmapCache__Key_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-08-29 07:01:51 +00:00
}
// NewQPixmapCache__Key2 constructs a new QPixmapCache::Key object.
func NewQPixmapCache__Key2(other *QPixmapCache__Key) *QPixmapCache__Key {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQPixmapCache__Key(C.QPixmapCache__Key_new2(other.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-08-29 07:01:51 +00:00
}
func (this *QPixmapCache__Key) OperatorEqual(key *QPixmapCache__Key) bool {
return (bool)(C.QPixmapCache__Key_OperatorEqual(this.h, key.cPointer()))
2024-08-29 07:01:51 +00:00
}
func (this *QPixmapCache__Key) OperatorNotEqual(key *QPixmapCache__Key) bool {
return (bool)(C.QPixmapCache__Key_OperatorNotEqual(this.h, key.cPointer()))
2024-08-29 07:01:51 +00:00
}
func (this *QPixmapCache__Key) OperatorAssign(other *QPixmapCache__Key) {
C.QPixmapCache__Key_OperatorAssign(this.h, other.cPointer())
}
2024-08-29 07:01:51 +00:00
func (this *QPixmapCache__Key) Swap(other *QPixmapCache__Key) {
C.QPixmapCache__Key_Swap(this.h, other.cPointer())
}
func (this *QPixmapCache__Key) IsValid() bool {
return (bool)(C.QPixmapCache__Key_IsValid(this.h))
2024-08-29 07:01:51 +00:00
}
// Delete this object from C++ memory.
2024-08-29 07:01:51 +00:00
func (this *QPixmapCache__Key) Delete() {
2024-11-19 06:29:06 +00:00
C.QPixmapCache__Key_Delete(this.h, C.bool(this.isSubclass))
2024-08-29 07:01:51 +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 *QPixmapCache__Key) GoGC() {
runtime.SetFinalizer(this, func(this *QPixmapCache__Key) {
this.Delete()
runtime.KeepAlive(this.h)
})
}