2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qbasictimer.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"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QBasicTimer struct {
|
|
|
|
h *C.QBasicTimer
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QBasicTimer) cPointer() *C.QBasicTimer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QBasicTimer) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQBasicTimer(h *C.QBasicTimer) *QBasicTimer {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QBasicTimer{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQBasicTimer(h unsafe.Pointer) *QBasicTimer {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQBasicTimer((*C.QBasicTimer)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQBasicTimer constructs a new QBasicTimer object.
|
|
|
|
func NewQBasicTimer(param1 *QBasicTimer) *QBasicTimer {
|
|
|
|
ret := C.QBasicTimer_new(param1.cPointer())
|
|
|
|
return newQBasicTimer(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQBasicTimer2 constructs a new QBasicTimer object.
|
|
|
|
func NewQBasicTimer2() *QBasicTimer {
|
|
|
|
ret := C.QBasicTimer_new2()
|
|
|
|
return newQBasicTimer(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QBasicTimer) OperatorAssign(param1 *QBasicTimer) {
|
|
|
|
C.QBasicTimer_OperatorAssign(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QBasicTimer) Swap(other *QBasicTimer) {
|
|
|
|
C.QBasicTimer_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QBasicTimer) IsActive() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QBasicTimer_IsActive(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QBasicTimer) TimerId() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QBasicTimer_TimerId(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QBasicTimer) Start(msec int, obj *QObject) {
|
|
|
|
C.QBasicTimer_Start(this.h, (C.int)(msec), obj.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QBasicTimer) Start2(msec int, timerType TimerType, obj *QObject) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QBasicTimer_Start2(this.h, (C.int)(msec), (C.int)(timerType), obj.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QBasicTimer) Stop() {
|
|
|
|
C.QBasicTimer_Stop(this.h)
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QBasicTimer) Delete() {
|
|
|
|
C.QBasicTimer_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 *QBasicTimer) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QBasicTimer) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|