miqt/qt/gen_qscroller.go

326 lines
10 KiB
Go
Raw Normal View History

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
)
type QScroller struct {
2024-11-19 06:29:06 +00:00
h *C.QScroller
isSubclass bool
*QObject
}
func (this *QScroller) cPointer() *C.QScroller {
if this == nil {
return nil
}
return this.h
}
func (this *QScroller) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQScroller constructs the type using only CGO pointers.
func newQScroller(h *C.QScroller, h_QObject *C.QObject) *QScroller {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
2024-11-19 06:29:06 +00:00
return &QScroller{h: h,
QObject: newQObject(h_QObject)}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQScroller constructs the type using only unsafe pointers.
func UnsafeNewQScroller(h unsafe.Pointer, h_QObject unsafe.Pointer) *QScroller {
if h == nil {
return nil
}
return &QScroller{h: (*C.QScroller)(h),
QObject: UnsafeNewQObject(h_QObject)}
}
func (this *QScroller) MetaObject() *QMetaObject {
return newQMetaObject(C.QScroller_MetaObject(this.h))
}
func (this *QScroller) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QScroller_Metacast(this.h, param1_Cstring))
}
func QScroller_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
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))
return _ret
}
func QScroller_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
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))
return _ret
}
func QScroller_HasScroller(target *QObject) bool {
return (bool)(C.QScroller_HasScroller(target.cPointer()))
}
func QScroller_Scroller(target *QObject) *QScroller {
return newQScroller(C.QScroller_Scroller(target.cPointer()), nil)
}
func QScroller_ScrollerWithTarget(target *QObject) *QScroller {
return newQScroller(C.QScroller_ScrollerWithTarget(target.cPointer()), nil)
}
2024-09-04 06:54:22 +00:00
func QScroller_GrabGesture(target *QObject) GestureType {
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 {
return (GestureType)(C.QScroller_GrabbedGesture(target.cPointer()))
2024-08-29 07:01:51 +00:00
}
func QScroller_UngrabGesture(target *QObject) {
C.QScroller_UngrabGesture(target.cPointer())
}
func QScroller_ActiveScrollers() []*QScroller {
var _ma C.struct_miqt_array = C.QScroller_ActiveScrollers()
_ret := make([]*QScroller, int(_ma.len))
_outCast := (*[0xffff]*C.QScroller)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_ret[i] = newQScroller(_outCast[i], nil)
}
return _ret
}
func (this *QScroller) Target() *QObject {
return newQObject(C.QScroller_Target(this.h))
}
2024-09-04 06:54:22 +00:00
func (this *QScroller) State() QScroller__State {
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 {
return (bool)(C.QScroller_HandleInput(this.h, (C.int)(input), position.cPointer()))
2024-08-29 07:01:51 +00:00
}
func (this *QScroller) Stop() {
C.QScroller_Stop(this.h)
}
func (this *QScroller) Velocity() *QPointF {
_goptr := newQPointF(C.QScroller_Velocity(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QScroller) FinalPosition() *QPointF {
_goptr := newQPointF(C.QScroller_FinalPosition(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QScroller) PixelPerMeter() *QPointF {
_goptr := newQPointF(C.QScroller_PixelPerMeter(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QScroller) ScrollerProperties() *QScrollerProperties {
_goptr := newQScrollerProperties(C.QScroller_ScrollerProperties(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QScroller) SetSnapPositionsX(positions []float64) {
positions_CArray := (*[0xffff]C.double)(C.malloc(C.size_t(8 * len(positions))))
defer C.free(unsafe.Pointer(positions_CArray))
for i := range positions {
positions_CArray[i] = (C.double)(positions[i])
}
positions_ma := C.struct_miqt_array{len: C.size_t(len(positions)), data: unsafe.Pointer(positions_CArray)}
C.QScroller_SetSnapPositionsX(this.h, positions_ma)
}
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) {
positions_CArray := (*[0xffff]C.double)(C.malloc(C.size_t(8 * len(positions))))
defer C.free(unsafe.Pointer(positions_CArray))
for i := range positions {
positions_CArray[i] = (C.double)(positions[i])
}
positions_ma := C.struct_miqt_array{len: C.size_t(len(positions)), data: unsafe.Pointer(positions_CArray)}
C.QScroller_SetSnapPositionsY(this.h, positions_ma)
}
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) {
C.QScroller_StateChanged(this.h, (C.int)(newstate))
2024-08-29 07:01:51 +00:00
}
func (this *QScroller) OnStateChanged(slot func(newstate QScroller__State)) {
C.QScroller_connect_StateChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
2024-08-29 07:01:51 +00:00
//export miqt_exec_callback_QScroller_StateChanged
func miqt_exec_callback_QScroller_StateChanged(cb C.intptr_t, newstate C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(newstate QScroller__State))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
2024-08-29 07:01:51 +00:00
}
// Convert all CABI parameters to Go parameters
slotval1 := (QScroller__State)(newstate)
gofunc(slotval1)
2024-08-29 07:01:51 +00:00
}
func (this *QScroller) ScrollerPropertiesChanged(param1 *QScrollerProperties) {
C.QScroller_ScrollerPropertiesChanged(this.h, param1.cPointer())
}
func (this *QScroller) OnScrollerPropertiesChanged(slot func(param1 *QScrollerProperties)) {
C.QScroller_connect_ScrollerPropertiesChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QScroller_ScrollerPropertiesChanged
func miqt_exec_callback_QScroller_ScrollerPropertiesChanged(cb C.intptr_t, param1 *C.QScrollerProperties) {
gofunc, ok := cgo.Handle(cb).Value().(func(param1 *QScrollerProperties))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQScrollerProperties(param1)
gofunc(slotval1)
}
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))
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))
return _ret
}
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))
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))
return _ret
}
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))
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))
return _ret
}
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))
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))
return _ret
}
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 {
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 {
return (bool)(C.QScroller_HandleInput3(this.h, (C.int)(input), position.cPointer(), (C.longlong)(timestamp)))
2024-08-29 07:01:51 +00:00
}