miqt/qt6/gen_qbackingstore.go

133 lines
3.3 KiB
Go
Raw Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qbackingstore.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QBackingStore struct {
2024-11-19 06:29:06 +00:00
h *C.QBackingStore
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QBackingStore) cPointer() *C.QBackingStore {
if this == nil {
return nil
}
return this.h
}
func (this *QBackingStore) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQBackingStore constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQBackingStore(h *C.QBackingStore) *QBackingStore {
if h == nil {
return nil
}
return &QBackingStore{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQBackingStore constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQBackingStore(h unsafe.Pointer) *QBackingStore {
2024-11-19 06:29:06 +00:00
if h == nil {
return nil
}
return &QBackingStore{h: (*C.QBackingStore)(h)}
2024-10-20 05:21:03 +00:00
}
// NewQBackingStore constructs a new QBackingStore object.
func NewQBackingStore(window *QWindow) *QBackingStore {
2024-11-19 06:29:06 +00:00
var outptr_QBackingStore *C.QBackingStore = nil
C.QBackingStore_new(window.cPointer(), &outptr_QBackingStore)
ret := newQBackingStore(outptr_QBackingStore)
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QBackingStore) Window() *QWindow {
2024-11-19 06:29:06 +00:00
return UnsafeNewQWindow(unsafe.Pointer(C.QBackingStore_Window(this.h)), nil, nil)
2024-10-20 05:21:03 +00:00
}
func (this *QBackingStore) PaintDevice() *QPaintDevice {
return UnsafeNewQPaintDevice(unsafe.Pointer(C.QBackingStore_PaintDevice(this.h)))
}
func (this *QBackingStore) Flush(region *QRegion) {
C.QBackingStore_Flush(this.h, region.cPointer())
}
func (this *QBackingStore) Resize(size *QSize) {
C.QBackingStore_Resize(this.h, size.cPointer())
}
func (this *QBackingStore) Size() *QSize {
_ret := C.QBackingStore_Size(this.h)
_goptr := newQSize(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QBackingStore) Scroll(area *QRegion, dx int, dy int) bool {
return (bool)(C.QBackingStore_Scroll(this.h, area.cPointer(), (C.int)(dx), (C.int)(dy)))
}
func (this *QBackingStore) BeginPaint(param1 *QRegion) {
C.QBackingStore_BeginPaint(this.h, param1.cPointer())
}
func (this *QBackingStore) EndPaint() {
C.QBackingStore_EndPaint(this.h)
}
func (this *QBackingStore) SetStaticContents(region *QRegion) {
C.QBackingStore_SetStaticContents(this.h, region.cPointer())
}
func (this *QBackingStore) StaticContents() *QRegion {
_ret := C.QBackingStore_StaticContents(this.h)
_goptr := newQRegion(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QBackingStore) HasStaticContents() bool {
return (bool)(C.QBackingStore_HasStaticContents(this.h))
}
func (this *QBackingStore) Flush2(region *QRegion, window *QWindow) {
C.QBackingStore_Flush2(this.h, region.cPointer(), window.cPointer())
}
func (this *QBackingStore) Flush3(region *QRegion, window *QWindow, offset *QPoint) {
C.QBackingStore_Flush3(this.h, region.cPointer(), window.cPointer(), offset.cPointer())
}
// Delete this object from C++ memory.
func (this *QBackingStore) Delete() {
2024-11-19 06:29:06 +00:00
C.QBackingStore_Delete(this.h, C.bool(this.isSubclass))
2024-10-20 05:21:03 +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 *QBackingStore) GoGC() {
runtime.SetFinalizer(this, func(this *QBackingStore) {
this.Delete()
runtime.KeepAlive(this.h)
})
}