init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
80
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/CMakeLists.txt
vendored
Normal file
80
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
ecm_setup_version(PROJECT VARIABLE_PREFIX FCITX5QT6DBUSADDONS
|
||||
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt6dbusaddons_version.h"
|
||||
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt6DBusAddonsConfigVersion.cmake"
|
||||
SOVERSION 1)
|
||||
|
||||
# create a Config.cmake and a ConfigVersion.cmake file and install them
|
||||
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Fcitx5Qt6DBusAddons")
|
||||
|
||||
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/Fcitx5Qt6DBusAddonsConfig.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt6DBusAddonsConfig.cmake"
|
||||
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
set(dbusaddons_SOURCES
|
||||
fcitxqtwatcher.cpp
|
||||
fcitxqtdbustypes.cpp
|
||||
fcitxqtinputcontextproxy.cpp
|
||||
fcitxqtinputcontextproxyimpl.cpp
|
||||
fcitxqtinputmethodproxy.cpp
|
||||
fcitxqtcontrollerproxy.cpp
|
||||
)
|
||||
|
||||
set(dbusaddons_HEADERS
|
||||
fcitxqtwatcher.h
|
||||
fcitxqtdbustypes.h
|
||||
fcitxqtinputcontextproxy.h
|
||||
fcitxqtinputmethodproxy.h
|
||||
fcitxqtcontrollerproxy.h
|
||||
)
|
||||
|
||||
set(fcitxqtdbusaddons_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(Fcitx5Qt6DBusAddons ${LIBRARY_TYPE} ${dbusaddons_SOURCES})
|
||||
generate_export_header(Fcitx5Qt6DBusAddons BASE_NAME Fcitx5Qt6DBusAddons)
|
||||
add_library(Fcitx5Qt6::DBusAddons ALIAS Fcitx5Qt6DBusAddons)
|
||||
|
||||
target_include_directories(Fcitx5Qt6DBusAddons PUBLIC "$<BUILD_INTERFACE:${fcitxqtdbusaddons_INCLUDE_DIRS}>")
|
||||
target_include_directories(Fcitx5Qt6DBusAddons INTERFACE "$<INSTALL_INTERFACE:${Fcitx5Qt6_INCLUDE_INSTALL_DIR}/Fcitx5Qt6DBusAddons>")
|
||||
|
||||
set_target_properties(Fcitx5Qt6DBusAddons
|
||||
PROPERTIES VERSION ${FCITX5QT6DBUSADDONS_VERSION}
|
||||
AUTOMOC TRUE
|
||||
SOVERSION ${FCITX5QT6DBUSADDONS_SOVERSION}
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
EXPORT_NAME DBusAddons
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
Fcitx5Qt6DBusAddons
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
Qt6::DBus
|
||||
)
|
||||
|
||||
if(BUILD_ONLY_PLUGIN)
|
||||
set_target_properties(Fcitx5Qt6DBusAddons PROPERTIES
|
||||
COMPILE_DEFINITIONS "FCITX5QT6DBUSADDONS_STATIC_DEFINE")
|
||||
|
||||
else()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt6DBusAddonsConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt6DBusAddonsConfigVersion.cmake"
|
||||
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
|
||||
COMPONENT Devel )
|
||||
|
||||
install(EXPORT Fcitx5Qt6DBusAddonsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE Fcitx5Qt6DBusAddonsTargets.cmake NAMESPACE Fcitx5Qt6:: )
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt6dbusaddons_version.h
|
||||
DESTINATION ${Fcitx5Qt6_INCLUDE_INSTALL_DIR} COMPONENT Devel )
|
||||
|
||||
install(TARGETS Fcitx5Qt6DBusAddons EXPORT Fcitx5Qt6DBusAddonsTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
install(FILES ${dbusaddons_HEADERS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt6dbusaddons_export.h
|
||||
DESTINATION "${Fcitx5Qt6_INCLUDE_INSTALL_DIR}/Fcitx5Qt6DBusAddons")
|
||||
endif()
|
||||
|
||||
|
||||
8
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/Fcitx5Qt6DBusAddonsConfig.cmake.in
vendored
Normal file
8
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/Fcitx5Qt6DBusAddonsConfig.cmake.in
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Qt6Core @REQUIRED_QT6_VERSION@)
|
||||
find_dependency(Qt6DBus @REQUIRED_QT6_VERSION@)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5Qt6DBusAddonsTargets.cmake")
|
||||
31
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtcontrollerproxy.cpp
vendored
Normal file
31
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtcontrollerproxy.cpp
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtcontrollerproxy -c
|
||||
* FcitxQtControllerProxy interfaces/org.fcitx.Fcitx.Controller1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "fcitxqtcontrollerproxy.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Implementation of interface class FcitxQtControllerProxy
|
||||
*/
|
||||
|
||||
FcitxQtControllerProxy::FcitxQtControllerProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
{
|
||||
}
|
||||
|
||||
FcitxQtControllerProxy::~FcitxQtControllerProxy()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
293
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtcontrollerproxy.h
vendored
Normal file
293
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtcontrollerproxy.h
vendored
Normal file
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtcontrollerproxy -c
|
||||
* FcitxQtControllerProxy interfaces/org.fcitx.Fcitx.Controller1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef FCITXQTCONTROLLERPROXY_H
|
||||
#define FCITXQTCONTROLLERPROXY_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "fcitxqtdbustypes.h"
|
||||
#include "fcitx5qt6dbusaddons_export.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.fcitx.Fcitx.Controller1
|
||||
*/
|
||||
class FCITX5QT6DBUSADDONS_EXPORT FcitxQtControllerProxy: public QDBusAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "org.fcitx.Fcitx.Controller1"; }
|
||||
|
||||
public:
|
||||
FcitxQtControllerProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
|
||||
|
||||
~FcitxQtControllerProxy();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<> Activate()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Activate"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> AddInputMethodGroup(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("AddInputMethodGroup"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QString> AddonForIM(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("AddonForIM"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<FcitxQtInputMethodEntryList> AvailableInputMethods()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("AvailableInputMethods"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<FcitxQtLayoutInfoList> AvailableKeyboardLayouts()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("AvailableKeyboardLayouts"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<bool> CanRestart() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("CanRestart"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<bool> CheckUpdate()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("CheckUpdate"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> Configure()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Configure"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> ConfigureAddon(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ConfigureAddon"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> ConfigureIM(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ConfigureIM"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QString> CurrentInputMethod()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("CurrentInputMethod"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QString> CurrentUI()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("CurrentUI"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> Exit()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Exit"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QString, QString, QString, QVariantMap,
|
||||
FcitxQtFullInputMethodEntryList>
|
||||
FullInputMethodGroupInfo(const QString &in0) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(
|
||||
QStringLiteral("FullInputMethodGroupInfo"), argumentList);
|
||||
}
|
||||
inline QDBusReply<QString> FullInputMethodGroupInfo(
|
||||
const QString &in0, QString &defaultInputMethod, QString &defaultLayout,
|
||||
QVariantMap &properties,
|
||||
FcitxQtFullInputMethodEntryList &inputMethodEntryList) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
QDBusMessage reply = callWithArgumentList(
|
||||
QDBus::Block, QStringLiteral("FullInputMethodGroupInfo"),
|
||||
argumentList);
|
||||
if (reply.type() == QDBusMessage::ReplyMessage &&
|
||||
reply.arguments().size() == 5) {
|
||||
defaultInputMethod = qdbus_cast<QString>(reply.arguments().at(1));
|
||||
defaultLayout = qdbus_cast<QString>(reply.arguments().at(2));
|
||||
properties = qdbus_cast<QVariantMap>(reply.arguments().at(3));
|
||||
inputMethodEntryList = qdbus_cast<FcitxQtFullInputMethodEntryList>(
|
||||
reply.arguments().at(4));
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<FcitxQtAddonInfoList> GetAddons()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetAddons"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<FcitxQtAddonInfoV2List> GetAddonsV2()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetAddonsV2"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QDBusVariant, FcitxQtConfigTypeList> GetConfig(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("GetConfig"), argumentList);
|
||||
}
|
||||
inline QDBusReply<QDBusVariant> GetConfig(const QString &in0, FcitxQtConfigTypeList &out1)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetConfig"), argumentList);
|
||||
if (reply.type() == QDBusMessage::ReplyMessage &&
|
||||
reply.arguments().size() == 2) {
|
||||
out1 = qdbus_cast<FcitxQtConfigTypeList>(reply.arguments().at(1));
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QString, FcitxQtStringKeyValueList> InputMethodGroupInfo(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("InputMethodGroupInfo"), argumentList);
|
||||
}
|
||||
inline QDBusReply<QString> InputMethodGroupInfo(const QString &in0, FcitxQtStringKeyValueList &items)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("InputMethodGroupInfo"), argumentList);
|
||||
if (reply.type() == QDBusMessage::ReplyMessage &&
|
||||
reply.arguments().size() == 2) {
|
||||
items = qdbus_cast<FcitxQtStringKeyValueList>(reply.arguments().at(1));
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QStringList> InputMethodGroups()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("InputMethodGroups"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> Refresh()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Refresh"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> ReloadAddonConfig(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ReloadAddonConfig"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> ReloadConfig()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ReloadConfig"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> RemoveInputMethodGroup(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("RemoveInputMethodGroup"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> ResetIMList()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ResetIMList"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> Restart()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Restart"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetAddonsState(FcitxQtAddonStateList in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetAddonsState"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetConfig(const QString &in0, const QDBusVariant &in1)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetConfig"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetCurrentIM(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetCurrentIM"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetInputMethodGroupInfo(const QString &name, const QString &layout, FcitxQtStringKeyValueList entries)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(name) << QVariant::fromValue(layout) << QVariant::fromValue(entries);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetInputMethodGroupInfo"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<int> State()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("State"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> Toggle()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Toggle"), argumentList);
|
||||
}
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void InputMethodGroupsChanged();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
339
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtdbustypes.cpp
vendored
Normal file
339
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtdbustypes.cpp
vendored
Normal file
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QDBusMetaType>
|
||||
|
||||
#include "fcitxqtdbustypes.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
#define FCITX5_QT_DEFINE_DBUS_TYPE(TYPE) \
|
||||
qRegisterMetaType<TYPE>(#TYPE); \
|
||||
qDBusRegisterMetaType<TYPE>(); \
|
||||
qRegisterMetaType<TYPE##List>(#TYPE "List"); \
|
||||
qDBusRegisterMetaType<TYPE##List>();
|
||||
|
||||
void registerFcitxQtDBusTypes() {
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtFormattedPreedit);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtStringKeyValue);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtInputMethodEntry);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtFullInputMethodEntry);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtLayoutInfo);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtVariantInfo);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtConfigOption);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtConfigType);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtAddonInfo);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtAddonState);
|
||||
FCITX5_QT_DEFINE_DBUS_TYPE(FcitxQtAddonInfoV2);
|
||||
}
|
||||
|
||||
bool FcitxQtFormattedPreedit::operator==(
|
||||
const FcitxQtFormattedPreedit &preedit) const {
|
||||
return (preedit.format_ == format_) && (preedit.string_ == string_);
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtFormattedPreedit &preedit) {
|
||||
argument.beginStructure();
|
||||
argument << preedit.string();
|
||||
argument << preedit.format();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtFormattedPreedit &preedit) {
|
||||
QString str;
|
||||
qint32 format;
|
||||
argument.beginStructure();
|
||||
argument >> str >> format;
|
||||
argument.endStructure();
|
||||
preedit.setString(str);
|
||||
preedit.setFormat(format);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtStringKeyValue &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.key();
|
||||
argument << arg.value();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtStringKeyValue &arg) {
|
||||
QString key, value;
|
||||
argument.beginStructure();
|
||||
argument >> key >> value;
|
||||
argument.endStructure();
|
||||
arg.setKey(key);
|
||||
arg.setValue(value);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtInputMethodEntry &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.uniqueName();
|
||||
argument << arg.name();
|
||||
argument << arg.nativeName();
|
||||
argument << arg.icon();
|
||||
argument << arg.label();
|
||||
argument << arg.languageCode();
|
||||
argument << arg.configurable();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtInputMethodEntry &arg) {
|
||||
QString uniqueName, name, nativeName, icon, label, languageCode;
|
||||
bool configurable;
|
||||
argument.beginStructure();
|
||||
argument >> uniqueName >> name >> nativeName >> icon >> label >>
|
||||
languageCode >> configurable;
|
||||
argument.endStructure();
|
||||
arg.setUniqueName(uniqueName);
|
||||
arg.setName(name);
|
||||
arg.setNativeName(nativeName);
|
||||
arg.setIcon(icon);
|
||||
arg.setLabel(label);
|
||||
arg.setLanguageCode(languageCode);
|
||||
arg.setConfigurable(configurable);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtFullInputMethodEntry &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.uniqueName();
|
||||
argument << arg.name();
|
||||
argument << arg.nativeName();
|
||||
argument << arg.icon();
|
||||
argument << arg.label();
|
||||
argument << arg.languageCode();
|
||||
argument << arg.addon();
|
||||
argument << arg.configurable();
|
||||
argument << arg.layout();
|
||||
argument << arg.properties();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtFullInputMethodEntry &arg) {
|
||||
QString uniqueName, name, nativeName, icon, label, languageCode, addon,
|
||||
layout;
|
||||
bool configurable;
|
||||
QVariantMap properties;
|
||||
argument.beginStructure();
|
||||
argument >> uniqueName >> name >> nativeName >> icon >> label >>
|
||||
languageCode >> addon >> configurable >> layout >> properties;
|
||||
argument.endStructure();
|
||||
arg.setUniqueName(uniqueName);
|
||||
arg.setName(name);
|
||||
arg.setNativeName(nativeName);
|
||||
arg.setIcon(icon);
|
||||
arg.setLabel(label);
|
||||
arg.setLanguageCode(languageCode);
|
||||
arg.setAddon(addon);
|
||||
arg.setConfigurable(configurable);
|
||||
arg.setLayout(layout);
|
||||
arg.setProperties(properties);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtVariantInfo &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.variant();
|
||||
argument << arg.description();
|
||||
argument << arg.languages();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtVariantInfo &arg) {
|
||||
QString variant, description;
|
||||
QStringList languages;
|
||||
argument.beginStructure();
|
||||
argument >> variant >> description >> languages;
|
||||
argument.endStructure();
|
||||
arg.setVariant(variant);
|
||||
arg.setDescription(description);
|
||||
arg.setLanguages(languages);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtLayoutInfo &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.layout();
|
||||
argument << arg.description();
|
||||
argument << arg.languages();
|
||||
argument << arg.variants();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtLayoutInfo &arg) {
|
||||
QString layout, description;
|
||||
QStringList languages;
|
||||
FcitxQtVariantInfoList variants;
|
||||
argument.beginStructure();
|
||||
argument >> layout >> description >> languages >> variants;
|
||||
argument.endStructure();
|
||||
arg.setLayout(layout);
|
||||
arg.setDescription(description);
|
||||
arg.setLanguages(languages);
|
||||
arg.setVariants(variants);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtConfigOption &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.name();
|
||||
argument << arg.type();
|
||||
argument << arg.description();
|
||||
argument << arg.defaultValue();
|
||||
argument << arg.properties();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtConfigOption &arg) {
|
||||
QString name, description, type;
|
||||
QDBusVariant defaultValue;
|
||||
QVariantMap properties;
|
||||
argument.beginStructure();
|
||||
argument >> name >> type >> description >> defaultValue >> properties;
|
||||
argument.endStructure();
|
||||
arg.setName(name);
|
||||
arg.setType(type);
|
||||
arg.setDescription(description);
|
||||
arg.setDefaultValue(defaultValue);
|
||||
arg.setProperties(properties);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtConfigType &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.name();
|
||||
argument << arg.options();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtConfigType &arg) {
|
||||
QString name;
|
||||
FcitxQtConfigOptionList options;
|
||||
argument.beginStructure();
|
||||
argument >> name >> options;
|
||||
argument.endStructure();
|
||||
arg.setName(name);
|
||||
arg.setOptions(options);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtAddonInfo &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.uniqueName();
|
||||
argument << arg.name();
|
||||
argument << arg.comment();
|
||||
argument << arg.category();
|
||||
argument << arg.configurable();
|
||||
argument << arg.enabled();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtAddonInfo &arg) {
|
||||
QString uniqueName, name, comment;
|
||||
int category;
|
||||
bool configurable, enabled;
|
||||
argument.beginStructure();
|
||||
argument >> uniqueName >> name >> comment >> category >> configurable >>
|
||||
enabled;
|
||||
argument.endStructure();
|
||||
arg.setUniqueName(uniqueName);
|
||||
arg.setName(name);
|
||||
arg.setComment(comment);
|
||||
arg.setCategory(category);
|
||||
arg.setConfigurable(configurable);
|
||||
arg.setEnabled(enabled);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtAddonInfoV2 &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.uniqueName();
|
||||
argument << arg.name();
|
||||
argument << arg.comment();
|
||||
argument << arg.category();
|
||||
argument << arg.configurable();
|
||||
argument << arg.enabled();
|
||||
argument << arg.onDemand();
|
||||
argument << arg.dependencies();
|
||||
argument << arg.optionalDependencies();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtAddonInfoV2 &arg) {
|
||||
QString uniqueName, name, comment;
|
||||
int category;
|
||||
bool configurable, enabled, onDemand;
|
||||
QStringList dependencies, optionalDependencies;
|
||||
argument.beginStructure();
|
||||
argument >> uniqueName >> name >> comment >> category >> configurable >>
|
||||
enabled >> onDemand >> dependencies >> optionalDependencies;
|
||||
argument.endStructure();
|
||||
arg.setUniqueName(uniqueName);
|
||||
arg.setName(name);
|
||||
arg.setComment(comment);
|
||||
arg.setCategory(category);
|
||||
arg.setConfigurable(configurable);
|
||||
arg.setEnabled(enabled);
|
||||
arg.setOnDemand(onDemand);
|
||||
arg.setDependencies(dependencies);
|
||||
arg.setOptionalDependencies(optionalDependencies);
|
||||
return argument;
|
||||
}
|
||||
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const FcitxQtAddonState &arg) {
|
||||
argument.beginStructure();
|
||||
argument << arg.uniqueName();
|
||||
argument << arg.enabled();
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
FcitxQtAddonState &arg) {
|
||||
QString uniqueName;
|
||||
bool enabled;
|
||||
argument.beginStructure();
|
||||
argument >> uniqueName >> enabled;
|
||||
argument.endStructure();
|
||||
arg.setUniqueName(uniqueName);
|
||||
arg.setEnabled(enabled);
|
||||
return argument;
|
||||
}
|
||||
} // namespace fcitx
|
||||
173
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtdbustypes.h
vendored
Normal file
173
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtdbustypes.h
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DBUSADDONS_FCITXQTDBUSTYPES_H_
|
||||
#define _DBUSADDONS_FCITXQTDBUSTYPES_H_
|
||||
|
||||
#include "fcitx5qt6dbusaddons_export.h"
|
||||
|
||||
#include <QDBusArgument>
|
||||
#include <QList>
|
||||
#include <QMetaType>
|
||||
#include <type_traits>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
FCITX5QT6DBUSADDONS_EXPORT void registerFcitxQtDBusTypes();
|
||||
|
||||
#define FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(TYPE) \
|
||||
class FCITX5QT6DBUSADDONS_EXPORT TYPE { \
|
||||
public:
|
||||
|
||||
#define FCITX5_QT_DECLARE_FIELD(TYPE, GETTER, SETTER) \
|
||||
public: \
|
||||
std::conditional_t<std::is_class<TYPE>::value, const TYPE &, TYPE> \
|
||||
GETTER() const { \
|
||||
return GETTER##_; \
|
||||
} \
|
||||
void SETTER( \
|
||||
std::conditional_t<std::is_class<TYPE>::value, const TYPE &, TYPE> \
|
||||
value) { \
|
||||
GETTER##_ = value; \
|
||||
} \
|
||||
\
|
||||
private: \
|
||||
TYPE GETTER##_ = TYPE();
|
||||
|
||||
#define FCITX5_QT_END_DECLARE_DBUS_TYPE(TYPE) \
|
||||
} \
|
||||
; \
|
||||
typedef QList<TYPE> TYPE##List; \
|
||||
FCITX5QT6DBUSADDONS_EXPORT QDBusArgument &operator<<( \
|
||||
QDBusArgument &argument, const TYPE &value); \
|
||||
FCITX5QT6DBUSADDONS_EXPORT const QDBusArgument &operator>>( \
|
||||
const QDBusArgument &argument, TYPE &value);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtFormattedPreedit);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, string, setString);
|
||||
FCITX5_QT_DECLARE_FIELD(qint32, format, setFormat);
|
||||
|
||||
public:
|
||||
bool operator==(const FcitxQtFormattedPreedit &preedit) const;
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtFormattedPreedit);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtStringKeyValue);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, key, setKey);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, value, setValue);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtStringKeyValue);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtInputMethodEntry);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, uniqueName, setUniqueName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, name, setName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, nativeName, setNativeName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, icon, setIcon);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, label, setLabel);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, languageCode, setLanguageCode);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, configurable, setConfigurable);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtInputMethodEntry);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtFullInputMethodEntry);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, uniqueName, setUniqueName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, name, setName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, nativeName, setNativeName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, icon, setIcon);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, label, setLabel);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, languageCode, setLanguageCode);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, addon, setAddon);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, configurable, setConfigurable);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, layout, setLayout);
|
||||
FCITX5_QT_DECLARE_FIELD(QVariantMap, properties, setProperties);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtFullInputMethodEntry);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtVariantInfo);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, variant, setVariant);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, description, setDescription);
|
||||
FCITX5_QT_DECLARE_FIELD(QStringList, languages, setLanguages);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtVariantInfo);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtLayoutInfo);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, layout, setLayout);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, description, setDescription);
|
||||
FCITX5_QT_DECLARE_FIELD(QStringList, languages, setLanguages);
|
||||
FCITX5_QT_DECLARE_FIELD(FcitxQtVariantInfoList, variants, setVariants);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtLayoutInfo);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtConfigOption);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, name, setName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, type, setType);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, description, setDescription);
|
||||
FCITX5_QT_DECLARE_FIELD(QDBusVariant, defaultValue, setDefaultValue);
|
||||
FCITX5_QT_DECLARE_FIELD(QVariantMap, properties, setProperties);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtConfigOption);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtConfigType);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, name, setName);
|
||||
FCITX5_QT_DECLARE_FIELD(FcitxQtConfigOptionList, options, setOptions);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtConfigType);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtAddonInfo);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, uniqueName, setUniqueName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, name, setName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, comment, setComment);
|
||||
FCITX5_QT_DECLARE_FIELD(int, category, setCategory);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, configurable, setConfigurable);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, enabled, setEnabled);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtAddonInfo);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtAddonInfoV2);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, uniqueName, setUniqueName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, name, setName);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, comment, setComment);
|
||||
FCITX5_QT_DECLARE_FIELD(int, category, setCategory);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, configurable, setConfigurable);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, enabled, setEnabled);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, onDemand, setOnDemand);
|
||||
FCITX5_QT_DECLARE_FIELD(QStringList, dependencies, setDependencies);
|
||||
FCITX5_QT_DECLARE_FIELD(QStringList, optionalDependencies,
|
||||
setOptionalDependencies);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtAddonInfoV2);
|
||||
|
||||
FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(FcitxQtAddonState);
|
||||
FCITX5_QT_DECLARE_FIELD(QString, uniqueName, setUniqueName);
|
||||
FCITX5_QT_DECLARE_FIELD(bool, enabled, setEnabled);
|
||||
FCITX5_QT_END_DECLARE_DBUS_TYPE(FcitxQtAddonState);
|
||||
} // namespace fcitx
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtFormattedPreedit)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtFormattedPreeditList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtStringKeyValue)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtStringKeyValueList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtInputMethodEntry)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtInputMethodEntryList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtFullInputMethodEntry)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtFullInputMethodEntryList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtVariantInfo)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtVariantInfoList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtLayoutInfo)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtLayoutInfoList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtConfigOption)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtConfigOptionList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtConfigType)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtConfigTypeList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtAddonInfo)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtAddonInfoList)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtAddonInfoV2)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtAddonInfoV2List)
|
||||
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtAddonState)
|
||||
Q_DECLARE_METATYPE(fcitx::FcitxQtAddonStateList)
|
||||
|
||||
#endif // _DBUSADDONS_FCITXQTDBUSTYPES_H_
|
||||
140
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxy.cpp
vendored
Normal file
140
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxy.cpp
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#include "fcitxqtinputcontextproxy_p.h"
|
||||
#include <QCoreApplication>
|
||||
#include <QDBusConnectionInterface>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusMetaType>
|
||||
#include <QFileInfo>
|
||||
#include <QTimer>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
FcitxQtInputContextProxy::FcitxQtInputContextProxy(FcitxQtWatcher *watcher,
|
||||
QObject *parent)
|
||||
: QObject(parent),
|
||||
d_ptr(new FcitxQtInputContextProxyPrivate(watcher, this)) {}
|
||||
|
||||
FcitxQtInputContextProxy::~FcitxQtInputContextProxy() { delete d_ptr; }
|
||||
|
||||
void FcitxQtInputContextProxy::setDisplay(const QString &display) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
d->display_ = display;
|
||||
}
|
||||
|
||||
const QString &FcitxQtInputContextProxy::display() const {
|
||||
Q_D(const FcitxQtInputContextProxy);
|
||||
return d->display_;
|
||||
}
|
||||
|
||||
bool FcitxQtInputContextProxy::isValid() const {
|
||||
Q_D(const FcitxQtInputContextProxy);
|
||||
return d->isValid();
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::focusIn() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->FocusIn();
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::focusOut() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->FocusOut();
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::hideVirtualKeyboard() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->HideVirtualKeyboard();
|
||||
}
|
||||
|
||||
QDBusPendingReply<bool> FcitxQtInputContextProxy::processKeyEvent(
|
||||
unsigned int keyval, unsigned int keycode, unsigned int state, bool type,
|
||||
unsigned int time) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->ProcessKeyEvent(keyval, keycode, state, type, time);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::reset() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->Reset();
|
||||
}
|
||||
|
||||
QDBusPendingReply<>
|
||||
FcitxQtInputContextProxy::setSupportedCapability(qulonglong caps) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->SetSupportedCapability(caps);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::setCapability(qulonglong caps) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->SetCapability(caps);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::setCursorRect(int x, int y, int w,
|
||||
int h) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->SetCursorRect(x, y, w, h);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::setCursorRectV2(int x, int y,
|
||||
int w, int h,
|
||||
double scale) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->SetCursorRectV2(x, y, w, h, scale);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::setSurroundingText(
|
||||
const QString &text, unsigned int cursor, unsigned int anchor) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->SetSurroundingText(text, cursor, anchor);
|
||||
}
|
||||
|
||||
QDBusPendingReply<>
|
||||
FcitxQtInputContextProxy::setSurroundingTextPosition(unsigned int cursor,
|
||||
unsigned int anchor) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->SetSurroundingTextPosition(cursor, anchor);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::showVirtualKeyboard() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->ShowVirtualKeyboard();
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::prevPage() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->PrevPage();
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::nextPage() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->NextPage();
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::selectCandidate(int i) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->SelectCandidate(i);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> FcitxQtInputContextProxy::invokeAction(unsigned int action,
|
||||
int cursor) {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->icproxy_->InvokeAction(action, cursor);
|
||||
}
|
||||
|
||||
bool FcitxQtInputContextProxy::isVirtualKeyboardVisible() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
return d->isVirtualKeyboardVisible_;
|
||||
}
|
||||
|
||||
bool FcitxQtInputContextProxy::supportInvokeAction() const {
|
||||
Q_D(const FcitxQtInputContextProxy);
|
||||
return d->supportInvokeAction_;
|
||||
}
|
||||
|
||||
} // namespace fcitx
|
||||
90
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxy.h
vendored
Normal file
90
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxy.h
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
#ifndef _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_H_
|
||||
#define _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_H_
|
||||
|
||||
#include "fcitx5qt6dbusaddons_export.h"
|
||||
|
||||
#include "fcitxqtdbustypes.h"
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusPendingReply>
|
||||
#include <QDBusServiceWatcher>
|
||||
#include <QObject>
|
||||
|
||||
class QDBusPendingCallWatcher;
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
class FcitxQtWatcher;
|
||||
class FcitxQtInputContextProxyPrivate;
|
||||
|
||||
class FCITX5QT6DBUSADDONS_EXPORT FcitxQtInputContextProxy : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
FcitxQtInputContextProxy(FcitxQtWatcher *watcher, QObject *parent);
|
||||
~FcitxQtInputContextProxy();
|
||||
|
||||
bool isValid() const;
|
||||
void setDisplay(const QString &display);
|
||||
const QString &display() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
QDBusPendingReply<> focusIn();
|
||||
QDBusPendingReply<> focusOut();
|
||||
QDBusPendingReply<> hideVirtualKeyboard();
|
||||
QDBusPendingReply<bool> processKeyEvent(unsigned int keyval,
|
||||
unsigned int keycode,
|
||||
unsigned int state, bool type,
|
||||
unsigned int time);
|
||||
QDBusPendingReply<> reset();
|
||||
QDBusPendingReply<> setSupportedCapability(qulonglong caps);
|
||||
QDBusPendingReply<> setCapability(qulonglong caps);
|
||||
QDBusPendingReply<> setCursorRect(int x, int y, int w, int h);
|
||||
QDBusPendingReply<> setCursorRectV2(int x, int y, int w, int h,
|
||||
double scale);
|
||||
QDBusPendingReply<> setSurroundingText(const QString &text,
|
||||
unsigned int cursor,
|
||||
unsigned int anchor);
|
||||
QDBusPendingReply<> setSurroundingTextPosition(unsigned int cursor,
|
||||
unsigned int anchor);
|
||||
QDBusPendingReply<> showVirtualKeyboard();
|
||||
QDBusPendingReply<> prevPage();
|
||||
QDBusPendingReply<> nextPage();
|
||||
QDBusPendingReply<> selectCandidate(int i);
|
||||
QDBusPendingReply<> invokeAction(unsigned int action, int cursor);
|
||||
bool isVirtualKeyboardVisible();
|
||||
|
||||
bool supportInvokeAction() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void commitString(const QString &str);
|
||||
void currentIM(const QString &name, const QString &uniqueName,
|
||||
const QString &langCode);
|
||||
void deleteSurroundingText(int offset, unsigned int nchar);
|
||||
void forwardKey(unsigned int keyval, unsigned int state, bool isRelease);
|
||||
void updateFormattedPreedit(const FcitxQtFormattedPreeditList &str,
|
||||
int cursorpos);
|
||||
void updateClientSideUI(const FcitxQtFormattedPreeditList &preedit,
|
||||
int cursorpos,
|
||||
const FcitxQtFormattedPreeditList &auxUp,
|
||||
const FcitxQtFormattedPreeditList &auxDown,
|
||||
const FcitxQtStringKeyValueList &candidates,
|
||||
int candidateIndex, int layoutHint, bool hasPrev,
|
||||
bool hasNext);
|
||||
void inputContextCreated(const QByteArray &uuid);
|
||||
void inputContextCreationFailed();
|
||||
void notifyFocusOut();
|
||||
void virtualKeyboardVisibilityChanged(bool visible);
|
||||
|
||||
private:
|
||||
FcitxQtInputContextProxyPrivate *const d_ptr;
|
||||
Q_DECLARE_PRIVATE(FcitxQtInputContextProxy);
|
||||
};
|
||||
|
||||
} // namespace fcitx
|
||||
|
||||
#endif // _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_H_
|
||||
271
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxy_p.h
vendored
Normal file
271
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxy_p.h
vendored
Normal file
@@ -0,0 +1,271 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
#ifndef _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_P_H_
|
||||
#define _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_P_H_
|
||||
|
||||
#include "fcitxqtinputcontextproxy.h"
|
||||
#include "fcitxqtinputcontextproxyimpl.h"
|
||||
#include "fcitxqtinputmethodproxy.h"
|
||||
#include "fcitxqtwatcher.h"
|
||||
#include <QDBusServiceWatcher>
|
||||
#include <cstddef>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
class FcitxQtInputContextProxyPrivate {
|
||||
public:
|
||||
FcitxQtInputContextProxyPrivate(FcitxQtWatcher *watcher,
|
||||
FcitxQtInputContextProxy *q)
|
||||
: q_ptr(q), fcitxWatcher_(watcher), watcher_(q) {
|
||||
registerFcitxQtDBusTypes();
|
||||
QObject::connect(fcitxWatcher_, &FcitxQtWatcher::availabilityChanged, q,
|
||||
[this]() { availabilityChanged(); });
|
||||
watcher_.setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
|
||||
QObject::connect(&watcher_, &QDBusServiceWatcher::serviceUnregistered,
|
||||
q, [this]() {
|
||||
cleanUp();
|
||||
availabilityChanged();
|
||||
});
|
||||
availabilityChanged();
|
||||
}
|
||||
|
||||
~FcitxQtInputContextProxyPrivate() {
|
||||
Q_Q(FcitxQtInputContextProxy);
|
||||
if (isValid()) {
|
||||
icproxy_->DestroyIC();
|
||||
}
|
||||
QObject::disconnect(
|
||||
q, &FcitxQtInputContextProxy::virtualKeyboardVisibilityChanged,
|
||||
nullptr, nullptr);
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
bool isValid() const { return (icproxy_ && icproxy_->isValid()); }
|
||||
|
||||
void availabilityChanged() {
|
||||
QTimer::singleShot(100, q_ptr, [this]() { recheck(); });
|
||||
}
|
||||
|
||||
void recheck() {
|
||||
if (!isValid() && fcitxWatcher_->availability()) {
|
||||
createInputContext();
|
||||
}
|
||||
if (!fcitxWatcher_->availability()) {
|
||||
cleanUp();
|
||||
}
|
||||
}
|
||||
|
||||
void cleanUp() {
|
||||
auto services = watcher_.watchedServices();
|
||||
for (const auto &service : services) {
|
||||
watcher_.removeWatchedService(service);
|
||||
}
|
||||
|
||||
delete improxy_;
|
||||
improxy_ = nullptr;
|
||||
delete icproxy_;
|
||||
icproxy_ = nullptr;
|
||||
delete createInputContextWatcher_;
|
||||
createInputContextWatcher_ = nullptr;
|
||||
delete introspectWatcher_;
|
||||
introspectWatcher_ = nullptr;
|
||||
delete queryWatcher_;
|
||||
queryWatcher_ = nullptr;
|
||||
setVirtualKeyboardVisible(false);
|
||||
supportInvokeAction_ = false;
|
||||
}
|
||||
|
||||
void createInputContext() {
|
||||
Q_Q(FcitxQtInputContextProxy);
|
||||
if (!fcitxWatcher_->availability()) {
|
||||
return;
|
||||
}
|
||||
|
||||
cleanUp();
|
||||
|
||||
auto service = fcitxWatcher_->serviceName();
|
||||
auto connection = fcitxWatcher_->connection();
|
||||
|
||||
auto owner = connection.interface()->serviceOwner(service);
|
||||
if (!owner.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
watcher_.setConnection(connection);
|
||||
watcher_.setWatchedServices(QStringList() << owner);
|
||||
// Avoid race, query again.
|
||||
if (!connection.interface()->isServiceRegistered(owner)) {
|
||||
cleanUp();
|
||||
return;
|
||||
}
|
||||
|
||||
QFileInfo info(QCoreApplication::applicationFilePath());
|
||||
improxy_ = new FcitxQtInputMethodProxy(
|
||||
owner, "/org/freedesktop/portal/inputmethod", connection, q);
|
||||
FcitxQtStringKeyValueList list;
|
||||
FcitxQtStringKeyValue arg;
|
||||
arg.setKey("program");
|
||||
arg.setValue(info.fileName());
|
||||
list << arg;
|
||||
if (!display_.isEmpty()) {
|
||||
FcitxQtStringKeyValue arg2;
|
||||
arg2.setKey("display");
|
||||
arg2.setValue(display_);
|
||||
list << arg2;
|
||||
}
|
||||
|
||||
// Qt has good support for showing virtual keyboard, so we should
|
||||
// disable the default behavior supported by fcitx5
|
||||
FcitxQtStringKeyValue clientControlVirtualkeyboardShow;
|
||||
clientControlVirtualkeyboardShow.setKey(
|
||||
"clientControlVirtualkeyboardShow");
|
||||
clientControlVirtualkeyboardShow.setValue("true");
|
||||
list << clientControlVirtualkeyboardShow;
|
||||
// Qt has poor support for hiding virtual keyboard, so we should enable
|
||||
// the default behavior supported by fcitx5
|
||||
FcitxQtStringKeyValue clientControlVirtualkeyboardHide;
|
||||
clientControlVirtualkeyboardHide.setKey(
|
||||
"clientControlVirtualkeyboardHide");
|
||||
clientControlVirtualkeyboardHide.setValue("false");
|
||||
list << clientControlVirtualkeyboardHide;
|
||||
|
||||
auto result = improxy_->CreateInputContext(list);
|
||||
createInputContextWatcher_ = new QDBusPendingCallWatcher(result);
|
||||
QObject::connect(createInputContextWatcher_,
|
||||
&QDBusPendingCallWatcher::finished, q,
|
||||
[this]() { createInputContextFinished(); });
|
||||
}
|
||||
|
||||
void createInputContextFinished() {
|
||||
Q_Q(FcitxQtInputContextProxy);
|
||||
if (createInputContextWatcher_->isError()) {
|
||||
cleanUp();
|
||||
Q_EMIT q->inputContextCreationFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
QDBusPendingReply<QDBusObjectPath, QByteArray> reply(
|
||||
*createInputContextWatcher_);
|
||||
icproxy_ = new FcitxQtInputContextProxyImpl(improxy_->service(),
|
||||
reply.value().path(),
|
||||
improxy_->connection(), q);
|
||||
QObject::connect(icproxy_, &FcitxQtInputContextProxyImpl::CommitString,
|
||||
q, &FcitxQtInputContextProxy::commitString);
|
||||
QObject::connect(icproxy_, &FcitxQtInputContextProxyImpl::CurrentIM, q,
|
||||
&FcitxQtInputContextProxy::currentIM);
|
||||
QObject::connect(icproxy_,
|
||||
&FcitxQtInputContextProxyImpl::DeleteSurroundingText,
|
||||
q, &FcitxQtInputContextProxy::deleteSurroundingText);
|
||||
QObject::connect(icproxy_, &FcitxQtInputContextProxyImpl::ForwardKey, q,
|
||||
&FcitxQtInputContextProxy::forwardKey);
|
||||
QObject::connect(icproxy_,
|
||||
&FcitxQtInputContextProxyImpl::UpdateFormattedPreedit,
|
||||
q, &FcitxQtInputContextProxy::updateFormattedPreedit);
|
||||
QObject::connect(icproxy_,
|
||||
&FcitxQtInputContextProxyImpl::UpdateClientSideUI, q,
|
||||
&FcitxQtInputContextProxy::updateClientSideUI);
|
||||
QObject::connect(icproxy_,
|
||||
&FcitxQtInputContextProxyImpl::NotifyFocusOut, q,
|
||||
&FcitxQtInputContextProxy::notifyFocusOut);
|
||||
QObject::connect(
|
||||
icproxy_,
|
||||
&FcitxQtInputContextProxyImpl::VirtualKeyboardVisibilityChanged, q,
|
||||
[this](bool visible) {
|
||||
if (queryWatcher_) {
|
||||
queryWatcher_->deleteLater();
|
||||
queryWatcher_ = nullptr;
|
||||
}
|
||||
setVirtualKeyboardVisible(visible);
|
||||
});
|
||||
|
||||
delete createInputContextWatcher_;
|
||||
createInputContextWatcher_ = nullptr;
|
||||
Q_EMIT q->inputContextCreated(reply.argumentAt<1>());
|
||||
|
||||
introspect();
|
||||
virtualKeyboardVisibilityQuery();
|
||||
}
|
||||
|
||||
void introspect() {
|
||||
Q_Q(FcitxQtInputContextProxy);
|
||||
if (introspectWatcher_) {
|
||||
delete introspectWatcher_;
|
||||
introspectWatcher_ = nullptr;
|
||||
}
|
||||
QDBusMessage call = QDBusMessage::createMethodCall(
|
||||
icproxy_->service(), icproxy_->path(),
|
||||
"org.freedesktop.DBus.Introspectable", "Introspect");
|
||||
|
||||
introspectWatcher_ = new QDBusPendingCallWatcher(
|
||||
fcitxWatcher_->connection().asyncCall(call));
|
||||
QObject::connect(introspectWatcher_, &QDBusPendingCallWatcher::finished,
|
||||
q, [this]() { introspectFinished(); });
|
||||
}
|
||||
|
||||
void introspectFinished() {
|
||||
if (introspectWatcher_->isFinished() &&
|
||||
!introspectWatcher_->isError()) {
|
||||
QDBusPendingReply<QString> reply = *introspectWatcher_;
|
||||
|
||||
if (reply.value().contains("InvokeAction")) {
|
||||
supportInvokeAction_ = true;
|
||||
}
|
||||
}
|
||||
delete introspectWatcher_;
|
||||
introspectWatcher_ = nullptr;
|
||||
}
|
||||
|
||||
void virtualKeyboardVisibilityQuery() {
|
||||
Q_Q(FcitxQtInputContextProxy);
|
||||
if (queryWatcher_) {
|
||||
delete queryWatcher_;
|
||||
queryWatcher_ = nullptr;
|
||||
}
|
||||
|
||||
queryWatcher_ =
|
||||
new QDBusPendingCallWatcher(icproxy_->IsVirtualKeyboardVisible());
|
||||
QObject::connect(
|
||||
queryWatcher_, &QDBusPendingCallWatcher::finished, q,
|
||||
[this]() { virtualKeyboardVisibilityQueryFinished(); });
|
||||
}
|
||||
|
||||
void virtualKeyboardVisibilityQueryFinished() {
|
||||
if (queryWatcher_ && queryWatcher_->isFinished() &&
|
||||
!queryWatcher_->isError()) {
|
||||
QDBusPendingReply<bool> reply = *queryWatcher_;
|
||||
setVirtualKeyboardVisible(reply.value());
|
||||
}
|
||||
delete queryWatcher_;
|
||||
queryWatcher_ = nullptr;
|
||||
}
|
||||
|
||||
void setVirtualKeyboardVisible(bool visible) {
|
||||
Q_Q(FcitxQtInputContextProxy);
|
||||
if (isVirtualKeyboardVisible_ != visible) {
|
||||
isVirtualKeyboardVisible_ = visible;
|
||||
Q_EMIT q->virtualKeyboardVisibilityChanged(
|
||||
isVirtualKeyboardVisible_);
|
||||
}
|
||||
}
|
||||
|
||||
FcitxQtInputContextProxy *q_ptr;
|
||||
Q_DECLARE_PUBLIC(FcitxQtInputContextProxy);
|
||||
|
||||
FcitxQtWatcher *fcitxWatcher_;
|
||||
QDBusServiceWatcher watcher_;
|
||||
FcitxQtInputMethodProxy *improxy_ = nullptr;
|
||||
FcitxQtInputContextProxyImpl *icproxy_ = nullptr;
|
||||
bool isVirtualKeyboardVisible_ = false;
|
||||
bool supportInvokeAction_ = false;
|
||||
QDBusPendingCallWatcher *createInputContextWatcher_ = nullptr;
|
||||
QDBusPendingCallWatcher *introspectWatcher_ = nullptr;
|
||||
QDBusPendingCallWatcher *queryWatcher_ = nullptr;
|
||||
QString display_;
|
||||
};
|
||||
} // namespace fcitx
|
||||
|
||||
#endif // _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_P_H_
|
||||
31
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxyimpl.cpp
vendored
Normal file
31
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxyimpl.cpp
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputcontextproxyimpl -c
|
||||
* FcitxQtInputContextProxyImpl interfaces/org.fcitx.Fcitx.InputContext1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "fcitxqtinputcontextproxyimpl.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Implementation of interface class FcitxQtInputContextProxyImpl
|
||||
*/
|
||||
|
||||
FcitxQtInputContextProxyImpl::FcitxQtInputContextProxyImpl(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
{
|
||||
}
|
||||
|
||||
FcitxQtInputContextProxyImpl::~FcitxQtInputContextProxyImpl()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
177
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxyimpl.h
vendored
Normal file
177
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputcontextproxyimpl.h
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputcontextproxyimpl -c
|
||||
* FcitxQtInputContextProxyImpl interfaces/org.fcitx.Fcitx.InputContext1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef FCITXQTINPUTCONTEXTPROXYIMPL_H
|
||||
#define FCITXQTINPUTCONTEXTPROXYIMPL_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "fcitxqtdbustypes.h"
|
||||
#include "fcitx5qt6dbusaddons_export.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.fcitx.Fcitx.InputContext1
|
||||
*/
|
||||
class FCITX5QT6DBUSADDONS_EXPORT FcitxQtInputContextProxyImpl: public QDBusAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "org.fcitx.Fcitx.InputContext1"; }
|
||||
|
||||
public:
|
||||
FcitxQtInputContextProxyImpl(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
|
||||
|
||||
~FcitxQtInputContextProxyImpl();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<> DestroyIC()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("DestroyIC"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> FocusIn()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("FocusIn"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> FocusOut()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("FocusOut"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> HideVirtualKeyboard() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("HideVirtualKeyboard"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> InvokeAction(unsigned int action, int cursor) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(action)
|
||||
<< QVariant::fromValue(cursor);
|
||||
return asyncCallWithArgumentList(QStringLiteral("InvokeAction"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<bool> IsVirtualKeyboardVisible() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(
|
||||
QStringLiteral("IsVirtualKeyboardVisible"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> NextPage()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("NextPage"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> PrevPage()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("PrevPage"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<bool>
|
||||
ProcessKeyEvent(unsigned int keyval, unsigned int keycode,
|
||||
unsigned int state, bool type, unsigned int time) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(keyval) << QVariant::fromValue(keycode) << QVariant::fromValue(state) << QVariant::fromValue(type) << QVariant::fromValue(time);
|
||||
return asyncCallWithArgumentList(QStringLiteral("ProcessKeyEvent"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> Reset()
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("Reset"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SelectCandidate(int index)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SelectCandidate"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetCapability(qulonglong caps)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(caps);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetCapability"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetCursorRect(int x, int y, int w, int h)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(x) << QVariant::fromValue(y) << QVariant::fromValue(w) << QVariant::fromValue(h);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetCursorRect"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetCursorRectV2(int x, int y, int w, int h, double scale)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(x) << QVariant::fromValue(y) << QVariant::fromValue(w) << QVariant::fromValue(h) << QVariant::fromValue(scale);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetCursorRectV2"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetSupportedCapability(qulonglong caps) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(caps);
|
||||
return asyncCallWithArgumentList(
|
||||
QStringLiteral("SetSupportedCapability"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetSurroundingText(const QString &text,
|
||||
unsigned int cursor,
|
||||
unsigned int anchor) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(text) << QVariant::fromValue(cursor) << QVariant::fromValue(anchor);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetSurroundingText"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetSurroundingTextPosition(unsigned int cursor,
|
||||
unsigned int anchor) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(cursor) << QVariant::fromValue(anchor);
|
||||
return asyncCallWithArgumentList(QStringLiteral("SetSurroundingTextPosition"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> ShowVirtualKeyboard() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QStringLiteral("ShowVirtualKeyboard"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void CommitString(const QString &str);
|
||||
void CurrentIM(const QString &name, const QString &uniqueName, const QString &langCode);
|
||||
void DeleteSurroundingText(int offset, unsigned int nchar);
|
||||
void ForwardKey(unsigned int keyval, unsigned int state, bool type);
|
||||
void NotifyFocusOut();
|
||||
void UpdateClientSideUI(FcitxQtFormattedPreeditList preedit, int cursorpos, FcitxQtFormattedPreeditList auxUp, FcitxQtFormattedPreeditList auxDown, FcitxQtStringKeyValueList candidates, int candidateIndex, int layoutHint, bool hasPrev, bool hasNext);
|
||||
void UpdateFormattedPreedit(FcitxQtFormattedPreeditList str, int cursorpos);
|
||||
void VirtualKeyboardVisibilityChanged(bool visible);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
31
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputmethodproxy.cpp
vendored
Normal file
31
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputmethodproxy.cpp
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputmethodproxy -c
|
||||
* FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* This file may have been hand-edited. Look for HAND-EDIT comments
|
||||
* before re-generating it.
|
||||
*/
|
||||
|
||||
#include "fcitxqtinputmethodproxy.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Implementation of interface class FcitxQtInputMethodProxy
|
||||
*/
|
||||
|
||||
FcitxQtInputMethodProxy::FcitxQtInputMethodProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
|
||||
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
|
||||
{
|
||||
}
|
||||
|
||||
FcitxQtInputMethodProxy::~FcitxQtInputMethodProxy()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
68
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputmethodproxy.h
vendored
Normal file
68
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtinputmethodproxy.h
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputmethodproxy -c
|
||||
* FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef FCITXQTINPUTMETHODPROXY_H
|
||||
#define FCITXQTINPUTMETHODPROXY_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "fcitxqtdbustypes.h"
|
||||
#include "fcitx5qt6dbusaddons_export.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.fcitx.Fcitx.InputMethod1
|
||||
*/
|
||||
class FCITX5QT6DBUSADDONS_EXPORT FcitxQtInputMethodProxy: public QDBusAbstractInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline const char *staticInterfaceName()
|
||||
{ return "org.fcitx.Fcitx.InputMethod1"; }
|
||||
|
||||
public:
|
||||
FcitxQtInputMethodProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
|
||||
|
||||
~FcitxQtInputMethodProxy();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<QDBusObjectPath, QByteArray> CreateInputContext(FcitxQtStringKeyValueList in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QStringLiteral("CreateInputContext"), argumentList);
|
||||
}
|
||||
inline QDBusReply<QDBusObjectPath> CreateInputContext(FcitxQtStringKeyValueList in0, QByteArray &out1)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("CreateInputContext"), argumentList);
|
||||
if (reply.type() == QDBusMessage::ReplyMessage &&
|
||||
reply.arguments().size() == 2) {
|
||||
out1 = qdbus_cast<QByteArray>(reply.arguments().at(1));
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
139
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtwatcher.cpp
vendored
Normal file
139
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtwatcher.cpp
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#include "fcitxqtwatcher_p.h"
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusConnectionInterface>
|
||||
#include <QDBusServiceWatcher>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
FcitxQtWatcher::FcitxQtWatcher(QObject *parent)
|
||||
: QObject(parent), d_ptr(new FcitxQtWatcherPrivate(this)) {}
|
||||
|
||||
FcitxQtWatcher::FcitxQtWatcher(const QDBusConnection &connection,
|
||||
QObject *parent)
|
||||
: FcitxQtWatcher(parent) {
|
||||
setConnection(connection);
|
||||
}
|
||||
|
||||
FcitxQtWatcher::~FcitxQtWatcher() { delete d_ptr; }
|
||||
|
||||
bool FcitxQtWatcher::availability() const {
|
||||
Q_D(const FcitxQtWatcher);
|
||||
return d->availability_;
|
||||
}
|
||||
|
||||
void FcitxQtWatcher::setConnection(const QDBusConnection &connection) {
|
||||
Q_D(FcitxQtWatcher);
|
||||
return d->serviceWatcher_.setConnection(connection);
|
||||
}
|
||||
|
||||
QDBusConnection FcitxQtWatcher::connection() const {
|
||||
Q_D(const FcitxQtWatcher);
|
||||
return d->serviceWatcher_.connection();
|
||||
}
|
||||
|
||||
void FcitxQtWatcher::setWatchPortal(bool portal) {
|
||||
Q_D(FcitxQtWatcher);
|
||||
d->watchPortal_ = portal;
|
||||
}
|
||||
|
||||
bool FcitxQtWatcher::watchPortal() const {
|
||||
Q_D(const FcitxQtWatcher);
|
||||
return d->watchPortal_;
|
||||
}
|
||||
|
||||
QString FcitxQtWatcher::serviceName() const {
|
||||
Q_D(const FcitxQtWatcher);
|
||||
if (d->mainPresent_) {
|
||||
return FCITX_MAIN_SERVICE_NAME;
|
||||
}
|
||||
if (d->portalPresent_) {
|
||||
return FCITX_PORTAL_SERVICE_NAME;
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
void FcitxQtWatcher::setAvailability(bool availability) {
|
||||
Q_D(FcitxQtWatcher);
|
||||
if (d->availability_ != availability) {
|
||||
d->availability_ = availability;
|
||||
Q_EMIT availabilityChanged(d->availability_);
|
||||
}
|
||||
}
|
||||
|
||||
void FcitxQtWatcher::watch() {
|
||||
Q_D(FcitxQtWatcher);
|
||||
if (d->watched_) {
|
||||
return;
|
||||
}
|
||||
|
||||
connect(&d->serviceWatcher_, &QDBusServiceWatcher::serviceOwnerChanged,
|
||||
this, &FcitxQtWatcher::imChanged);
|
||||
d->serviceWatcher_.addWatchedService(FCITX_MAIN_SERVICE_NAME);
|
||||
if (d->watchPortal_) {
|
||||
d->serviceWatcher_.addWatchedService(FCITX_PORTAL_SERVICE_NAME);
|
||||
}
|
||||
|
||||
if (connection().interface()->isServiceRegistered(
|
||||
FCITX_MAIN_SERVICE_NAME)) {
|
||||
d->mainPresent_ = true;
|
||||
}
|
||||
if (d->watchPortal_ && connection().interface()->isServiceRegistered(
|
||||
FCITX_PORTAL_SERVICE_NAME)) {
|
||||
d->portalPresent_ = true;
|
||||
}
|
||||
|
||||
updateAvailability();
|
||||
|
||||
d->watched_ = true;
|
||||
}
|
||||
|
||||
void FcitxQtWatcher::unwatch() {
|
||||
Q_D(FcitxQtWatcher);
|
||||
if (!d->watched_) {
|
||||
return;
|
||||
}
|
||||
disconnect(&d->serviceWatcher_, &QDBusServiceWatcher::serviceOwnerChanged,
|
||||
this, &FcitxQtWatcher::imChanged);
|
||||
d->mainPresent_ = false;
|
||||
d->portalPresent_ = false;
|
||||
d->watched_ = false;
|
||||
updateAvailability();
|
||||
}
|
||||
|
||||
bool FcitxQtWatcher::isWatching() const {
|
||||
Q_D(const FcitxQtWatcher);
|
||||
return d->watched_;
|
||||
}
|
||||
|
||||
void FcitxQtWatcher::imChanged(const QString &service, const QString &,
|
||||
const QString &newOwner) {
|
||||
Q_D(FcitxQtWatcher);
|
||||
if (service == FCITX_MAIN_SERVICE_NAME) {
|
||||
if (!newOwner.isEmpty()) {
|
||||
d->mainPresent_ = true;
|
||||
} else {
|
||||
d->mainPresent_ = false;
|
||||
}
|
||||
} else if (service == FCITX_PORTAL_SERVICE_NAME) {
|
||||
if (!newOwner.isEmpty()) {
|
||||
d->portalPresent_ = true;
|
||||
} else {
|
||||
d->portalPresent_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
updateAvailability();
|
||||
}
|
||||
|
||||
void FcitxQtWatcher::updateAvailability() {
|
||||
Q_D(FcitxQtWatcher);
|
||||
setAvailability(d->mainPresent_ || d->portalPresent_);
|
||||
}
|
||||
} // namespace fcitx
|
||||
54
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtwatcher.h
vendored
Normal file
54
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtwatcher.h
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DBUSADDONS_FCITXQTWATCHER_H_
|
||||
#define _DBUSADDONS_FCITXQTWATCHER_H_
|
||||
|
||||
#include "fcitx5qt6dbusaddons_export.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QObject>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
class FcitxQtWatcherPrivate;
|
||||
|
||||
class FCITX5QT6DBUSADDONS_EXPORT FcitxQtWatcher : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FcitxQtWatcher(QObject *parent = nullptr);
|
||||
explicit FcitxQtWatcher(const QDBusConnection &connection,
|
||||
QObject *parent = nullptr);
|
||||
~FcitxQtWatcher();
|
||||
void watch();
|
||||
void unwatch();
|
||||
void setConnection(const QDBusConnection &connection);
|
||||
QDBusConnection connection() const;
|
||||
void setWatchPortal(bool portal);
|
||||
bool watchPortal() const;
|
||||
bool isWatching() const;
|
||||
bool availability() const;
|
||||
|
||||
QString serviceName() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void availabilityChanged(bool);
|
||||
|
||||
private Q_SLOTS:
|
||||
void imChanged(const QString &service, const QString &oldOwner,
|
||||
const QString &newOwner);
|
||||
|
||||
private:
|
||||
void setAvailability(bool availability);
|
||||
void updateAvailability();
|
||||
|
||||
FcitxQtWatcherPrivate *const d_ptr;
|
||||
Q_DECLARE_PRIVATE(FcitxQtWatcher);
|
||||
};
|
||||
} // namespace fcitx
|
||||
|
||||
#endif // _DBUSADDONS_FCITXQTWATCHER_H_
|
||||
32
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtwatcher_p.h
vendored
Normal file
32
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/fcitxqtwatcher_p.h
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DBUSADDONS_FCITXQTWATCHER_P_H_
|
||||
#define _DBUSADDONS_FCITXQTWATCHER_P_H_
|
||||
|
||||
#include "fcitxqtwatcher.h"
|
||||
#include <QDBusServiceWatcher>
|
||||
|
||||
#define FCITX_MAIN_SERVICE_NAME "org.fcitx.Fcitx5"
|
||||
#define FCITX_PORTAL_SERVICE_NAME "org.freedesktop.portal.Fcitx"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
class FcitxQtWatcherPrivate {
|
||||
public:
|
||||
FcitxQtWatcherPrivate(FcitxQtWatcher *q) : serviceWatcher_(q) {}
|
||||
|
||||
QDBusServiceWatcher serviceWatcher_;
|
||||
bool watchPortal_ = false;
|
||||
bool availability_ = false;
|
||||
bool mainPresent_ = false;
|
||||
bool portalPresent_ = false;
|
||||
bool watched_ = false;
|
||||
};
|
||||
} // namespace fcitx
|
||||
|
||||
#endif // _DBUSADDONS_FCITXQTWATCHER_P_H_
|
||||
5
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/gen_dbus.sh
vendored
Executable file
5
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/gen_dbus.sh
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
qdbusxml2cpp-qt6 -N -p fcitxqtinputcontextproxyimpl -c FcitxQtInputContextProxyImpl interfaces/org.fcitx.Fcitx.InputContext1.xml -i fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
qdbusxml2cpp-qt6 -N -p fcitxqtinputmethodproxy -c FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod1.xml -i fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
qdbusxml2cpp-qt6 -N -p fcitxqtcontrollerproxy -c FcitxQtControllerProxy interfaces/org.fcitx.Fcitx.Controller1.xml -i fcitxqtdbustypes.h -i fcitx5qt6dbusaddons_export.h
|
||||
1
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/interfaces
vendored
Symbolic link
1
Telegram/ThirdParty/fcitx5-qt/qt6/dbusaddons/interfaces
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../../qt5/dbusaddons/interfaces/
|
||||
Reference in New Issue
Block a user