2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qsessionmanager.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"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QSessionManager__RestartHint int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QSessionManager__RestartHint__RestartIfRunning QSessionManager__RestartHint = 0
|
|
|
|
QSessionManager__RestartHint__RestartAnyway QSessionManager__RestartHint = 1
|
|
|
|
QSessionManager__RestartHint__RestartImmediately QSessionManager__RestartHint = 2
|
|
|
|
QSessionManager__RestartHint__RestartNever QSessionManager__RestartHint = 3
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QSessionManager struct {
|
|
|
|
h *C.QSessionManager
|
|
|
|
*QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) cPointer() *C.QSessionManager {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSessionManager(h *C.QSessionManager) *QSessionManager {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QSessionManager{h: h, QObject: newQObject_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSessionManager_U(h unsafe.Pointer) *QSessionManager {
|
|
|
|
return newQSessionManager((*C.QSessionManager)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) MetaObject() *QMetaObject {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMetaObject_U(unsafe.Pointer(C.QSessionManager_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSessionManager_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSessionManager_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) SessionId() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_SessionId(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) SessionKey() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_SessionKey(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) AllowsInteraction() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSessionManager_AllowsInteraction(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) AllowsErrorInteraction() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSessionManager_AllowsErrorInteraction(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) Release() {
|
|
|
|
C.QSessionManager_Release(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) Cancel() {
|
|
|
|
C.QSessionManager_Cancel(this.h)
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSessionManager) SetRestartHint(restartHint QSessionManager__RestartHint) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QSessionManager_SetRestartHint(this.h, (C.int)(restartHint))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSessionManager) RestartHint() QSessionManager__RestartHint {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QSessionManager__RestartHint)(C.QSessionManager_RestartHint(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSessionManager) SetRestartCommand(restartCommand []string) {
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
restartCommand_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(restartCommand))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(restartCommand_CArray))
|
|
|
|
for i := range restartCommand {
|
2024-09-17 07:30:27 +00:00
|
|
|
restartCommand_i_ms := miqt_strdupg(restartCommand[i])
|
|
|
|
defer C.free(restartCommand_i_ms)
|
|
|
|
restartCommand_CArray[i] = (*C.struct_miqt_string)(restartCommand_i_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
restartCommand_ma := &C.struct_miqt_array{len: C.size_t(len(restartCommand)), data: unsafe.Pointer(restartCommand_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(restartCommand_ma))
|
|
|
|
C.QSessionManager_SetRestartCommand(this.h, restartCommand_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) RestartCommand() []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QSessionManager_RestartCommand(this.h)
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
var _lv_ms *C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(&_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms))
|
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) SetDiscardCommand(discardCommand []string) {
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
discardCommand_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(discardCommand))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(discardCommand_CArray))
|
|
|
|
for i := range discardCommand {
|
2024-09-17 07:30:27 +00:00
|
|
|
discardCommand_i_ms := miqt_strdupg(discardCommand[i])
|
|
|
|
defer C.free(discardCommand_i_ms)
|
|
|
|
discardCommand_CArray[i] = (*C.struct_miqt_string)(discardCommand_i_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
discardCommand_ma := &C.struct_miqt_array{len: C.size_t(len(discardCommand)), data: unsafe.Pointer(discardCommand_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(discardCommand_ma))
|
|
|
|
C.QSessionManager_SetDiscardCommand(this.h, discardCommand_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) DiscardCommand() []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QSessionManager_DiscardCommand(this.h)
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
var _lv_ms *C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(&_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms))
|
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) SetManagerProperty(name string, value string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
value_ms := miqt_strdupg(value)
|
|
|
|
defer C.free(value_ms)
|
|
|
|
C.QSessionManager_SetManagerProperty(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(value_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) SetManagerProperty2(name string, value []string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
value_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(value))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(value_CArray))
|
|
|
|
for i := range value {
|
2024-09-17 07:30:27 +00:00
|
|
|
value_i_ms := miqt_strdupg(value[i])
|
|
|
|
defer C.free(value_i_ms)
|
|
|
|
value_CArray[i] = (*C.struct_miqt_string)(value_i_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
value_ma := &C.struct_miqt_array{len: C.size_t(len(value)), data: unsafe.Pointer(value_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(value_ma))
|
|
|
|
C.QSessionManager_SetManagerProperty2(this.h, (*C.struct_miqt_string)(name_ms), value_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) IsPhase2() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSessionManager_IsPhase2(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSessionManager) RequestPhase2() {
|
|
|
|
C.QSessionManager_RequestPhase2(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func QSessionManager_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-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSessionManager_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-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSessionManager_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-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSessionManager_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-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QSessionManager_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|