2024-10-20 05:21:03 +00:00
|
|
|
package qt6
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qcursor.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QCursor struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QCursor
|
|
|
|
isSubclass bool
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) cPointer() *C.QCursor {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQCursor constructs the type using only CGO pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func newQCursor(h *C.QCursor) *QCursor {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
return &QCursor{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQCursor constructs the type using only unsafe pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func UnsafeNewQCursor(h unsafe.Pointer) *QCursor {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQCursor((*C.QCursor)(h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor constructs a new QCursor object.
|
|
|
|
func NewQCursor() *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor2 constructs a new QCursor object.
|
|
|
|
func NewQCursor2(shape CursorShape) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new2((C.int)(shape)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor3 constructs a new QCursor object.
|
|
|
|
func NewQCursor3(bitmap *QBitmap, mask *QBitmap) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new3(bitmap.cPointer(), mask.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor4 constructs a new QCursor object.
|
|
|
|
func NewQCursor4(pixmap *QPixmap) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new4(pixmap.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor5 constructs a new QCursor object.
|
|
|
|
func NewQCursor5(cursor *QCursor) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new5(cursor.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor6 constructs a new QCursor object.
|
|
|
|
func NewQCursor6(bitmap *QBitmap, mask *QBitmap, hotX int) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new6(bitmap.cPointer(), mask.cPointer(), (C.int)(hotX)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor7 constructs a new QCursor object.
|
|
|
|
func NewQCursor7(bitmap *QBitmap, mask *QBitmap, hotX int, hotY int) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new7(bitmap.cPointer(), mask.cPointer(), (C.int)(hotX), (C.int)(hotY)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor8 constructs a new QCursor object.
|
|
|
|
func NewQCursor8(pixmap *QPixmap, hotX int) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new8(pixmap.cPointer(), (C.int)(hotX)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCursor9 constructs a new QCursor object.
|
|
|
|
func NewQCursor9(pixmap *QPixmap, hotX int, hotY int) *QCursor {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQCursor(C.QCursor_new9(pixmap.cPointer(), (C.int)(hotX), (C.int)(hotY)))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) OperatorAssign(cursor *QCursor) {
|
|
|
|
C.QCursor_OperatorAssign(this.h, cursor.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) Swap(other *QCursor) {
|
|
|
|
C.QCursor_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) Shape() CursorShape {
|
|
|
|
return (CursorShape)(C.QCursor_Shape(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) SetShape(newShape CursorShape) {
|
|
|
|
C.QCursor_SetShape(this.h, (C.int)(newShape))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) Bitmap(param1 ReturnByValueConstant) *QBitmap {
|
2024-12-07 04:15:57 +00:00
|
|
|
_goptr := newQBitmap(C.QCursor_Bitmap(this.h, (C.int)(param1)))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) Mask(param1 ReturnByValueConstant) *QBitmap {
|
2024-12-07 04:15:57 +00:00
|
|
|
_goptr := newQBitmap(C.QCursor_Mask(this.h, (C.int)(param1)))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) Bitmap2() *QBitmap {
|
2024-12-07 04:15:57 +00:00
|
|
|
_goptr := newQBitmap(C.QCursor_Bitmap2(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) Mask2() *QBitmap {
|
2024-12-07 04:15:57 +00:00
|
|
|
_goptr := newQBitmap(C.QCursor_Mask2(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) Pixmap() *QPixmap {
|
2024-12-07 04:15:57 +00:00
|
|
|
_goptr := newQPixmap(C.QCursor_Pixmap(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCursor) HotSpot() *QPoint {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQPoint(C.QCursor_HotSpot(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QCursor_Pos() *QPoint {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQPoint(C.QCursor_Pos())
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QCursor_PosWithScreen(screen *QScreen) *QPoint {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQPoint(C.QCursor_PosWithScreen(screen.cPointer()))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QCursor_SetPos(x int, y int) {
|
|
|
|
C.QCursor_SetPos((C.int)(x), (C.int)(y))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QCursor_SetPos2(screen *QScreen, x int, y int) {
|
|
|
|
C.QCursor_SetPos2(screen.cPointer(), (C.int)(x), (C.int)(y))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QCursor_SetPosWithQPoint(p *QPoint) {
|
|
|
|
C.QCursor_SetPosWithQPoint(p.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QCursor_SetPos3(screen *QScreen, p *QPoint) {
|
|
|
|
C.QCursor_SetPos3(screen.cPointer(), p.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QCursor) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QCursor_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 *QCursor) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QCursor) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|