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:
78
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/CMakeLists.txt
vendored
Normal file
78
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
ecm_setup_version(PROJECT VARIABLE_PREFIX FCITX5QT4DBUSADDONS
|
||||
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt4dbusaddons_version.h"
|
||||
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt4DBusAddonsConfigVersion.cmake"
|
||||
SOVERSION 1)
|
||||
|
||||
# create a Config.cmake and a ConfigVersion.cmake file and install them
|
||||
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Fcitx5Qt4DBusAddons")
|
||||
|
||||
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/Fcitx5Qt4DBusAddonsConfig.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt4DBusAddonsConfig.cmake"
|
||||
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
set(dbusaddons_SOURCES
|
||||
fcitxqtwatcher.cpp
|
||||
fcitxqtdbustypes.cpp
|
||||
fcitxqtinputcontextproxy.cpp
|
||||
fcitxqtinputcontextproxyimpl.cpp
|
||||
fcitxqtinputmethodproxy.cpp
|
||||
)
|
||||
|
||||
set(dbusaddons_HEADERS
|
||||
fcitxqtwatcher.h
|
||||
fcitxqtdbustypes.h
|
||||
fcitxqtinputcontextproxy.h
|
||||
fcitxqtinputmethodproxy.h
|
||||
)
|
||||
|
||||
set(fcitxqtdbusaddons_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(Fcitx5Qt4DBusAddons ${LIBRARY_TYPE} ${dbusaddons_SOURCES})
|
||||
generate_export_header(Fcitx5Qt4DBusAddons BASE_NAME Fcitx5Qt4DBusAddons)
|
||||
add_library(Fcitx5Qt4::DBusAddons ALIAS Fcitx5Qt4DBusAddons)
|
||||
|
||||
target_include_directories(Fcitx5Qt4DBusAddons PUBLIC "$<BUILD_INTERFACE:${fcitxqtdbusaddons_INCLUDE_DIRS}>")
|
||||
target_include_directories(Fcitx5Qt4DBusAddons INTERFACE "$<INSTALL_INTERFACE:${Fcitx5Qt4_INCLUDE_INSTALL_DIR}/Fcitx5Qt4DBusAddons>")
|
||||
|
||||
set_target_properties(Fcitx5Qt4DBusAddons
|
||||
PROPERTIES VERSION ${FCITX5QT4DBUSADDONS_VERSION}
|
||||
AUTOMOC TRUE
|
||||
SOVERSION ${FCITX5QT4DBUSADDONS_SOVERSION}
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
EXPORT_NAME DBusAddons
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
Fcitx5Qt4DBusAddons
|
||||
PUBLIC
|
||||
Qt4::QtCore
|
||||
Qt4::QtDBus
|
||||
)
|
||||
|
||||
if(BUILD_ONLY_PLUGIN)
|
||||
set_target_properties(Fcitx5Qt4DBusAddons PROPERTIES
|
||||
COMPILE_DEFINITIONS "FCITX5QT4DBUSADDONS_STATIC_DEFINE")
|
||||
|
||||
else()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt4DBusAddonsConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Qt4DBusAddonsConfigVersion.cmake"
|
||||
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
|
||||
COMPONENT Devel )
|
||||
|
||||
install(EXPORT Fcitx5Qt4DBusAddonsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE Fcitx5Qt4DBusAddonsTargets.cmake NAMESPACE Fcitx5Qt4:: )
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt4dbusaddons_version.h
|
||||
DESTINATION ${Fcitx5Qt4_INCLUDE_INSTALL_DIR} COMPONENT Devel )
|
||||
|
||||
install(TARGETS Fcitx5Qt4DBusAddons EXPORT Fcitx5Qt4DBusAddonsTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
install(FILES ${dbusaddons_HEADERS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fcitx5qt4dbusaddons_export.h
|
||||
DESTINATION "${Fcitx5Qt4_INCLUDE_INSTALL_DIR}/Fcitx5Qt4DBusAddons")
|
||||
endif()
|
||||
|
||||
|
||||
7
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/Fcitx5Qt4DBusAddonsConfig.cmake.in
vendored
Normal file
7
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/Fcitx5Qt4DBusAddonsConfig.cmake.in
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Qt4 @REQUIRED_QT4_VERSION@)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5Qt4DBusAddonsTargets.cmake")
|
||||
298
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtdbustypes.cpp
vendored
Normal file
298
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtdbustypes.cpp
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
/*
|
||||
* 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(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 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
|
||||
157
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtdbustypes.h
vendored
Normal file
157
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtdbustypes.h
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DBUSADDONS_FCITXQTDBUSTYPES_H_
|
||||
#define _DBUSADDONS_FCITXQTDBUSTYPES_H_
|
||||
|
||||
#include "fcitx5qt4dbusaddons_export.h"
|
||||
|
||||
#include <QDBusArgument>
|
||||
#include <QList>
|
||||
#include <QMetaType>
|
||||
#include <type_traits>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
FCITX5QT4DBUSADDONS_EXPORT void registerFcitxQtDBusTypes();
|
||||
|
||||
#define FCITX5_QT_BEGIN_DECLARE_DBUS_TYPE(TYPE) \
|
||||
class FCITX5QT4DBUSADDONS_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; \
|
||||
FCITX5QT4DBUSADDONS_EXPORT QDBusArgument &operator<<( \
|
||||
QDBusArgument &argument, const TYPE &value); \
|
||||
FCITX5QT4DBUSADDONS_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(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::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_
|
||||
133
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxy.cpp
vendored
Normal file
133
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxy.cpp
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017~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() {
|
||||
Q_D(FcitxQtInputContextProxy);
|
||||
if (isValid()) {
|
||||
d->icproxy_->DestroyIC();
|
||||
}
|
||||
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<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::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::supportInvokeAction() const {
|
||||
Q_D(const FcitxQtInputContextProxy);
|
||||
return d->supportInvokeAction_;
|
||||
}
|
||||
|
||||
} // namespace fcitx
|
||||
|
||||
#include "moc_fcitxqtinputcontextproxy.cpp"
|
||||
93
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxy.h
vendored
Normal file
93
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxy.h
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012~2017 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_H_
|
||||
#define _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_H_
|
||||
|
||||
#include "fcitx5qt4dbusaddons_export.h"
|
||||
|
||||
#include "fcitxqtdbustypes.h"
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusPendingReply>
|
||||
#include <QDBusServiceWatcher>
|
||||
#include <QObject>
|
||||
|
||||
class QDBusPendingCallWatcher;
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
class FcitxQtWatcher;
|
||||
class FcitxQtInputContextProxyPrivate;
|
||||
|
||||
class FCITX5QT4DBUSADDONS_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<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<> prevPage();
|
||||
QDBusPendingReply<> nextPage();
|
||||
QDBusPendingReply<> selectCandidate(int i);
|
||||
QDBusPendingReply<> invokeAction(unsigned int action, int cursor);
|
||||
|
||||
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 notifyFocusOut();
|
||||
|
||||
private:
|
||||
Q_PRIVATE_SLOT(d_func(), void availabilityChanged());
|
||||
Q_PRIVATE_SLOT(d_func(), void recheck());
|
||||
Q_PRIVATE_SLOT(d_func(), void cleanUp());
|
||||
Q_PRIVATE_SLOT(d_func(), void serviceUnregistered());
|
||||
Q_PRIVATE_SLOT(d_func(), void createInputContextFinished());
|
||||
Q_PRIVATE_SLOT(d_func(), void introspectFinished());
|
||||
|
||||
FcitxQtInputContextProxyPrivate *const d_ptr;
|
||||
Q_DECLARE_PRIVATE(FcitxQtInputContextProxy);
|
||||
};
|
||||
|
||||
} // namespace fcitx
|
||||
|
||||
#endif // _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_H_
|
||||
218
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxy_p.h
vendored
Normal file
218
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxy_p.h
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
* 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>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
class FcitxQtInputContextProxyPrivate {
|
||||
public:
|
||||
FcitxQtInputContextProxyPrivate(FcitxQtWatcher *watcher,
|
||||
FcitxQtInputContextProxy *q)
|
||||
: q_ptr(q), fcitxWatcher_(watcher), watcher_(q) {
|
||||
registerFcitxQtDBusTypes();
|
||||
QObject::connect(fcitxWatcher_, SIGNAL(availabilityChanged(bool)), q,
|
||||
SLOT(availabilityChanged()));
|
||||
watcher_.setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
|
||||
QObject::connect(&watcher_, SIGNAL(serviceUnregistered(QString)), q,
|
||||
SLOT(serviceUnregistered()));
|
||||
availabilityChanged();
|
||||
}
|
||||
|
||||
~FcitxQtInputContextProxyPrivate() {
|
||||
if (isValid()) {
|
||||
icproxy_->DestroyIC();
|
||||
}
|
||||
}
|
||||
|
||||
bool isValid() const { return (icproxy_ && icproxy_->isValid()); }
|
||||
|
||||
void serviceUnregistered() {
|
||||
cleanUp();
|
||||
availabilityChanged();
|
||||
}
|
||||
|
||||
void availabilityChanged() {
|
||||
QTimer::singleShot(100, q_ptr, SLOT(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;
|
||||
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());
|
||||
portal_ = true;
|
||||
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_,
|
||||
SIGNAL(finished(QDBusPendingCallWatcher *)), q,
|
||||
SLOT(createInputContextFinished()));
|
||||
}
|
||||
|
||||
void createInputContextFinished() {
|
||||
Q_Q(FcitxQtInputContextProxy);
|
||||
if (createInputContextWatcher_->isError()) {
|
||||
cleanUp();
|
||||
return;
|
||||
}
|
||||
|
||||
QDBusPendingReply<QDBusObjectPath, QByteArray> reply(
|
||||
*createInputContextWatcher_);
|
||||
icproxy_ = new FcitxQtInputContextProxyImpl(improxy_->service(),
|
||||
reply.value().path(),
|
||||
improxy_->connection(), q);
|
||||
QObject::connect(icproxy_, SIGNAL(CommitString(QString)), q,
|
||||
SIGNAL(commitString(QString)));
|
||||
QObject::connect(icproxy_, SIGNAL(CurrentIM(QString, QString, QString)),
|
||||
q, SIGNAL(currentIM(QString, QString, QString)));
|
||||
QObject::connect(
|
||||
icproxy_, SIGNAL(ForwardKey(unsigned int, unsigned int, bool)), q,
|
||||
SIGNAL(forwardKey(unsigned int, unsigned int, bool)));
|
||||
QObject::connect(
|
||||
icproxy_,
|
||||
SIGNAL(UpdateFormattedPreedit(FcitxQtFormattedPreeditList, int)), q,
|
||||
SIGNAL(updateFormattedPreedit(FcitxQtFormattedPreeditList, int)));
|
||||
QObject::connect(icproxy_,
|
||||
SIGNAL(DeleteSurroundingText(int, unsigned int)), q,
|
||||
SIGNAL(deleteSurroundingText(int, unsigned int)));
|
||||
QObject::connect(icproxy_, SIGNAL(NotifyFocusOut()), q,
|
||||
SIGNAL(notifyFocusOut()));
|
||||
|
||||
delete createInputContextWatcher_;
|
||||
createInputContextWatcher_ = nullptr;
|
||||
Q_EMIT q->inputContextCreated(reply.argumentAt<1>());
|
||||
|
||||
introspect();
|
||||
}
|
||||
|
||||
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_,
|
||||
SIGNAL(finished(QDBusPendingCallWatcher *)), q,
|
||||
SLOT(introspectFinished()));
|
||||
}
|
||||
|
||||
void introspectFinished() {
|
||||
if (introspectWatcher_->isFinished() &&
|
||||
!introspectWatcher_->isError()) {
|
||||
QDBusPendingReply<QString> reply = *introspectWatcher_;
|
||||
|
||||
if (reply.value().contains("InvokeAction")) {
|
||||
supportInvokeAction_ = true;
|
||||
}
|
||||
}
|
||||
delete introspectWatcher_;
|
||||
introspectWatcher_ = nullptr;
|
||||
}
|
||||
|
||||
FcitxQtInputContextProxy *q_ptr;
|
||||
Q_DECLARE_PUBLIC(FcitxQtInputContextProxy);
|
||||
|
||||
FcitxQtWatcher *fcitxWatcher_;
|
||||
QDBusServiceWatcher watcher_;
|
||||
FcitxQtInputMethodProxy *improxy_ = nullptr;
|
||||
FcitxQtInputContextProxyImpl *icproxy_ = nullptr;
|
||||
bool supportInvokeAction_ = false;
|
||||
QDBusPendingCallWatcher *createInputContextWatcher_ = nullptr;
|
||||
QDBusPendingCallWatcher *introspectWatcher_ = nullptr;
|
||||
QString display_;
|
||||
bool portal_ = false;
|
||||
};
|
||||
} // namespace fcitx
|
||||
|
||||
#endif // _DBUSADDONS_FCITXQTINPUTCONTEXTPROXY_P_H_
|
||||
29
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxyimpl.cpp
vendored
Normal file
29
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxyimpl.cpp
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.7
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputcontextproxyimpl -c
|
||||
* FcitxQtInputContextProxyImpl interfaces/org.fcitx.Fcitx.InputContext1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt4dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
|
||||
*
|
||||
* 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() {}
|
||||
} // namespace fcitx
|
||||
176
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxyimpl.h
vendored
Normal file
176
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputcontextproxyimpl.h
vendored
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.7
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputcontextproxyimpl -c
|
||||
* FcitxQtInputContextProxyImpl interfaces/org.fcitx.Fcitx.InputContext1.xml -i
|
||||
* fcitxqtdbustypes.h -i fcitx5qt4dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef FCITXQTINPUTCONTEXTPROXYIMPL_H_1637715099
|
||||
#define FCITXQTINPUTCONTEXTPROXYIMPL_H_1637715099
|
||||
|
||||
#include "fcitx5qt4dbusaddons_export.h"
|
||||
#include "fcitxqtdbustypes.h"
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.fcitx.Fcitx.InputContext1
|
||||
*/
|
||||
class 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 = 0);
|
||||
|
||||
~FcitxQtInputContextProxyImpl();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<> DestroyIC() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1String("DestroyIC"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> FocusIn() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1String("FocusIn"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> FocusOut() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1String("FocusOut"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> InvokeAction(unsigned int action, int cursor) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(action)
|
||||
<< QVariant::fromValue(cursor);
|
||||
return asyncCallWithArgumentList(QLatin1String("InvokeAction"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> NextPage() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1String("NextPage"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> PrevPage() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1String("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(QLatin1String("ProcessKeyEvent"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> Reset() {
|
||||
QList<QVariant> argumentList;
|
||||
return asyncCallWithArgumentList(QLatin1String("Reset"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SelectCandidate(int index) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(index);
|
||||
return asyncCallWithArgumentList(QLatin1String("SelectCandidate"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetSupportedCapability(qulonglong caps)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(caps);
|
||||
return asyncCallWithArgumentList(QLatin1String("SetSupportedCapability"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetCapability(qulonglong caps) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(caps);
|
||||
return asyncCallWithArgumentList(QLatin1String("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(QLatin1String("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(QLatin1String("SetCursorRectV2"),
|
||||
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(QLatin1String("SetSurroundingText"),
|
||||
argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> SetSurroundingTextPosition(unsigned int cursor,
|
||||
unsigned int anchor) {
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(cursor)
|
||||
<< QVariant::fromValue(anchor);
|
||||
return asyncCallWithArgumentList(
|
||||
QLatin1String("SetSurroundingTextPosition"), 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,
|
||||
FcitxQtFormattedPreeditList candidates,
|
||||
int candidateIndex, int layoutHint, bool hasPrev,
|
||||
bool hasNext);
|
||||
void UpdateFormattedPreedit(FcitxQtFormattedPreeditList str, int cursorpos);
|
||||
};
|
||||
} // namespace fcitx
|
||||
|
||||
#endif
|
||||
29
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputmethodproxy.cpp
vendored
Normal file
29
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputmethodproxy.cpp
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.7
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputmethodproxy -c FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod1.xml -i fcitxqtdbustypes.h -i fcitx5qt4dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
|
||||
*
|
||||
* 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()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
65
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputmethodproxy.h
vendored
Normal file
65
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtinputmethodproxy.h
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.7
|
||||
* Command line was: qdbusxml2cpp -N -p fcitxqtinputmethodproxy -c FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod1.xml -i fcitxqtdbustypes.h -i fcitx5qt4dbusaddons_export.h
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
|
||||
*
|
||||
* This is an auto-generated file.
|
||||
* Do not edit! All changes made to it will be lost.
|
||||
*/
|
||||
|
||||
#ifndef FCITXQTINPUTMETHODPROXY_H_1637715099
|
||||
#define FCITXQTINPUTMETHODPROXY_H_1637715099
|
||||
|
||||
#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 "fcitx5qt4dbusaddons_export.h"
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
/*
|
||||
* Proxy class for interface org.fcitx.Fcitx.InputMethod1
|
||||
*/
|
||||
class FCITX5QT4DBUSADDONS_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 = 0);
|
||||
|
||||
~FcitxQtInputMethodProxy();
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
inline QDBusPendingReply<QDBusObjectPath, QByteArray> CreateInputContext(FcitxQtStringKeyValueList in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
return asyncCallWithArgumentList(QLatin1String("CreateInputContext"), argumentList);
|
||||
}
|
||||
inline QDBusReply<QDBusObjectPath> CreateInputContext(FcitxQtStringKeyValueList in0, QByteArray &out1)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << QVariant::fromValue(in0);
|
||||
QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("CreateInputContext"), argumentList);
|
||||
if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
|
||||
out1 = qdbus_cast<QByteArray>(reply.arguments().at(1));
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
142
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtwatcher.cpp
vendored
Normal file
142
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/fcitxqtwatcher.cpp
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* 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_,
|
||||
SIGNAL(serviceOwnerChanged(QString, QString, QString)), this,
|
||||
SLOT(imChanged(QString, QString, QString)));
|
||||
d->serviceWatcher_.addWatchedService(FCITX_MAIN_SERVICE_NAME);
|
||||
if (d->watchPortal_) {
|
||||
d->serviceWatcher_.addWatchedService(FCITX_PORTAL_SERVICE_NAME);
|
||||
}
|
||||
|
||||
if (QDBusConnection::sessionBus().interface()->isServiceRegistered(
|
||||
FCITX_MAIN_SERVICE_NAME)) {
|
||||
d->mainPresent_ = true;
|
||||
}
|
||||
if (d->watchPortal_ &&
|
||||
QDBusConnection::sessionBus().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_,
|
||||
SIGNAL(serviceOwnerChanged(QString, QString, QString)), this,
|
||||
SLOT(imChanged(QString, QString, QString)));
|
||||
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/qt4/dbusaddons/fcitxqtwatcher.h
vendored
Normal file
54
Telegram/ThirdParty/fcitx5-qt/qt4/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 "fcitx5qt4dbusaddons_export.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QObject>
|
||||
|
||||
namespace fcitx {
|
||||
|
||||
class FcitxQtWatcherPrivate;
|
||||
|
||||
class FCITX5QT4DBUSADDONS_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/qt4/dbusaddons/fcitxqtwatcher_p.h
vendored
Normal file
32
Telegram/ThirdParty/fcitx5-qt/qt4/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_
|
||||
4
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/gen_dbus.sh
vendored
Executable file
4
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/gen_dbus.sh
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
qdbusxml2cpp-qt4 -N -p fcitxqtinputcontextproxyimpl -c FcitxQtInputContextProxyImpl interfaces/org.fcitx.Fcitx.InputContext1.xml -i fcitxqtdbustypes.h -i fcitx5qt4dbusaddons_export.h
|
||||
qdbusxml2cpp-qt4 -N -p fcitxqtinputmethodproxy -c FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod1.xml -i fcitxqtdbustypes.h -i fcitx5qt4dbusaddons_export.h
|
||||
1
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/interfaces/org.fcitx.Fcitx.InputContext1.xml
vendored
Symbolic link
1
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/interfaces/org.fcitx.Fcitx.InputContext1.xml
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../qt5/dbusaddons/interfaces/org.fcitx.Fcitx.InputContext1.xml
|
||||
1
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/interfaces/org.fcitx.Fcitx.InputMethod1.xml
vendored
Symbolic link
1
Telegram/ThirdParty/fcitx5-qt/qt4/dbusaddons/interfaces/org.fcitx.Fcitx.InputMethod1.xml
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../qt5/dbusaddons/interfaces/org.fcitx.Fcitx.InputMethod1.xml
|
||||
Reference in New Issue
Block a user