miqt/qt/gen_qdeadlinetimer.go

217 lines
6.5 KiB
Go
Raw Normal View History

package qt
/*
#include "gen_qdeadlinetimer.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
2024-09-04 06:54:22 +00:00
type QDeadlineTimer__ForeverConstant int
const (
QDeadlineTimer__ForeverConstant__Forever QDeadlineTimer__ForeverConstant = 0
)
type QDeadlineTimer struct {
h *C.QDeadlineTimer
}
func (this *QDeadlineTimer) cPointer() *C.QDeadlineTimer {
if this == nil {
return nil
}
return this.h
}
func newQDeadlineTimer(h *C.QDeadlineTimer) *QDeadlineTimer {
2024-09-01 02:23:55 +00:00
if h == nil {
return nil
}
return &QDeadlineTimer{h: h}
}
func newQDeadlineTimer_U(h unsafe.Pointer) *QDeadlineTimer {
return newQDeadlineTimer((*C.QDeadlineTimer)(h))
}
// NewQDeadlineTimer constructs a new QDeadlineTimer object.
2024-08-29 07:01:51 +00:00
func NewQDeadlineTimer() *QDeadlineTimer {
ret := C.QDeadlineTimer_new()
return newQDeadlineTimer(ret)
}
// NewQDeadlineTimer2 constructs a new QDeadlineTimer object.
2024-09-04 06:54:22 +00:00
func NewQDeadlineTimer2(param1 QDeadlineTimer__ForeverConstant) *QDeadlineTimer {
2024-08-29 07:01:51 +00:00
ret := C.QDeadlineTimer_new2((C.uintptr_t)(param1))
return newQDeadlineTimer(ret)
}
// NewQDeadlineTimer3 constructs a new QDeadlineTimer object.
func NewQDeadlineTimer3(msecs int64) *QDeadlineTimer {
ret := C.QDeadlineTimer_new3((C.longlong)(msecs))
return newQDeadlineTimer(ret)
}
// NewQDeadlineTimer4 constructs a new QDeadlineTimer object.
func NewQDeadlineTimer4(param1 *QDeadlineTimer) *QDeadlineTimer {
ret := C.QDeadlineTimer_new4(param1.cPointer())
return newQDeadlineTimer(ret)
}
// NewQDeadlineTimer5 constructs a new QDeadlineTimer object.
2024-09-04 06:54:22 +00:00
func NewQDeadlineTimer5(type_ TimerType) *QDeadlineTimer {
2024-08-29 07:01:51 +00:00
ret := C.QDeadlineTimer_new5((C.uintptr_t)(type_))
return newQDeadlineTimer(ret)
}
// NewQDeadlineTimer6 constructs a new QDeadlineTimer object.
2024-09-04 06:54:22 +00:00
func NewQDeadlineTimer6(param1 QDeadlineTimer__ForeverConstant, type_ TimerType) *QDeadlineTimer {
2024-08-29 07:01:51 +00:00
ret := C.QDeadlineTimer_new6((C.uintptr_t)(param1), (C.uintptr_t)(type_))
return newQDeadlineTimer(ret)
}
// NewQDeadlineTimer7 constructs a new QDeadlineTimer object.
2024-09-04 06:54:22 +00:00
func NewQDeadlineTimer7(msecs int64, typeVal TimerType) *QDeadlineTimer {
2024-08-29 07:01:51 +00:00
ret := C.QDeadlineTimer_new7((C.longlong)(msecs), (C.uintptr_t)(typeVal))
return newQDeadlineTimer(ret)
}
func (this *QDeadlineTimer) Swap(other *QDeadlineTimer) {
C.QDeadlineTimer_Swap(this.h, other.cPointer())
}
func (this *QDeadlineTimer) IsForever() bool {
_ret := C.QDeadlineTimer_IsForever(this.h)
return (bool)(_ret)
}
func (this *QDeadlineTimer) HasExpired() bool {
_ret := C.QDeadlineTimer_HasExpired(this.h)
return (bool)(_ret)
}
2024-09-04 06:54:22 +00:00
func (this *QDeadlineTimer) TimerType() TimerType {
_ret := C.QDeadlineTimer_TimerType(this.h)
return (TimerType)(_ret)
2024-08-29 07:01:51 +00:00
}
2024-09-04 06:54:22 +00:00
func (this *QDeadlineTimer) SetTimerType(typeVal TimerType) {
2024-08-29 07:01:51 +00:00
C.QDeadlineTimer_SetTimerType(this.h, (C.uintptr_t)(typeVal))
}
func (this *QDeadlineTimer) RemainingTime() int64 {
_ret := C.QDeadlineTimer_RemainingTime(this.h)
return (int64)(_ret)
}
func (this *QDeadlineTimer) RemainingTimeNSecs() int64 {
_ret := C.QDeadlineTimer_RemainingTimeNSecs(this.h)
return (int64)(_ret)
}
2024-08-29 07:01:51 +00:00
func (this *QDeadlineTimer) SetRemainingTime(msecs int64) {
C.QDeadlineTimer_SetRemainingTime(this.h, (C.longlong)(msecs))
}
func (this *QDeadlineTimer) SetPreciseRemainingTime(secs int64) {
C.QDeadlineTimer_SetPreciseRemainingTime(this.h, (C.longlong)(secs))
}
func (this *QDeadlineTimer) Deadline() int64 {
_ret := C.QDeadlineTimer_Deadline(this.h)
return (int64)(_ret)
}
func (this *QDeadlineTimer) DeadlineNSecs() int64 {
_ret := C.QDeadlineTimer_DeadlineNSecs(this.h)
return (int64)(_ret)
}
2024-08-29 07:01:51 +00:00
func (this *QDeadlineTimer) SetDeadline(msecs int64) {
C.QDeadlineTimer_SetDeadline(this.h, (C.longlong)(msecs))
}
func (this *QDeadlineTimer) SetPreciseDeadline(secs int64) {
C.QDeadlineTimer_SetPreciseDeadline(this.h, (C.longlong)(secs))
}
func QDeadlineTimer_AddNSecs(dt QDeadlineTimer, nsecs int64) *QDeadlineTimer {
_ret := C.QDeadlineTimer_AddNSecs(dt.cPointer(), (C.longlong)(nsecs))
_goptr := newQDeadlineTimer(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
2024-08-29 07:01:51 +00:00
}
func QDeadlineTimer_Current() *QDeadlineTimer {
_ret := C.QDeadlineTimer_Current()
_goptr := newQDeadlineTimer(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QDeadlineTimer) OperatorPlusAssign(msecs int64) *QDeadlineTimer {
_ret := C.QDeadlineTimer_OperatorPlusAssign(this.h, (C.longlong)(msecs))
return newQDeadlineTimer_U(unsafe.Pointer(_ret))
}
func (this *QDeadlineTimer) OperatorMinusAssign(msecs int64) *QDeadlineTimer {
_ret := C.QDeadlineTimer_OperatorMinusAssign(this.h, (C.longlong)(msecs))
return newQDeadlineTimer_U(unsafe.Pointer(_ret))
}
func (this *QDeadlineTimer) OperatorAssign(param1 *QDeadlineTimer) {
C.QDeadlineTimer_OperatorAssign(this.h, param1.cPointer())
}
2024-09-04 06:54:22 +00:00
func (this *QDeadlineTimer) SetRemainingTime2(msecs int64, typeVal TimerType) {
2024-08-29 07:01:51 +00:00
C.QDeadlineTimer_SetRemainingTime2(this.h, (C.longlong)(msecs), (C.uintptr_t)(typeVal))
}
func (this *QDeadlineTimer) SetPreciseRemainingTime2(secs int64, nsecs int64) {
C.QDeadlineTimer_SetPreciseRemainingTime2(this.h, (C.longlong)(secs), (C.longlong)(nsecs))
}
2024-09-04 06:54:22 +00:00
func (this *QDeadlineTimer) SetPreciseRemainingTime3(secs int64, nsecs int64, typeVal TimerType) {
2024-08-29 07:01:51 +00:00
C.QDeadlineTimer_SetPreciseRemainingTime3(this.h, (C.longlong)(secs), (C.longlong)(nsecs), (C.uintptr_t)(typeVal))
}
2024-09-04 06:54:22 +00:00
func (this *QDeadlineTimer) SetDeadline2(msecs int64, timerType TimerType) {
2024-08-29 07:01:51 +00:00
C.QDeadlineTimer_SetDeadline2(this.h, (C.longlong)(msecs), (C.uintptr_t)(timerType))
}
func (this *QDeadlineTimer) SetPreciseDeadline2(secs int64, nsecs int64) {
C.QDeadlineTimer_SetPreciseDeadline2(this.h, (C.longlong)(secs), (C.longlong)(nsecs))
}
2024-09-04 06:54:22 +00:00
func (this *QDeadlineTimer) SetPreciseDeadline3(secs int64, nsecs int64, typeVal TimerType) {
2024-08-29 07:01:51 +00:00
C.QDeadlineTimer_SetPreciseDeadline3(this.h, (C.longlong)(secs), (C.longlong)(nsecs), (C.uintptr_t)(typeVal))
}
2024-09-04 06:54:22 +00:00
func QDeadlineTimer_Current1(timerType TimerType) *QDeadlineTimer {
_ret := C.QDeadlineTimer_Current1((C.uintptr_t)(timerType))
_goptr := newQDeadlineTimer(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
2024-08-29 07:01:51 +00:00
}
// Delete this object from C++ memory.
func (this *QDeadlineTimer) Delete() {
C.QDeadlineTimer_Delete(this.h)
}
// 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 *QDeadlineTimer) GoGC() {
runtime.SetFinalizer(this, func(this *QDeadlineTimer) {
this.Delete()
runtime.KeepAlive(this.h)
})
}