2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qmatrix.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QMatrix struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QMatrix
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) cPointer() *C.QMatrix {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QMatrix) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQMatrix constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQMatrix(h *C.QMatrix) *QMatrix {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QMatrix{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQMatrix constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQMatrix(h unsafe.Pointer) *QMatrix {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QMatrix{h: (*C.QMatrix)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQMatrix constructs a new QMatrix object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQMatrix(param1 Initialization) *QMatrix {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QMatrix *C.QMatrix = nil
|
|
|
|
|
|
|
|
C.QMatrix_new((C.int)(param1), &outptr_QMatrix)
|
|
|
|
ret := newQMatrix(outptr_QMatrix)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQMatrix2 constructs a new QMatrix object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQMatrix2() *QMatrix {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QMatrix *C.QMatrix = nil
|
|
|
|
|
|
|
|
C.QMatrix_new2(&outptr_QMatrix)
|
|
|
|
ret := newQMatrix(outptr_QMatrix)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQMatrix3 constructs a new QMatrix object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQMatrix3(m11 float64, m12 float64, m21 float64, m22 float64, dx float64, dy float64) *QMatrix {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QMatrix *C.QMatrix = nil
|
|
|
|
|
|
|
|
C.QMatrix_new3((C.double)(m11), (C.double)(m12), (C.double)(m21), (C.double)(m22), (C.double)(dx), (C.double)(dy), &outptr_QMatrix)
|
|
|
|
ret := newQMatrix(outptr_QMatrix)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQMatrix4 constructs a new QMatrix object.
|
|
|
|
func NewQMatrix4(other *QMatrix) *QMatrix {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QMatrix *C.QMatrix = nil
|
|
|
|
|
|
|
|
C.QMatrix_new4(other.cPointer(), &outptr_QMatrix)
|
|
|
|
ret := newQMatrix(outptr_QMatrix)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) OperatorAssign(param1 *QMatrix) {
|
|
|
|
C.QMatrix_OperatorAssign(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) SetMatrix(m11 float64, m12 float64, m21 float64, m22 float64, dx float64, dy float64) {
|
|
|
|
C.QMatrix_SetMatrix(this.h, (C.double)(m11), (C.double)(m12), (C.double)(m21), (C.double)(m22), (C.double)(dx), (C.double)(dy))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) M11() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QMatrix_M11(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) M12() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QMatrix_M12(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) M21() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QMatrix_M21(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) M22() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QMatrix_M22(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Dx() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QMatrix_Dx(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Dy() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QMatrix_Dy(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Map(x int, y int, tx *int, ty *int) {
|
|
|
|
C.QMatrix_Map(this.h, (C.int)(x), (C.int)(y), (*C.int)(unsafe.Pointer(tx)), (*C.int)(unsafe.Pointer(ty)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Map2(x float64, y float64, tx *float64, ty *float64) {
|
|
|
|
C.QMatrix_Map2(this.h, (C.double)(x), (C.double)(y), (*C.double)(unsafe.Pointer(tx)), (*C.double)(unsafe.Pointer(ty)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapRect(param1 *QRect) *QRect {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapRect(this.h, param1.cPointer())
|
|
|
|
_goptr := newQRect(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapRectWithQRectF(param1 *QRectF) *QRectF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapRectWithQRectF(this.h, param1.cPointer())
|
|
|
|
_goptr := newQRectF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapWithQPoint(p *QPoint) *QPoint {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapWithQPoint(this.h, p.cPointer())
|
|
|
|
_goptr := newQPoint(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapWithQPointF(p *QPointF) *QPointF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapWithQPointF(this.h, p.cPointer())
|
|
|
|
_goptr := newQPointF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapWithQLine(l *QLine) *QLine {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapWithQLine(this.h, l.cPointer())
|
|
|
|
_goptr := newQLine(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapWithQLineF(l *QLineF) *QLineF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapWithQLineF(this.h, l.cPointer())
|
|
|
|
_goptr := newQLineF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapWithQRegion(r *QRegion) *QRegion {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapWithQRegion(this.h, r.cPointer())
|
|
|
|
_goptr := newQRegion(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) MapWithQPainterPath(p *QPainterPath) *QPainterPath {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_MapWithQPainterPath(this.h, p.cPointer())
|
|
|
|
_goptr := newQPainterPath(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Reset() {
|
|
|
|
C.QMatrix_Reset(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) IsIdentity() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QMatrix_IsIdentity(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Translate(dx float64, dy float64) *QMatrix {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Translate(this.h, (C.double)(dx), (C.double)(dy))))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Scale(sx float64, sy float64) *QMatrix {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Scale(this.h, (C.double)(sx), (C.double)(sy))))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Shear(sh float64, sv float64) *QMatrix {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Shear(this.h, (C.double)(sh), (C.double)(sv))))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Rotate(a float64) *QMatrix {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Rotate(this.h, (C.double)(a))))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) IsInvertible() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QMatrix_IsInvertible(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Determinant() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QMatrix_Determinant(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Inverted() *QMatrix {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_Inverted(this.h)
|
|
|
|
_goptr := newQMatrix(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) OperatorEqual(param1 *QMatrix) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QMatrix_OperatorEqual(this.h, param1.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) OperatorNotEqual(param1 *QMatrix) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QMatrix_OperatorNotEqual(this.h, param1.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) OperatorMultiplyAssign(param1 *QMatrix) *QMatrix {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_OperatorMultiplyAssign(this.h, param1.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) OperatorMultiply(o *QMatrix) *QMatrix {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_OperatorMultiply(this.h, o.cPointer())
|
|
|
|
_goptr := newQMatrix(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMatrix) Inverted1(invertible *bool) *QMatrix {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMatrix_Inverted1(this.h, (*C.bool)(unsafe.Pointer(invertible)))
|
|
|
|
_goptr := newQMatrix(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QMatrix) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QMatrix_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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 *QMatrix) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QMatrix) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|