2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qscroller.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QScroller__State int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QScroller__Inactive QScroller__State = 0
|
|
|
|
QScroller__Pressed QScroller__State = 1
|
|
|
|
QScroller__Dragging QScroller__State = 2
|
|
|
|
QScroller__Scrolling QScroller__State = 3
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QScroller__ScrollerGestureType int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QScroller__TouchGesture QScroller__ScrollerGestureType = 0
|
|
|
|
QScroller__LeftMouseButtonGesture QScroller__ScrollerGestureType = 1
|
|
|
|
QScroller__RightMouseButtonGesture QScroller__ScrollerGestureType = 2
|
|
|
|
QScroller__MiddleMouseButtonGesture QScroller__ScrollerGestureType = 3
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QScroller__Input int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QScroller__InputPress QScroller__Input = 1
|
|
|
|
QScroller__InputMove QScroller__Input = 2
|
|
|
|
QScroller__InputRelease QScroller__Input = 3
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QScroller struct {
|
|
|
|
h *C.QScroller
|
|
|
|
*QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) cPointer() *C.QScroller {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QScroller) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQScroller(h *C.QScroller) *QScroller {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-10-16 05:07:56 +00:00
|
|
|
return &QScroller{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQScroller(h unsafe.Pointer) *QScroller {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQScroller((*C.QScroller)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) MetaObject() *QMetaObject {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QScroller_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QScroller) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
return (unsafe.Pointer)(C.QScroller_Metacast(this.h, param1_Cstring))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QScroller_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QScroller_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QScroller_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_HasScroller(target *QObject) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QScroller_HasScroller(target.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_Scroller(target *QObject) *QScroller {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQScroller(unsafe.Pointer(C.QScroller_Scroller(target.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_ScrollerWithTarget(target *QObject) *QScroller {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQScroller(unsafe.Pointer(C.QScroller_ScrollerWithTarget(target.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QScroller_GrabGesture(target *QObject) GestureType {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (GestureType)(C.QScroller_GrabGesture(target.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QScroller_GrabbedGesture(target *QObject) GestureType {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (GestureType)(C.QScroller_GrabbedGesture(target.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QScroller_UngrabGesture(target *QObject) {
|
|
|
|
C.QScroller_UngrabGesture(target.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_ActiveScrollers() []*QScroller {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QScroller_ActiveScrollers()
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]*QScroller, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QScroller)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-16 05:07:56 +00:00
|
|
|
_ret[i] = UnsafeNewQScroller(unsafe.Pointer(_outCast[i]))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) Target() *QObject {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQObject(unsafe.Pointer(C.QScroller_Target(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QScroller) State() QScroller__State {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QScroller__State)(C.QScroller_State(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QScroller) HandleInput(input QScroller__Input, position *QPointF) bool {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (bool)(C.QScroller_HandleInput(this.h, (C.int)(input), position.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QScroller) Stop() {
|
|
|
|
C.QScroller_Stop(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) Velocity() *QPointF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QScroller_Velocity(this.h)
|
|
|
|
_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 *QScroller) FinalPosition() *QPointF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QScroller_FinalPosition(this.h)
|
|
|
|
_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 *QScroller) PixelPerMeter() *QPointF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QScroller_PixelPerMeter(this.h)
|
|
|
|
_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 *QScroller) ScrollerProperties() *QScrollerProperties {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QScroller_ScrollerProperties(this.h)
|
|
|
|
_goptr := newQScrollerProperties(_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 *QScroller) SetSnapPositionsX(positions []float64) {
|
2024-09-01 05:51:28 +00:00
|
|
|
positions_CArray := (*[0xffff]C.double)(C.malloc(C.size_t(8 * len(positions))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(positions_CArray))
|
|
|
|
for i := range positions {
|
|
|
|
positions_CArray[i] = (C.double)(positions[i])
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
positions_ma := C.struct_miqt_array{len: C.size_t(len(positions)), data: unsafe.Pointer(positions_CArray)}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QScroller_SetSnapPositionsX(this.h, positions_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) SetSnapPositionsX2(first float64, interval float64) {
|
|
|
|
C.QScroller_SetSnapPositionsX2(this.h, (C.double)(first), (C.double)(interval))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) SetSnapPositionsY(positions []float64) {
|
2024-09-01 05:51:28 +00:00
|
|
|
positions_CArray := (*[0xffff]C.double)(C.malloc(C.size_t(8 * len(positions))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(positions_CArray))
|
|
|
|
for i := range positions {
|
|
|
|
positions_CArray[i] = (C.double)(positions[i])
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
positions_ma := C.struct_miqt_array{len: C.size_t(len(positions)), data: unsafe.Pointer(positions_CArray)}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QScroller_SetSnapPositionsY(this.h, positions_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) SetSnapPositionsY2(first float64, interval float64) {
|
|
|
|
C.QScroller_SetSnapPositionsY2(this.h, (C.double)(first), (C.double)(interval))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) SetScrollerProperties(prop *QScrollerProperties) {
|
|
|
|
C.QScroller_SetScrollerProperties(this.h, prop.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) ScrollTo(pos *QPointF) {
|
|
|
|
C.QScroller_ScrollTo(this.h, pos.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) ScrollTo2(pos *QPointF, scrollTime int) {
|
|
|
|
C.QScroller_ScrollTo2(this.h, pos.cPointer(), (C.int)(scrollTime))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) EnsureVisible(rect *QRectF, xmargin float64, ymargin float64) {
|
|
|
|
C.QScroller_EnsureVisible(this.h, rect.cPointer(), (C.double)(xmargin), (C.double)(ymargin))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) EnsureVisible2(rect *QRectF, xmargin float64, ymargin float64, scrollTime int) {
|
|
|
|
C.QScroller_EnsureVisible2(this.h, rect.cPointer(), (C.double)(xmargin), (C.double)(ymargin), (C.int)(scrollTime))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QScroller) ResendPrepareEvent() {
|
|
|
|
C.QScroller_ResendPrepareEvent(this.h)
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QScroller) StateChanged(newstate QScroller__State) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QScroller_StateChanged(this.h, (C.int)(newstate))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QScroller) OnStateChanged(slot func(newstate QScroller__State)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QScroller_connect_StateChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QScroller_StateChanged
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QScroller_StateChanged(cb C.intptr_t, newstate C.int) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(newstate QScroller__State))
|
2024-09-14 22:29:05 +00:00
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-09-17 07:30:27 +00:00
|
|
|
slotval1 := (QScroller__State)(newstate)
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QScroller) ScrollerPropertiesChanged(param1 *QScrollerProperties) {
|
|
|
|
C.QScroller_ScrollerPropertiesChanged(this.h, param1.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QScroller) OnScrollerPropertiesChanged(slot func(param1 *QScrollerProperties)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QScroller_connect_ScrollerPropertiesChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QScroller_ScrollerPropertiesChanged
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QScroller_ScrollerPropertiesChanged(cb C.intptr_t, param1 *C.QScrollerProperties) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(param1 *QScrollerProperties))
|
2024-09-14 22:29:05 +00:00
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-10-16 05:07:56 +00:00
|
|
|
slotval1 := UnsafeNewQScrollerProperties(unsafe.Pointer(param1))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QScroller_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QScroller_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QScroller_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QScroller_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QScroller_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QScroller_GrabGesture2(target *QObject, gestureType QScroller__ScrollerGestureType) GestureType {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (GestureType)(C.QScroller_GrabGesture2(target.cPointer(), (C.int)(gestureType)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QScroller) HandleInput3(input QScroller__Input, position *QPointF, timestamp int64) bool {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (bool)(C.QScroller_HandleInput3(this.h, (C.int)(input), position.cPointer(), (C.longlong)(timestamp)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|