2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qsystemtrayicon.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QSystemTrayIcon__ActivationReason int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QSystemTrayIcon__Unknown QSystemTrayIcon__ActivationReason = 0
|
|
|
|
QSystemTrayIcon__Context QSystemTrayIcon__ActivationReason = 1
|
|
|
|
QSystemTrayIcon__DoubleClick QSystemTrayIcon__ActivationReason = 2
|
|
|
|
QSystemTrayIcon__Trigger QSystemTrayIcon__ActivationReason = 3
|
|
|
|
QSystemTrayIcon__MiddleClick QSystemTrayIcon__ActivationReason = 4
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QSystemTrayIcon__MessageIcon int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QSystemTrayIcon__NoIcon QSystemTrayIcon__MessageIcon = 0
|
|
|
|
QSystemTrayIcon__Information QSystemTrayIcon__MessageIcon = 1
|
|
|
|
QSystemTrayIcon__Warning QSystemTrayIcon__MessageIcon = 2
|
|
|
|
QSystemTrayIcon__Critical QSystemTrayIcon__MessageIcon = 3
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QSystemTrayIcon struct {
|
|
|
|
h *C.QSystemTrayIcon
|
|
|
|
*QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) cPointer() *C.QSystemTrayIcon {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QSystemTrayIcon) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQSystemTrayIcon(h *C.QSystemTrayIcon) *QSystemTrayIcon {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-10-16 05:07:56 +00:00
|
|
|
return &QSystemTrayIcon{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQSystemTrayIcon(h unsafe.Pointer) *QSystemTrayIcon {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQSystemTrayIcon((*C.QSystemTrayIcon)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSystemTrayIcon constructs a new QSystemTrayIcon object.
|
|
|
|
func NewQSystemTrayIcon() *QSystemTrayIcon {
|
|
|
|
ret := C.QSystemTrayIcon_new()
|
|
|
|
return newQSystemTrayIcon(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSystemTrayIcon2 constructs a new QSystemTrayIcon object.
|
|
|
|
func NewQSystemTrayIcon2(icon *QIcon) *QSystemTrayIcon {
|
|
|
|
ret := C.QSystemTrayIcon_new2(icon.cPointer())
|
|
|
|
return newQSystemTrayIcon(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSystemTrayIcon3 constructs a new QSystemTrayIcon object.
|
|
|
|
func NewQSystemTrayIcon3(parent *QObject) *QSystemTrayIcon {
|
|
|
|
ret := C.QSystemTrayIcon_new3(parent.cPointer())
|
|
|
|
return newQSystemTrayIcon(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSystemTrayIcon4 constructs a new QSystemTrayIcon object.
|
|
|
|
func NewQSystemTrayIcon4(icon *QIcon, parent *QObject) *QSystemTrayIcon {
|
|
|
|
ret := C.QSystemTrayIcon_new4(icon.cPointer(), parent.cPointer())
|
|
|
|
return newQSystemTrayIcon(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) MetaObject() *QMetaObject {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QSystemTrayIcon_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QSystemTrayIcon) 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.QSystemTrayIcon_Metacast(this.h, param1_Cstring))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QSystemTrayIcon_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.QSystemTrayIcon_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 QSystemTrayIcon_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.QSystemTrayIcon_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 (this *QSystemTrayIcon) SetContextMenu(menu *QMenu) {
|
|
|
|
C.QSystemTrayIcon_SetContextMenu(this.h, menu.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) ContextMenu() *QMenu {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMenu(unsafe.Pointer(C.QSystemTrayIcon_ContextMenu(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) Icon() *QIcon {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSystemTrayIcon_Icon(this.h)
|
|
|
|
_goptr := newQIcon(_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 *QSystemTrayIcon) SetIcon(icon *QIcon) {
|
|
|
|
C.QSystemTrayIcon_SetIcon(this.h, icon.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) ToolTip() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QSystemTrayIcon_ToolTip(this.h)
|
|
|
|
_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 (this *QSystemTrayIcon) SetToolTip(tip string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
tip_ms := C.struct_miqt_string{}
|
|
|
|
tip_ms.data = C.CString(tip)
|
|
|
|
tip_ms.len = C.size_t(len(tip))
|
|
|
|
defer C.free(unsafe.Pointer(tip_ms.data))
|
|
|
|
C.QSystemTrayIcon_SetToolTip(this.h, tip_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSystemTrayIcon_IsSystemTrayAvailable() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSystemTrayIcon_IsSystemTrayAvailable())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSystemTrayIcon_SupportsMessages() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSystemTrayIcon_SupportsMessages())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) Geometry() *QRect {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QSystemTrayIcon_Geometry(this.h)
|
|
|
|
_goptr := newQRect(_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 *QSystemTrayIcon) IsVisible() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSystemTrayIcon_IsVisible(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) SetVisible(visible bool) {
|
|
|
|
C.QSystemTrayIcon_SetVisible(this.h, (C.bool)(visible))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) Show() {
|
|
|
|
C.QSystemTrayIcon_Show(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) Hide() {
|
|
|
|
C.QSystemTrayIcon_Hide(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) ShowMessage(title string, msg string, icon *QIcon) {
|
2024-10-18 23:53:33 +00:00
|
|
|
title_ms := C.struct_miqt_string{}
|
|
|
|
title_ms.data = C.CString(title)
|
|
|
|
title_ms.len = C.size_t(len(title))
|
|
|
|
defer C.free(unsafe.Pointer(title_ms.data))
|
|
|
|
msg_ms := C.struct_miqt_string{}
|
|
|
|
msg_ms.data = C.CString(msg)
|
|
|
|
msg_ms.len = C.size_t(len(msg))
|
|
|
|
defer C.free(unsafe.Pointer(msg_ms.data))
|
|
|
|
C.QSystemTrayIcon_ShowMessage(this.h, title_ms, msg_ms, icon.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QSystemTrayIcon) ShowMessage2(title string, msg string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
title_ms := C.struct_miqt_string{}
|
|
|
|
title_ms.data = C.CString(title)
|
|
|
|
title_ms.len = C.size_t(len(title))
|
|
|
|
defer C.free(unsafe.Pointer(title_ms.data))
|
|
|
|
msg_ms := C.struct_miqt_string{}
|
|
|
|
msg_ms.data = C.CString(msg)
|
|
|
|
msg_ms.len = C.size_t(len(msg))
|
|
|
|
defer C.free(unsafe.Pointer(msg_ms.data))
|
|
|
|
C.QSystemTrayIcon_ShowMessage2(this.h, title_ms, msg_ms)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSystemTrayIcon) Activated(reason QSystemTrayIcon__ActivationReason) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QSystemTrayIcon_Activated(this.h, (C.int)(reason))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QSystemTrayIcon) OnActivated(slot func(reason QSystemTrayIcon__ActivationReason)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QSystemTrayIcon_connect_Activated(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_QSystemTrayIcon_Activated
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QSystemTrayIcon_Activated(cb C.intptr_t, reason C.int) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(reason QSystemTrayIcon__ActivationReason))
|
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 := (QSystemTrayIcon__ActivationReason)(reason)
|
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 *QSystemTrayIcon) MessageClicked() {
|
|
|
|
C.QSystemTrayIcon_MessageClicked(this.h)
|
|
|
|
}
|
|
|
|
func (this *QSystemTrayIcon) OnMessageClicked(slot func()) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QSystemTrayIcon_connect_MessageClicked(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QSystemTrayIcon_MessageClicked
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QSystemTrayIcon_MessageClicked(cb C.intptr_t) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func())
|
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
|
|
|
gofunc()
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSystemTrayIcon_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.QSystemTrayIcon_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 QSystemTrayIcon_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.QSystemTrayIcon_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 QSystemTrayIcon_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.QSystemTrayIcon_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 QSystemTrayIcon_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.QSystemTrayIcon_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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSystemTrayIcon) ShowMessage4(title string, msg string, icon *QIcon, msecs int) {
|
2024-10-18 23:53:33 +00:00
|
|
|
title_ms := C.struct_miqt_string{}
|
|
|
|
title_ms.data = C.CString(title)
|
|
|
|
title_ms.len = C.size_t(len(title))
|
|
|
|
defer C.free(unsafe.Pointer(title_ms.data))
|
|
|
|
msg_ms := C.struct_miqt_string{}
|
|
|
|
msg_ms.data = C.CString(msg)
|
|
|
|
msg_ms.len = C.size_t(len(msg))
|
|
|
|
defer C.free(unsafe.Pointer(msg_ms.data))
|
|
|
|
C.QSystemTrayIcon_ShowMessage4(this.h, title_ms, msg_ms, icon.cPointer(), (C.int)(msecs))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSystemTrayIcon) ShowMessage3(title string, msg string, icon QSystemTrayIcon__MessageIcon) {
|
2024-10-18 23:53:33 +00:00
|
|
|
title_ms := C.struct_miqt_string{}
|
|
|
|
title_ms.data = C.CString(title)
|
|
|
|
title_ms.len = C.size_t(len(title))
|
|
|
|
defer C.free(unsafe.Pointer(title_ms.data))
|
|
|
|
msg_ms := C.struct_miqt_string{}
|
|
|
|
msg_ms.data = C.CString(msg)
|
|
|
|
msg_ms.len = C.size_t(len(msg))
|
|
|
|
defer C.free(unsafe.Pointer(msg_ms.data))
|
|
|
|
C.QSystemTrayIcon_ShowMessage3(this.h, title_ms, msg_ms, (C.int)(icon))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSystemTrayIcon) ShowMessage42(title string, msg string, icon QSystemTrayIcon__MessageIcon, msecs int) {
|
2024-10-18 23:53:33 +00:00
|
|
|
title_ms := C.struct_miqt_string{}
|
|
|
|
title_ms.data = C.CString(title)
|
|
|
|
title_ms.len = C.size_t(len(title))
|
|
|
|
defer C.free(unsafe.Pointer(title_ms.data))
|
|
|
|
msg_ms := C.struct_miqt_string{}
|
|
|
|
msg_ms.data = C.CString(msg)
|
|
|
|
msg_ms.len = C.size_t(len(msg))
|
|
|
|
defer C.free(unsafe.Pointer(msg_ms.data))
|
|
|
|
C.QSystemTrayIcon_ShowMessage42(this.h, title_ms, msg_ms, (C.int)(icon), (C.int)(msecs))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSystemTrayIcon) Delete() {
|
|
|
|
C.QSystemTrayIcon_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 *QSystemTrayIcon) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QSystemTrayIcon) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|