cutego/gui/qshortcutevent.go

68 lines
1.5 KiB
Go
Raw Normal View History

2015-10-24 18:18:24 +03:00
package gui
//#include "gui.h"
2015-10-24 18:18:24 +03:00
import "C"
import (
"github.com/therecipe/qt"
"github.com/therecipe/qt/core"
"unsafe"
)
type QShortcutEvent struct {
core.QEvent
}
2015-11-09 20:23:42 +03:00
type QShortcutEvent_ITF interface {
core.QEvent_ITF
QShortcutEvent_PTR() *QShortcutEvent
2015-10-24 18:18:24 +03:00
}
2015-11-09 20:23:42 +03:00
func PointerFromQShortcutEvent(ptr QShortcutEvent_ITF) unsafe.Pointer {
2015-10-24 18:18:24 +03:00
if ptr != nil {
2015-11-09 20:23:42 +03:00
return ptr.QShortcutEvent_PTR().Pointer()
2015-10-24 18:18:24 +03:00
}
return nil
}
2015-11-09 20:23:42 +03:00
func NewQShortcutEventFromPointer(ptr unsafe.Pointer) *QShortcutEvent {
2015-10-24 18:18:24 +03:00
var n = new(QShortcutEvent)
n.SetPointer(ptr)
return n
}
2015-11-09 20:23:42 +03:00
func (ptr *QShortcutEvent) QShortcutEvent_PTR() *QShortcutEvent {
2015-10-24 18:18:24 +03:00
return ptr
}
2015-11-09 20:23:42 +03:00
func NewQShortcutEvent(key QKeySequence_ITF, id int, ambiguous bool) *QShortcutEvent {
defer qt.Recovering("QShortcutEvent::QShortcutEvent")
2015-11-09 20:23:42 +03:00
return NewQShortcutEventFromPointer(C.QShortcutEvent_NewQShortcutEvent(PointerFromQKeySequence(key), C.int(id), C.int(qt.GoBoolToInt(ambiguous))))
2015-10-24 18:18:24 +03:00
}
func (ptr *QShortcutEvent) IsAmbiguous() bool {
defer qt.Recovering("QShortcutEvent::isAmbiguous")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QShortcutEvent_IsAmbiguous(ptr.Pointer()) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QShortcutEvent) ShortcutId() int {
defer qt.Recovering("QShortcutEvent::shortcutId")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QShortcutEvent_ShortcutId(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QShortcutEvent) DestroyQShortcutEvent() {
defer qt.Recovering("QShortcutEvent::~QShortcutEvent")
2015-10-24 18:18:24 +03:00
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QShortcutEvent_DestroyQShortcutEvent(ptr.Pointer())
2015-10-24 18:18:24 +03:00
}
}