2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qrubberband.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QRubberBand__Shape int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QRubberBand__Line QRubberBand__Shape = 0
|
|
|
|
QRubberBand__Rectangle QRubberBand__Shape = 1
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QRubberBand struct {
|
|
|
|
h *C.QRubberBand
|
|
|
|
*QWidget
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRubberBand) cPointer() *C.QRubberBand {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQRubberBand(h *C.QRubberBand) *QRubberBand {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QRubberBand{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQRubberBand_U(h unsafe.Pointer) *QRubberBand {
|
|
|
|
return newQRubberBand((*C.QRubberBand)(h))
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
// NewQRubberBand constructs a new QRubberBand object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQRubberBand(param1 QRubberBand__Shape) *QRubberBand {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QRubberBand_new((C.int)(param1))
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQRubberBand(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQRubberBand2 constructs a new QRubberBand object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQRubberBand2(param1 QRubberBand__Shape, param2 *QWidget) *QRubberBand {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QRubberBand_new2((C.int)(param1), param2.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQRubberBand(ret)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QRubberBand) MetaObject() *QMetaObject {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMetaObject_U(unsafe.Pointer(C.QRubberBand_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QRubberBand_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QRubberBand_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QRubberBand_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QRubberBand_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QRubberBand) Shape() QRubberBand__Shape {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QRubberBand__Shape)(C.QRubberBand_Shape(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QRubberBand) SetGeometry(r *QRect) {
|
|
|
|
C.QRubberBand_SetGeometry(this.h, r.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRubberBand) SetGeometry2(x int, y int, w int, h int) {
|
|
|
|
C.QRubberBand_SetGeometry2(this.h, (C.int)(x), (C.int)(y), (C.int)(w), (C.int)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRubberBand) Move(x int, y int) {
|
|
|
|
C.QRubberBand_Move(this.h, (C.int)(x), (C.int)(y))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRubberBand) MoveWithQPoint(p *QPoint) {
|
|
|
|
C.QRubberBand_MoveWithQPoint(this.h, p.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRubberBand) Resize(w int, h int) {
|
|
|
|
C.QRubberBand_Resize(this.h, (C.int)(w), (C.int)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRubberBand) ResizeWithQSize(s *QSize) {
|
|
|
|
C.QRubberBand_ResizeWithQSize(this.h, s.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QRubberBand_Tr2(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QRubberBand_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QRubberBand_Tr3(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QRubberBand_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QRubberBand_TrUtf82(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QRubberBand_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QRubberBand_TrUtf83(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QRubberBand_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
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 *QRubberBand) Delete() {
|
|
|
|
C.QRubberBand_Delete(this.h)
|
|
|
|
}
|
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 *QRubberBand) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QRubberBand) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|