diff --git a/BiometricAuth/CMakeLists.txt b/BiometricAuth/CMakeLists.txt
index 18c3215..e1b52a5 100644
--- a/BiometricAuth/CMakeLists.txt
+++ b/BiometricAuth/CMakeLists.txt
@@ -1,8 +1,6 @@
qt5_wrap_cpp(BiometricAuth_SRC
biometricdeviceinfo.h
- biometricproxy.h
- biometricauthwidget.h
- biometricdeviceswidget.h
+ biometricproxy.h
giodbus.h
uniauthservice.h
)
@@ -10,9 +8,7 @@ qt5_wrap_cpp(BiometricAuth_SRC
set(BiometricAuth_SRC
${BiometricAuth_SRC}
biometricdeviceinfo.cpp
- biometricproxy.cpp
- biometricauthwidget.cpp
- biometricdeviceswidget.cpp
+ biometricproxy.cpp
giodbus.cpp
uniauthservice.cpp
)
@@ -20,11 +16,12 @@ set(BiometricAuth_SRC
include_directories(
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
- ${Qt5DBus_INCLUDE_DIRS}
- ${OpenCV_INCLUDE_DIRS}
+ ${Qt5DBus_INCLUDE_DIRS}
${GLIB2_INCLUDE_DIRS}
+ ${GIOUNIX2_INCLUDE_DIRS}
)
add_library(BiometricAuth STATIC ${BiometricAuth_SRC})
-target_link_libraries(BiometricAuth Qt5::Core Qt5::DBus Qt5::Widgets ${OpenCV_LIBS} ${GIOUNIX2_LIBRARIES})
+target_link_libraries(BiometricAuth Qt5::Core Qt5::DBus Qt5::Widgets
+ ${GIOUNIX2_LIBRARIES})
diff --git a/BiometricAuth/biometricauthwidget.cpp b/BiometricAuth/biometricauthwidget.cpp
index a7b552d..4a03938 100644
--- a/BiometricAuth/biometricauthwidget.cpp
+++ b/BiometricAuth/biometricauthwidget.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include "biometricauthwidget.h"
#include
diff --git a/BiometricAuth/biometricauthwidget.h b/BiometricAuth/biometricauthwidget.h
index e380abf..8390a02 100644
--- a/BiometricAuth/biometricauthwidget.h
+++ b/BiometricAuth/biometricauthwidget.h
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#ifndef BIOMETRICAUTHWIDGET_H
#define BIOMETRICAUTHWIDGET_H
diff --git a/BiometricAuth/biometricdeviceinfo.cpp b/BiometricAuth/biometricdeviceinfo.cpp
index f49881e..83f97f0 100644
--- a/BiometricAuth/biometricdeviceinfo.cpp
+++ b/BiometricAuth/biometricdeviceinfo.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include "biometricdeviceinfo.h"
@@ -67,6 +66,8 @@ QString DeviceType::getDeviceType_tr(int deviceType)
return tr("Face");
case VoicePrint:
return tr("VoicePrint");
+ case LOGINOPT_TYPE_GENERAL_UKEY:
+ return tr("ukey");
case REMOTE_QRCODE_TYPE:
return tr("QRCode");
default:
@@ -126,10 +127,33 @@ const QDBusArgument &operator >>(const QDBusArgument &arg, DeviceInfo &deviceInf
return arg;
}
+/* For the type FeatureInfo */
+QDBusArgument &operator<<(QDBusArgument &argument, const FeatureInfo &featureInfo)
+{
+ argument.beginStructure();
+ argument << featureInfo.uid << featureInfo.biotype
+ << featureInfo.device_shortname << featureInfo.index
+ << featureInfo.index_name;
+ argument.endStructure();
+ return argument;
+}
+
+const QDBusArgument &operator>>(const QDBusArgument &argument, FeatureInfo &featureInfo)
+{
+ argument.beginStructure();
+ argument >> featureInfo.uid >> featureInfo.biotype
+ >> featureInfo.device_shortname >> featureInfo.index
+ >> featureInfo.index_name;
+ argument.endStructure();
+ return argument;
+}
+
void registerMetaType()
{
qRegisterMetaType("DeviceInfo");
qDBusRegisterMetaType();
+ qRegisterMetaType("FeatureInfo");
+ qDBusRegisterMetaType();
}
diff --git a/BiometricAuth/biometricdeviceinfo.h b/BiometricAuth/biometricdeviceinfo.h
index 7ffb27a..e5a4e64 100644
--- a/BiometricAuth/biometricdeviceinfo.h
+++ b/BiometricAuth/biometricdeviceinfo.h
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#ifndef BIOMETRICDEVICEINFO_H
#define BIOMETRICDEVICEINFO_H
@@ -212,20 +211,35 @@ struct DeviceInfo
int OpsStatus;
};
+
+struct FeatureInfo {
+ int uid;
+ int biotype;
+ QString device_shortname;
+ int index;
+ QString index_name;
+};
+
class QDBusArgument;
QDBusArgument &operator <<(QDBusArgument &arg, const DeviceInfo &deviceInfo);
const QDBusArgument &operator >>(const QDBusArgument &arg, DeviceInfo &deviceInfo);
+QDBusArgument &operator<<(QDBusArgument &argument, const FeatureInfo &featureInfo);
+const QDBusArgument &operator>>(const QDBusArgument &argument, FeatureInfo &featureInfo);
void registerMetaType();
typedef std::shared_ptr DeviceInfoPtr;
typedef QList DeviceList;
typedef QMap DeviceMap;
+typedef std::shared_ptr FeatureInfoPtr;
+typedef QList FeatureList;
+typedef QMap FeatureMap;
QDebug operator <<(QDebug stream, const DeviceInfo &deviceInfo);
Q_DECLARE_METATYPE(DeviceInfo)
+Q_DECLARE_METATYPE(FeatureInfo)
/**
* @brief 获取默认设备
@@ -266,6 +280,8 @@ enum LOGINOPT_TYPE {
LOGINOPT_TYPE_IRIS, // 虹膜
LOGINOPT_TYPE_VOICEPRINT, // 声纹
LOGINOPT_TYPE_FINGERVEIN, // 指静脉
+ LOGINOPT_TYPE_GENERAL_UKEY, // 普通的ukey
+ LOGINOPT_TYPE_ADVANCED_UKEY, // 高阶的ukey
LOGINOPT_TYPE_QRCODE, // 二维码
LOGINOPT_TYPE_OTHERS, // 其他
LOGINOPT_TYPE_COUNT
diff --git a/BiometricAuth/biometricdeviceswidget.cpp b/BiometricAuth/biometricdeviceswidget.cpp
index 856b750..0766ae3 100644
--- a/BiometricAuth/biometricdeviceswidget.cpp
+++ b/BiometricAuth/biometricdeviceswidget.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include "biometricdeviceswidget.h"
#include
diff --git a/BiometricAuth/biometricdeviceswidget.h b/BiometricAuth/biometricdeviceswidget.h
index d606aef..bdef3da 100644
--- a/BiometricAuth/biometricdeviceswidget.h
+++ b/BiometricAuth/biometricdeviceswidget.h
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#ifndef BIOMETRICDEVICESWIDGET_H
#define BIOMETRICDEVICESWIDGET_H
diff --git a/BiometricAuth/biometricproxy.cpp b/BiometricAuth/biometricproxy.cpp
index 85637a4..9f2513e 100644
--- a/BiometricAuth/biometricproxy.cpp
+++ b/BiometricAuth/biometricproxy.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,12 +12,12 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include "biometricproxy.h"
#include
+#include
BiometricProxy::BiometricProxy(QObject *parent)
: QDBusAbstractInterface(BIOMETRIC_DBUS_SERVICE,
@@ -37,6 +37,41 @@ QDBusPendingCall BiometricProxy::Identify(int drvid, int uid, int indexStart, in
return asyncCallWithArgumentList(QStringLiteral("Identify"), argList);
}
+QDBusPendingCall BiometricProxy::UkeyIdentify(int drvid, int type, int uid)
+{
+ QList argList;
+ argList << drvid << type << uid;
+ return asyncCallWithArgumentList(QStringLiteral("UkeyIdentify"), argList);
+}
+
+bool BiometricProxy::GetHasUkeyFeature(int uid, int indexStart, int indexEnd)
+{
+ QList qlist;
+ FeatureInfo *featureInfo;
+ int listsize;
+ QDBusMessage result = call(QStringLiteral("GetAllFeatureList"),uid,indexStart,indexEnd);
+ if(result.type() == QDBusMessage::ErrorMessage)
+ {
+ qWarning() << "GetDevList error:" << result.errorMessage();
+ return false;
+ }
+ QList variantList = result.arguments();
+ listsize = variantList[0].value();
+ variantList[1].value() >> qlist;
+ for (int i = 0; i < listsize; i++) {
+ featureInfo = new FeatureInfo;
+ qlist[i].variant().value() >> *featureInfo;
+ if(featureInfo->biotype == LOGINOPT_TYPE_GENERAL_UKEY){
+ delete featureInfo;
+ return true;
+ }
+ delete featureInfo;
+ }
+
+ return false;
+
+}
+
int BiometricProxy::GetFeatureCount(int uid, int indexStart, int indexEnd)
{
QDBusMessage result = call(QStringLiteral("GetDevList"));
@@ -68,6 +103,17 @@ int BiometricProxy::GetFeatureCount(int uid, int indexStart, int indexEnd)
return res;
}
+int BiometricProxy::SetExtraInfo(QString info_type,QString extra_info)
+{
+ QDBusReply reply = call(QStringLiteral("SetExtraInfo"), info_type, extra_info);
+ if(!reply.isValid())
+ {
+ qWarning() << "SetExtraInfo error:" << reply.error();
+ return -1;
+ }
+ return reply.value();
+}
+
int BiometricProxy::StopOps(int drvid, int waiting)
{
QDBusReply reply = call(QStringLiteral("StopOps"), drvid, waiting);
@@ -145,6 +191,28 @@ DeviceList BiometricProxy::GetDevList()
return deviceList;
}
+FeatureMap BiometricProxy::GetUserFeatures(int uid)
+{
+ FeatureMap featureMap;
+ QList qlist;
+ int listsize;
+ QDBusMessage result = call(QStringLiteral("GetAllFeatureList"), uid, 0, -1);
+ if(result.type() == QDBusMessage::ErrorMessage)
+ {
+ qWarning() << "GetDevList error:" << result.errorMessage();
+ return featureMap;
+ }
+ QList variantList = result.arguments();
+ listsize = variantList[0].value();
+ variantList[1].value() >> qlist;
+ for (int i = 0; i < listsize; i++) {
+ FeatureInfoPtr pFeatureInfo = std::make_shared();
+ qlist[i].variant().value() >> *pFeatureInfo;
+ featureMap[pFeatureInfo->device_shortname].append(pFeatureInfo);
+ }
+ return featureMap;
+}
+
int BiometricProxy::GetDevCount()
{
QDBusMessage result = call(QStringLiteral("GetDevList"));
diff --git a/BiometricAuth/biometricproxy.h b/BiometricAuth/biometricproxy.h
index ac03881..5395ed7 100644
--- a/BiometricAuth/biometricproxy.h
+++ b/BiometricAuth/biometricproxy.h
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#ifndef BIOMETRICPROXY_H
#define BIOMETRICPROXY_H
@@ -65,6 +64,21 @@ public Q_SLOTS:
* @return 结果: (结果,用户id)
*/
QDBusPendingCall Identify(int drvid, int uid, int indexStart = 0, int indexEnd = -1);
+ /**
+ * @brief 使用指定id的设备进行用户认证
+ * @param drvid 驱动(设备)id
+ * @param type ukey的认证类型,2表示pin认证(需通过setExtraInfo设置pin码,3表示指纹认证)
+ * @param uid 用户id
+ * @return 结果: (结果,用户id)
+ */
+ QDBusPendingCall UkeyIdentify(int drvid, int type, int uid);
+ /**
+ * @brief 设置一些认证时所需的额外的信息
+ * @param info_type 额外的信息类型,ukey pincode认证时传 "pincode"
+ * @param extra_info 额外的信息内容,ukey pincode认证时传PIN码内容
+ * @return 结果: (设置额外信息的结果)
+ */
+ int SetExtraInfo(QString info_type, QString extra_info);
/**
* @brief 终止设备上正在进行的操作
* @param drvid 设备id
@@ -80,6 +94,14 @@ public Q_SLOTS:
* @return
*/
int GetFeatureCount(int uid, int indexStart = 0, int indexEnd = -1);
+ /**
+ * @brief 获取当前用户已连接设备对应特征数目
+ * @param uid 用户id
+ * @param indexStart 用于认证的特征索引范围
+ * @param indexEnd
+ * @return 返回是否存在ukey特征
+ */
+ bool GetHasUkeyFeature(int uid, int indexStart = 0, int indexEnd = -1);
/**
* @brief 获取已连接的设备列表
* @return
@@ -117,7 +139,12 @@ public Q_SLOTS:
StatusReslut UpdateStatus(int drvid);
int GetUserDevCount(int uid);
int GetUserDevFeatureCount(int uid,int drvid);
-
+ /**
+ * @brief GetUserFeatures 获取用户所有特征
+ * @param uid 用户id
+ * @return 特征信息列表
+ */
+ FeatureMap GetUserFeatures(int uid);
Q_SIGNALS:
/**
diff --git a/BiometricAuth/giodbus.cpp b/BiometricAuth/giodbus.cpp
index 9e0490e..02a362b 100644
--- a/BiometricAuth/giodbus.cpp
+++ b/BiometricAuth/giodbus.cpp
@@ -1,6 +1,23 @@
+/*
+ * Copyright (C) 2021 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
#include "giodbus.h"
#include
-#include
+#include
#include
int get_server_gvariant_stdout (int drvid)
diff --git a/BiometricAuth/giodbus.h b/BiometricAuth/giodbus.h
index 13e0880..a75f989 100644
--- a/BiometricAuth/giodbus.h
+++ b/BiometricAuth/giodbus.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2021 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
#ifndef GIODBUS_H
#define GIODBUS_H
diff --git a/BiometricAuth/main.cpp b/BiometricAuth/main.cpp
index 6215ae1..cd780b5 100644
--- a/BiometricAuth/main.cpp
+++ b/BiometricAuth/main.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include
#include
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14d81a6..0aa1a46 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,10 +5,13 @@ find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras Xml Network Svg)
find_package(PkgConfig REQUIRED)
find_package(OpenCV REQUIRED)
find_package(PkgConfig)
+find_package(KF5Screen REQUIRED)
+find_package(KF5Wayland REQUIRED)
+
pkg_check_modules(GIOUNIX2 REQUIRED gio-unix-2.0)
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
pkg_check_modules(kylin-nm-base REQUIRED kylin-nm-base)
-
+pkg_check_modules(KScreen REQUIRED kscreen2)
# 是否是intel项目
option (USE_INTEL "intel项目" OFF)
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt
index 5390d95..a53f577 100644
--- a/Common/CMakeLists.txt
+++ b/Common/CMakeLists.txt
@@ -1,7 +1,21 @@
+pkg_check_modules(GLIB REQUIRED glib-2.0)
+find_package(X11 REQUIRED)
+find_package(KF5WindowSystem)
+
+include_directories(
+ ${Qt5Core_INCLUDE_DIRS}
+ ${Qt5Widgets_INCLUDE_DIRS}
+ ${Qt5DBus_INCLUDE_DIRS}
+ ${GLIB2_INCLUDE_DIRS}
+ ${KF5Wayland_LIBRARIES}
+ )
+
qt5_wrap_cpp(Common_SRC
autoresize.h
checkbutton.h
commonfunc.h
+ glibinterface.h
+ plasma-shell-manager.h
)
set(Common_SRC
@@ -9,14 +23,9 @@ set(Common_SRC
autoresize.cpp
checkbutton.cpp
commonfunc.cpp
+ glibinterface.cpp
+ plasma-shell-manager.cpp
)
-include_directories(
- ${Qt5Core_INCLUDE_DIRS}
- ${Qt5Widgets_INCLUDE_DIRS}
- ${Qt5DBus_INCLUDE_DIRS}
- )
-
-
add_library(Common STATIC ${Common_SRC})
-target_link_libraries(Common Qt5::Core Qt5::DBus Qt5::Widgets)
+target_link_libraries(Common Qt5::Core Qt5::DBus Qt5::Widgets ${GIOUNIX2_LIBRARIES} ${KF5Wayland_LIBRARIES} -lKF5WaylandClient -lKF5WaylandServer KF5::WindowSystem)
diff --git a/Common/checkbutton.cpp b/Common/checkbutton.cpp
index 14ae327..9962a15 100644
--- a/Common/checkbutton.cpp
+++ b/Common/checkbutton.cpp
@@ -1,11 +1,10 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,10 +12,9 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see .
*
- */
+**/
#include "checkbutton.h"
diff --git a/Common/checkbutton.h b/Common/checkbutton.h
index d6167c9..59f3463 100644
--- a/Common/checkbutton.h
+++ b/Common/checkbutton.h
@@ -1,11 +1,10 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,10 +12,9 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see .
*
- */
+**/
#ifndef CHECKBUTTON_H
#define CHECKBUTTON_H
diff --git a/Common/commonfunc.cpp b/Common/commonfunc.cpp
index 79df19e..e9aacce 100644
--- a/Common/commonfunc.cpp
+++ b/Common/commonfunc.cpp
@@ -1,11 +1,10 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,15 +12,15 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see .
*
- */
+**/
#include
#include
#include
#include
+#include
#include
#include
#include "commonfunc.h"
diff --git a/Common/commonfunc.h b/Common/commonfunc.h
index 43ab4a9..d028bdd 100644
--- a/Common/commonfunc.h
+++ b/Common/commonfunc.h
@@ -1,11 +1,10 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
+/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,10 +12,9 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program; if not, see .
*
- */
+**/
#ifndef COMMONFUNC_H
#define COMMONFUNC_H
@@ -25,6 +23,8 @@
#include
#include
+#define G_FONT_SIZE (11.0)
+
bool ispicture(QString filepath);
QString getSystemVersion();
QString getSystemDistrib();
diff --git a/Common/glibinterface.cpp b/Common/glibinterface.cpp
new file mode 100644
index 0000000..66c26bc
--- /dev/null
+++ b/Common/glibinterface.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "glibinterface.h"
+#include
+#include
+
+#define STYLE_TYPE_SCHEMA "org.ukui.style"
+#define KEY_SYSTEM_FONT_SIZE "system-font-size"
+#define DEFAULT_FONT_SIZE (10.0)
+
+double getDefaultFontSize()
+{
+ GSettingsSchemaSource *schema_source = NULL;
+ GSettingsSchema *schema = NULL;
+
+ schema_source = g_settings_schema_source_get_default();
+ if(schema_source){
+ schema = g_settings_schema_source_lookup (schema_source,KEY_SYSTEM_FONT_SIZE,TRUE);
+ if(schema){
+ GVariant *size;
+ unsigned long length;
+ GSettings *gs;
+
+ gs = g_settings_new(STYLE_TYPE_SCHEMA);
+ size = g_settings_get_default_value(gs, KEY_SYSTEM_FONT_SIZE);
+ QString fontsize(g_variant_get_string(size,&length));
+ g_object_unref(gs);
+
+ return fontsize.toDouble();
+ }
+ }
+ return DEFAULT_FONT_SIZE;
+}
diff --git a/Common/glibinterface.h b/Common/glibinterface.h
new file mode 100644
index 0000000..3b3c018
--- /dev/null
+++ b/Common/glibinterface.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef GLIBINTERFACE_H
+#define GLIBINTERFACE_H
+
+double getDefaultFontSize();
+
+#endif // LOCKWIDGET_H
+
diff --git a/Common/plasma-shell-manager.cpp b/Common/plasma-shell-manager.cpp
new file mode 100644
index 0000000..eeea7e4
--- /dev/null
+++ b/Common/plasma-shell-manager.cpp
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+
+#include "plasma-shell-manager.h"
+
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+
+static PlasmaShellManager* global_instance = nullptr;
+
+PlasmaShellManager *PlasmaShellManager::getInstance()
+{
+ if (!global_instance)
+ {
+ global_instance = new PlasmaShellManager;
+ qDebug() << "Here create instance...";
+ }
+ qDebug() << "Return instance";
+ return global_instance;
+}
+
+bool PlasmaShellManager::setAppWindowActive()
+{
+ if (!supportPlasmaWindowManagement())
+ return false;
+
+ m_appWindow->requestActivate();
+ return true;
+}
+
+bool PlasmaShellManager::setAppWindowKeepAbove(bool keep)
+{
+ if (!supportPlasmaWindowManagement())
+ {
+ qDebug() << "false";
+ return false;
+ }
+ if(keep != m_appWindow->isKeepAbove()) {
+ qDebug() << "to keep above";
+ m_appWindow->requestToggleKeepAbove();
+ }
+ return true;
+}
+
+bool PlasmaShellManager::setMaximized(QWindow *window)
+{
+ if (!supportShell())
+ return false;
+
+ auto surface = KWayland::Client::Surface::fromWindow(window);
+ if (!surface)
+ return false;
+
+ auto shellSurface = m_shell->createSurface(surface, window);
+ if (!shellSurface)
+ return false;
+
+ shellSurface->setMaximized();
+ return true;
+}
+
+bool PlasmaShellManager::setRole(QWindow *window, KWayland::Client::PlasmaShellSurface::Role role)
+{
+ if (!supportPlasmaShell())
+ return false;
+
+ auto surface = KWayland::Client::Surface::fromWindow(window);
+ if (!surface)
+ return false;
+
+ auto plasmaShellSurface = m_plasmaShell->createSurface(surface, window);
+ if (!plasmaShellSurface)
+ return false;
+
+ plasmaShellSurface->setRole(role);
+ return true;
+}
+
+bool PlasmaShellManager::setPos(QWindow *window, const QPoint &pos)
+{
+ if (!supportPlasmaShell())
+ return false;
+
+ auto surface = KWayland::Client::Surface::fromWindow(window);
+ if (!surface)
+ return false;
+
+ auto plasmaShellSurface = m_plasmaShell->createSurface(surface, window);
+ if (!plasmaShellSurface)
+ return false;
+
+ plasmaShellSurface->setPosition(pos);
+
+ return true;
+}
+
+bool PlasmaShellManager::supportPlasmaShell()
+{
+ return m_plasmaShell;
+}
+
+bool PlasmaShellManager::supportShell()
+{
+ return m_shell;
+}
+
+bool PlasmaShellManager::supportPlasmaWindowManagement()
+{
+ return m_windowManager && m_appWindow;
+}
+
+bool PlasmaShellManager::supportFakeInput()
+{
+ return m_fakeInput;
+}
+
+bool PlasmaShellManager::supportKeyState()
+{
+ return m_keyState;
+}
+
+KWayland::Client::Keystate::State PlasmaShellManager::getKeyState(KWayland::Client::Keystate::Key key)
+{
+ if(!supportKeyState()){
+ return KWayland::Client::Keystate::Unlocked;
+ }
+
+ return m_keyStateMap[key];
+}
+
+void PlasmaShellManager::setKeyPressed(quint32 key)
+{
+ if(!supportFakeInput())
+ return ;
+
+ m_fakeInput->requestKeyboardKeyPress(key);
+ m_fakeInput->requestKeyboardKeyRelease(key);
+}
+
+PlasmaShellManager::PlasmaShellManager(QObject *parent) : QObject(parent)
+{
+ m_keyStateMap.insert(KWayland::Client::Keystate::Key::CapsLock,KWayland::Client::Keystate::Unlocked);
+ m_keyStateMap.insert(KWayland::Client::Keystate::Key::NumLock,KWayland::Client::Keystate::Unlocked);
+ m_keyStateMap.insert(KWayland::Client::Keystate::Key::ScrollLock,KWayland::Client::Keystate::Unlocked);
+
+ auto connection = KWayland::Client::ConnectionThread::fromApplication(qApp);
+ auto registry = new KWayland::Client::Registry(this);
+ registry->create(connection->display());
+
+ connect(registry, &KWayland::Client::Registry::plasmaShellAnnounced, this, [=](){
+ qDebug() << "plasmaShellAnnounced...";
+ const auto interface = registry->interface(KWayland::Client::Registry::Interface::PlasmaShell);
+ if (interface.name != 0) {
+ qDebug() << "createPlasmaShell...";
+ m_plasmaShell = registry->createPlasmaShell(interface.name, interface.version, this);
+ }
+ });
+
+ connect(registry, &KWayland::Client::Registry::plasmaWindowManagementAnnounced, this, [=](){
+ qDebug() << "plasmaWindowManagementAnnounced";
+ const auto interface = registry->interface(KWayland::Client::Registry::Interface::PlasmaWindowManagement);
+ if (interface.name != 0) {
+ qDebug() << "createPlasmaWindowManagement";
+ m_windowManager = registry->createPlasmaWindowManagement(interface.name, interface.version, this);
+ }
+ if(m_windowManager) {
+ connect(m_windowManager, &KWayland::Client::PlasmaWindowManagement::windowCreated,
+ [this](KWayland::Client::PlasmaWindow *window) {
+ qDebug()<< "PlasmaWindow...";
+ if (window->pid() == getpid()) {
+ if(isFirstCreate) {
+ isFirstCreate = false;
+ m_appWindow = window;
+
+ connect(m_appWindow, &KWayland::Client::PlasmaWindow::activeChanged,
+ [this]() {
+ this->setAppWindowKeepAbove(true);
+ this->setAppWindowActive();
+ });
+ connect(m_appWindow, &KWayland::Client::PlasmaWindow::keepAboveChanged,
+ [this]() {
+ this->setAppWindowKeepAbove(true);
+ this->setAppWindowActive();
+ });
+ }
+ }
+ });
+ }
+ });
+
+ connect(registry, &KWayland::Client::Registry::shellAnnounced, this, [=](){
+ const auto interface = registry->interface(KWayland::Client::Registry::Interface::Shell);
+ if (interface.name != 0) {
+ m_shell = registry->createShell(interface.name, interface.version, this);
+ }
+ });
+
+ connect(registry, &KWayland::Client::Registry::fakeInputAnnounced, this, [=](){
+ qDebug()<<"fakeInputAnnounced";
+ const auto interface = registry->interface(KWayland::Client::Registry::Interface::FakeInput);
+ if (interface.name != 0) {
+ qDebug()<<"createFakeInput";
+ m_fakeInput = registry->createFakeInput(interface.name, interface.version);
+ m_fakeInput->authenticate("ukui-screensaver-dialog","virual keyboard");
+ }
+ });
+
+ connect(registry, &KWayland::Client::Registry::keystateAnnounced, this, [=](){
+ qDebug()<<"keystateAnnounced";
+ const auto interface = registry->interface(KWayland::Client::Registry::Interface::Keystate);
+ if (interface.name != 0) {
+ qDebug()<<"createKeyState";
+ m_keyState = registry->createKeystate(interface.name, interface.version);
+ if(m_keyState){
+ connect(m_keyState, &KWayland::Client::Keystate::stateChanged,
+ [this](KWayland::Client::Keystate::Key key,KWayland::Client::Keystate::State state) {
+ qDebug()<<"key = "<fetchStates();
+ }
+ }
+ });
+
+ registry->setup();
+ connection->roundtrip();
+}
diff --git a/Common/plasma-shell-manager.h b/Common/plasma-shell-manager.h
new file mode 100644
index 0000000..e5e0230
--- /dev/null
+++ b/Common/plasma-shell-manager.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+
+#ifndef PLASMASHELLMANAGER_H
+#define PLASMASHELLMANAGER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class PlasmaShellManager : public QObject
+{
+ Q_OBJECT
+public:
+ static PlasmaShellManager *getInstance();
+
+ bool setAppWindowActive();
+ bool setAppWindowKeepAbove(bool keep);
+ bool setMaximized(QWindow *window);
+ bool setRole(QWindow *window, KWayland::Client::PlasmaShellSurface::Role role);
+ bool setPos(QWindow *window, const QPoint &pos);
+ void setKeyPressed(quint32 key);
+
+ bool supportPlasmaShell();
+ bool supportShell();
+ bool supportPlasmaWindowManagement();
+ bool supportFakeInput();
+ bool supportKeyState();
+ KWayland::Client::Keystate::State getKeyState(KWayland::Client::Keystate::Key key);
+Q_SIGNALS:
+ void keyStateChanged();
+
+private:
+ explicit PlasmaShellManager(QObject *parent = nullptr);
+
+ KWayland::Client::PlasmaShell *m_plasmaShell = nullptr;
+ KWayland::Client::Shell *m_shell = nullptr;
+ KWayland::Client::PlasmaWindowManagement *m_windowManager = nullptr;
+ KWayland::Client::PlasmaWindow *m_appWindow = nullptr;
+ KWayland::Client::FakeInput *m_fakeInput = nullptr;
+ KWayland::Client::Keystate *m_keyState = nullptr;
+
+ bool isFirstCreate = true;
+
+ QMap m_keyStateMap;
+
+};
+
+
+#endif // PLASMASHELLMANAGER_H
diff --git a/KylinNM/src/kylinnm.cpp b/KylinNM/src/kylinnm.cpp
index 3446f2e..d17fd83 100644
--- a/KylinNM/src/kylinnm.cpp
+++ b/KylinNM/src/kylinnm.cpp
@@ -2470,6 +2470,7 @@ void KylinNM::enWifiDone()
qDebug()<<"debug: already turn on the switch of wifi network";
syslog(LOG_DEBUG, "Already turn on the switch of wifi network");
+ QTimer::singleShot(200, this, &KylinNM::onConnectChanged);
}
void KylinNM::disWifiDone()
{
diff --git a/KylinNM/src/swipegesturerecognizer.cpp b/KylinNM/src/swipegesturerecognizer.cpp
index 87b553c..dd888c3 100644
--- a/KylinNM/src/swipegesturerecognizer.cpp
+++ b/KylinNM/src/swipegesturerecognizer.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2020 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
#include
#include
diff --git a/KylinNM/src/swipegesturerecognizer.h b/KylinNM/src/swipegesturerecognizer.h
index 2e51665..4b6c7b8 100644
--- a/KylinNM/src/swipegesturerecognizer.h
+++ b/KylinNM/src/swipegesturerecognizer.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2020 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
#ifndef SWIPEGESTURERECOGNIZER_H
#define SWIPEGESTURERECOGNIZER_H
diff --git a/KylinNM/src/switchbutton.cpp b/KylinNM/src/switchbutton.cpp
index 714e249..43ad098 100644
--- a/KylinNM/src/switchbutton.cpp
+++ b/KylinNM/src/switchbutton.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2020 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
#include "switchbutton.h"
SwitchButton::SwitchButton(QWidget *parent) : QWidget(parent)
diff --git a/KylinNM/src/switchbutton.h b/KylinNM/src/switchbutton.h
index 7c0f1e5..8c86bc2 100644
--- a/KylinNM/src/switchbutton.h
+++ b/KylinNM/src/switchbutton.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2020 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
#ifndef SWITCHBUTTON_H
#define SWITCHBUTTON_H
diff --git a/VirtualKeyboard/CMakeLists.txt b/VirtualKeyboard/CMakeLists.txt
index f9d52c7..aa1ddf2 100644
--- a/VirtualKeyboard/CMakeLists.txt
+++ b/VirtualKeyboard/CMakeLists.txt
@@ -4,21 +4,33 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
+include_directories(${PROJECT_SOURCE_DIR}/Common)
+
qt5_add_resources(VirtualKeyboard_SRC
src/keyboard.qrc)
+qt5_wrap_cpp(VirtualKeyboard_SRC
+ src/fakekeyboard.h
+ )
+
set(VirtualKeyboard_SRC
${VirtualKeyboard_SRC}
- src/cursormonitor.cpp
- src/keyboardwidget.cpp
- src/virtualkeyboard.cpp
- src/x11keyboard.cpp
- src/keyboard.qrc)
+ src/charsmorewidget.cpp
+ src/charswidget.cpp
+ src/dragwidget.cpp
+ src/kbbutton.cpp
+ src/kbtitle.cpp
+ src/letterswidget.cpp
+ src/numberswidget.cpp
+ src/virtualkeyboardwidget.cpp
+ src/x11keyboard.cpp
+ src/qtkeyboard.cpp
+ )
include_directories(
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
- )
+ )
add_library(VirtualKeyboard STATIC ${VirtualKeyboard_SRC})
-target_link_libraries(VirtualKeyboard Qt5::Core Qt5::Widgets)
+target_link_libraries(VirtualKeyboard Qt5::Core Qt5::Widgets Qt5::X11Extras Common)
diff --git a/VirtualKeyboard/VirtualKeyboard.pri b/VirtualKeyboard/VirtualKeyboard.pri
index e8029dc..79c43c4 100644
--- a/VirtualKeyboard/VirtualKeyboard.pri
+++ b/VirtualKeyboard/VirtualKeyboard.pri
@@ -1,18 +1,26 @@
SOURCES += \
- $$PWD/src/keyboardwidget.cpp \
- $$PWD/src/x11keyboard.cpp \
- $$PWD/src/cursormonitor.cpp \
- $$PWD/src/virtualkeyboard.cpp
+ $$PWD/src/charsmorewidget.cpp \
+ $$PWD/src/charswidget.cpp \
+ $$PWD/src/dragwidget.cpp \
+ $$PWD/src/kbbutton.cpp \
+ $$PWD/src/kbtitle.cpp \
+ $$PWD/src/letterswidget.cpp \
+ $$PWD/src/numberswidget.cpp \
+ $$PWD/src/virtualkeyboardwidget.cpp \
+ $$PWD/src/x11keyboard.cpp
HEADERS += \
- $$PWD/src/keyboardwidget.h \
- $$PWD/src/x11keyboard.h \
- $$PWD/src/cursormonitor.h \
- $$PWD/src/virtualkeyboard.h
-
-FORMS += \
- $$PWD/src/keyboardwidget.ui
+ $$PWD/src/charsmorewidget.h \
+ $$PWD/src/charswidget.h \
+ $$PWD/src/commondef.h \
+ $$PWD/src/dragwidget.h \
+ $$PWD/src/kbbutton.h \
+ $$PWD/src/kbtitle.h \
+ $$PWD/src/letterswidget.h \
+ $$PWD/src/numberswidget.h \
+ $$PWD/src/virtualkeyboardwidget.h \
+ $$PWD/src/x11keyboard.h
RESOURCES += \
diff --git a/VirtualKeyboard/src/charsmorewidget.cpp b/VirtualKeyboard/src/charsmorewidget.cpp
new file mode 100644
index 0000000..01cc10f
--- /dev/null
+++ b/VirtualKeyboard/src/charsmorewidget.cpp
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "charsmorewidget.h"
+#include "commondef.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+CharsMoreWidget::CharsMoreWidget(QWidget *parent/* = nullptr*/)
+ : QWidget(parent)
+{
+ this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
+ setWindowFlags(Qt::FramelessWindowHint |
+ Qt::WindowStaysOnTopHint |
+ Qt::WindowDoesNotAcceptFocus);
+ initUI();
+}
+
+CharsMoreWidget::~CharsMoreWidget()
+{
+
+}
+
+void CharsMoreWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
+{
+ QMap::iterator itGeometry = m_mapBtnGeometrys.begin();
+ for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
+ QWidget *widget = itGeometry.key();
+ if (widget) {
+ QRect oldGeometry = itGeometry.value();
+ QRect newGeometry = oldGeometry;
+ if (floatStatus) {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ } else {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ }
+ widget->setGeometry(newGeometry);
+ }
+ }
+
+ QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
+ '/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
+ '%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
+ '$', '-'};
+ for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) { //单独更新符号btn的高度
+ QString objName = QString("btn_%1").arg(QString(chChars[n]));
+ KBButton *btn = findChild(objName);
+ btn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT *lfHeightScale);
+ }
+ //更新listfarame的高度
+ listFrame->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT *m_vlayoutBtnList->count() *lfHeightScale);
+}
+
+void CharsMoreWidget::onBtnClicked(QChar charId)
+{
+ QObject *obj = sender();
+ KBButton *btn = static_cast(obj);
+ QString objName = btn->objectName();
+ int lastUnderline = objName.lastIndexOf('_');
+ int start = strlen("btn_");
+ int keyLength = lastUnderline - start;
+ QString keyName = objName.mid(start, keyLength);
+ if (keyName == BTN_RETURN) {
+ Q_EMIT specialBtnClicked(PAGE_CHAR);
+ } else if (charId != QChar::Null) {
+ Q_EMIT normalBtnClicked(charId);
+ } else {
+ Q_EMIT specialBtnClicked(keyName);
+ }
+}
+
+void CharsMoreWidget::initUI()
+{
+ // all chars
+ m_vlayoutBtnList = new QVBoxLayout();
+ m_vlayoutBtnList->setContentsMargins(8,0,0,0);
+ m_vlayoutBtnList->setSpacing(1);
+ listFrame = new QFrame();
+ listFrame->setLayout(m_vlayoutBtnList);
+ listFrame->setStyleSheet("QFrame{border-radius: 8px}");
+ m_scrollFrame = new QScrollArea(this);
+ m_scrollFrame->setContentsMargins(0, 0, 0, 0);
+ m_scrollFrame->setFocusPolicy(Qt::NoFocus);
+ m_scrollFrame->setStyleSheet("QScrollArea {background-color: #C0FFFFFF; border-radius:8px;}");
+ m_scrollFrame->viewport()->setStyleSheet("background-color:transparent;");
+ m_scrollFrame->verticalScrollBar()->setProperty("drawScrollBarGroove", false);
+ m_scrollFrame->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_scrollFrame->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);
+ m_scrollFrame->setWidgetResizable(true);
+ m_scrollFrame->setWidget(listFrame);
+ m_scrollFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1, 0,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH, KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_HEIGHT);
+ listFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1, 0,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH, KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_HEIGHT);
+ m_mapBtnGeometrys[m_scrollFrame] = m_scrollFrame->geometry();
+ m_mapBtnGeometrys[listFrame] = listFrame->geometry();
+ QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
+ '/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
+ '%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
+ '$', '-', ' ', ' ', ' ', ' '};
+ QHBoxLayout *lastLayout = nullptr;
+ for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) {
+ KBButton *charBtn = new KBButton(listFrame);
+ charBtn->setCharId(chChars[n]);
+ charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_NORMAL,
+ KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_FONT_COLOR_PRESS,
+ KBButton::BORDER_RADIUS_NONE);
+ if ((n%KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_COLS) == 0) {
+ lastLayout = new QHBoxLayout();
+ lastLayout->setContentsMargins(0,0,0,0);
+ lastLayout->setSpacing(1);
+ m_vlayoutBtnList->addLayout(lastLayout);
+ }
+ if (chChars[n] == ' ') {
+ charBtn->setDisabled(true);
+ } else {
+ charBtn->setObjectName(QString("btn_%1").arg(QString(chChars[n])));
+ }
+ charBtn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT);
+ lastLayout->addWidget(charBtn);
+ m_mapSubWidgetListRects[charBtn] = charBtn->geometry();
+ connect(charBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
+ }
+ // backspace
+ KBButton *backspaceBtn = new KBButton(this);
+ backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1+(KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH+KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING),
+ 0,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT);
+ backspaceBtn->setObjectName("btn_backspace");
+ backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
+ m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
+ connect(backspaceBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
+ // enter
+ KBButton *enterBtn = new KBButton(this);
+ enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1+(KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH+KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING),
+ (KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT+KEYBOARD_FIXED_DEFAULT_CHARSMORE_VSPACING)*1,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT);
+ enterBtn->setObjectName("btn_enter");
+ enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
+ connect(enterBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
+ m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
+ // return
+ KBButton *returnBtn = new KBButton(this);
+ returnBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1+(KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH+KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING),
+ (KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT+KEYBOARD_FIXED_DEFAULT_CHARSMORE_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT);
+ returnBtn->setObjectName("btn_return");
+ returnBtn->setText(tr("&&?!"));
+ returnBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(returnBtn, &KBButton::clicked, this, &CharsMoreWidget::onBtnClicked);
+ m_mapBtnGeometrys[returnBtn] = returnBtn->geometry();
+}
diff --git a/VirtualKeyboard/src/charsmorewidget.h b/VirtualKeyboard/src/charsmorewidget.h
new file mode 100644
index 0000000..9971ed3
--- /dev/null
+++ b/VirtualKeyboard/src/charsmorewidget.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef CHARSMOREWIDGETS_H
+#define CHARSMOREWIDGETS_H
+
+#include
+#include "kbbutton.h"
+#include
+
+class QVBoxLayout;
+class QHBoxLayout;
+class QScrollArea;
+class QFrame;
+class CharsMoreWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit CharsMoreWidget(QWidget *parent = nullptr);
+ ~CharsMoreWidget();
+ void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
+
+public Q_SLOTS:
+ void onBtnClicked(QChar charId);
+
+Q_SIGNALS:
+ void clicked(int nKeyId);
+ void specialBtnClicked(QString keyName);
+ void normalBtnClicked(QChar charId);
+
+private:
+ void initUI();
+
+private:
+ QMap m_mapBtnGeometrys;
+ QMap m_mapSubWidgetListRects;
+ QVBoxLayout *m_vlayoutBtnList = nullptr;
+ QScrollArea *m_scrollFrame = nullptr;
+ QFrame *listFrame = nullptr;
+};
+
+#endif // CHARSMOREWIDGETS_H
diff --git a/VirtualKeyboard/src/charswidget.cpp b/VirtualKeyboard/src/charswidget.cpp
new file mode 100644
index 0000000..c66597f
--- /dev/null
+++ b/VirtualKeyboard/src/charswidget.cpp
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "charswidget.h"
+
+#include "commondef.h"
+#include
+
+CharsWidget::CharsWidget(QWidget *parent/* = nullptr*/)
+ : QWidget(parent)
+{
+ this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
+ initUI();
+}
+
+CharsWidget::~CharsWidget()
+{
+
+}
+
+void CharsWidget::initUI()
+{
+ // line 1
+ QChar chLine1[] = {'1','2','3','4','5','6','7','8','9','0'};
+ for (int n = 0; n < sizeof(chLine1)/sizeof(QChar); n++) {
+ KBButton *charBtn = new KBButton(this);
+ charBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ charBtn->setCharId(chLine1[n]);
+ charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(charBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[charBtn] = charBtn->geometry();
+ }
+ // backspace
+ KBButton *backspaceBtn = new KBButton(this);
+ backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ backspaceBtn->setObjectName("btn_backspace");
+ backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(backspaceBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
+ m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
+
+ // line 2
+ QChar chLine2[] = {'~','/',':',';','(',')','@','"','\''};
+ for (int n = 0; n < sizeof(chLine2)/sizeof(QChar); n++) {
+ KBButton *charBtn = new KBButton(this);
+ charBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ charBtn->setCharId(chLine2[n]);
+ charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(charBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[charBtn] = charBtn->geometry();
+ }
+ // enter
+ KBButton *enterBtn = new KBButton(this);
+ enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
+ KEYBOARD_FIXED_DEFAULT_ENTERBTN_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ enterBtn->setObjectName("btn_enter");
+ enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(enterBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
+ m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
+
+ // line 3
+ QChar chLine3[] = {'-','_','#','%','$','+','^',',','.','!'};
+ for (int n = 0; n < sizeof(chLine3)/sizeof(QChar); n++) {
+ KBButton *charBtn = new KBButton(this);
+ charBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ charBtn->setCharId(chLine3[n]);
+ charBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(charBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[charBtn] = charBtn->geometry();
+ }
+ // more
+ KBButton *moreBtn = new KBButton(this);
+ moreBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ moreBtn->setObjectName("btn_more");
+ moreBtn->setText(tr("More"));
+ moreBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(moreBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[moreBtn] = moreBtn->geometry();
+
+ // line 4
+ KBButton *returnBtn = new KBButton(this);
+ returnBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ returnBtn->setObjectName("btn_return");
+ returnBtn->setText(tr("ABC"));
+ returnBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(returnBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[returnBtn] = returnBtn->geometry();
+
+ KBButton *numBtn = new KBButton(this);
+ numBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING),
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ numBtn->setObjectName("btn_number");
+ numBtn->setText(tr("123"));
+ numBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(numBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[numBtn] = numBtn->geometry();
+
+ KBButton *threedBtn = new KBButton(this);
+ threedBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ threedBtn->setObjectName("btn_threed");
+ threedBtn->setCharId(('&'));
+ threedBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(threedBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[threedBtn] = threedBtn->geometry();
+
+ KBButton *spaceBtn = new KBButton(this);
+ spaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_SPACEBTN_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ spaceBtn->setObjectName("btn_space");
+ spaceBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
+ KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ spaceBtn->setIcon(QIcon(":/images/images/space.svg"));
+ connect(spaceBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[spaceBtn] = spaceBtn->geometry();
+
+ KBButton *whBtn = new KBButton(this);
+ whBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*8,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ whBtn->setCharId('?');
+ whBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(whBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[whBtn] = whBtn->geometry();
+
+ KBButton *leftBtn = new KBButton(this);
+ leftBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ leftBtn->setObjectName("btn_left");
+ leftBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ leftBtn->setIcon(QIcon(":/images/images/left.svg"));
+ connect(leftBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[leftBtn] = leftBtn->geometry();
+
+ KBButton *rightBtn = new KBButton(this);
+ rightBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ rightBtn->setObjectName("btn_right");
+ rightBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ rightBtn->setIcon(QIcon(":/images/images/right.svg"));
+ connect(rightBtn, &KBButton::clicked, this, &CharsWidget::onBtnClicked);
+ m_mapBtnGeometrys[rightBtn] = rightBtn->geometry();
+}
+
+void CharsWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
+{
+ QMap::iterator itGeometry = m_mapBtnGeometrys.begin();
+ for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
+ KBButton *button = itGeometry.key();
+ if (button) {
+ QRect oldGeometry = itGeometry.value();
+ QRect newGeometry = oldGeometry;
+ if (floatStatus) {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ } else {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ }
+ button->setGeometry(newGeometry);
+ }
+ }
+}
+
+void CharsWidget::onBtnClicked(QChar charId)
+{
+ QObject *obj = sender();
+ KBButton *btn = static_cast(obj);
+ QString objName = btn->objectName();
+ int lastUnderline = objName.lastIndexOf('_');
+ int start = strlen("btn_");
+ int keyLength = lastUnderline - start;
+ QString keyName = objName.mid(start, keyLength);
+ if (keyName == BTN_RETURN) {
+ Q_EMIT specialBtnClicked(PAGE_LETTER);
+ } else if (keyName == "more") {
+ Q_EMIT specialBtnClicked(PAGE_CHARSMORE);
+ } else if (keyName == "number") {
+ Q_EMIT specialBtnClicked(PAGE_NUMBER);
+ } else if (charId != QChar::Null) {
+ Q_EMIT normalBtnClicked(charId);
+ } else {
+ Q_EMIT specialBtnClicked(keyName);
+ }
+}
diff --git a/VirtualKeyboard/src/charswidget.h b/VirtualKeyboard/src/charswidget.h
new file mode 100644
index 0000000..1076201
--- /dev/null
+++ b/VirtualKeyboard/src/charswidget.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef CHARSWIDGET_H
+#define CHARSWIDGET_H
+
+#include
+#include "kbbutton.h"
+#include
+
+class CharsWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit CharsWidget(QWidget *parent = nullptr);
+ virtual ~CharsWidget();
+
+ void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
+
+public Q_SLOTS:
+ void onBtnClicked(QChar charId);
+
+Q_SIGNALS:
+ void clicked(int nKeyId);
+ void specialBtnClicked(QString keyName);
+ void normalBtnClicked(QChar c);
+
+private:
+ void initUI();
+
+private:
+ QMap m_mapBtnGeometrys;
+
+};
+
+#endif // CHARSWIDGET_H
diff --git a/VirtualKeyboard/src/commondef.h b/VirtualKeyboard/src/commondef.h
new file mode 100644
index 0000000..629bd2d
--- /dev/null
+++ b/VirtualKeyboard/src/commondef.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef COMMONDEF_H
+#define COMMONDEF_H
+
+#define KEYBOARD_PARENT_DEFAULT_WIDTH 1620
+#define KEYBOARD_PARENT_DEFAULT_HEIGHT 1080
+
+#define KEYBOARD_FIXED_DEFAULT_WIDTH 1620
+#define KEYBOARD_DRAGSHOW_FIXED_DEFAULT_HEIGHT 428
+
+#define KEYBOARD_DRAGSHOW_FIXED_DEFAULT_WIDTH 1458
+#define KEYBOARD_DRAGHIDE_FIXED_DEFAULT_HEIGHT 404
+
+#define KEYBOARD_TITLEBTN_DEFAULT_WIDTH 56
+#define KEYBOARD_TITLEBTN_DEFAULT_HEIGHT 56
+#define KEYBOARD_TITLE_DEFAULT_HEIGHT 68
+
+#define KEYBOARD_DRAGBTN_DEFAULT_WIDTH 56
+#define KEYBOARD_DRAGBTN_DEFAULT_HEIGHT 4
+#define KEYBOARD_DRAG_DEFAULT_HEIGHT 26
+
+#define KEYBOARD_FLOAT_PERCENTAGE 0.9
+
+#define KEYBOARD_FIXED_DEFAULT_LMARGIN 22 // 左边距
+#define KEYBOARD_FIXED_DEFAULT_RMARGIN 22 // 右边距
+#define KEYBOARD_FIXED_DEFAULT_TMARGIN 8 // 上边距
+#define KEYBOARD_FIXED_DEFAULT_BMARGIN 16 // 下边距
+
+#define KEYBOAED_FIXED_DEFAULT_VSPACING 8 // 垂直间隔
+#define KEYBOAED_FIXED_DEFAULT_HSPACING 8 // 水平间隔
+// letters
+#define KEYBOARD_FIXED_DEFAULT_LETTER_L1 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0) // 字符页面左起点
+#define KEYBOARD_FIXED_DEFAULT_LETTER_L2 (KEYBOARD_FIXED_DEFAULT_LMARGIN+72) // 字符页面左起点
+#define KEYBOARD_FIXED_DEFAULT_LETTER_L3 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0) // 字符页面左起点
+#define KEYBOARD_FIXED_DEFAULT_LETTER_L4 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0) // 字符页面左起点
+#define KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH 136 // 字符按钮宽度
+#define KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT 72 // 字符按钮高度
+#define KEYBOARD_FIXED_DEFAULT_LETTER_ENTWIDTH 208
+#define KEYBOARD_FIXED_DEFAULT_LETTER_SPCWIDTH 712
+#define KEYBOARD_FIXED_DEFAULT_TITLEBTN_WIDTH 56
+#define KEYBOARD_FIXED_DEFAULT_TITLEBTN_HEIGHT 56
+
+#define KEYBOARD_FIXED_DEFAULT_ENTERBTN_WIDTH 208
+#define KEYBOARD_FIXED_DEFAULT_SPACEBTN_WIDTH 712
+
+#define KEYBOARD_LETTER_COLOR_NORMAL "#FFFFFF"
+#define KEYBOARD_LETTER_COLOR_PRESSED "#DDE0E4"
+#define KEYBOARD_LETTER_COLOR_BORDER_NORMAL "#95A0AD"
+#define KEYBOARD_LETTER_COLOR_BORDER_PRESSED "#95A0AD"
+
+#define KEYBOARD_OTHER_COLOR_NORMAL "#CED3D9"
+#define KEYBOARD_OTHER_COLOR_PRESSED "#3790FA"
+#define KEYBOARD_OTHER_COLOR_BORDER_NORMAL "#95A0AD"
+#define KEYBOARD_OTHER_COLOR_BORDER_PRESSED "#1174E5"
+
+#define KEYBOARD_FONT_COLOR_PRESS "#262626"
+#define KEYBOARD_OTHER_FONT_COLOR_PRESS "#FFFFFF"
+
+//numbers
+#define KEYBOARD_FIXED_DEFAULT_NUMBER_L1 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
+#define KEYBOARD_FIXED_DEFAULT_NUMBER_L2 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
+#define KEYBOARD_FIXED_DEFAULT_NUMBER_L3 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
+#define KEYBOARD_FIXED_DEFAULT_NUMBER_L4 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
+
+#define KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH 306 // 数字按钮宽度
+#define KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT 72 // 数字按钮高度
+#define KEYBOARD_FIXED_DEFAULT_NUMBER_CHARS_HEIGHT 230 // 数字字符按钮高度
+
+// chars more
+
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_L1 (KEYBOARD_FIXED_DEFAULT_LMARGIN+0)
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_HSPACING 16
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_VSPACING 16
+
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_COLS 6
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_WIDTH 1350 // 字符列表宽度
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_LIST_HEIGHT 315 // 字符列表高度
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_WIDTH 214 // 按钮宽度
+#define KEYBOARD_FIXED_DEFAULT_CHARSMORE_BTN_HEIGHT 94 // 功能按钮高度
+#define KEYBOARD_FIXED_DEFAULT_NORMAL_CHARSMORE_BTN_HEIGHT 80 // 符号按钮高度
+
+//iconsize
+#define KEYBOARD_FIXED_DEFAULT_ICONSIZE QSize(25, 25)
+
+//keyName
+#define PAGE_CHAR "page_char"
+#define PAGE_NUMBER "page_number"
+#define PAGE_CHARSMORE "page_charmore"
+#define PAGE_LETTER "page_letter"
+#define BTN_FLOAT "float"
+#define BTN_CLOSE "close"
+#define BTN_RETURN "return"
+#define BTN_BACK "backspace"
+#define BTN_ENTER "enter"
+#define BTN_SHIFT "shift"
+#define BTN_CTRL "ctrl"
+#define BTN_ALT "alt"
+#define BTN_SPACE "space"
+#define BTN_RIGHT "right"
+#define BTN_LEFT "left"
+#define BTN_CAPSLOCK "capslock"
+
+
+
+#endif // COMMONDEF_H
diff --git a/VirtualKeyboard/src/cursormonitor.cpp b/VirtualKeyboard/src/cursormonitor.cpp
index 2c76123..9553a60 100644
--- a/VirtualKeyboard/src/cursormonitor.cpp
+++ b/VirtualKeyboard/src/cursormonitor.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include "cursormonitor.h"
#include
diff --git a/VirtualKeyboard/src/dragwidget.cpp b/VirtualKeyboard/src/dragwidget.cpp
new file mode 100644
index 0000000..db8a332
--- /dev/null
+++ b/VirtualKeyboard/src/dragwidget.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "dragwidget.h"
+#include
+#include
+#include
+#include "commondef.h"
+
+DragWidget::DragWidget(QWidget *parent/* = nullptr*/)
+ : QWidget(parent)
+{
+ setAttribute(Qt::WA_TranslucentBackground);//背景透明
+ initUI();
+}
+
+DragWidget::~DragWidget()
+{
+
+}
+
+void DragWidget::initUI()
+{
+ setFixedHeight(KEYBOARD_DRAG_DEFAULT_HEIGHT);
+
+ m_labelDrag = new QLabel(this);
+ m_labelDrag->setPixmap(QPixmap(":/images/images/drag.svg"));
+ m_labelDrag->setGeometry((KEYBOARD_PARENT_DEFAULT_WIDTH - KEYBOARD_TITLEBTN_DEFAULT_WIDTH)/2,
+ (this->height() - KEYBOARD_TITLEBTN_DEFAULT_HEIGHT)/2,
+ KEYBOARD_TITLEBTN_DEFAULT_WIDTH, KEYBOARD_TITLEBTN_DEFAULT_HEIGHT);
+ m_mapSubGeometrys[m_labelDrag] = m_labelDrag->geometry();
+}
+
+void DragWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
+{
+ setFixedHeight(KEYBOARD_DRAG_DEFAULT_HEIGHT*lfHeightScale);
+ QMap::iterator itGeometry = m_mapSubGeometrys.begin();
+ for (; itGeometry != m_mapSubGeometrys.end(); itGeometry ++) {
+ QLabel *label = itGeometry.key();
+ if (label) {
+ QRect oldGeometry = itGeometry.value();
+ QRect newGeometry = oldGeometry;
+ if (floatStatus) {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ } else {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ }
+ label->setGeometry(newGeometry);
+ }
+ }
+}
diff --git a/VirtualKeyboard/src/dragwidget.h b/VirtualKeyboard/src/dragwidget.h
new file mode 100644
index 0000000..e8b1527
--- /dev/null
+++ b/VirtualKeyboard/src/dragwidget.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef DRAGWIDGET_H
+#define DRAGWIDGET_H
+
+#include
+#include
+#include
+
+class DragWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ DragWidget(QWidget *parent = nullptr);
+ virtual ~DragWidget();
+
+public:
+ void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
+
+private:
+ void initUI();
+
+private:
+ QLabel *m_labelDrag = nullptr;
+ QMap m_mapSubGeometrys;
+};
+
+#endif // DRAGWIDGET_H
diff --git a/VirtualKeyboard/src/fakekeyboard.h b/VirtualKeyboard/src/fakekeyboard.h
new file mode 100644
index 0000000..65a22ce
--- /dev/null
+++ b/VirtualKeyboard/src/fakekeyboard.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef FAKEKEYBOARD_H
+#define FAKEKEYBOARD_H
+
+#include
+#include
+
+class Modifier : public QObject
+{
+ Q_OBJECT
+public:
+ Modifier(){}
+
+ enum MOD{
+ UNKNOWN = -1,
+ CTRL,
+ SHIFT,
+ ALT,
+ SUPER
+ };
+ Q_ENUM(MOD)
+
+ static QString getModifierName(int mod)
+ {
+ QMetaEnum metaEnum = QMetaEnum::fromType();
+ const char* modName = metaEnum.valueToKey(mod);
+ QString result = QString(modName).toLower();
+ return result;
+ }
+ static MOD getModifier(const QString &modName)
+ {
+ QMetaEnum metaEnum = QMetaEnum::fromType();
+ MOD mod = (MOD)metaEnum.keyToValue(modName.toUpper().toLocal8Bit().data());
+ return mod;
+ }
+};
+
+class FuncKey : public QObject
+{
+ Q_OBJECT
+public:
+ FuncKey(){}
+
+ enum FUNCKEY {
+ UNKNOWN = -1,
+ SPACE = 0,
+ BACKSPACE,
+ ENTER,
+ HOME,
+ END,
+ PGUP,
+ PGDN,
+ INSERT,
+ DELETE,
+ UP,
+ DOWN,
+ LEFT,
+ RIGHT,
+ CAPSLOCK
+ };
+ Q_ENUM(FUNCKEY)
+ static QString getKeyName(int key)
+ {
+ QMetaEnum metaEnum = QMetaEnum::fromType();
+ const char* keyName = metaEnum.valueToKey(key);
+ QString result = QString(keyName).toLower();
+ return result;
+ }
+ static FUNCKEY getKey(const QString &keyName)
+ {
+ QMetaEnum metaEnum = QMetaEnum::fromType();
+ FUNCKEY key = (FUNCKEY)metaEnum.keyToValue(keyName.toUpper().toLocal8Bit().data());
+ return key;
+ }
+};
+
+class FakeKeyboard : public QObject
+{
+ Q_OBJECT
+public:
+ explicit FakeKeyboard(QObject *parent = nullptr)
+ : QObject(parent)
+ {
+
+ }
+
+ virtual void addModifier(Modifier::MOD mod) = 0;
+ virtual void removeModifier(Modifier::MOD mod) = 0;
+ virtual bool hasModifier(Modifier::MOD mod) = 0;
+ virtual QList getAllModifier() = 0;
+ virtual void clearModifier() = 0;
+
+public Q_SLOTS:
+ virtual void onKeyPressed(QChar c) = 0;
+ virtual void onKeyPressed(FuncKey::FUNCKEY key) = 0;
+};
+
+#endif // FAKEKEYBOARD_H
diff --git a/VirtualKeyboard/src/images/backspace.svg b/VirtualKeyboard/src/images/backspace.svg
deleted file mode 100644
index 092d72d..0000000
--- a/VirtualKeyboard/src/images/backspace.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/backspace_click.svg b/VirtualKeyboard/src/images/backspace_click.svg
deleted file mode 100644
index 4a9d7fa..0000000
--- a/VirtualKeyboard/src/images/backspace_click.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/capslock.svg b/VirtualKeyboard/src/images/capslock.svg
deleted file mode 100644
index a5a367c..0000000
--- a/VirtualKeyboard/src/images/capslock.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/capslock_click.svg b/VirtualKeyboard/src/images/capslock_click.svg
deleted file mode 100644
index 36ae8f8..0000000
--- a/VirtualKeyboard/src/images/capslock_click.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/capslock_hl.svg b/VirtualKeyboard/src/images/capslock_hl.svg
deleted file mode 100644
index 4f8870a..0000000
--- a/VirtualKeyboard/src/images/capslock_hl.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/capslock_hl_click.svg b/VirtualKeyboard/src/images/capslock_hl_click.svg
deleted file mode 100644
index 65b0a21..0000000
--- a/VirtualKeyboard/src/images/capslock_hl_click.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/close.svg b/VirtualKeyboard/src/images/close.svg
index c509415..ba56780 100644
--- a/VirtualKeyboard/src/images/close.svg
+++ b/VirtualKeyboard/src/images/close.svg
@@ -1,22 +1,4 @@
-
-
-
+
diff --git a/VirtualKeyboard/src/images/close_click.svg b/VirtualKeyboard/src/images/close_click.svg
deleted file mode 100644
index d143065..0000000
--- a/VirtualKeyboard/src/images/close_click.svg
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/delet.svg b/VirtualKeyboard/src/images/delet.svg
new file mode 100644
index 0000000..b290563
--- /dev/null
+++ b/VirtualKeyboard/src/images/delet.svg
@@ -0,0 +1,5 @@
+
diff --git a/VirtualKeyboard/src/images/down.svg b/VirtualKeyboard/src/images/down.svg
deleted file mode 100644
index 73361dd..0000000
--- a/VirtualKeyboard/src/images/down.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/down_click.svg b/VirtualKeyboard/src/images/down_click.svg
deleted file mode 100644
index 9140b38..0000000
--- a/VirtualKeyboard/src/images/down_click.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/drag.svg b/VirtualKeyboard/src/images/drag.svg
new file mode 100644
index 0000000..9bc4dac
--- /dev/null
+++ b/VirtualKeyboard/src/images/drag.svg
@@ -0,0 +1,3 @@
+
diff --git a/VirtualKeyboard/src/images/enter.svg b/VirtualKeyboard/src/images/enter.svg
index 5cbc51d..9c09d11 100644
--- a/VirtualKeyboard/src/images/enter.svg
+++ b/VirtualKeyboard/src/images/enter.svg
@@ -1,11 +1,4 @@
-
-
-
+
diff --git a/VirtualKeyboard/src/images/enter_click.svg b/VirtualKeyboard/src/images/enter_click.svg
deleted file mode 100644
index 106cc7b..0000000
--- a/VirtualKeyboard/src/images/enter_click.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/float-restore.svg b/VirtualKeyboard/src/images/float-restore.svg
new file mode 100644
index 0000000..3349d01
--- /dev/null
+++ b/VirtualKeyboard/src/images/float-restore.svg
@@ -0,0 +1,6 @@
+
diff --git a/VirtualKeyboard/src/images/float.svg b/VirtualKeyboard/src/images/float.svg
new file mode 100644
index 0000000..a24e50f
--- /dev/null
+++ b/VirtualKeyboard/src/images/float.svg
@@ -0,0 +1,6 @@
+
diff --git a/VirtualKeyboard/src/images/left.svg b/VirtualKeyboard/src/images/left.svg
index 6ac0fa8..f614a70 100644
--- a/VirtualKeyboard/src/images/left.svg
+++ b/VirtualKeyboard/src/images/left.svg
@@ -1,7 +1,3 @@
-
-
-
+
diff --git a/VirtualKeyboard/src/images/left_click.svg b/VirtualKeyboard/src/images/left_click.svg
deleted file mode 100644
index edfd291..0000000
--- a/VirtualKeyboard/src/images/left_click.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/rectangle.svg b/VirtualKeyboard/src/images/rectangle.svg
new file mode 100644
index 0000000..7ffef85
--- /dev/null
+++ b/VirtualKeyboard/src/images/rectangle.svg
@@ -0,0 +1,3 @@
+
diff --git a/VirtualKeyboard/src/images/right.svg b/VirtualKeyboard/src/images/right.svg
index 62c301c..9922eb7 100644
--- a/VirtualKeyboard/src/images/right.svg
+++ b/VirtualKeyboard/src/images/right.svg
@@ -1,6 +1,3 @@
-
-
-
+
diff --git a/VirtualKeyboard/src/images/right_click.svg b/VirtualKeyboard/src/images/right_click.svg
deleted file mode 100644
index 5ba0ec6..0000000
--- a/VirtualKeyboard/src/images/right_click.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/shift.svg b/VirtualKeyboard/src/images/shift.svg
new file mode 100644
index 0000000..6a3b438
--- /dev/null
+++ b/VirtualKeyboard/src/images/shift.svg
@@ -0,0 +1,3 @@
+
diff --git a/VirtualKeyboard/src/images/shift_lock.svg b/VirtualKeyboard/src/images/shift_lock.svg
new file mode 100644
index 0000000..09d5c99
--- /dev/null
+++ b/VirtualKeyboard/src/images/shift_lock.svg
@@ -0,0 +1,4 @@
+
diff --git a/VirtualKeyboard/src/images/space.svg b/VirtualKeyboard/src/images/space.svg
new file mode 100644
index 0000000..b5b9769
--- /dev/null
+++ b/VirtualKeyboard/src/images/space.svg
@@ -0,0 +1,10 @@
+
diff --git a/VirtualKeyboard/src/images/super.svg b/VirtualKeyboard/src/images/super.svg
deleted file mode 100644
index c847e44..0000000
--- a/VirtualKeyboard/src/images/super.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/VirtualKeyboard/src/images/super_click.svg b/VirtualKeyboard/src/images/super_click.svg
deleted file mode 100644
index 7fcc495..0000000
--- a/VirtualKeyboard/src/images/super_click.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/VirtualKeyboard/src/images/unlock.svg b/VirtualKeyboard/src/images/unlock.svg
new file mode 100644
index 0000000..17271fd
--- /dev/null
+++ b/VirtualKeyboard/src/images/unlock.svg
@@ -0,0 +1,5 @@
+
diff --git a/VirtualKeyboard/src/images/up.svg b/VirtualKeyboard/src/images/up.svg
deleted file mode 100644
index d5613b2..0000000
--- a/VirtualKeyboard/src/images/up.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/images/up_click.svg b/VirtualKeyboard/src/images/up_click.svg
deleted file mode 100644
index 225e401..0000000
--- a/VirtualKeyboard/src/images/up_click.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
diff --git a/VirtualKeyboard/src/kbbutton.cpp b/VirtualKeyboard/src/kbbutton.cpp
new file mode 100644
index 0000000..d593793
--- /dev/null
+++ b/VirtualKeyboard/src/kbbutton.cpp
@@ -0,0 +1,182 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "kbbutton.h"
+#include "commondef.h"
+#include
+#include
+
+KBButton::KBButton(QWidget *parent/* = nullptr*/)
+ : QPushButton(parent)
+{
+ this->installEventFilter(this);
+ this->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
+ this->setFocusPolicy(Qt::NoFocus);
+ connect(this, &QPushButton::clicked, this, [&,this]() {
+ if (m_charId.isLetter()) {
+ if (m_isShift) {
+ if (m_isCaps) {
+ m_charId = m_charId.toLower();
+ } else {
+ m_charId = m_charId.toUpper();
+ }
+ } else {
+ if (m_isCaps) {
+ m_charId = m_charId.toUpper();
+ } else {
+ m_charId = m_charId.toLower();
+ }
+ }
+ }
+ Q_EMIT clicked(m_charId);
+ });
+}
+
+KBButton::~KBButton()
+{
+
+}
+
+bool KBButton::eventFilter(QObject *watched, QEvent *event)
+{
+ if (m_clrNormal == KEYBOARD_LETTER_COLOR_NORMAL)
+ return QPushButton::eventFilter(watched, event);
+ if (event->type() == QEvent::MouseButtonPress) {
+ QPixmap pressIcon = this->icon().pixmap(QSize(24, 24));
+ pressIcon = drawSymbolicColoredPixmap(pressIcon, "white");
+ this->setIcon(pressIcon);
+ } else if (event->type() == QEvent::MouseButtonRelease) {
+ QPixmap releaseIcon = this->icon().pixmap(QSize(24, 24));
+ releaseIcon = drawSymbolicColoredPixmap(releaseIcon, "black");
+ this->setIcon(releaseIcon);
+ }
+ return QPushButton::eventFilter(watched, event);
+}
+
+void KBButton::setCharId(QChar charId)
+{
+ m_charId = charId;
+ if (charId == '&') {
+ setText("&&");
+ } else {
+ setText(m_charId);
+ }
+}
+
+void KBButton::updateStyleSheet(QString clrNormal, QString clrHover, QString clrChecked, QString clrBoard, QString clrBoardPress, QString clrFontPress, int radius, bool is_lock)
+{
+ QString strBorderRadius = QString("border-top-left-radius: %1px; border-top-right-radius: %2px; border-bottom-right-radius: %3px;border-bottom-left-radius: %4px;")
+ .arg((radius&BORDER_RADIUS_LT)?8:0)
+ .arg((radius&BORDER_RADIUS_TR)?8:0)
+ .arg((radius&BORDER_RADIUS_RB)?8:0)
+ .arg((radius&BORDER_RADIUS_LB)?8:0);
+ if (!is_lock) {
+ setStyleSheet(QString("QPushButton{%1 border: 2px solid %2; border-width: 0px 0px 2px 0px; background: %3; color: #262626}"
+ // "QPushButton:hover{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5;}"
+ "QPushButton:pressed{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5; color: %6}"
+ "QPushButton:checked{border: 2px solid %7; border-width: 2px 0px 0px 0px; background: %8; color: %9}")
+ .arg(strBorderRadius).arg(clrBoard).arg(clrNormal).arg(clrBoardPress).arg(clrHover).arg(clrFontPress).arg(clrBoardPress).arg(clrChecked).arg(clrFontPress)
+ );
+ } else {
+ setStyleSheet(QString("QPushButton{%1 border: 2px solid %2; border-width: 0px 0px 2px 0px; background: %3; color: #FFFFFF}"
+ // "QPushButton:hover{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5;}"
+ "QPushButton:pressed{border: 2px solid %4; border-width: 2px 0px 0px 0px; background: %5; color: %6}"
+ "QPushButton:checked{border: 2px solid %7; border-width: 2px 0px 0px 0px; background: %8; color: %9}")
+ .arg(strBorderRadius).arg(clrBoard).arg(clrNormal).arg(clrBoardPress).arg(clrHover).arg(clrFontPress).arg(clrBoardPress).arg(clrChecked).arg(clrFontPress)
+ );
+ }
+ m_clrBoard = clrBoard;
+ m_clrNormal = clrNormal;
+ m_clrBoardPress = clrBoardPress;
+ m_clrHover = clrHover;
+ m_clrChecked = clrChecked;
+ if (m_clrNormal == KEYBOARD_LETTER_COLOR_NORMAL) {
+ sysFont.setPixelSize(32);
+ this->setFont(sysFont);
+ this->setIconSize(QSize(32, 32));
+ } else {
+ sysFont.setPixelSize(24);
+ this->setFont(sysFont);
+ this->setIconSize(QSize(24, 24));
+ }
+}
+
+QPixmap KBButton::drawSymbolicColoredPixmap(const QPixmap &source, QString cgColor)
+{
+ QImage img = source.toImage();
+ for (int x = 0; x < img.width(); x++) {
+ for (int y = 0; y < img.height(); y++) {
+ auto color = img.pixelColor(x, y);
+ if (color.alpha() > 0) {
+ if ( "white" == cgColor) {
+ color.setRed(255);
+ color.setGreen(255);
+ color.setBlue(255);
+ img.setPixelColor(x, y, color);
+ } else if( "black" == cgColor) {
+ color.setRed(0);
+ color.setGreen(0);
+ color.setBlue(0);
+ img.setPixelColor(x, y, color);
+ } else if ("gray"== cgColor) {
+ color.setRed(152);
+ color.setGreen(163);
+ color.setBlue(164);
+ img.setPixelColor(x, y, color);
+ } else if ("blue" == cgColor){
+ color.setRed(61);
+ color.setGreen(107);
+ color.setBlue(229);
+ img.setPixelColor(x, y, color);
+ } else {
+ return source;
+ }
+ }
+ }
+ }
+ return QPixmap::fromImage(img);
+}
+
+void KBButton::setShiftState(bool isShift)
+{
+ if (m_isShift != isShift) {
+ if (m_charId.isLetter()) {
+ if (isShift) {
+ setText(m_charId.toUpper());
+ } else {
+ setText(m_charId.toLower());
+ }
+ }
+ m_isShift = isShift;
+ }
+}
+
+void KBButton::setCapsStatus(bool isCaps)
+{
+ m_isCaps = isCaps;
+ setShiftState(m_isCaps);
+}
+
+void KBButton::setCtrlState(bool isCtrl)
+{
+
+}
+
+void KBButton::setAltState(bool isAlt)
+{
+
+}
diff --git a/VirtualKeyboard/src/kbbutton.h b/VirtualKeyboard/src/kbbutton.h
new file mode 100644
index 0000000..923fa2e
--- /dev/null
+++ b/VirtualKeyboard/src/kbbutton.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef KBBUTTON_H
+#define KBBUTTON_H
+
+#include
+
+class KBButton : public QPushButton
+{
+ Q_OBJECT
+public:
+ enum BORDER_RADIUS{
+ BORDER_RADIUS_NONE,
+ BORDER_RADIUS_LT = 1,
+ BORDER_RADIUS_TR = 2,
+ BORDER_RADIUS_RB = 4,
+ BORDER_RADIUS_LB = 8,
+ BORDER_RADIUS_ALL = 0xF,
+ };
+ KBButton(QWidget *parent = nullptr);
+ virtual ~KBButton();
+
+ void setCharId(QChar charId);
+ void updateStyleSheet(QString clrNormal, QString clrHover, QString clrChecked, QString clrBoard, QString clrBoardPress, QString clrFontPress, int radius = BORDER_RADIUS_ALL, bool is_lock = false);
+ void setShiftState(bool isShift);
+ void setCapsStatus(bool isCaps);
+ void setCtrlState(bool isCtrl);
+ void setAltState(bool isAlt);
+
+protected:
+ bool eventFilter(QObject *watched, QEvent *event);
+
+Q_SIGNALS:
+ void clicked(QChar charId);
+
+private:
+ QPixmap drawSymbolicColoredPixmap(const QPixmap &source, QString cgColor);
+
+private:
+ int m_nKeyId = -1;
+ bool m_isShift = false;
+ bool m_isCtrl = false;
+ bool m_isAlt = false;
+ bool m_isCaps = false;
+ QChar m_charId = QChar::Null;
+ QString m_clrBoard;
+ QString m_clrNormal;
+ QString m_clrBoardPress;
+ QString m_clrHover;
+ QString m_clrChecked;
+ QFont sysFont;
+};
+
+#endif // KBBUTTON_H
diff --git a/VirtualKeyboard/src/kbtitle.cpp b/VirtualKeyboard/src/kbtitle.cpp
new file mode 100644
index 0000000..1d270cc
--- /dev/null
+++ b/VirtualKeyboard/src/kbtitle.cpp
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "kbtitle.h"
+#include
+#include
+#include "commondef.h"
+#include
+
+KBTitle::KBTitle(QWidget *parent/* = nullptr*/)
+ : QWidget(parent)
+{
+ setAttribute(Qt::WA_TranslucentBackground);//背景透明
+ initUI();
+ initConnections();
+}
+
+KBTitle::~KBTitle()
+{
+
+}
+
+void KBTitle::initUI()
+{
+ setFixedHeight(KEYBOARD_TITLE_DEFAULT_HEIGHT);
+ QString strBtnStyle = "QPushButton{ text-align:center; color: rgb(255, 255, 255, 255); border: none; border-radius: 4px; outline: none;}"
+ "QPushButton:hover{ background-color: rgb(255,255,255,15%); }"
+ "QPushButton::pressed { background-color: rgba(255,255,255,40%); }"
+ "QPushButton::checked { background-color: rgba(255,255,255,40%); }";
+
+ m_btnFloat = new QPushButton(this);
+ m_btnFloat->setFlat(true);
+ m_btnFloat->setIcon(QIcon(":/images/images/float.svg"));
+ m_btnFloat->setObjectName("btn_float");
+ m_btnFloat->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
+ m_btnFloat->setGeometry(1484, 8, KEYBOARD_TITLEBTN_DEFAULT_WIDTH, KEYBOARD_TITLEBTN_DEFAULT_HEIGHT);
+ m_btnFloat->setStyleSheet(strBtnStyle);
+ m_mapSubGeometrys[m_btnFloat] = m_btnFloat->geometry();
+
+ m_btnClose = new QPushButton(this);
+ m_btnClose->setFlat(true);
+ m_btnClose->setIcon(QIcon(":/images/images/close.svg"));
+ m_btnClose->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
+ m_btnClose->setObjectName("btn_close");
+ m_btnClose->setGeometry(1548, 8, KEYBOARD_TITLEBTN_DEFAULT_WIDTH, KEYBOARD_TITLEBTN_DEFAULT_HEIGHT);
+ m_btnClose->setStyleSheet(strBtnStyle);
+ m_mapSubGeometrys[m_btnClose] = m_btnClose->geometry();
+}
+
+void KBTitle::initConnections()
+{
+ connect(m_btnFloat, &QPushButton::clicked, this, &KBTitle::onBtnClicked);
+ connect(m_btnClose, &QPushButton::clicked, this, &KBTitle::onBtnClicked);
+}
+
+void KBTitle::onBtnClicked()
+{
+ QObject *obj = sender();
+ QPushButton *btn = static_cast(obj);
+ QString objName = btn->objectName();
+ int lastUnderline = objName.lastIndexOf('_');
+ int start = strlen("btn_");
+ int keyLength = lastUnderline - start;
+ QString keyName = objName.mid(start, keyLength);
+ if (keyName == BTN_FLOAT) {
+ if (floatStatus) {
+ btn->setIcon(QIcon(":/images/images/float.svg"));
+ } else {
+ btn->setIcon(QIcon(":/images/images/float-restore.svg"));
+ }
+ floatStatus = !floatStatus;
+ }
+
+ Q_EMIT btnClicked(keyName);
+}
+
+void KBTitle::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
+{
+ setFixedHeight(KEYBOARD_TITLE_DEFAULT_HEIGHT*lfHeightScale);
+ QMap::iterator itGeometry = m_mapSubGeometrys.begin();
+ for (; itGeometry != m_mapSubGeometrys.end(); itGeometry ++) {
+ QPushButton *button = itGeometry.key();
+ if (button) {
+ QRect oldGeometry = itGeometry.value();
+ QRect newGeometry = oldGeometry;
+ if (floatStatus) {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ } else {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ }
+ button->setGeometry(newGeometry);
+ }
+ }
+}
diff --git a/VirtualKeyboard/src/kbtitle.h b/VirtualKeyboard/src/kbtitle.h
new file mode 100644
index 0000000..cda3263
--- /dev/null
+++ b/VirtualKeyboard/src/kbtitle.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef KBTITLE_H
+#define KBTITLE_H
+
+#include
+#include
+#include
+
+class KBTitle : public QWidget
+{
+ Q_OBJECT
+public:
+ KBTitle(QWidget *parent = nullptr);
+ virtual ~KBTitle();
+
+public:
+ void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
+
+public Q_SLOTS:
+ void onBtnClicked();
+
+Q_SIGNALS:
+ void btnClicked(QString keyName);
+
+private:
+ void initUI();
+ void initConnections();
+
+private:
+ QPushButton *m_btnFloat = nullptr;
+ QPushButton *m_btnClose = nullptr;
+ QMap m_mapSubGeometrys;
+ bool floatStatus = false;
+};
+
+#endif // KBTITLE_H
diff --git a/VirtualKeyboard/src/keyboard.qrc b/VirtualKeyboard/src/keyboard.qrc
index 4e38067..a5e482e 100644
--- a/VirtualKeyboard/src/keyboard.qrc
+++ b/VirtualKeyboard/src/keyboard.qrc
@@ -1,27 +1,17 @@
-
- keyboard.qss
-
- images/backspace_click.svg
- images/backspace.svg
- images/capslock_click.svg
- images/capslock_hl.svg
- images/capslock.svg
- images/down_click.svg
- images/down.svg
- images/enter_click.svg
images/enter.svg
- images/left_click.svg
images/left.svg
- images/right_click.svg
images/right.svg
- images/super_click.svg
- images/super.svg
- images/up.svg
- images/close_click.svg
images/close.svg
- images/capslock_hl_click.svg
- images/up_click.svg
+ images/unlock.svg
+ images/space.svg
+ images/shift.svg
+ images/float.svg
+ images/float-restore.svg
+ images/drag.svg
+ images/delet.svg
+ images/shift_lock.svg
+ images/rectangle.svg
diff --git a/VirtualKeyboard/src/keyboard.qss b/VirtualKeyboard/src/keyboard.qss
deleted file mode 100644
index e91e23c..0000000
--- a/VirtualKeyboard/src/keyboard.qss
+++ /dev/null
@@ -1,37 +0,0 @@
-QPushButton
-{
- border: none;
- font: 24px;
- color: white;
- background: #35322f;
- border-radius: 5px;
-}
-
-QPushButton::pressed
-{
- color: gray;
- background: #2a2826;
-}
-
-#btn_backspace, #btn_enter, #btn_shift_l,
-#btn_shift_r, #btn_ctrl_l, #btn_ctrl_r,
-#btn_alt_l, #btn_alt_r, #btn_super
-{
- font: 16px;
- background: #1e1b18
-}
-
-#btn_backspace::pressed, #btn_enter::pressed, #btn_shift_l::pressed,
-#btn_shift_r::pressed, #btn_ctrl_l::pressed, #btn_ctrl_r::pressed,
-#btn_alt_l::pressed, #btn_alt_r::pressed, #btn_super::pressed
-{
- background: #181613;
- color: gray;
-}
-
-#btn_letter, #btn_symbol, #btn_number,
-#btn_insert, #btn_delete, #btn_home,
-#btn_end, #btn_pgup, #btn_pgdn, #btn_close
-{
- font: 16px;
-}
diff --git a/VirtualKeyboard/src/keyboardwidget.cpp b/VirtualKeyboard/src/keyboardwidget.cpp
deleted file mode 100644
index e97a710..0000000
--- a/VirtualKeyboard/src/keyboardwidget.cpp
+++ /dev/null
@@ -1,459 +0,0 @@
-/**
- * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
-**/
-#include "keyboardwidget.h"
-#include "ui_keyboardwidget.h"
-#include
-#include
-#include
-
-#define SYMBOL_KEY_COUNT 29
-#define SYMBOL_PAGE_COUNT 2
-
-#define BUTTON_BG "QPushButton{background:#1E1B18}"
-#define BUTTON_BG_PRESSED "QPushButton{background: #181613;}"
-#define BUTTON_BG_HL "QPushButton{background:#80c342}"
-#define BUTTON_BG_HL_PRESSED "QPushButton{background:#486E25}"
-
-
-QChar symbols[SYMBOL_PAGE_COUNT][SYMBOL_KEY_COUNT] =
- { {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p',
- 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l',
- 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/'},
- {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
- '`', '-', '=', '[', ']', '\\', '|', '{', '}',
- '~','<', '>', ':', ';', '\'', '"', '_', '+', '?'}};
-
-
-KeyboardWidget::KeyboardWidget(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::KeyboardWidget),
- capsLock(false),
- isShift(false),
- page(0)
-{
- vKeyboard = new X11Keyboard(this);
- connect(this, SIGNAL(keyPressed(QChar)),
- vKeyboard, SLOT(onKeyPressed(QChar)));
- connect(this, SIGNAL(keyPressed(FuncKey::FUNCKEY)),
- vKeyboard, SLOT(onKeyPressed(FuncKey::FUNCKEY)));
-
- ui->setupUi(this);
- bindSingal();
- setDefaultIcon();
-}
-
-KeyboardWidget::~KeyboardWidget()
-{
- delete ui;
-}
-
-void KeyboardWidget::resizeEvent(QResizeEvent */*event*/)
-{
- int w = width();
- int h = height();
- int mainLeftMargin = ui->hl_main->contentsMargins().left();
- int mainRightMargin = ui->hl_main->contentsMargins().right();
- int mainTopMargin = ui->hl_main->contentsMargins().left();
- int mainBottomMargin = ui->hl_main->contentsMargins().right();
- int mainSpacing = ui->hl_main->spacing();
- int itemSpacing = ui->hl_1->spacing();
-
- int btnWidthCount = w - 11 * itemSpacing - mainSpacing- mainLeftMargin - mainRightMargin;
- int btnHeightCount = h - 3 * itemSpacing - mainTopMargin - mainBottomMargin;
- double btnWidth = btnWidthCount / 12;
- double btnHeight = btnHeightCount / 4;
- for(int i = 0; i <= 28; i++) {
- QString btnObjName = "btn_" + QString::number(i);
- QPushButton *btn = ui->page_letter->findChild(btnObjName);
- btn->setFixedSize(btnWidth, btnHeight);
- }
- ui->btn_ctrl_l->setFixedSize(btnWidth * 1.3, btnHeight);
- ui->btn_ctrl_r->setFixedSize(btnWidth * 1.3, btnHeight);
- ui->btn_alt_l->setFixedSize(btnWidth, btnHeight);
- ui->btn_alt_r->setFixedSize(btnWidth, btnHeight);
- ui->btn_super->setFixedSize(btnWidth, btnHeight);
- ui->btn_shift_l->setFixedSize(btnWidth, btnHeight);
- ui->btn_shift_r->setFixedHeight(btnHeight);
- ui->spacer_2->changeSize(btnWidth / 2, 20);
-
-
- for(int i = 1; i <= 9; i++) {
- QString btnObjName = "btn_num_" + QString::number(i);
- QPushButton *btn = ui->page_number->findChild(btnObjName);
- btn->setFixedWidth(btnWidth);
- }
- ui->btn_backspace_num->setFixedSize(btnWidth,btnHeight);
- ui->btn_insert->setFixedWidth(btnWidth);
- ui->btn_delete->setFixedWidth(btnWidth);
- ui->btn_home->setFixedWidth(btnWidth);
- ui->btn_end->setFixedWidth(btnWidth);
- ui->btn_pgup->setFixedWidth(btnWidth);
- ui->btn_pgdn->setFixedWidth(btnWidth);
- ui->btn_up->setFixedSize(btnWidth,btnHeight);
- ui->btn_down->setFixedSize(btnWidth,btnHeight);
- ui->btn_left->setFixedSize(btnWidth,btnHeight);
- ui->btn_right->setFixedSize(btnWidth,btnHeight);
-
- ui->btn_close->setFixedHeight(btnHeight);
- ui->btn_letter->setFixedHeight(btnHeight);
- ui->btn_symbol->setFixedHeight(btnHeight);
- ui->btn_number->setFixedHeight(btnHeight);
-
- setIconSize();
-}
-
-float hScale = 0.6;
-float wScale = hScale;
-#define SET_ICON_SIZE_SCALE(btn) \
- ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->width() * hScale, ui->btn_##btn->height() * wScale));
-
-#define SET_ICON_SIZE(btn) \
- ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->width(), ui->btn_##btn->height()));
-
-#define SET_SHIFT_ICON_SIZE_SCALE(btn) \
- ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->height() * 0.4, ui->btn_##btn->height() * 0.4));
-
-#define SET_ENTER_ICON_SIZE_SCALE(btn) \
- ui->btn_##btn->setIconSize(QSize(ui->btn_##btn->width() * 0.4, ui->btn_##btn->height() * 0.4));
-
-void KeyboardWidget::setIconSize()
-{
- SET_ICON_SIZE_SCALE(backspace);
- SET_ICON_SIZE_SCALE(backspace_num);
- SET_ENTER_ICON_SIZE_SCALE(enter);
- SET_ICON_SIZE_SCALE(enter_num);
- SET_ICON_SIZE_SCALE(close);
- SET_ICON_SIZE_SCALE(super);
-
- SET_SHIFT_ICON_SIZE_SCALE(shift_l);
- SET_SHIFT_ICON_SIZE_SCALE(shift_r);
- SET_ICON_SIZE(up);
- SET_ICON_SIZE(down);
- SET_ICON_SIZE(left);
- SET_ICON_SIZE(right);
-}
-
-void KeyboardWidget::bindSingal()
-{
- for(auto obj : ui->page_letter->children()) {
- if(obj->metaObject()->className() == QString("QPushButton")) {
- QPushButton *btn = static_cast(obj);
- btn->setFocusPolicy(Qt::NoFocus);
- connect(btn, &QPushButton::clicked, this, &KeyboardWidget::onButtonClicked);
- connect(btn, &QPushButton::pressed, this, &KeyboardWidget::onButtonPressed);
- connect(btn, &QPushButton::released, this, &KeyboardWidget::onButtonReleased);
- }
- }
- for(auto obj : ui->page_number->children()) {
- if(obj->metaObject()->className() == QString("QPushButton")) {
- QPushButton *btn = static_cast(obj);
- btn->setFocusPolicy(Qt::NoFocus);
- connect(btn, &QPushButton::clicked, this, &KeyboardWidget::onButtonClicked);
- connect(btn, &QPushButton::pressed, this, &KeyboardWidget::onButtonPressed);
- connect(btn, &QPushButton::released, this, &KeyboardWidget::onButtonReleased);
- }
- }
- ui->btn_close->setFocusPolicy(Qt::NoFocus);
- ui->btn_letter->setFocusPolicy(Qt::NoFocus);
- ui->btn_symbol->setFocusPolicy(Qt::NoFocus);
- ui->btn_number->setFocusPolicy(Qt::NoFocus);
-
- connect(ui->btn_letter, &QPushButton::clicked, this, [&] {
- ui->stackedWidget->setCurrentWidget(ui->page_letter);
- page = 0;
- switchPage();
- });
- connect(ui->btn_symbol, &QPushButton::clicked, this, [&] {
- ui->stackedWidget->setCurrentWidget(ui->page_letter);
- page = 1;
- switchPage();
- });
- connect(ui->btn_number, &QPushButton::clicked, this, [&] {
- ui->stackedWidget->setCurrentWidget(ui->page_number);
- });
- connect(ui->btn_close, &QPushButton::clicked,
- this, &KeyboardWidget::aboutToClose);
-
- connect(ui->btn_close, &QPushButton::pressed,
- this, &KeyboardWidget::onButtonPressed);
- connect(ui->btn_close, &QPushButton::released,
- this, &KeyboardWidget::onButtonReleased);
-}
-
-void KeyboardWidget::setDefaultIcon()
-{
- ui->btn_backspace->setIcon(QIcon(":/images/images/backspace.svg"));
- ui->btn_backspace_num->setIcon(QIcon(":/images/images/backspace.svg"));
- ui->btn_enter->setIcon(QIcon(":/images/images/enter.svg"));
- ui->btn_enter_num->setIcon(QIcon(":/images/images/enter.svg"));
- ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_close->setIcon(QIcon(":/images/images/close.svg"));
- //ui->btn_super->setIcon(QIcon(":/images/images/super.svg"));
- ui->btn_super->setText("Super");
- ui->btn_up->setIcon(QIcon(":/images/images/up.svg"));
- ui->btn_down->setIcon(QIcon(":/images/images/down.svg"));
- ui->btn_left->setIcon(QIcon(":/images/images/left.svg"));
- ui->btn_right->setIcon(QIcon(":/images/images/right.svg"));
-}
-
-QString KeyboardWidget::getKeyName(QPushButton *btn)
-{
- QString objName = btn->objectName();
- int lastUnderline = objName.lastIndexOf('_');
- int start = strlen("btn_");
- int keyLength = lastUnderline - start;
- QString keyName = objName.mid(start, keyLength);
- return keyName;
-}
-
-void KeyboardWidget::changeFuncKeyStyle(QPushButton *btn, bool isPressed)
-{
- QString modName = getKeyName(btn);
- Modifier::MOD mod = Modifier::getModifier(modName);
-
- if(vKeyboard->hasModifier(mod)) {
- if(isPressed)
- btn->setStyleSheet(BUTTON_BG_HL_PRESSED);
- else
- btn->setStyleSheet(BUTTON_BG_HL);
- } else {
- if(isPressed)
- btn->setStyleSheet(BUTTON_BG_PRESSED);
- else
- btn->setStyleSheet(BUTTON_BG);
- }
-}
-
-void KeyboardWidget::changeShitKeyStyle(QPushButton *btn, bool isPressed)
-{
- if(page == 0){
- if(isShift) {
- if(capsLock){
- if(isPressed) {
- btn->setStyleSheet(BUTTON_BG_HL_PRESSED);
- btn->setIcon(QIcon(":/images/images/capslock_click.svg"));
- } else {
- btn->setStyleSheet(BUTTON_BG_HL);
- btn->setIcon(QIcon(":/images/images/capslock.svg"));
- }
- }
- else {
- if(isPressed)
- btn->setIcon(QIcon(":/images/images/capslock_hl_click.svg"));
- else
- btn->setIcon(QIcon(":/images/images/capslock_hl.svg"));
- }
- } else {
- if(isPressed)
- btn->setIcon(QIcon(":/images/images/capslock_click.svg"));
- else
- btn->setIcon(QIcon(":/images/images/capslock.svg"));
- }
- }
-}
-
-
-void KeyboardWidget::changeDirectKeyStyle(QPushButton *btn, bool isPressed)
-{
- QString keyName = getKeyName(btn);
- FuncKey::FUNCKEY key = FuncKey::getKey(keyName);
- if(key == FuncKey::UNKNOWN)
- return;
-
- QString iconName = QString(":/images/images/%1.svg").arg(keyName);
- QString iconNamePressed = QString(":/images/images/%1_click.svg").arg(keyName);
-
- if(isPressed)
- btn->setIcon(QIcon(iconNamePressed));
- else
- btn->setIcon(QIcon(iconName));
-}
-
-/**
- * @brief 修改按键样式
- * @param obj 按键
- * @param isPressed 按下或者松开
- */
-void KeyboardWidget::changeKeyStyle(QPushButton *btn, bool isPressed)
-{
- if(btn == ui->btn_ctrl_l || btn == ui->btn_ctrl_r ||
- btn == ui->btn_alt_l || btn == ui->btn_alt_r ||
- btn == ui->btn_super) {
- changeFuncKeyStyle(btn, isPressed);
- }
-
- if(btn == ui->btn_shift_l)
- changeShitKeyStyle(ui->btn_shift_l, isPressed);
- if(btn == ui->btn_shift_r)
- changeShitKeyStyle(ui->btn_shift_r, isPressed);
-
- changeDirectKeyStyle(btn, isPressed);
-}
-
-void KeyboardWidget::onButtonPressed()
-{
- QPushButton *btn = static_cast(sender());
- changeKeyStyle(btn, true);
-}
-
-void KeyboardWidget::onButtonReleased()
-{
- QPushButton *btn = static_cast(sender());
- changeKeyStyle(btn, false);
-}
-
-void KeyboardWidget::onButtonClicked()
-{
- QObject *obj = sender();
- if(obj->metaObject()->className() != QString("QPushButton"))
- return;
-
- QPushButton *btn = static_cast(obj);
- QString keyName = getKeyName(btn);
- qDebug() << "keyName: " << keyName;
-
- Modifier::MOD mod = Modifier::getModifier(keyName);
- FuncKey::FUNCKEY funcKey = FuncKey::getKey(keyName);
-
- if(keyName == "shift") {
- if(page == 0) {
- isShift = !isShift;
- if(isShift) { //第一次被按下
- capsLock = false;
- shiftLastClicked = QTime::currentTime();
- ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock_hl.svg"));
- ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock_hl.svg"));
- }
- else {
- int doubleClickInterval = QApplication::doubleClickInterval();
- if(shiftLastClicked.msecsTo(QTime::currentTime()) <= doubleClickInterval) {
- //shift键双击,锁定大写
- capsLock = true;
- isShift = true;
- ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_shift_l->setStyleSheet("QPushButton{background:#80c342}");
- ui->btn_shift_r->setStyleSheet("QPushButton{background:#80c342}");
- } else {
- ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_shift_l->setStyleSheet("QPushButton{background:#1e1b18}");
- ui->btn_shift_r->setStyleSheet("QPushButton{background:#1e1b18}");
- }
- }
- toggleCase();
- } else {
- page = page % (SYMBOL_PAGE_COUNT - 1) + 1;
- switchPage();
- }
- } else if(mod != Modifier::UNKNOWN) {
- if(vKeyboard->hasModifier(mod)) {
- vKeyboard->removeModifier(mod);
- btn->setStyleSheet(BUTTON_BG);
- btn->setStyleSheet(BUTTON_BG);
- } else {
- vKeyboard->addModifier(mod);
- btn->setStyleSheet(BUTTON_BG_HL);
- btn->setStyleSheet(BUTTON_BG_HL);
- }
- } else if(funcKey != FuncKey::UNKNOWN) {
- Q_EMIT keyPressed(funcKey);
- } else { //字符键
- QChar c;
- QString text = btn->text();
- qDebug() << "clicked button text: " << text;
- if(text == "&&")
- c = '&';
- else if(text.length() == 1)
- c = text.at(0);
-
- Q_EMIT keyPressed(c);
-
- //如果shift键被单击,按一个键后就恢复为小写
- if(isShift && !capsLock) {
- isShift = false;
- toggleCase();
- changeShitKeyStyle(ui->btn_shift_l, false);
- changeShitKeyStyle(ui->btn_shift_r, false);
- }
- clearModifier();
- }
-}
-
-void KeyboardWidget::clearModifier()
-{
- for(auto mod : vKeyboard->getAllModifier()) {
- QString modName = Modifier::getModifierName(mod);
- if(mod == Modifier::SUPER) {
- QString objName = QString("btn_%1").arg(modName);
- QPushButton *btn = ui->page_letter->findChild(objName);
- btn->setStyleSheet(BUTTON_BG);
- } else {
- QString objName = QString("btn_%1_l").arg(modName);
- QPushButton *btn = ui->page_letter->findChild(objName);
- btn->setStyleSheet(BUTTON_BG);
- objName = QString("btn_%1_r").arg(modName);
- btn = ui->page_letter->findChild(objName);
- btn->setStyleSheet(BUTTON_BG);
- }
- }
- vKeyboard->clearModifier();
-}
-
-void KeyboardWidget::toggleCase()
-{
- for(int i = 0; i < 26; i++) {
- QString objName = "btn_" + QString::number(i);
- QPushButton *btn = findChild(objName);
- QChar ch;
- if(isShift) { //切换到大写
- ch = symbols[0][i].toUpper();
- } else {
- ch = symbols[0][i];
- }
- btn->setText(ch);
- }
-}
-
-void KeyboardWidget::switchPage()
-{
- if(page == 0) {
- ui->btn_shift_l->setText("");
- ui->btn_shift_r->setText("");
- ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
- } else {
- ui->btn_shift_l->setText("");
- ui->btn_shift_r->setText("");
- ui->btn_shift_l->setIcon(QIcon(":/images/images/capslock.svg"));
- ui->btn_shift_r->setIcon(QIcon(":/images/images/capslock.svg"));
- }
-
- for(int i = 0; i < SYMBOL_KEY_COUNT; i++) {
- QString btnObjName = "btn_" + QString::number(i);
- QPushButton *btn = ui->page_letter->findChild(btnObjName);
- QChar c = symbols[page][i];
- if(c == '&')
- btn->setText("&&");
- else
- btn->setText(c);
- }
-}
-
diff --git a/VirtualKeyboard/src/keyboardwidget.h b/VirtualKeyboard/src/keyboardwidget.h
deleted file mode 100644
index 25591ae..0000000
--- a/VirtualKeyboard/src/keyboardwidget.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
-**/
-#ifndef KEYBOARDWIDGET_H
-#define KEYBOARDWIDGET_H
-
-#include
-#include
-#include
-#include "x11keyboard.h"
-
-namespace Ui {
-class KeyboardWidget;
-}
-
-class QPushButton;
-
-class KeyboardWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit KeyboardWidget(QWidget *parent = 0);
- ~KeyboardWidget();
-
-protected:
- void resizeEvent(QResizeEvent *event);
-
-private:
- void bindSingal();
- void toggleCase();
- void switchPage();
- void setDefaultIcon();
- void setIconSize();
- void changeKeyStyle(QPushButton *btn, bool isPressed);
- void changeFuncKeyStyle(QPushButton *btn, bool isPressed);
- void changeShitKeyStyle(QPushButton *btn, bool isPressed);
- void changeDirectKeyStyle(QPushButton *btn, bool isPressed);
- void clearModifier();
- QString getKeyName(QPushButton *btn);
-
-
-private Q_SLOTS:
- void onButtonClicked();
- void onButtonPressed();
- void onButtonReleased();
-
-Q_SIGNALS:
- void aboutToClose();
- void keyPressed(QChar c);
- void keyPressed(FuncKey::FUNCKEY key);
-
-private:
- Ui::KeyboardWidget *ui;
- bool capsLock; //是否大写锁定
- bool isShift;
- QTime shiftLastClicked; //shift键上次被点击的时间
- int page; //当前是第几页的键盘
- X11Keyboard *vKeyboard;
-};
-
-#endif // KEYBOARDWIDGET_H
diff --git a/VirtualKeyboard/src/keyboardwidget.ui b/VirtualKeyboard/src/keyboardwidget.ui
deleted file mode 100644
index ac55eff..0000000
--- a/VirtualKeyboard/src/keyboardwidget.ui
+++ /dev/null
@@ -1,1203 +0,0 @@
-
-
- KeyboardWidget
-
-
- Qt::NonModal
-
-
-
- 0
- 0
- 1132
- 293
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
- KeyboardWidget
-
-
-
- 0
-
-
- QLayout::SetMinAndMaxSize
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- 20
-
-
- QLayout::SetNoConstraint
-
-
- 10
-
-
- 10
-
-
- 10
-
-
- 10
-
-
-
-
-
- 1
-
-
-
-
- 0
-
-
- QLayout::SetNoConstraint
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- 5
-
-
- QLayout::SetNoConstraint
-
-
-
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
- 10
-
-
- QLayout::SetNoConstraint
-
-
-
-
-
-
- 0
- 0
-
-
-
- q
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- w
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- e
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- r
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- t
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- y
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- u
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- i
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- o
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- p
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- -
-
-
- 10
-
-
- QLayout::SetNoConstraint
-
-
-
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Maximum
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- a
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- s
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- d
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- f
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- g
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- h
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- j
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- k
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- l
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- 10
-
-
- QLayout::SetNoConstraint
-
-
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- z
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- x
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- c
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- v
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- b
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- n
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- m
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- ,
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- .
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- 10
-
-
- QLayout::SetNoConstraint
-
-
-
-
-
-
- 0
- 0
-
-
-
-
-
-
- Ctrl
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Alt
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Alt
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- /
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Ctrl
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
-
-
- QLayout::SetNoConstraint
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- 10
-
-
- QLayout::SetNoConstraint
-
-
-
-
-
- QLayout::SetNoConstraint
-
-
- 10
-
-
-
-
-
-
- 0
- 0
-
-
-
- 9
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 5
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 8
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 4
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 2
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 7
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 1
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 6
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 3
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 0
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- QLayout::SetNoConstraint
-
-
- 10
-
-
-
-
-
-
- 0
- 0
-
-
-
- Delete
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- End
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Insert
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- PgUp
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Home
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- PgDn
-
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
- -
-
-
- 5
-
-
- QLayout::SetNoConstraint
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 16777215
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 16777215
-
-
-
- Abc
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 16777215
-
-
-
- @
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 16777215
-
-
-
- 123
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VirtualKeyboard/src/letterswidget.cpp b/VirtualKeyboard/src/letterswidget.cpp
new file mode 100644
index 0000000..102d64b
--- /dev/null
+++ b/VirtualKeyboard/src/letterswidget.cpp
@@ -0,0 +1,383 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "letterswidget.h"
+#include "commondef.h"
+#include "plasma-shell-manager.h"
+#include
+#include
+#include
+
+LettersWidget::LettersWidget(QWidget *parent/* = nullptr*/)
+ : QWidget(parent)
+{
+ this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
+ initUI();
+
+ if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") {
+ isWayland = true;
+ }
+
+ if(isWayland){
+ connect(PlasmaShellManager::getInstance(), &PlasmaShellManager::keyStateChanged,
+ this, &LettersWidget::onCapsChanged);
+ }else{
+ settings = new QGSettings("org.ukui.peripherals-keyboard", "", this);
+ connect(settings, &QGSettings::changed,
+ this, &LettersWidget::onCapsChanged);
+ }
+ onCapsChanged();
+}
+
+LettersWidget::~LettersWidget()
+{
+
+}
+
+void LettersWidget::initUI()
+{
+ // line 1
+ QChar chLine1[] = {'q','w','e','r','t','y','u','i','o','p'};
+ for (int n = 0; n < sizeof(chLine1)/sizeof(QChar); n++) {
+ KBButton *letterBtn = new KBButton(this);
+ QString objName = "btn_" + QString::number(chLine1[n].toLatin1());
+ letterBtn->setObjectName(objName);
+ letterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ letterBtn->setCharId(chLine1[n]);
+ letterBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(letterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[letterBtn] = letterBtn->geometry();
+ }
+ // backspace
+ KBButton *backspaceBtn = new KBButton(this);
+ backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L1+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ backspaceBtn->setObjectName("btn_backspace");
+ backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
+ connect(backspaceBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
+ qDebug()<<"backspaceBtn geometry:"<geometry();
+
+ // line 2
+ QChar chLine2[] = {'a','s','d','f','g','h','j','k','l'};
+ for (int n = 0; n < sizeof(chLine2)/sizeof(QChar); n++) {
+ KBButton *letterBtn = new KBButton(this);
+ QString objName = "btn_" + QString::number(chLine2[n].toLatin1());
+ letterBtn->setObjectName(objName);
+ letterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*n,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ letterBtn->setCharId(chLine2[n]);
+ letterBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(letterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[letterBtn] = letterBtn->geometry();
+ }
+ // enter
+ KBButton *enterBtn = new KBButton(this);
+ enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L2+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING),
+ KEYBOARD_FIXED_DEFAULT_ENTERBTN_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ enterBtn->setObjectName("btn_enter");
+ enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
+ connect(enterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
+
+ // line 3
+ QChar chLine3[] = {'z','x','c','v','b','n','m',',','.'};
+ for (int n = 0; n < sizeof(chLine3)/sizeof(QChar); n++) {
+ KBButton *letterBtn = new KBButton(this);
+ QString objName = "btn_" + QString::number(chLine3[n].toLatin1());
+ letterBtn->setObjectName(objName);
+ letterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ letterBtn->setCharId(chLine3[n]);
+ letterBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,
+ KEYBOARD_FONT_COLOR_PRESS);
+ connect(letterBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[letterBtn] = letterBtn->geometry();
+ }
+ // shift l
+ KBButton *shiftLBtn = new KBButton(this);
+ shiftLBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ shiftLBtn->setObjectName("btn_shift_l");
+ shiftLBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ shiftLBtn->setIcon(QIcon(":/images/images/shift.svg"));
+ connect(shiftLBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[shiftLBtn] = shiftLBtn->geometry();
+ // shift r
+ KBButton *shiftRBtn = new KBButton(this);
+ shiftRBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L3+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ shiftRBtn->setObjectName("btn_shift_r");
+ shiftRBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ shiftRBtn->setIcon(QIcon(":/images/images/shift.svg"));
+ connect(shiftRBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[shiftRBtn] = shiftRBtn->geometry();
+
+ // line 4
+ KBButton *symbolBtn = new KBButton(this);
+ symbolBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ symbolBtn->setObjectName("btn_symbol");
+ symbolBtn->setText(tr("&&?!"));
+ symbolBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(symbolBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[symbolBtn] = symbolBtn->geometry();
+
+ KBButton *numBtn = new KBButton(this);
+ numBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING),
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ numBtn->setObjectName("btn_num");
+ numBtn->setText(tr("123"));
+ numBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(numBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[numBtn] = numBtn->geometry();
+
+ KBButton *ctrlBtn = new KBButton(this);
+ ctrlBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ ctrlBtn->setObjectName("btn_ctrl");
+ ctrlBtn->setText(tr("Ctrl"));
+ ctrlBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(ctrlBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[ctrlBtn] = ctrlBtn->geometry();
+
+ KBButton *spaceBtn = new KBButton(this);
+ spaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_SPACEBTN_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ spaceBtn->setObjectName("btn_space");
+ spaceBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
+ KEYBOARD_LETTER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ spaceBtn->setIcon(QIcon(":/images/images/space.svg"));
+ connect(spaceBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[spaceBtn] = spaceBtn->geometry();
+
+ KBButton *altBtn = new KBButton(this);
+ altBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*8,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ altBtn->setObjectName("btn_alt");
+ altBtn->setText(tr("Alt"));
+ altBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(altBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[altBtn] = altBtn->geometry();
+
+ KBButton *leftBtn = new KBButton(this);
+ leftBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*9,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ leftBtn->setObjectName("btn_left");
+ leftBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ leftBtn->setIcon(QIcon(":/images/images/left.svg"));
+ connect(leftBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[leftBtn] = leftBtn->geometry();
+
+ KBButton *rightBtn = new KBButton(this);
+ rightBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_LETTER_L4+(KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*10,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
+ rightBtn->setObjectName("btn_right");
+ rightBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
+ KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ rightBtn->setIcon(QIcon(":/images/images/right.svg"));
+ connect(rightBtn, &KBButton::clicked, this, &LettersWidget::onBtnClicked);
+ m_mapBtnGeometrys[rightBtn] = rightBtn->geometry();
+}
+
+void LettersWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
+{
+ QMap::iterator itGeometry = m_mapBtnGeometrys.begin();
+ for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
+ KBButton *button = itGeometry.key();
+ if (button) {
+ QRect oldGeometry = itGeometry.value();
+ QRect newGeometry = oldGeometry;
+ if (floatStatus) {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ } else {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ }
+ button->setGeometry(newGeometry);
+ }
+ }
+}
+
+void LettersWidget::onBtnClicked(QChar charId)
+{
+ QObject *obj = sender();
+ KBButton *btn = static_cast(obj);
+ QString objName = btn->objectName();
+ int lastUnderline = objName.lastIndexOf('_');
+ int start = strlen("btn_");
+ int keyLength = lastUnderline - start;
+ QString keyName = objName.mid(start, keyLength);
+
+ if (charId != QChar::Null && isShift && !capsState) { //第一次按shift,按后取消shift状态
+ isShift = false;
+ changeFuncKeyStyle("shift_l", false);
+ changeFuncKeyStyle("shift_r", false);
+ toggleCase();
+ }
+
+ if (keyName == "num") { //数字页面
+ Q_EMIT specialBtnClicked(PAGE_NUMBER);
+ } else if (keyName == "symbol") { //符号页面
+ Q_EMIT specialBtnClicked(PAGE_CHAR);
+ } else if (keyName == BTN_SHIFT) { //shift
+ if (capsState) {
+ capsState = false;
+ isShift = false;
+ changeFuncKeyStyle("shift_l", false);
+ changeFuncKeyStyle("shift_r", false);
+ Q_EMIT specialBtnClicked(BTN_CAPSLOCK);
+ } else if (isShift) { //shift键锁定
+ capsState = true;
+ isShift = true;
+ changeFuncKeyStyle("shift_l", true);
+ changeFuncKeyStyle("shift_r", true);
+ Q_EMIT specialBtnClicked(BTN_CAPSLOCK);
+ } else {
+ isShift = true;
+ changeFuncKeyStyle("shift_l", true);
+ changeFuncKeyStyle("shift_r", true);
+ }
+ toggleCase();
+ } else if (charId != QChar::Null) { //字符
+ Q_EMIT normalBtnClicked(charId);
+ } else { //ctrl或者alt
+ Q_EMIT specialBtnClicked(keyName);
+
+ }
+}
+
+void LettersWidget::onCapsChanged()
+{
+ if(isWayland){
+ capsState = PlasmaShellManager::getInstance()->getKeyState(KWayland::Client::Keystate::Key::CapsLock);
+ }else{
+ capsState = settings->get("capslock-state").toBool();
+ }
+
+ isShift = capsState;
+ for (int i = 97; i < 123; i++) { //大小写切换
+ QString objName = QString("btn_%1").arg(QString::number(i));
+ KBButton *btn = findChild(objName);
+ btn->setCapsStatus(capsState);
+ changeFuncKeyStyle("shift_l", capsState);
+ changeFuncKeyStyle("shift_r", capsState);
+ }
+}
+
+void LettersWidget::toggleCase()
+{
+ for (int i = 97; i < 123; i++) { //大小写切换
+ QString objName = QString("btn_%1").arg(QString::number(i));
+ KBButton *btn = findChild(objName);
+ btn->setShiftState(isShift);
+ }
+}
+
+void LettersWidget::changeFuncKeyStyle(QString obj, bool isLock)
+{
+ if(obj == BTN_CAPSLOCK)
+ return;
+ QString objName = QString("btn_%1").arg(obj);
+ KBButton *btn = findChild(objName);
+ if (isLock) {
+ btn->updateStyleSheet(KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS,
+ KBButton::BORDER_RADIUS_ALL,true);
+ if (capsState && obj.contains(BTN_SHIFT)) {
+ btn->setIcon(QIcon(":/images/images/shift_lock.svg"));
+ } else if (obj.contains(BTN_SHIFT)) {
+ btn->setIcon(QIcon(":/images/images/rectangle.svg"));
+ }
+ } else {
+ btn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ if (obj.contains(BTN_SHIFT)) {
+ btn->setIcon(QIcon(":/images/images/shift.svg"));
+ }
+ }
+}
diff --git a/VirtualKeyboard/src/letterswidget.h b/VirtualKeyboard/src/letterswidget.h
new file mode 100644
index 0000000..31ee168
--- /dev/null
+++ b/VirtualKeyboard/src/letterswidget.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef LETTERSWIDGET_H
+#define LETTERSWIDGET_H
+
+#include
+#include
+#include "kbbutton.h"
+#include
+
+class LettersWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit LettersWidget(QWidget *parent = nullptr);
+ virtual ~LettersWidget();
+
+ void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
+ void changeFuncKeyStyle(QString obj, bool isLock);
+
+public Q_SLOTS:
+ void onBtnClicked(QChar charId);
+ void onCapsChanged();
+
+Q_SIGNALS:
+ void clicked(int nKeyId);
+ void specialBtnClicked(QString keyName);
+ void normalBtnClicked(QChar c);
+
+private:
+ void initUI();
+ void toggleCase();
+
+private:
+ QMap m_mapBtnGeometrys;
+
+ bool isShift = false;
+
+ QGSettings *settings;
+ bool capsState = false;
+ bool isWayland = false;
+};
+
+#endif // LETTERSWIDGET_H
diff --git a/VirtualKeyboard/src/main.cpp b/VirtualKeyboard/src/main.cpp
index 99fc2f0..dbb84a0 100644
--- a/VirtualKeyboard/src/main.cpp
+++ b/VirtualKeyboard/src/main.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include "virtualkeyboard.h"
#include
diff --git a/VirtualKeyboard/src/numberswidget.cpp b/VirtualKeyboard/src/numberswidget.cpp
new file mode 100644
index 0000000..a09de13
--- /dev/null
+++ b/VirtualKeyboard/src/numberswidget.cpp
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "numberswidget.h"
+#include "kbbutton.h"
+#include "commondef.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+NumbersWidget::NumbersWidget(QWidget *parent)
+ : QWidget(parent)
+{
+ this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
+ initUI();
+}
+
+NumbersWidget::~NumbersWidget()
+{
+
+}
+
+void NumbersWidget::initUI()
+{
+ // all chars
+ m_layoutBtnList = new QVBoxLayout();
+ m_layoutBtnList->setContentsMargins(8,0,0,0);
+ m_layoutBtnList->setSpacing(1);
+ listFrame = new QFrame();
+ listFrame->setObjectName("listFrame");
+ listFrame->setLayout(m_layoutBtnList);
+ listFrame->setStyleSheet("QFrame{border-radius: 8px}");
+ listFrame->setFrameStyle(QFrame::Plain);
+ m_scrollFrame = new QScrollArea(this);
+ m_scrollFrame->setObjectName("scrollFrame");
+ m_scrollFrame->setFocusPolicy(Qt::NoFocus);
+ m_scrollFrame->setContentsMargins(0, 0, 0, 0);
+ m_scrollFrame->setStyleSheet("QScrollArea {background-color: #C0CED3D9; border-radius:8px;}");
+ m_scrollFrame->viewport()->setStyleSheet("background-color:transparent;");
+ m_scrollFrame->verticalScrollBar()->setProperty("drawScrollBarGroove", false);
+ m_scrollFrame->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_scrollFrame->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);
+ m_scrollFrame->setWidgetResizable(true);
+ m_scrollFrame->setWidget(listFrame);
+ m_scrollFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1, KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH, KEYBOARD_FIXED_DEFAULT_NUMBER_CHARS_HEIGHT);
+ listFrame->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1, KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH, KEYBOARD_FIXED_DEFAULT_NUMBER_CHARS_HEIGHT);
+ m_mapBtnGeometrys[m_scrollFrame] = m_scrollFrame->geometry();
+ //m_mapBtnGeometrys[listFrame] = listFrame->geometry();
+ QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
+ '/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
+ '%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
+ '$', '-'};
+ for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) {
+ KBButton *charBtn = new KBButton(listFrame);
+ charBtn->setCharId(chChars[n]);
+ charBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_NORMAL,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS,
+ KBButton::BORDER_RADIUS_NONE);
+ charBtn->setObjectName(QString("btn_%1").arg(QString(chChars[n])));
+ connect(charBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ charBtn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ m_layoutBtnList->addWidget(charBtn);
+ }
+ // line 1
+ QChar chLine1[] = {'1','2','3'};
+ for (int n = 0; n < sizeof(chLine1)/sizeof(QChar); n++) {
+ KBButton *numberBtn = new KBButton(this);
+ numberBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
+ KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ numberBtn->setCharId(chLine1[n]);
+ numberBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(numberBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[numberBtn] = numberBtn->geometry();
+ }
+ // backspace
+ KBButton *backspaceBtn = new KBButton(this);
+ backspaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L1+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ backspaceBtn->setObjectName("btn_backspace");
+ backspaceBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ backspaceBtn->setIcon(QIcon(":/images/images/delet.svg"));
+ connect(backspaceBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[backspaceBtn] = backspaceBtn->geometry();
+
+ // line 2
+ QChar chLine2[] = {'4','5','6'};
+ for (int n = 0; n < sizeof(chLine2)/sizeof(QChar); n++) {
+ KBButton *numberBtn = new KBButton(this);
+ numberBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L2+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*1,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ numberBtn->setCharId(chLine2[n]);
+ numberBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(numberBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[numberBtn] = numberBtn->geometry();
+ }
+ // @
+ KBButton *atBtn = new KBButton(this);
+ atBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L2+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*1,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ atBtn->setCharId('@');
+ atBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(atBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[atBtn] = atBtn->geometry();
+ // line 3
+ QChar chLine3[] = {'7','8','9'};
+ for (int n = 0; n < sizeof(chLine3)/sizeof(QChar); n++) {
+ KBButton *numberBtn = new KBButton(this);
+ numberBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L3+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*(n+1),
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ numberBtn->setCharId(chLine3[n]);
+ numberBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_BORDER_NORMAL,KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(numberBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[numberBtn] = numberBtn->geometry();
+ }
+ // symbol
+ KBButton *symbolBtn = new KBButton(this);
+ symbolBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L3+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ symbolBtn->setObjectName("btn_symbol");
+ symbolBtn->setText(tr("&&?!"));
+ symbolBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(symbolBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[symbolBtn] = symbolBtn->geometry();
+
+ // line 4
+ KBButton *returnBtn = new KBButton(this);
+ returnBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ returnBtn->setObjectName("btn_return");
+ returnBtn->setText(tr("Return"));
+ returnBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ connect(returnBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[returnBtn] = returnBtn->geometry();
+
+ // space
+ KBButton *spaceBtn = new KBButton(this);
+ spaceBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*1,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ spaceBtn->setObjectName("btn_space");
+ spaceBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
+ KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ spaceBtn->setIcon(QIcon(":/images/images/space.svg"));
+ connect(spaceBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[spaceBtn] = spaceBtn->geometry();
+
+ // .
+ KBButton *dianBtn = new KBButton(this);
+ dianBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ dianBtn->setCharId('.');
+ dianBtn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
+ KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(dianBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[dianBtn] = dianBtn->geometry();
+
+ // 9
+ KBButton *num0Btn = new KBButton(this);
+ num0Btn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L4+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*2,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ num0Btn->setCharId('0');
+ num0Btn->updateStyleSheet(KEYBOARD_LETTER_COLOR_NORMAL,KEYBOARD_LETTER_COLOR_PRESSED,
+ KEYBOARD_LETTER_COLOR_PRESSED,KEYBOARD_LETTER_COLOR_BORDER_NORMAL,
+ KEYBOARD_LETTER_COLOR_BORDER_PRESSED,KEYBOARD_FONT_COLOR_PRESS);
+ connect(num0Btn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[num0Btn] = num0Btn->geometry();
+
+ // enter
+ KBButton *enterBtn = new KBButton(this);
+ enterBtn->setGeometry(KEYBOARD_FIXED_DEFAULT_NUMBER_L3+(KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH+KEYBOAED_FIXED_DEFAULT_HSPACING)*4,
+ KEYBOARD_FIXED_DEFAULT_TMARGIN+(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT+KEYBOAED_FIXED_DEFAULT_VSPACING)*3,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_WIDTH,
+ KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT);
+ enterBtn->setObjectName("btn_enter");
+ enterBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
+ KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
+ KEYBOARD_OTHER_COLOR_BORDER_PRESSED,KEYBOARD_OTHER_FONT_COLOR_PRESS);
+ enterBtn->setIcon(QIcon(":/images/images/enter.svg"));
+ connect(enterBtn, &KBButton::clicked, this, &NumbersWidget::onBtnClicked);
+ m_mapBtnGeometrys[enterBtn] = enterBtn->geometry();
+}
+
+void NumbersWidget::adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical/* = false*/, bool floatStatus)
+{
+ QMap::iterator itGeometry = m_mapBtnGeometrys.begin();
+ for (; itGeometry != m_mapBtnGeometrys.end(); itGeometry ++) {
+ QWidget *widget = itGeometry.key();
+ if (widget) {
+ QRect oldGeometry = itGeometry.value();
+ QRect newGeometry = oldGeometry;
+ if (floatStatus) {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale*KEYBOARD_FLOAT_PERCENTAGE);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ } else {
+ newGeometry.setX(oldGeometry.x()*lfWidthScale);
+ newGeometry.setY(oldGeometry.y()*lfHeightScale);
+ newGeometry.setWidth(oldGeometry.width()*lfWidthScale);
+ newGeometry.setHeight(oldGeometry.height()*lfHeightScale);
+ }
+ widget->setGeometry(newGeometry);
+ }
+ }
+
+ QChar chChars[] = {',', '.', '?', '!', '\'', ':', '~', '@', ';', '"',
+ '/', '(', ')', '_', '+', '=', '`', '^', '#', '*',
+ '%', '&', '\\', '[', ']', '<', '>', '{', '}', '|',
+ '$', '-'};
+ for (int n = 0; n < sizeof(chChars)/sizeof(QChar); n++) { //单独更新符号btn的高度
+ QString objName = QString("btn_%1").arg(QString(chChars[n]));
+ KBButton *btn = findChild(objName);
+ btn->setFixedHeight(KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT *lfHeightScale);
+ }
+ //更新listfarame的高度
+ listFrame->setFixedHeight((KEYBOARD_FIXED_DEFAULT_NUMBER_HEIGHT *lfHeightScale +1) * (m_layoutBtnList->count()));
+}
+
+void NumbersWidget::onBtnClicked(QChar charId)
+{
+ QObject *obj = sender();
+ KBButton *btn = static_cast(obj);
+ QString objName = btn->objectName();
+ int lastUnderline = objName.lastIndexOf('_');
+ int start = strlen("btn_");
+ int keyLength = lastUnderline - start;
+ QString keyName = objName.mid(start, keyLength);
+ qDebug() << "keyName: " << keyName;
+ if (keyName == BTN_RETURN) {
+ Q_EMIT specialBtnClicked(PAGE_LETTER);
+ } else if (keyName == "symbol") {
+ Q_EMIT specialBtnClicked(PAGE_CHAR);
+ } else if (charId != QChar::Null) {
+ Q_EMIT narmalBtnClicked(charId);
+ } else if (keyName == BTN_BACK) {
+ Q_EMIT specialBtnClicked(BTN_BACK);
+ } else {
+ Q_EMIT specialBtnClicked(keyName);
+ }
+}
diff --git a/VirtualKeyboard/src/numberswidget.h b/VirtualKeyboard/src/numberswidget.h
new file mode 100644
index 0000000..bea0f28
--- /dev/null
+++ b/VirtualKeyboard/src/numberswidget.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef NUMBERSWIDGET_H
+#define NUMBERSWIDGET_H
+
+#include
+#include
+
+class KBButton;
+class QVBoxLayout;
+class QScrollArea;
+class QFrame;
+class NumbersWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit NumbersWidget(QWidget *parent = nullptr);
+ virtual ~NumbersWidget();
+
+ void adjustGeometry(double lfWidthScale, double lfHeightScale, bool isVertical = false, bool floatStatus = false);
+
+public Q_SLOTS:
+ void onBtnClicked(QChar charId);
+
+Q_SIGNALS:
+ void clicked(int nKeyId);
+ void specialBtnClicked(QString keyName);
+ void narmalBtnClicked(QChar charId);
+
+private:
+ void initUI();
+
+private:
+ QMap m_mapBtnGeometrys;
+ QVBoxLayout *m_layoutBtnList = nullptr;
+ QScrollArea *m_scrollFrame = nullptr;
+ QFrame *listFrame = nullptr;
+};
+
+#endif // NUMBERSWIDGET_H
diff --git a/VirtualKeyboard/src/qtkeyboard.cpp b/VirtualKeyboard/src/qtkeyboard.cpp
new file mode 100644
index 0000000..a87495b
--- /dev/null
+++ b/VirtualKeyboard/src/qtkeyboard.cpp
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "qtkeyboard.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include "plasma-shell-manager.h"
+
+QMap m_specialSymbolMap = {
+ {' ', Qt::Key_Space},
+ {',', Qt::Key_Comma},
+ {'.', Qt::Key_Period},
+ {'\'', Qt::Key_QuoteLeft},
+ {'@', Qt::Key_At},
+ {'#', Qt::Key_NumberSign},
+ {'$', Qt::Key_Dollar},
+ {'%', Qt::Key_Percent},
+ {'&', Qt::Key_Ampersand},
+ {'*', Qt::Key_Asterisk},
+ {'(', Qt::Key_ParenLeft},
+ {')', Qt::Key_ParenRight},
+ {'-', Qt::Key_Minus},
+ {'+', Qt::Key_Plus},
+ {'!', Qt::Key_Exclam},
+ {'"', Qt::Key_QuoteDbl},
+ {'<', Qt::Key_Less},
+ {'>', Qt::Key_Greater},
+ {':', Qt::Key_Colon},
+ {';', Qt::Key_Semicolon},
+ {'/', Qt::Key_Slash},
+ {'?', Qt::Key_Question},
+ {'=', Qt::Key_Equal},
+ {'.', Qt::Key_Period}, /*XK_kana_middledot*/
+ {'~', Qt::Key_AsciiTilde},
+ {'`', Qt::Key_QuoteLeft},
+ {'|', Qt::Key_Bar},
+ {'^', Qt::Key_AsciiCircum},
+ {'{', Qt::Key_BraceLeft},
+ {'}', Qt::Key_BraceRight},
+ {'[', Qt::Key_BracketLeft},
+ {']', Qt::Key_BracketRight},
+ {'_', Qt::Key_Underscore},
+ {'\\', Qt::Key_Backslash},
+};
+
+QMap m_funckeyMap = {
+ {FuncKey::SPACE, Qt::Key_Space},
+ {FuncKey::BACKSPACE, Qt::Key_Backspace},
+ {FuncKey::ENTER, Qt::Key_Enter},
+ {FuncKey::HOME, Qt::Key_Home},
+ {FuncKey::END, Qt::Key_End},
+ {FuncKey::PGUP, Qt::Key_PageUp},
+ {FuncKey::PGDN, Qt::Key_PageDown},
+ {FuncKey::INSERT, Qt::Key_Insert},
+ {FuncKey::DELETE, Qt::Key_Delete},
+ {FuncKey::UP, Qt::Key_Up},
+ {FuncKey::DOWN, Qt::Key_Down},
+ {FuncKey::LEFT, Qt::Key_Left},
+ {FuncKey::RIGHT, Qt::Key_Right}
+};
+
+QMap m_modifierMap = {
+ {Modifier::CTRL, Qt::ControlModifier},
+ {Modifier::ALT, Qt::AltModifier},
+ {Modifier::SUPER, Qt::MetaModifier},
+ {Modifier::SHIFT, Qt::ShiftModifier}
+};
+
+QVector m_shiftKeyVec = {'~', '!', '@', '#', '$', '%', '^', '&', '*',
+ '(', ')', '_', '+', '{', '}', '|', ':', '"',
+ '>', '?'};
+
+#define DRM_DIR "/sys/class/leds/"
+#define CAPSLOCK_STATUS "capslock_state"
+
+/**
+ * @brief 判断大写键状态
+ * @return true: 大写锁定
+ */
+bool QtKeyboard::checkCapsLockState()
+{
+ QDir ledDir(DRM_DIR);
+ QStringList leds = ledDir.entryList(QDir::Dirs);
+ QString capsFile;
+
+ for(int i = 0;i QtKeyboard::getAllModifier()
+{
+ return modList;
+}
+
+void QtKeyboard::clearModifier()
+{
+ modList.clear();
+}
+
+
+void QtKeyboard::onKeyPressed(QChar c)
+{
+ /*判断大写锁定打开时,转换字母大小写状态,与x11keyboard类逻辑保持一致*/
+ if(checkCapsLockState() && c.isLetter()){
+ if(c.isUpper()){
+ c = c.toLower();
+ }
+ else if(c.isLower()){
+ c = c.toUpper();
+ }
+ }
+
+ if(c>='A' && c<='Z'){
+ sendKey(c.toLatin1(),c);
+ }else if(c>='a' && c<='z'){
+ sendKey(c.toLatin1() - 32,c);
+ }else if(c >= '0' && c<='9'){
+ sendKey(c.toLatin1(),c);
+ }else if(m_specialSymbolMap.contains(c)){
+ sendKey(m_specialSymbolMap[c],c);
+ }else {
+ sendKey(c.toLatin1(),c);
+ }
+}
+
+void QtKeyboard::onKeyPressed(FuncKey::FUNCKEY key)
+{
+ int keysym = m_funckeyMap[key];
+ /*这里的text根据实际按键得到的QEvent中的text内容打印*/
+ if(key == FuncKey::SPACE){
+ sendKey(keysym," ");
+ }else if(key == FuncKey::BACKSPACE){
+ sendKey(keysym,"\b");
+ }else if(key == FuncKey::ENTER){
+ sendKey(keysym,"\r");
+ }else if(key == FuncKey::INSERT){
+ sendKey(keysym,"\u007F");
+ }else if(key == FuncKey::CAPSLOCK){
+ PlasmaShellManager::getInstance()->setKeyPressed(58);
+ }else{
+ sendKey(keysym,"");
+ }
+}
+
+void QtKeyboard::sendKey(const unsigned int keysym,const QString text)
+{
+ Qt::KeyboardModifiers modifier = Qt::NoModifier;
+ for(auto mod : modList){
+ modifier = modifier | m_modifierMap[mod];
+ }
+
+ QWidget *objfous = QApplication::focusWidget();
+
+ if(objfous){
+ QKeyEvent event1(QEvent::KeyPress, keysym
+ , modifier, text
+ , true, 1);
+ QKeyEvent event2(QEvent::KeyRelease, keysym
+ , modifier, text
+ , true, 1);
+
+ QCoreApplication::sendEvent(objfous, &event1);
+ QCoreApplication::sendEvent(objfous, &event2);
+ }
+
+}
diff --git a/VirtualKeyboard/src/qtkeyboard.h b/VirtualKeyboard/src/qtkeyboard.h
new file mode 100644
index 0000000..a9c9690
--- /dev/null
+++ b/VirtualKeyboard/src/qtkeyboard.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef QTKEYBOARD_H
+#define QTKEYBOARD_H
+
+#include
+#include
+#include "fakekeyboard.h"
+
+class QtKeyboard : public FakeKeyboard
+{
+ Q_OBJECT
+public:
+ explicit QtKeyboard(QObject *parent = nullptr);
+ ~QtKeyboard();
+ void addModifier(Modifier::MOD mod);
+ void removeModifier(Modifier::MOD mod);
+ bool hasModifier(Modifier::MOD mod);
+ QList getAllModifier();
+ void clearModifier();
+
+public Q_SLOTS:
+ void onKeyPressed(QChar c);
+ void onKeyPressed(FuncKey::FUNCKEY key);
+
+private:
+ void sendKey(const unsigned int keyCode,const QString text);
+ bool checkCapsLockState();
+
+private:
+ QList modList;
+};
+
+#endif // QTKEYBOARD_H
diff --git a/VirtualKeyboard/src/virtualkeyboard.cpp b/VirtualKeyboard/src/virtualkeyboard.cpp
deleted file mode 100644
index ea46695..0000000
--- a/VirtualKeyboard/src/virtualkeyboard.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
-**/
-#include "virtualkeyboard.h"
-#include
-#include
-#include
-#include
-
-VirtualKeyboard::VirtualKeyboard(QWidget *parent)
- : QWidget(parent)
-{
- Q_INIT_RESOURCE(keyboard);
-
- setAutoFillBackground(true);
- QPalette plt;
- plt.setBrush(QPalette::Background, Qt::black);
- setPalette(plt);
-
- setWindowFlags(Qt::FramelessWindowHint |
- Qt::WindowStaysOnTopHint |
- Qt::WindowDoesNotAcceptFocus);
-
-
- keyboardWidget = new KeyboardWidget(this);
- QHBoxLayout *hl_keyboard = new QHBoxLayout(this);
- QSpacerItem *spacer = new QSpacerItem(40, 20);
- hl_keyboard->addSpacerItem(spacer);
- hl_keyboard->addWidget(keyboardWidget);
- QSpacerItem *spacer2 = new QSpacerItem(40, 20);
- hl_keyboard->addSpacerItem(spacer2);
-
- QFile qssFile(":/qss/keyboard.qss");
- qssFile.open(QIODevice::ReadOnly);
- setStyleSheet(qssFile.readAll());
- qssFile.close();
-
- QDesktopWidget *desktop = QApplication::desktop();
- cursorMonitor = new CursorMonitor(this);
-
- //在多显示器情况下,监视鼠标指针的位置和主显示器变化信号
- connect(cursorMonitor, &CursorMonitor::cursorPosChanged,
- this, [&](const QPoint &pos){
- adjustGeometry(desktop->screenNumber(pos));
- });
-
- connect(desktop, &QDesktopWidget::primaryScreenChanged,
- this, [&]{
- adjustGeometry(desktop->primaryScreen());
- });
-
- connect(keyboardWidget, &KeyboardWidget::aboutToClose,
- this, &VirtualKeyboard::aboutToClose);
-
- adjustGeometry(desktop->primaryScreen());
-}
-
-void VirtualKeyboard::adjustGeometry(int screen)
-{
- QDesktopWidget *desktop = QApplication::desktop();
- QWidget *activateScreen = desktop->screen(screen);
- setGeometry(0, activateScreen->height() - activateScreen->height() / 3,
- activateScreen->width(), activateScreen->height() / 3);
-}
diff --git a/VirtualKeyboard/src/virtualkeyboard.h b/VirtualKeyboard/src/virtualkeyboard.h
deleted file mode 100644
index 44b628a..0000000
--- a/VirtualKeyboard/src/virtualkeyboard.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
-**/
-#ifndef VIRTUALKEYBOARD_H
-#define VIRTUALKEYBOARD_H
-
-#include
-#include
-
-#include "keyboardwidget.h"
-#include "cursormonitor.h"
-
-class VirtualKeyboard : public QWidget
-{
- Q_OBJECT
-public:
- explicit VirtualKeyboard(QWidget *parent = 0);
-
-private:
- void adjustGeometry(int screen);
-
-Q_SIGNALS:
- void aboutToClose();
-
-private:
- KeyboardWidget *keyboardWidget;
- CursorMonitor *cursorMonitor;
- bool isApplication;
-};
-
-
-#endif // VIRTUALKEYBOARD_H
diff --git a/VirtualKeyboard/src/virtualkeyboardwidget.cpp b/VirtualKeyboard/src/virtualkeyboardwidget.cpp
new file mode 100644
index 0000000..4318702
--- /dev/null
+++ b/VirtualKeyboard/src/virtualkeyboardwidget.cpp
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#include "virtualkeyboardwidget.h"
+
+#include
+#include
+#include
+#include
+#include "commondef.h"
+#include
+#include
+#include "dragwidget.h"
+#include "kbtitle.h"
+#include "letterswidget.h"
+#include "numberswidget.h"
+#include "charswidget.h"
+#include "charsmorewidget.h"
+#include "x11keyboard.h"
+#include "qtkeyboard.h"
+
+VirtualKeyboardWidget::VirtualKeyboardWidget(QWidget *parent)
+ : QWidget(parent)
+ , m_lfWidthScale(1.0)
+ , m_lfHeightScale(1.0)
+ , m_isVertical(false)
+{
+ Q_INIT_RESOURCE(keyboard);
+ setAttribute(Qt::WA_TranslucentBackground);//背景透明
+ //setAutoFillBackground(true);
+ setWindowFlags(Qt::FramelessWindowHint |
+ Qt::WindowStaysOnTopHint |
+ Qt::WindowDoesNotAcceptFocus);
+
+ if(QX11Info::isPlatformX11()){
+ vKeyboard = new X11Keyboard(this);
+ }else{
+ vKeyboard = new QtKeyboard(this);
+ }
+
+ connect(this, SIGNAL(keyPressed(QChar)),
+ vKeyboard, SLOT(onKeyPressed(QChar)));
+ connect(this, SIGNAL(keyPressed(FuncKey::FUNCKEY)),
+ vKeyboard, SLOT(onKeyPressed(FuncKey::FUNCKEY)));
+ initUI();
+ initConnections();
+}
+
+VirtualKeyboardWidget::~VirtualKeyboardWidget()
+{
+
+}
+
+void VirtualKeyboardWidget::initUI()
+{
+ QVBoxLayout *layoutMain = new QVBoxLayout(this);
+ layoutMain->setContentsMargins(0,0,0,0);
+ layoutMain->setSpacing(0);
+
+ m_dragWidget = new DragWidget();
+ layoutMain->addWidget(m_dragWidget);
+ m_dragWidget->installEventFilter(this);
+
+ m_kbTitle = new KBTitle();
+ layoutMain->addWidget(m_kbTitle);
+
+ m_stackedWidget = new QStackedWidget();
+
+ m_lettersWidget = new LettersWidget();
+ m_stackedWidget->addWidget(m_lettersWidget);
+
+ m_numbersWidget = new NumbersWidget(this);
+ m_stackedWidget->addWidget(m_numbersWidget);
+
+ m_charsWidget = new CharsWidget();
+ m_stackedWidget->addWidget(m_charsWidget);
+
+ m_charsMoreWidget = new CharsMoreWidget();
+ m_stackedWidget->addWidget(m_charsMoreWidget);
+
+ m_stackedWidget->setCurrentIndex(VKB_PAGE_LETTERS);
+ m_nCurPage = VKB_PAGE_CHARSMORE;
+ layoutMain->addWidget(m_stackedWidget);
+}
+
+void VirtualKeyboardWidget::initConnections()
+{
+ connect(m_kbTitle, &KBTitle::btnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
+ connect(m_lettersWidget, &LettersWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
+ connect(m_lettersWidget, &LettersWidget::normalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
+ connect(m_numbersWidget, &NumbersWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
+ connect(m_numbersWidget, &NumbersWidget::narmalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
+ connect(m_charsWidget, &CharsWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
+ connect(m_charsWidget, &CharsWidget::normalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
+ connect(m_charsMoreWidget, &CharsMoreWidget::specialBtnClicked, this, &VirtualKeyboardWidget::onSpecialBtnClicked);
+ connect(m_charsMoreWidget, &CharsMoreWidget::normalBtnClicked, this, &VirtualKeyboardWidget::onNormalBtnClicked);
+}
+
+void VirtualKeyboardWidget::adjustGeometry()
+{
+ QWidget *parentWidget = qobject_cast(parent());
+ if (parentWidget) {
+ //qDebug()<< "parent: " << parentWidget <<"Parent gemotry:"<geometry();
+ double lfWidth = parentWidget->geometry().width();
+ double lfHeight = parentWidget->geometry().height();
+ m_isVertical = lfHeight > lfWidth;
+ m_lfWidthScale = lfWidth/KEYBOARD_PARENT_DEFAULT_WIDTH;
+ if (m_isVertical)
+ m_lfHeightScale = lfHeight / KEYBOARD_PARENT_DEFAULT_WIDTH;
+ else
+ m_lfHeightScale = lfHeight / KEYBOARD_PARENT_DEFAULT_HEIGHT;
+ if (m_isdragState) {
+ lfWidth = m_lfWidthScale * KEYBOARD_DRAGSHOW_FIXED_DEFAULT_WIDTH;
+ lfHeight = m_lfHeightScale * KEYBOARD_DRAGSHOW_FIXED_DEFAULT_HEIGHT;
+ setGeometry(QRect(m_lfWidthScale * (KEYBOARD_PARENT_DEFAULT_WIDTH - KEYBOARD_DRAGSHOW_FIXED_DEFAULT_WIDTH) / 2,
+ parentWidget->geometry().height() - lfHeight,
+ lfWidth, lfHeight));
+ m_dragWidget->show();
+ } else {
+ lfWidth = m_lfWidthScale * KEYBOARD_FIXED_DEFAULT_WIDTH;
+ lfHeight = m_lfHeightScale * KEYBOARD_DRAGHIDE_FIXED_DEFAULT_HEIGHT;
+ m_dragWidget->hide();
+ setGeometry(QRect(0, parentWidget->geometry().height()-lfHeight, lfWidth, lfHeight));
+ }
+
+ //qDebug()<<"Widget geometry:"<show();
+ } else {
+ setGeometry(QRect(0, 0,
+ KEYBOARD_FIXED_DEFAULT_WIDTH, KEYBOARD_DRAGHIDE_FIXED_DEFAULT_HEIGHT));
+ m_dragWidget->hide();
+ }
+ m_lfWidthScale = 1.0;
+ m_lfHeightScale = 1.0;
+ m_isVertical = false;
+ }
+ if (m_dragWidget) {
+ m_dragWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
+ }
+ if (m_kbTitle) {
+ m_kbTitle->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
+ }
+ if (m_lettersWidget) {
+ m_lettersWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
+ }
+ if (m_numbersWidget) {
+ m_numbersWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
+ }
+ if (m_charsWidget) {
+ m_charsWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
+ }
+ if (m_charsMoreWidget) {
+ m_charsMoreWidget->adjustGeometry(m_lfWidthScale, m_lfHeightScale, m_isVertical, m_isdragState);
+ }
+}
+
+bool VirtualKeyboardWidget::eventFilter(QObject *watched, QEvent *event)
+{
+ if(watched != m_dragWidget && !isMove) return QWidget::eventFilter(watched, event);
+ switch(event->type())
+ {
+ case QEvent::MouseButtonPress:
+ onMouseEvents(1);
+ return true;
+ case QEvent::MouseMove:
+ onMouseEvents(2);
+ return true;
+ case QEvent::MouseButtonRelease:
+ onMouseEvents(3);
+ return true;
+ default:
+ break;
+ }
+ return QWidget::eventFilter(watched, event);
+}
+
+void VirtualKeyboardWidget::resizeEvent(QResizeEvent *event)
+{
+ adjustGeometry();
+}
+
+void VirtualKeyboardWidget::paintEvent(QPaintEvent *event)
+{
+ QPainterPath path;
+ QPainter painter(this);
+ painter.setOpacity(1.0);
+ painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
+ painter.setClipping(true);
+ painter.setPen(Qt::transparent);
+ if (m_isdragState) {
+ path.addRoundedRect(this->rect(), 16, 16);
+ } else {
+ path.addRoundedRect(this->rect(), 0, 0);
+ }
+ path.setFillRule(Qt::WindingFill);
+ painter.setBrush(QColor("#EBEDEF"));
+ painter.setPen(Qt::transparent);
+ painter.drawPath(path);
+ QWidget::paintEvent(event);
+}
+
+void VirtualKeyboardWidget::onSpecialBtnClicked(QString keyName)
+{
+ Modifier::MOD mod = Modifier::getModifier(keyName);
+ FuncKey::FUNCKEY funcKey = FuncKey::getKey(keyName);
+ if (mod != Modifier::UNKNOWN) {
+ if(vKeyboard->hasModifier(mod)) {
+ vKeyboard->removeModifier(mod);
+ m_lettersWidget->changeFuncKeyStyle(keyName, false);
+ } else {
+ vKeyboard->addModifier(mod);
+ m_lettersWidget->changeFuncKeyStyle(keyName, true);
+ }
+ if (keyName == BTN_CAPSLOCK) {
+ Q_EMIT keyPressed(FuncKey::CAPSLOCK);
+ clearModifier();
+ }
+ } else if(funcKey != FuncKey::UNKNOWN) {
+ Q_EMIT keyPressed(funcKey);
+ } else if (keyName == PAGE_CHARSMORE) {
+ m_stackedWidget->setCurrentIndex(VKB_PAGE_CHARSMORE);
+ update();
+ } else if (keyName == PAGE_CHAR) {
+ m_stackedWidget->setCurrentIndex(VKB_PAGE_CHARS);
+ update();
+ } else if (keyName == PAGE_NUMBER) {
+ m_stackedWidget->setCurrentIndex(VKB_PAGE_NUMBERS);
+ update();
+ } else if (keyName == PAGE_LETTER) {
+ m_stackedWidget->setCurrentIndex(VKB_PAGE_LETTERS);
+ update();
+ } else if (keyName == BTN_FLOAT) {
+ m_isdragState = !m_isdragState;
+ adjustGeometry();
+ Q_EMIT aboutToFloat();
+ } else if (keyName == BTN_CLOSE) {
+ Q_EMIT aboutToClose();
+ }
+}
+
+void VirtualKeyboardWidget::onNormalBtnClicked(QChar c)
+{
+ Q_EMIT keyPressed(c);
+ clearModifier();
+}
+
+void VirtualKeyboardWidget::clearModifier()
+{
+ for(auto mod : vKeyboard->getAllModifier()) {
+ QString modName = Modifier::getModifierName(mod);
+ m_lettersWidget->changeFuncKeyStyle(modName, false);
+ }
+ vKeyboard->clearModifier();
+}
+
+void VirtualKeyboardWidget::onMouseEvents(int type)
+{
+ switch (type) {
+ case 1:
+ {
+ isMove = true;
+ lastPoint = QCursor::pos();
+ break;
+ }
+ case 2:
+ {
+ if(isMove)
+ {
+ QPoint cPoint = QCursor::pos();
+ QPoint p = pos();
+ p.setX(p.x() - lastPoint.x() + cPoint.x());
+ p.setY(p.y() - lastPoint.y() + cPoint.y());
+ lastPoint = cPoint;
+ move(p);
+ }
+ break;
+ }
+ case 3:
+ {
+ isMove = false;
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+
+bool VirtualKeyboardWidget::getFloatStatus()
+{
+ return m_isdragState;
+}
diff --git a/VirtualKeyboard/src/virtualkeyboardwidget.h b/VirtualKeyboard/src/virtualkeyboardwidget.h
new file mode 100644
index 0000000..3238662
--- /dev/null
+++ b/VirtualKeyboard/src/virtualkeyboardwidget.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ *
+**/
+#ifndef VIRTUALKEYBOARDWIDGET_H
+#define VIRTUALKEYBOARDWIDGET_H
+
+#include
+#include
+#include
+#include
+#include "fakekeyboard.h"
+#include "plasma-shell-manager.h"
+
+class DragWidget;
+class KBTitle;
+class LettersWidget;
+class NumbersWidget;
+class CharsWidget;
+class CharsMoreWidget;
+class VirtualKeyboardWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ enum {
+ VKB_PAGE_LETTERS,
+ VKB_PAGE_NUMBERS,
+ VKB_PAGE_CHARS,
+ VKB_PAGE_CHARSMORE,
+ };
+ VirtualKeyboardWidget(QWidget *parent = nullptr);
+ virtual ~VirtualKeyboardWidget();
+ bool getFloatStatus();
+
+public Q_SLOTS:
+ void onNormalBtnClicked(QChar c);
+ void onSpecialBtnClicked(QString keyName);
+
+Q_SIGNALS:
+ void aboutToClose();
+ void aboutToFloat();
+ void keyPressed(QChar c);
+ void keyPressed(FuncKey::FUNCKEY key);
+
+protected:
+ void paintEvent(QPaintEvent *) override;
+ void resizeEvent(QResizeEvent *event) override;
+ bool eventFilter(QObject *watched, QEvent *event) override;
+
+private:
+ void initUI();
+ void initConnections();
+ void adjustGeometry();
+ void onMouseEvents(int type);
+ void clearModifier();
+
+private:
+ double m_lfWidthScale;
+ double m_lfHeightScale;
+ bool m_isVertical;
+ QStackedWidget *m_stackedWidget = nullptr;
+ LettersWidget *m_lettersWidget = nullptr;
+ NumbersWidget *m_numbersWidget = nullptr;
+ CharsWidget *m_charsWidget = nullptr;
+ CharsMoreWidget *m_charsMoreWidget = nullptr;
+ KBTitle *m_kbTitle = nullptr;
+ DragWidget *m_dragWidget = nullptr;
+ int m_nCurPage;
+ QList m_listPageHis;
+ bool m_isdragState = false;//是否为悬浮状态
+ bool isMove;// 是否可移动
+ QPoint lastPoint;// 拖拽控件时 记录当前控件的位置
+ FakeKeyboard *vKeyboard;
+};
+
+#endif // VIRTUALKEYBOARDWIDGET_H
diff --git a/VirtualKeyboard/src/x11keyboard.cpp b/VirtualKeyboard/src/x11keyboard.cpp
index 5e160ed..c7cd2c8 100644
--- a/VirtualKeyboard/src/x11keyboard.cpp
+++ b/VirtualKeyboard/src/x11keyboard.cpp
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,9 +12,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#include "x11keyboard.h"
#include
@@ -22,8 +21,6 @@
#include
#include
-
-
struct CharMap {
QChar name;
KeySym code;
@@ -79,14 +76,15 @@ QMap funckeyMap = {
{FuncKey::UP, XK_Up},
{FuncKey::DOWN, XK_Down},
{FuncKey::LEFT, XK_Left},
- {FuncKey::RIGHT, XK_Right}
+ {FuncKey::RIGHT, XK_Right},
+ {FuncKey::CAPSLOCK, XK_Caps_Lock}
};
QMap modifierMap = {
{Modifier::CTRL, XK_Control_L},
{Modifier::ALT, XK_Alt_L},
{Modifier::SUPER, XK_Super_L},
- {Modifier::SHIFT, XK_Shift_L}
+ {Modifier::SHIFT, XK_Shift_L},
};
QVector shiftKeyVec = {'~', '!', '@', '#', '$', '%', '^', '&', '*',
@@ -123,7 +121,7 @@ unsigned int keyCodeOfChar(QChar c)
}
X11Keyboard::X11Keyboard(QObject *parent)
- : QObject(parent)
+ : FakeKeyboard(parent)
{
}
@@ -168,6 +166,7 @@ void X11Keyboard::onKeyPressed(QChar c)
void X11Keyboard::onKeyPressed(FuncKey::FUNCKEY key)
{
KeyCode keyCode;
+
KeySym keysym = funckeyMap[key];
if(keysym != NoSymbol)
@@ -203,6 +202,9 @@ void X11Keyboard::sendKey(unsigned int keyCode)
KeyCode keyCode = XKeysymToKeycode(display, modifierMap[mod]);
XTestFakeKeyEvent(display, keyCode, False, 2);
}
+
+ //输入结束清除shift状态
+ isShift = false;
XFlush(display);
}
diff --git a/VirtualKeyboard/src/x11keyboard.h b/VirtualKeyboard/src/x11keyboard.h
index 42fd997..9914019 100644
--- a/VirtualKeyboard/src/x11keyboard.h
+++ b/VirtualKeyboard/src/x11keyboard.h
@@ -1,9 +1,9 @@
-/**
+/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -12,85 +12,17 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see .
+ *
**/
#ifndef X11KEYBOARD_H
#define X11KEYBOARD_H
#include
#include
+#include "fakekeyboard.h"
-class Modifier : public QObject
-{
- Q_OBJECT
-public:
- Modifier(){}
-
- enum MOD{
- UNKNOWN = -1,
- CTRL,
- SHIFT,
- ALT,
- SUPER
- };
- Q_ENUM(MOD)
-
- static QString getModifierName(int mod)
- {
- QMetaEnum metaEnum = QMetaEnum::fromType();
- const char* modName = metaEnum.valueToKey(mod);
- QString result = QString(modName).toLower();
- return result;
- }
- static MOD getModifier(const QString &modName)
- {
- QMetaEnum metaEnum = QMetaEnum::fromType();
- MOD mod = (MOD)metaEnum.keyToValue(modName.toUpper().toLocal8Bit().data());
- return mod;
- }
-};
-
-class FuncKey : public QObject
-{
- Q_OBJECT
-public:
- FuncKey(){}
-
- enum FUNCKEY {
- UNKNOWN = -1,
- SPACE = 0,
- BACKSPACE,
- ENTER,
- HOME,
- END,
- PGUP,
- PGDN,
- INSERT,
- DELETE,
- UP,
- DOWN,
- LEFT,
- RIGHT
- };
- Q_ENUM(FUNCKEY)
- static QString getKeyName(int key)
- {
- QMetaEnum metaEnum = QMetaEnum::fromType();
- const char* keyName = metaEnum.valueToKey(key);
- QString result = QString(keyName).toLower();
- return result;
- }
- static FUNCKEY getKey(const QString &keyName)
- {
- QMetaEnum metaEnum = QMetaEnum::fromType();
- FUNCKEY key = (FUNCKEY)metaEnum.keyToValue(keyName.toUpper().toLocal8Bit().data());
- return key;
- }
-};
-
-class X11Keyboard : public QObject
+class X11Keyboard : public FakeKeyboard
{
Q_OBJECT
public:
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index ac9b470..6900182 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -4,3 +4,4 @@ install(FILES ukui-screensaver.directory DESTINATION /usr/share/desktop-director
install(FILES ukui-screensavers.menu DESTINATION /etc/xdg/menus)
install(FILES ukui-screensaver-qt DESTINATION /etc/pam.d)
install(FILES screensaver-startup.sh DESTINATION /usr/bin)
+install(FILES ukui-screensaver-dialog.desktop DESTINATION /usr/share/applications)
diff --git a/data/org.ukui.screensaver.gschema.xml b/data/org.ukui.screensaver.gschema.xml
index 302bc72..4aef623 100644
--- a/data/org.ukui.screensaver.gschema.xml
+++ b/data/org.ukui.screensaver.gschema.xml
@@ -166,7 +166,7 @@
Allow the session status message to be displayed when the screen is locked.
- '/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg'
+ '/usr/share/backgrounds/1-openkylin.jpg'
the background iamge of lockscreen
Allow the user to set the background iamge of lockscreen.
diff --git a/data/screensaver-startup.sh b/data/screensaver-startup.sh
index c110d2e..822388a 100755
--- a/data/screensaver-startup.sh
+++ b/data/screensaver-startup.sh
@@ -1,5 +1,4 @@
#!/bin/bash
-/usr/lib/ukui-screensaver/set4kScale >/dev/null 2>&1
ukui-screensaver-dialog --lock-startup & >/dev/null 2>&1
/usr/lib/ukui-screensaver/screensaver-focus-helper & >/dev/null 2>&1
diff --git a/data/ukui-screensaver-dialog.desktop b/data/ukui-screensaver-dialog.desktop
new file mode 100644
index 0000000..95f33d1
--- /dev/null
+++ b/data/ukui-screensaver-dialog.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Type=Application
+Name=Lockscreen Dialog
+Name[tr]=Ekran pencere
+Name[zh_CN]=锁屏窗口程序
+Name[zh_HK]=鎖屏窗口程式
+Name[zh_TW]=鎖屏窗口程式
+Comment[tr]=Ekran kilidini ve kurtarıcı göster
+Comment[zh_CN]=展示屏幕锁定和保护程序
+Comment[zh_TW]=展示屏幕鎖定和保護程式
+Exec=/usr/bin/ukui-screensaver-dialog
+NoDisplay=true
+OnlyShowIn=UKUI
+X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_kwin_keystate
+
diff --git a/data/ukui-screensaver.desktop b/data/ukui-screensaver.desktop
index ce57723..9db6658 100644
--- a/data/ukui-screensaver.desktop
+++ b/data/ukui-screensaver.desktop
@@ -17,3 +17,4 @@ X-UKUI-Bugzilla-Product=ukui-screensaver
X-UKUI-Bugzilla-Component=general
X-UKUI-Bugzilla-Version=1.0.0
OnlyShowIn=UKUI
+X-UKUI-AutoRestart=true
diff --git a/debian/changelog b/debian/changelog
index 745320d..74c6e0d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+ukui-screensaver (4.0.0.0-ok0~0426) yangtze; urgency=medium
+
+ * BUG号: 137546 【RISC-V】【控制面板】无法更改屏幕缩放
+ * 需求号:无
+ * 其他修改说明:无
+
+ -- Yang Min Wed, 26 Apr 2023 19:49:20 +0800
+
ukui-screensaver (3.22.1.3-ok11~0412) yangtze; urgency=medium
* BUG号:I5XFFQ 锁屏登入界面无键盘图标,无实体键盘时无法输入
diff --git a/debian/control b/debian/control
index dd14820..ad39a66 100644
--- a/debian/control
+++ b/debian/control
@@ -25,6 +25,7 @@ Build-Depends: debhelper-compat (= 12),
libgsettings-qt-dev,
libkf5windowsystem-dev,
libmatemixer-dev,
+ libimlib2-dev,
libukui-log4qt-dev,
libkysdk-sysinfo-dev (>> 1.1.0kylin1),
ukui-input-gather (>=1.0.0.2),
diff --git a/debian/patches/0001-change-version-for-rebuild.patch b/debian/patches/0001-change-version-for-rebuild.patch
deleted file mode 100644
index 2b07b39..0000000
--- a/debian/patches/0001-change-version-for-rebuild.patch
+++ /dev/null
@@ -1,8914 +0,0 @@
-From: winnerym
-Date: Thu, 8 Dec 2022 14:21:31 +0800
-Subject: change version for rebuild
-
----
- CMakeLists.txt | 5 +-
- Common/commonfunc.cpp | 1 +
- KylinNM/src/kylinnm.cpp | 1 +
- VirtualKeyboard/CMakeLists.txt | 5 +
- VirtualKeyboard/src/keyboardwidget.ui | 63 +-
- VirtualKeyboard/src/virtualkeyboard.cpp | 6 +-
- VirtualKeyboard/src/vkstackedwidget.cpp | 22 +
- VirtualKeyboard/src/vkstackedwidget.h | 18 +
- data/CMakeLists.txt | 1 +
- data/org.ukui.screensaver.gschema.xml | 2 +-
- data/ukui-screensaver-dialog.desktop | 15 +
- data/ukui-screensaver.desktop | 1 +
- i18n_ts/bo.ts | 375 ++++--
- i18n_ts/bo_CN.ts | 1912 +++++++++++--------------------
- i18n_ts/es.ts | 194 +++-
- i18n_ts/fr.ts | 194 +++-
- i18n_ts/pt.ts | 194 +++-
- i18n_ts/ru.ts | 194 +++-
- i18n_ts/tr.ts | 375 ++++--
- i18n_ts/zh_CN.ts | 173 +--
- screensaver/scconfiguration.cpp | 2 +-
- screensaver/screensaver.cpp | 19 -
- src/CMakeLists.txt | 11 +-
- src/assets.qrc | 12 +-
- src/assets/authdialog.qss | 5 -
- src/assets/hibernate.png | Bin 902 -> 0 bytes
- src/assets/hibernate.svg | 1 +
- src/assets/keyboard.png | Bin 171 -> 0 bytes
- src/assets/powerManager.png | Bin 501 -> 0 bytes
- src/assets/reboot.png | Bin 1106 -> 0 bytes
- src/assets/reboot.svg | 1 +
- src/assets/shutdown.png | Bin 1157 -> 0 bytes
- src/assets/shutdown.svg | 1 +
- src/assets/suspend.png | Bin 817 -> 0 bytes
- src/assets/suspend.svg | 1 +
- src/assets/switchUser.png | Bin 424 -> 0 bytes
- src/assets/switchuser.svg | 1 +
- src/auth-pam.cpp | 52 +-
- src/auth-pam.h | 3 +-
- src/authdialog.cpp | 52 +-
- src/authdialog.h | 6 +-
- src/authpamthread.cpp | 201 ----
- src/authpamthread.h | 35 -
- src/batterywidget.cpp | 3 +-
- src/configuration.cpp | 3 +-
- src/fullbackgroundwidget.cpp | 142 ++-
- src/iconedit.cpp | 26 +-
- src/interface.cpp | 16 +-
- src/libinputswitchevent.cpp | 65 ++
- src/libinputswitchevent.h | 40 +
- src/lockwidget.cpp | 338 ++++--
- src/lockwidget.h | 13 +-
- src/plasma-shell-manager.cpp | 170 +++
- src/plasma-shell-manager.h | 37 +
- src/powermanager.cpp | 33 +-
- src/powermanager.h | 11 +-
- src/screensaverwidget.cpp | 4 +-
- src/ukui-screensaver-dialog.cpp | 16 +-
- 58 files changed, 3074 insertions(+), 1997 deletions(-)
- create mode 100644 VirtualKeyboard/src/vkstackedwidget.cpp
- create mode 100644 VirtualKeyboard/src/vkstackedwidget.h
- create mode 100644 data/ukui-screensaver-dialog.desktop
- delete mode 100644 src/assets/hibernate.png
- create mode 100644 src/assets/hibernate.svg
- delete mode 100644 src/assets/keyboard.png
- delete mode 100644 src/assets/powerManager.png
- delete mode 100644 src/assets/reboot.png
- create mode 100644 src/assets/reboot.svg
- delete mode 100644 src/assets/shutdown.png
- create mode 100644 src/assets/shutdown.svg
- delete mode 100644 src/assets/suspend.png
- create mode 100644 src/assets/suspend.svg
- delete mode 100644 src/assets/switchUser.png
- create mode 100644 src/assets/switchuser.svg
- delete mode 100644 src/authpamthread.cpp
- delete mode 100644 src/authpamthread.h
- create mode 100644 src/libinputswitchevent.cpp
- create mode 100644 src/libinputswitchevent.h
- create mode 100644 src/plasma-shell-manager.cpp
- create mode 100644 src/plasma-shell-manager.h
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 14d81a6..0aa1a46 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -5,10 +5,13 @@ find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras Xml Network Svg)
- find_package(PkgConfig REQUIRED)
- find_package(OpenCV REQUIRED)
- find_package(PkgConfig)
-+find_package(KF5Screen REQUIRED)
-+find_package(KF5Wayland REQUIRED)
-+
- pkg_check_modules(GIOUNIX2 REQUIRED gio-unix-2.0)
- pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
- pkg_check_modules(kylin-nm-base REQUIRED kylin-nm-base)
--
-+pkg_check_modules(KScreen REQUIRED kscreen2)
-
- # 是否是intel项目
- option (USE_INTEL "intel项目" OFF)
-diff --git a/Common/commonfunc.cpp b/Common/commonfunc.cpp
-index 79df19e..c80213b 100644
---- a/Common/commonfunc.cpp
-+++ b/Common/commonfunc.cpp
-@@ -22,6 +22,7 @@
- #include
- #include
- #include
-+#include
- #include
- #include
- #include "commonfunc.h"
-diff --git a/KylinNM/src/kylinnm.cpp b/KylinNM/src/kylinnm.cpp
-index 3446f2e..d17fd83 100644
---- a/KylinNM/src/kylinnm.cpp
-+++ b/KylinNM/src/kylinnm.cpp
-@@ -2470,6 +2470,7 @@ void KylinNM::enWifiDone()
-
- qDebug()<<"debug: already turn on the switch of wifi network";
- syslog(LOG_DEBUG, "Already turn on the switch of wifi network");
-+ QTimer::singleShot(200, this, &KylinNM::onConnectChanged);
- }
- void KylinNM::disWifiDone()
- {
-diff --git a/VirtualKeyboard/CMakeLists.txt b/VirtualKeyboard/CMakeLists.txt
-index f9d52c7..3c8a010 100644
---- a/VirtualKeyboard/CMakeLists.txt
-+++ b/VirtualKeyboard/CMakeLists.txt
-@@ -7,12 +7,17 @@ set(CMAKE_AUTORCC ON)
- qt5_add_resources(VirtualKeyboard_SRC
- src/keyboard.qrc)
-
-+qt5_wrap_cpp(VirtualKeyboard_SRC
-+ src/vkstackedwidget.h
-+ )
-+
- set(VirtualKeyboard_SRC
- ${VirtualKeyboard_SRC}
- src/cursormonitor.cpp
- src/keyboardwidget.cpp
- src/virtualkeyboard.cpp
- src/x11keyboard.cpp
-+ src/vkstackedwidget.cpp
- src/keyboard.qrc)
-
- include_directories(
-diff --git a/VirtualKeyboard/src/keyboardwidget.ui b/VirtualKeyboard/src/keyboardwidget.ui
-index ac55eff..2f6b5f1 100644
---- a/VirtualKeyboard/src/keyboardwidget.ui
-+++ b/VirtualKeyboard/src/keyboardwidget.ui
-@@ -50,25 +50,25 @@
- -
-
-
-- 20
-+ 8
-
-
- QLayout::SetNoConstraint
-
-
-- 10
-+ 8
-
-
-- 10
-+ 8
-
-
-- 10
-+ 8
-
-
-- 10
-+ 8
-
-
-
--
-+
-
- 1
-
-@@ -107,8 +107,8 @@
-
-
-
-- 20
-- 40
-+ 10
-+ 20
-
-
-
-@@ -695,8 +695,8 @@
-
-
-
-- 20
-- 40
-+ 10
-+ 20
-
-
-
-@@ -707,9 +707,24 @@
-
-
-
-+
-+ 4
-+
-
- QLayout::SetNoConstraint
-
-+
-+ 0
-+
-+
-+ 0
-+
-+
-+ 0
-+
-+
-+ 0
-+
-
-
-
-
-@@ -872,7 +887,7 @@
-
-
-
-
--
-+
- 0
- 0
-
-@@ -885,7 +900,7 @@
-
-
-
-
--
-+
- 0
- 0
-
-@@ -973,7 +988,7 @@
-
-
-
-
--
-+
- 0
- 0
-
-@@ -986,7 +1001,7 @@
-
-
-
-
--
-+
- 0
- 0
-
-@@ -1012,7 +1027,7 @@
-
-
-
-
--
-+
- 0
- 0
-
-@@ -1025,7 +1040,7 @@
-
-
-
-
--
-+
- 0
- 0
-
-@@ -1096,8 +1111,8 @@
-
-
-
-- 20
-- 40
-+ 10
-+ 20
-
-
-
-@@ -1185,8 +1200,8 @@
-
-
-
-- 20
-- 40
-+ 10
-+ 20
-
-
-
-@@ -1198,6 +1213,14 @@
-
-
-
-+
-+
-+ VKStackedWidget
-+ QStackedWidget
-+
-+ 1
-+
-+
-
-
-
-diff --git a/VirtualKeyboard/src/virtualkeyboard.cpp b/VirtualKeyboard/src/virtualkeyboard.cpp
-index ea46695..bdc65a7 100644
---- a/VirtualKeyboard/src/virtualkeyboard.cpp
-+++ b/VirtualKeyboard/src/virtualkeyboard.cpp
-@@ -39,10 +39,12 @@ VirtualKeyboard::VirtualKeyboard(QWidget *parent)
-
- keyboardWidget = new KeyboardWidget(this);
- QHBoxLayout *hl_keyboard = new QHBoxLayout(this);
-- QSpacerItem *spacer = new QSpacerItem(40, 20);
-+ hl_keyboard->setContentsMargins(0,0,0,0);
-+ hl_keyboard->setSpacing(0);
-+ QSpacerItem *spacer = new QSpacerItem(10, 5);
- hl_keyboard->addSpacerItem(spacer);
- hl_keyboard->addWidget(keyboardWidget);
-- QSpacerItem *spacer2 = new QSpacerItem(40, 20);
-+ QSpacerItem *spacer2 = new QSpacerItem(10, 5);
- hl_keyboard->addSpacerItem(spacer2);
-
- QFile qssFile(":/qss/keyboard.qss");
-diff --git a/VirtualKeyboard/src/vkstackedwidget.cpp b/VirtualKeyboard/src/vkstackedwidget.cpp
-new file mode 100644
-index 0000000..1e966bb
---- /dev/null
-+++ b/VirtualKeyboard/src/vkstackedwidget.cpp
-@@ -0,0 +1,22 @@
-+#include "vkstackedwidget.h"
-+
-+VKStackedWidget::VKStackedWidget(QWidget *parent/* = nullptr*/)
-+ : QStackedWidget(parent)
-+{
-+
-+}
-+
-+VKStackedWidget::~VKStackedWidget()
-+{
-+
-+}
-+
-+QSize VKStackedWidget::sizeHint() const
-+{
-+ return currentWidget()->sizeHint();
-+}
-+
-+QSize VKStackedWidget::minimumSizeHint() const
-+{
-+ return currentWidget()->minimumSizeHint();
-+}
-diff --git a/VirtualKeyboard/src/vkstackedwidget.h b/VirtualKeyboard/src/vkstackedwidget.h
-new file mode 100644
-index 0000000..8ca4994
---- /dev/null
-+++ b/VirtualKeyboard/src/vkstackedwidget.h
-@@ -0,0 +1,18 @@
-+#ifndef VKSTACKEDWIDGET_H
-+#define VKSTACKEDWIDGET_H
-+
-+#include
-+
-+class VKStackedWidget : public QStackedWidget
-+{
-+ Q_OBJECT
-+public:
-+ explicit VKStackedWidget(QWidget *parent = nullptr);
-+ virtual ~VKStackedWidget();
-+
-+protected:
-+ QSize sizeHint() const override;
-+ QSize minimumSizeHint() const override;
-+};
-+
-+#endif // VKSTACKEDWIDGET_H
-diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
-index ac9b470..6900182 100644
---- a/data/CMakeLists.txt
-+++ b/data/CMakeLists.txt
-@@ -4,3 +4,4 @@ install(FILES ukui-screensaver.directory DESTINATION /usr/share/desktop-director
- install(FILES ukui-screensavers.menu DESTINATION /etc/xdg/menus)
- install(FILES ukui-screensaver-qt DESTINATION /etc/pam.d)
- install(FILES screensaver-startup.sh DESTINATION /usr/bin)
-+install(FILES ukui-screensaver-dialog.desktop DESTINATION /usr/share/applications)
-diff --git a/data/org.ukui.screensaver.gschema.xml b/data/org.ukui.screensaver.gschema.xml
-index 302bc72..4aef623 100644
---- a/data/org.ukui.screensaver.gschema.xml
-+++ b/data/org.ukui.screensaver.gschema.xml
-@@ -166,7 +166,7 @@
- Allow the session status message to be displayed when the screen is locked.
-
-
-- '/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg'
-+ '/usr/share/backgrounds/1-openkylin.jpg'
- the background iamge of lockscreen
- Allow the user to set the background iamge of lockscreen.
-
-diff --git a/data/ukui-screensaver-dialog.desktop b/data/ukui-screensaver-dialog.desktop
-new file mode 100644
-index 0000000..95f33d1
---- /dev/null
-+++ b/data/ukui-screensaver-dialog.desktop
-@@ -0,0 +1,15 @@
-+[Desktop Entry]
-+Type=Application
-+Name=Lockscreen Dialog
-+Name[tr]=Ekran pencere
-+Name[zh_CN]=锁屏窗口程序
-+Name[zh_HK]=鎖屏窗口程式
-+Name[zh_TW]=鎖屏窗口程式
-+Comment[tr]=Ekran kilidini ve kurtarıcı göster
-+Comment[zh_CN]=展示屏幕锁定和保护程序
-+Comment[zh_TW]=展示屏幕鎖定和保護程式
-+Exec=/usr/bin/ukui-screensaver-dialog
-+NoDisplay=true
-+OnlyShowIn=UKUI
-+X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_kwin_keystate
-+
-diff --git a/data/ukui-screensaver.desktop b/data/ukui-screensaver.desktop
-index ce57723..9db6658 100644
---- a/data/ukui-screensaver.desktop
-+++ b/data/ukui-screensaver.desktop
-@@ -17,3 +17,4 @@ X-UKUI-Bugzilla-Product=ukui-screensaver
- X-UKUI-Bugzilla-Component=general
- X-UKUI-Bugzilla-Version=1.0.0
- OnlyShowIn=UKUI
-+X-UKUI-AutoRestart=true
-diff --git a/i18n_ts/bo.ts b/i18n_ts/bo.ts
-index df90984..c88658a 100644
---- a/i18n_ts/bo.ts
-+++ b/i18n_ts/bo.ts
-@@ -4,111 +4,134 @@
-
- AuthDialog
-
--
-+
-
-
-
-
--
--
--
--
-+
-+
-+
-+
-
-
-
-
--
--
--
--
-+
-+
-+
-+
-
-
-
-
--
--
--
--
-+
-+
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
-+
-+ BatteryWidget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- BiometricAuthWidget
-
-@@ -1424,6 +1447,124 @@
-
-
-
-+
-+ EngineDevice
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- InputInfos
-
-@@ -1541,7 +1682,7 @@
-
-
-
--
-+
-
-
-
-@@ -1554,7 +1695,7 @@
-
-
-
--
-+
-
-
-
-@@ -1580,22 +1721,22 @@
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1618,17 +1759,17 @@
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1636,12 +1777,12 @@
-
- LoginOptionsWidget
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1821,38 +1962,38 @@
-
- PowerManager
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1870,20 +2011,95 @@
-
-
-
-+
-+ S:
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+
-+ laptop primary battery
-+
-+
-+
-+
-+
-+ battery-backed AC power source
-+
-+
-+
-+
-+
-+ a monitor is a device to measure voltage and current
-+
-+
-+
-+
-+
-+ wireless mice with internal batteries
-+
-+
-+
-+
-+
-+ wireless keyboard with internal battery
-+
-+
-+
-+
-+
-+ portable device
-+
-+
-+
-+
-+
-+ cell phone (mobile...)
-+
-+
-+
-+
-+
-+ media player, mp3 etc
-+
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-
- Screensaver
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1955,38 +2171,38 @@
-
- TabletLockWidget
-
--
--
--
--
--
--
-+
-+
-+
-+
-+
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -2058,25 +2274,38 @@
-
-
-
-+
-+ Widget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- main
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -2087,8 +2316,8 @@
-
-
-
--
-
-+
-
-
-
-@@ -2108,23 +2337,23 @@
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-diff --git a/i18n_ts/bo_CN.ts b/i18n_ts/bo_CN.ts
-index 3b0bc42..e4e93b5 100644
---- a/i18n_ts/bo_CN.ts
-+++ b/i18n_ts/bo_CN.ts
-@@ -4,2549 +4,1927 @@
-
- AuthDialog
-
--
-- 选择其他设备
--
--
--
-- 使用生物识别认证
-+
-+ ཡང་བསྐྱར་ཚོད་ལེན།
-
-
--
-- 使用密码认证
-+
-+ གསང་ཨང་མནོན་པའམ་མཛུབ་རིམ་མནོན་རོགས།
-
-
--
--
-- བསྐྱར་དུ་ཞིབ་བཤེར་བྱ་དགོས།
-+
-+ མཛུབ་རིས་ར་སྤྲོད་ཕམ་ཉེས་ཚད་ཆེས་ཆེ་ལས་བརྒལ་བ། ཁྱོས་གསང་ཨང་བཀོལ་ནས་ཟྭ་འབྱེད་རོགས།
-
-
--
-- 解锁
-+
-+ མཛུབ་རིས་ར་སྤྲོད་ཕམ་ཉེས་བྱུང་། ཁྱོད་ལ་ད་དུང་གོ་སྐབས་གཅིག་ཡོད།
-
-
--
-- 向上滑动解锁
-+
-+ གསང་ཨང་།
-
-
--
-- 您有%1条未读消息
-+
-+ སྐྱེ་དངོས་ངོས་འཛིན་ཀྱི་དཔང་ལེན།
-
-
--
-- 已登录
-+
-+ སྒྲིག་ཆས་གཞན་དག
-
-
--
-- 密码:
-+
-+ གསང་ཨང་ར་སྤྲོད་གྲོས་ཆིངས།
-
-
--
-- 账户锁定%1分钟由于%2次错误尝试
-+
-+ དཔང་ལེན་བྱ་མ་ཐུབ། ཡང་བསྐྱར་ཚོད་ལྟ་བྱོས།
-
-
--
--
--
--
-
-- ཁྱོད་ཀྱིས་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་ཚོད་ལྟ་ཞིག་བྱེད་རོགས།
-+
-
-
--
--
--
--
-
-- ཁྱོད་ཀྱིས་དུས་ཚོད་སྐར་ཆ་གཅིག་གི་ནང་དུ་ཡང་བསྐྱར་ཚོད་ལྟ་ཞིག་བྱེད་རོགས།
-+
-
-
--
--
--
--
-
-- དུས་གཏན་དུ་ཟྭ་བརྒྱབ་པའི་རྩིས་ཐོ།
-+
-
-
--
-
-- ངོ་གདོང་ངོས་འཛིན་ལ་ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་
-+
-
-
--
-
-- མཛུབ་རིས་མནན་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་
-+
-
-
--
-
-- སྒྲ་པར་ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག
-+
-
-
--
-
-- མཛུབ་མོའི་ནང་དུ་ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་
-+
-
-
--
-
-- iris ཞིབ་བཤེར་བྱེད་པའམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་
--
--
--
--
-- ནང་འཇུག་གི་གསང་གྲངས།
--
--
--
--
-- %1ལ་ཞིབ་བཤེར་བྱེད་མ་ཐུབ་ན། གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག་རོགས།
--
--
--
--
-- %1ལ་ཞིབ་བཤེར་བྱེད་ཐབས་བྲལ་བ་དང་། གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག་རོགས།
--
--
--
--
-- རྒྱུན་ལྡན་མིན་པའི་དྲ་
--
--
--
-- 使用绑定的微信扫码或输入密码登录
-+
-
-
--
--
-
-- གསང་གྲངས་སྟོང་པ་ཡིན་མི་སྲིད།
-+
-
-
--
-- 验证%1失败,请输入密码.
-+
-+
-
-
--
-- 无法验证%1,请输入密码.
-+
-+
-
-
--
-
-- %1ལ་ཞིབ་བཤེར་བྱེད་མ་ཐུབ་ན། ཁྱེད་ཚོར་ད་དུང་%2ལ་ཞིབ་བཤེར་བྱེད་པའི་གོ་སྐབས་ཡོད།
--
--
--
-- 生物/扫码验证失败达最大次数,请使用密码解锁
--
--
--
-- 生物/扫码验证失败,您还有%1次尝试机会
--
--
--
-- 网络异常
--
--
--
-- 密码错误,请重试
--
--
--
-- 认证失败,还剩%1次尝试机会
--
--
--
-- 请输入密码或者录入指纹
--
--
--
--
-- བདེན་དཔང་ར་སྤྲོད་བྱེད་མ་ཐུབ་ན། ཡང་བསྐྱར་ཚོད་ལྟ་ཞིག
-+
-
-
--
-
-- འབྲེལ་མཐུད་ཀྱི་འཕྲིན་ཕྲན་ཞིབ་བཤེར་ཨང་གྲངས་སམ་ཡང་ན་གསང་གྲངས་ནང་འཇུག་བྱས་ནས་ཟྭ་རྒྱག་པ།
--
--
--
--
-- གསང་གྲངས།
--
--
--
--
-- ཐོ་འགོད་བྱེད་པ།
--
--
--
-- 生物识别认证
-+
-
-
--
-- 密码认证
-+
-+
-
-
--
-- 其他设备
-+
-+
-
-
--
-- 指纹验证失败达最大次数,请使用密码登录
-+
-+
-
-
--
-- 指纹验证失败,您还有%1次尝试机会
-+
-+
-
-
-
-- BioDevices
-+ BatteryWidget
-
--
-- 指纹
--
--
--
-- 指静脉
--
--
--
-- 虹膜
--
--
--
-- 人脸
--
--
--
-- 声纹
-+
-+
-
--
--
-- BioDevicesWidget
-
--
-- 请选择其他生物识别设备
-+
-+
-
-
--
-- 设备类型:
-+
-+
-
-
--
-- 设备名称:
-+
-+
-
-
-
- BiometricAuthWidget
-
--
--
-- མིག་སྔའི་སྒྲིག་ཆས་ནི།
-+
-+ ངོས་འཛིན་མ་ཐུབ། ཡང་བསྐྱར་ཚོད་ལྟ་བྱོས།
-
-
--
--
-- ཕམ་ཉེས་བྱུང་བར་ངོས་འཛིན་གནང་རོགས། ཁྱེད་ཀྱིས་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ
-+
-+ མིག་སྔའི་སྒྲིག་ཆས་རེའུ་མིག:
-
-
-
- BiometricDevicesWidget
-
--
-+
-+ གཏན་འཁེལ་བྱེད་པ།
-+
-+
-
-- སྐྱེ་དངོས་དབྱེ་འབྱེད་སྒྲིག་ཆས་འདེམས་རོགས།
-+ ཉིད་ཀྱིས་སྐྱེ་དངོས་སྒྲིག་ཆས་འདེམ་རོགས།
-
-
--
-
-- སྒྲིག་ཆས་ཀྱི་རིགས་དབྱིབས་ནི།
-+ སྒྲིག་ཆས་ཀྱི་རིགས།
-
-
--
-
-- སྒྲིག་ཆས་ཀྱི་མིང་གཤམ་གསལ།
--
--
--
--
-- འགྲིགས།
-+ སྒྲིག་ཆས་ཀྱི་མིང་།
-
-
-
- ConfForm
-
--
-
-- རྩོམ་སྒྲིག་དྲ་བ།
-+
-
-
--
-
-- LANཡི་མིང་ནི།
-+
-
-
--
-
-- བྱེད་ཐབས་ནི།
-+
-
-
--
-
-- སྡོད་གནས་ནི།
-+
-
-
--
-
-- དྲ་རྒྱའི་མ་སི་ཁི་ཡིས་བཤད་རྒྱུར།
-+
-
-
--
-
-- འགག་སྒོ་ནི།
-+
-
-
--
-
-- DNS 1:
-+
-
-
--
-
-- DNS 2:
-+
-
-
--
-
-- རྩོམ་སྒྲིག་པ།
-+
-
-
--
--
-
-- རང་འགུལ་(DHCP)
-+
-
-
--
--
-
-- ལག་དེབ།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- གྲོན་ཆུང་བྱེད་དགོས།
-+
-
-
--
-
-- འགྲིགས།
-+
-
-
--
-
-- སྐུད་ཡོད་བྱང་བུ་མེད་ན་སྐུད་ཡོད་དྲ་རྒྱ་གསར་པ་གཏོད་མི་ཐུབ།
-+
-
-
--
-
-- དྲ་རྒྱ་གསར་པ་གསར་སྐྲུན་བྱས་ཟིན་པ།
-+
-
-
--
-
-- དྲ་རྒྱའི་སྒྲིག་བཀོད་གསར་པ་ལེགས་འགྲུབ་བྱུང་ཡོད།
--
--
--
--
-- རྩོམ་སྒྲིག་དྲ་བ།
--
--
--
--
-- སྐུད་ཡོད་བརྙན་འཕྲིན་དྲ་བ་ཁ་སྣོན་
--
--
--
-- 已创建新的有线网络
-+
-
-
--
-- 新的设置已经生效
-+
-+
-
-
--
--
-- སྒྲིག་གཞི་གསར་པར་ཕན་ནུས་ཐོན་ཡོད།
-+
-+
-
-
--
-- 已有同名连接存在
-+
-+
-
-
-
- DeviceType
-
--
--
-- མཛུབ་མོའི་པར་གཞི།
-+
-+ མིའི་གདོང་།
-
-
--
--
-- མཛུབ་མོ་ཝེ་ལིན།
-+
-+ འཇའ་སྐྱི།
-
-
--
--
-- དབྱི་ལི་སི།
-+
-+ སྒྲ་རིས།
-
-
--
--
-- ངོ་གདོང་།
-+
-+ མཛུབ་རིས།
-
-
--
--
-- སྒྲ་གདངས་ཀྱི་པར་གཞི།
-+
-+ མཛུབ་མོའི་སྡོད་རྩ།
-
-
--
-
-- QRCode
-+
-
-
-
- DigitalAuthDialog
-
--
--
-
-- LoginByUEdu
--
--
--
-- 认证中,请稍后
--
--
--
-- 密码错误,请重试
-+
-
-
--
-
-- ཡང་བསྐྱར་བཀོད་སྒྲིག་བྱེད་དགོས་སམ།
-+
-
-
--
--
-
-- SetNewUeduPWD
-+
-+
-+
-+
-+
-
-
--
-
-- གསར་དུ་གཏན་འཁེལ་བྱས་པའི་ནུའུ་ཝུའུ་ཏུའུ་ཕུའུ་ཝེ་ཏི།
-+
-
-
--
-
-- གསང་བའི་འཇུག་སྒོ་གཉིས་གཅིག་མཐུན་མིན་པས་བསྐྱར་དུ་བཀོད་སྒྲིག་གནང་རོགས།
-+
-
-
--
-
-- གསང་གྲངས་ནང་འཇུག་བྱས་པ་ནོར་འདུག་པས་ཡང་བསྐྱར་ཚོད་ལྟ་ཞིག་གནང་རོགས།
--
--
--
--
-- གསལ་པོར་བཤད་ན།
-+
-
-
-
- DlgConnHidWifi
-
--
-+
-+
-+
-+
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- Wi-Fiཡི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
--
--
--
-- WEP 40/128 位密钥(十六进制或ASCII)
--
--
--
-- WEP 128 位密码句
--
--
--
-- 动态 WEP (802.1x)
--
--
--
-- WPA 及 WPA2 企业
--
--
--
--
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
-
- DlgConnHidWifiLeap
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་མིང་།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
-
- DlgConnHidWifiSecFast
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་
-+
-
-
--
-
-- མིང་མ་བཀོད་པའི་ཐོབ་ཐང
-+
-
-
--
-
-- རང་འགུལ་གྱིས་PACའགོ་pro_visioning་བྱས་ཆོག།
-+
-
-
--
-
-- PACཡིག་ཆ།
-+
-
-
--
-
-- ནང་ཁུལ་གྱི་བདེན་དཔང་ར་སྤྲོད།
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་མིང་།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
--
-
-- ཕུག་ལམ་གྱི་TLS
-+
-
-
--
-
-- སྲུང་སྐྱོབ་ཐོབ་པའི་EAP(PEAP)
-+
-
-
--
-
-- མིང་མ་བཀོད་པའི་
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་བྱས།
-+
-
-
--
-
-- དེ་གཉིས་ཀ
-+
-
-
-
- DlgConnHidWifiSecLeap
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་མིང་།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
--
-
-- ཕུག་ལམ་གྱི་TLS
-+
-
-
--
-
-- སྲུང་སྐྱོབ་ཐོབ་པའི་EAP(PEAP)
-+
-
-
-
- DlgConnHidWifiSecPeap
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་
-+
-
-
--
-
-- མིང་མ་བཀོད་པའི་ཐོབ་ཐང
-+
-
-
--
-
-- ཁྱབ་ཁོངས།
-+
-
-
--
-
-- CA དཔང་ཡིག
-+
-
-
--
-
-- CA དཔང་ཡིག་གི་གསང་གྲངས།
-+
-
-
--
-
-- CAལག་ཁྱེར་མི་དགོས།
-+
-
-
--
-
-- PEAPཔར་གཞི།
-+
-
-
--
-
-- ནང་ཁུལ་གྱི་བདེན་དཔང་ར་སྤྲོད།
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་མིང་།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
--
-
-- ཕུག་ལམ་གྱི་TLS
-+
-
-
--
-
-- སྲུང་སྐྱོབ་ཐོབ་པའི་EAP(PEAP)
-+
-
-
--
-
-- ཡིག་ཆའི་ནང་ནས་གདམ་གསེས་
-+
-
-
--
-
-- རང་འགུལ་གྱིས་རང་
-+
-
-
--
-
-- པར་གཞི་0
-+
-
-
--
-
-- པར་གཞི་དང་པོ།
-+
-
-
-
- DlgConnHidWifiSecPwd
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་མིང་།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
--
-
-- ཕུག་ལམ་གྱི་TLS
-+
-
-
--
-
-- སྲུང་སྐྱོབ་ཐོབ་པའི་EAP(PEAP)
-+
-
-
-
- DlgConnHidWifiSecTls
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་
-+
-
-
--
-
-- ཐོབ་ཐང་།
-+
-
-
--
-
-- ཁྱབ་ཁོངས།
-+
-
-
--
-
-- CA དཔང་ཡིག
-+
-
-
--
-
-- CA དཔང་ཡིག་གི་གསང་གྲངས།
-+
-
-
--
-
-- CAལག་ཁྱེར་མི་དགོས།
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་ལག་ཁྱེར།
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་ལག་ཁྱེར་གྱི་གསང་
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་སྒེར་གྱི་ལྡེ་མིག
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་ལྡེ་མིག་གི་གསང་
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
--
--
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
--
-
-- ཕུག་ལམ་གྱི་TLS
-+
-
-
--
-
-- སྲུང་སྐྱོབ་ཐོབ་པའི་EAP(PEAP)
-+
-
-
--
--
--
-
-- ཡིག་ཆའི་ནང་ནས་གདམ་གསེས་
-+
-
-
-
- DlgConnHidWifiSecTunnelTLS
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་
-+
-
-
--
-
-- མིང་མ་བཀོད་པའི་ཐོབ་ཐང
-+
-
-
--
-
-- ཁྱབ་ཁོངས།
-+
-
-
--
-
-- CA དཔང་ཡིག
-+
-
-
--
-
-- CA དཔང་ཡིག་གི་གསང་གྲངས།
-+
-
-
--
-
-- CAལག་ཁྱེར་མི་དགོས།
-+
-
-
--
-
-- ནང་ཁུལ་གྱི་བདེན་དཔང་ར་སྤྲོད།
-+
-
-
--
-
-- སྤྱོད་མཁན་གྱི་མིང་།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
--
-
-- ཕུག་ལམ་གྱི་TLS
-+
-
-
--
-
-- སྲུང་སྐྱོབ་ཐོབ་པའི་EAP(PEAP)
-+
-
-
--
-
-- ཡིག་ཆའི་ནང་ནས་གདམ་གསེས་
-+
-
-
-
- DlgConnHidWifiWep
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- ལྡེ་མིག
-+
-
-
--
-
-- WEPསྟོན་གྲངས།
-+
-
-
--
-
-- བདེན་དཔང་ར་སྤྲོད་
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
--
-
-- WEP 40/128-bit Key (Hex or ASCII)
-+
-
-
--
-
-- WEP 128-bit Passprase
-+
-
-
--
-
-- འགུལ་རྣམ་གྱི་WEP (802.1X)
-+
-
-
--
-
-- WPA & WPA2 ཁེ་ལས།
-+
-
-
--
-
-- 1(default)
-+
-
-
--
-
-- སྒོ་འབྱེད་མ་ལག
-+
-
-
--
-
-- མཉམ་སྤྱོད་ཀྱི་ལྡེ་མིག
-+
-
-
-
- DlgConnHidWifiWpa
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
-+
-
-
--
-
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiབསྣན་པ།
-+
-
-
--
-
-- འབྲེལ་མཐུད་
-+
-
-
--
-
-- Wi-Fiཡི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- C_reate…
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
--
--
--
-- WEP 40/128 位密钥(十六进制或ASCII)
--
--
--
-- WEP 128 位密码句
--
--
--
-- 动态 WEP (802.1x)
--
--
--
-- WPA 及 WPA2 企业
-+
-
-
-
- DlgHotspotCreate
-
--
-
-- གླེང་མོལ།
-+
-
-
--
-
-- ཚ་བ་ཆེ་བའི་ས་ཆ་གསར་སྐྲུན་
-+
-
-
--
-
-- དྲ་རྒྱའི་མིང་།
-+
-
-
--
-
-- Wi-Fiབདེ་འཇགས།
-+
-
-
--
-
-- གསང་གྲངས།
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- འགྲིགས།
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WPA & WPA2 མི་སྒེར་
-+
-
-
-
-- InputInfos
-+ EngineDevice
-
--
--
-- ཞབས་ཞུའི་དམིགས་བསལ་ ...
-+
-+
-
-
--
--
-- གོ་མི་ཐུབ་པའི་གྲངས་ཀ་ ...
-+
-+
-
-
--
--
-- ཤེས་མེད་པའི་ནོར་འཛོལ། %1
-+
-+
-
-
--
--
-- ཕྱིར་ལེན་པ།(60s)
-+
-+
-
-
--
--
-- ཕྱིར་ལེན་པ།(%1s)
-+
-+
-
-
--
--
--
-- ཚབ་རྟགས་ཐོབ་པ།
-+
-+
-
--
--
-- KeyboardWidget
-
--
--
-- མཐེབ་གཞོང་Widget
-+
-+
-
--
--
-- KylinDBus
-
--
-- 麒麟网络工具信息提示
-+
-+
-
--
--
-- KylinNM
-
--
--
-- kylin-nm
-+
-+
-
-
--
--
--
-- ལན་ལན།
-+
-+
-
-
--
-- 其他有线网络
-+
-+
-
-
--
-- 无线网络
-+
-+
-
-
--
-- 其他无线网络
-+
-+
-
-
--
-- 加入其他网络
-+
-+
-
-
--
-- 网络
-+
-+
-
-
--
--
--
-- སྔོན་ཐོན་རང་བཞིན།
-+
-+
-
-
--
-- 有线网络
-+
-+
-
-
--
-- 加入网络
-+
-+
-
-
--
-- 无线网络
-+
-+
-
-
--
-- 已开启
-+
-+
-
-
--
-- 已关闭
-+
-+
-
-
--
--
-- ཚ་བ་ཆེ་བ།
-+
-+
-
-
--
--
-- འཕུར་སྐྱོད་འཕྲུལ་འཁོར།
-+
-+
-
-+
-+
-+ InputInfos
-
--
-- 显示网络连接界面
-+
-+
-
-
--
--
-- འགུལ་སྐྱོད་མ་བྱས་པའི་LAN
-+
-+
-
-
--
-- 未激活
-+
-+
-
-
--
--
-- WLAN གཞན་དག
-+
-+
-
-
--
--
--
-- སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ།
-+
-+
-
-
--
--
-- ཅིན་ལིན་ནའེ་མུའུ་ལ་བསྟན་དོན།
-+
-+
-
-+
-+
-+ KeyboardWidget
-
--
--
-- སྐུད་མེད་བྱང་བུ་མ་རྙེད་པ།
-+
-+
-
-+
-+
-+ KylinNM
-
--
--
-- འགུལ་སྐྱོད་བྱས་པའི་LAN
-+
-+
-
-
--
--
-- འགུལ་སྐྱོད་བྱས་པའི་WLAN
-+
-+
-
-
--
--
--
--
--
--
-- འབྲེལ་མཐུད་མི་བྱེད་པ།
--
--
--
--
--
--
--
--
--
--
--
--
-- འབྲེལ་ཐག་ཆད་པ།
-+
-+
-
-
--
--
-- སྐུད་ཡོད་བརྙན་འཕྲིན་དྲ་བའི་འཆར་གཞི་གཞན་དག་མེད
-+
-+
-
-
--
-- 编辑
-+
-+
-
-
--
-- 完成
-+
-+
-
-
--
-- 未连接任何网络
-+
-+
-
-
--
--
-- སྐུད་མེད་དྲ་རྒྱའི་འཆར་གཞི་གཞན་དག་མེད།
-+
-+
-
-
--
--
-- སྐུད་ཡོད་དྲ་རྒྱ་ཆད་པ།
-+
-+
-
-
--
-- 断开无线网络
-+
-+
-
-
--
--
-- ཁྱོད་ཀྱི་Wi-Fiཡི་གསང་གྲངས་སམ་ཡང་ན་སྐུད་མེད་བྱང་བུ་བཀོལ་སྤྱོད་བྱེད་ཆོག་པ་ར་སྤྲོད
--
--
--
-- 其他有线网络
--
--
--
-- 新建有线网络
--
--
--
-- 加入网络
-+
-+
-
-
--
--
-- མིང་ཐོའི་ནང་དུ་སྤྱོད་གོ་ཆོད་པའི་དྲ་རྒྱ་མེད།
-+
-+
-
-
--
--
--
-- དྲ་རྒྱ་དང་།
-+
-+
-
-
--
-- 其他无线网络
-+
-+
-
-
--
-- 无
-+
-+
-
-
--
-- 打开无线网开关前保持有线网开关打开
-+
-+
-
-
--
-- 请先插入无线网卡
-+
-+
-
-
--
-- 正在断开异常连接的网络
-+
-+
-
-
--
-- 正在更新 Wi-Fi列表 请再次点击
-+
-+
-
-
--
-- 正在更新 Wi-Fi列表
-+
-+
-
-
--
--
-- Conn Ethernetལེགས་འགྲུབ་བྱུང་བ།
-+
-+
-
-
--
--
-- ཁུང་ནེ་ཨེ་ཐེ་ནའེ་ལ་ཕམ་ཉེས་བྱུང་བ།
-+
-+
-
-
--
--
-- ཁུང་ནེ་ཝེ་ཧྥེ་ལེགས་འགྲུབ་བྱུང་བ།
-+
-+
-
-
-
- LockWidget
-
--
--
--
--
--
--
-
- དུས་ཚོད།
-
-
--
-+
-+ ནས་འོང་བ།
-+
-+
-
- དུས་ཚོད།
-
-
-
-- 游客
-+ མགྲོན་པོ།
-
-
-
-- 切换用户
-+ བཀོལ་མི་བརྗེ་བ།
-
-
--
-
-- སྤྱོད་མཁན་མང་པོ་ཞིག་དུས་གཅིག་ཏུ་ཐོ་འགོད་བྱས་པ་རེད། ཁྱོད་ཀྱིས་མ་ལག་འདི་བསྐྱར་དུ་སྒྲིག་རྒྱུ་ཡིན་ནམ།
-+
-
-
--
-
-- སྐུད་ཡོད་དྲ་བ།
-+
-
-
--
-
-- སྐུད་མེད་ཅུས་ཁོངས་ཀྱི་དྲ་བ།
-+
-
-
-
- LoginOptionsWidget
-
--
-
-- ཐོ་འགོད་ཀྱི་བསལ་འདེམས་ཀྱི་དབང་ཆ།
--
--
--
-- 密码
--
--
--
-- 微信
-+
-
-
--
-
-- དབྱེ་འབྱེད་སྒྲིག་ཆས་མེད་པར་བཟོ་དགོས།
-+
-
-
-
- MyLineEdit
-
--
--
--
-
-- ཞིབ་བཤེར་གྱི་ཚབ་རྟགས།
-+
-
-
-
- OneConnForm
-
--
-
-- རྣམ་པ།
--
--
--
--
-- རང་འགུལ་གྱིས་དྲ་རྒྱའི་ནང་དུ་ཞུགས་པ།
--
--
--
-- 输入密码
--
--
--
-- 设置
-+ ནས་འོང་བ།
-
-
--
--
--
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- འབྲེལ་ཐག་ཆད་པ།
-+
-
-
--
-
-- ནང་འཇུག་གི་གསང་གྲངས་
--
--
--
--
-- སྦས་སྐུང་བྱས་པའི་Wi-Fiདྲ་རྒྱ་སྦྲེལ་མཐུད་བྱེད་པ།
--
--
--
--
-- བརྡ་རྟགས་ནི།
--
--
--
-- 开放
-+
-
-
--
-- 安全
-+
-+
-
-
--
-- 速率
-+
-+
-
-
--
-
-- གཅིག་ཀྱང་མེད།
-+
-
-
--
-
-- WiFiབཀོལ་སྤྱོད་བདེ་འཇགས་ནི།
-+
-+
-+
-+
-+
-
-
--
-
-- MAC:
-+
-
-
--
-
-- ཁུང་ནེ་ཝེ་ཧྥེ་ཕམ་སོང་།
-+
-
-
-
- OneLancForm
-
--
-
-- རྣམ་པ།
--
--
--
-- 设置
-+ ནས་འོང་བ།
-
-
--
--
-
-- སྦྲེལ་མཐུད་བྱེད་པ
-+
-
-
--
-
-- འབྲེལ་ཐག་ཆད་པ།
-+
-
-
--
--
-
-- བཀོད་སྒྲིག་བྱས་མེད་པ།
-+
-
-
--
-
-- IPv4:
-+
-
-
--
-
-- IPv6:
-+
-
-
--
-
-- 带宽:
-+
-
-
--
-
-- MAC:
--
--
--
-- 自动
-+
-
-
-
- PhoneAuthWidget
-
--
--
-
-- ཁ་པར་གྱི་ནུའུ་མུའུ་ཡིས་ཞིབ་བཤེར་བྱས།
-+
-
-
--
-
-- 「ས་མཚམས་ཀྱི་ཁ་པར་ཨང་གྲངས་ལ་བརྟེན་ནས་ཞིབ་བཤེར་བྱ་དགོས།」
--
--
--
--
-- 「SMSབཀོལ་ནས་ཞིབ་བཤེར་བྱ་དགོས།」
-+
-
-
--
--
-
-- བསྒྲུབ་རྒྱུ་ཁས་ལེན་
-+
-
-
--
--
--
-- དྲ་རྒྱ་དང་འབྲེལ་མཐུད་མི་བྱེད་པ
-+
-+
-
-
--
--
-- དྲ་རྒྱ་སྤྱོད་མི་ཐུབ་པ~
-+
-+
-
-
--
-
-- ཞིབ་བཤེར་ཚད་གཞི་གོ་མི་ཆོད་པ་རེད།
-+
-
-
--
-
-- ཞིབ་བཤེར་ཚད་གཞི་ཡང་དག་མིན་པ། ཁྱེད་ཀྱིས་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་བསྐྱར་དུ་ཞིབ
-+
-
-
--
-
-- ཚད་ལས་བརྒལ་ནས་ཕམ་ཁ་བྱུང་བའི་དུས་ཚོད་ ཆུ་ཚོད་1འགོར་རྗེས་ཡང་བསྐྱར་ཞིབ་བཤེར་བྱ་དགོས།
-+
-
-
--
-
-- ངོ་རྒོལ་བྱེད་པའི་བྱ་སྤྱོད་ལ་ཕམ་ཉེས་བྱུང་བ་རེད།
-+
-+
-+
-+
-+
-
-
-
- PowerManager
-
--
--
-- ཟྭ་རྒྱག་པ།
--
--
--
-- 切换用户
--
--
--
-- 注销
-+
-+ མལ་གསོ།
-
-
--
-- 重启
-+
-+ རྩིས་ཐེམ་ནས་བསུབ་པ།
-
-
--
-- 关机
-+
-+ བརྙན་ཡོལ་ཟྭ་རྒྱག།(_L)
-
-
--
-- 锁屏
-+
-+ བསྐྱར་སློང་།
-
-
-
-- 切换用户
-+ སྤྱོད་མཁན་བརྗེ་རེས།
-
-
--
--
-- ཕྱིར་འཐེན་བྱ་དགོས།
-+
-+ འགེལ་འཇོག
-
-
--
-- ཡང་བསྐྱར་འགོ་འཛུགས་
-+
-+ འཁོར་ཁ་རྒྱག་པ།
-
-
--
--
--
-+
-
-
-
--
--
-- གློག་ཆད་པ།
-+
-+
-
-
--
-
-- ལས་མཚམས་འཇོག
-+
-
-
--
-
-- ཧིན་རྡུ་ཉི་ཞི་ཡ།
-+
-
-+
-+
-+ QObject
-
--
--
-- གནས་སྐབས་མཚམས་འཇོག་
-+
-+ འཆར་ངོས་སྲུང་སྐྱོབ་བྱ་རིམ་སད་མི་འདུག
-
-
--
-- 休眠
-+
-+ འཆར་ངོས་སྲུང་སྐྱོབ་བྱ་རིམ་སད་འདུག
-
-
-
-- QObject
-+ S:
-
--
--
-- བརྙན་ཤེལ་འདི་འགུལ་སྐྱོད་བྱེད་བཞིན་ཡོད།
-+
-+ this is only shown for laptops with multiple batteries
-+
-
-
--
--
-- བརྙན་ཤེལ་འདི་ལ་ནུས་པ་མེད།
-+
-+ this is only shown for laptops with multiple batteries
-+
-
--
--
-- Screensaver
-
--
-- 退出(Esc)
-+
-+ laptop primary battery
-+
-
-
--
-- 退出
-+
-+ battery-backed AC power source
-+
-
-
--
--
-- རི་མོ་མི་གནས་པ།
-+
-+ a monitor is a device to measure voltage and current
-+
-
-
--
-- 设置为桌面壁纸
-+
-+ wireless mice with internal batteries
-+
-+
-+
-+
-+ wireless keyboard with internal battery
-+
-+
-+
-+
-+ portable device
-+
-+
-+
-+
-+ cell phone (mobile...)
-+
-+
-+
-+
-+ media player, mp3 etc
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-+
-+ tablet device
-+
-
-+
-+
-+ Screensaver
-
-
-- 自动切换
-+ རང་འགུལ་བརྗེ་སྤོར།
-
-
--
-- 您有%1条未读消息
-+
-+ པར་རིས་མི་འདུག
-
-
--
--
-- ཁྱེད་ཚོར་བརྡ་ཐོ་གསར་པ་ཡོད།
-+
-+ ཅོག་ངོས་ཀྱི་གདོང་ཤོག་ཏུ་འཇོག་པ།
-
-
--
-
-- ལྟ་ཚུལ།
-+
-+
-+
-+
-+
-
-
-
- SleepTime
-
--
--
-- ཁྱེད་ཚོས་ངལ་གསོ་བྱས་ཟིན་པ་གཤམ་གསལ།
-+
-+ ཁྱེད་ཀྱིས་ ལ་ངལ་གསོས་ཟིན།
-
-
--
-- ཁྱེད་ཚོས་ངལ་གསོ་བྱས་ཟིན་པ་གཤམ་གསལ།
-+
-+
-
-
-
- SureWindow
-
--
-
-- རྣམ་པ།
-+ ནས་འོང་བ།
-
-
--
-
-- ཡི་གེ་ལ་པེར་གྱིས་བཤད་རྒྱུར
-+
-
-
--
-
-- ཕྱིར་འཐེན།
-+
-
-
--
-
-- གཏན་འཁེལ་བྱ་དགོས།
--
--
--
-- 同时有多个用户登录系统,您确定要退出系统吗?
--
--
--
--
-- གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་གནས་སྐབས་མཚམས་འཇོག་པར་བཀག་འགོག་བྱེད་པའི་ཆེད་དུ་ཡིན།
-+
-
-
--
--
-- གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་ལ་བཀག་འགོག་བྱེད་པའི་ཆེད་དུ་ཡིན།
-+
-+
-
-
--
-
-- གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་གི་སྒོ་རྒྱག་པར་བཀག་འགོག་བྱེད་པའི་ཆེད་དུ་ཡིན།
-+
-
-
--
--
-- གཤམ་གྱི་གོ་རིམ་ནི་མ་ལག་བསྐྱར་དུ་འབྱུང་བར་སྔོན་འགོག་བྱེད་ཆེད་ཡིན།
--
--
--
-- SwitchButton
--
--
-- 密码登录
-+
-+
-
-
--
-- 微信登录
-+
-+
-
-
-
- SwitchButtonGroup
-
--
-
-- uEduPWD
-+
-
-
--
-
-- འཕྲིན་ཕྲན།
-+
-
-
-
- TabletLockWidget
-
--
-- 您有%1条未读消息
-+
-+
-+
-+
-+
-+
-
-
--
-- 向上滑动解锁
-+
-+
-
-
--
-
-- གསང་གྲངས་གསར་པ་དང་རྙིང་པ་གཅིག་མཚུངས་ཡིན།
-+
-
-
--
-
-- གསང་གྲངས་ཀྱི་ནོར་འཁྲུལ་བསྐྱར་དུ་བཀོད་སྒྲིག་བྱེད་པ།%1
-+
-
-
--
-
-- ཡང་དག་པའི་འཕྲིན་ཕྲན་ཐོག་ནས་ཞིབ་བཤེར་གནང་རོགས།
--
--
--
--
--
--
--
--
--
-- ཕྱིར་འཐེན།
--
--
--
--
--
-- ཕྱིར་ལོག་པ།
--
--
--
--
-- བྲོས་བྱོལ་དུ་སོང་བ།
-+
-
-
-
- Utils
-
--
-
-- kylinདྲ་རྒྱའི་ཀུ་ཤུའི་ཅོག་ཙེའི་ཆ་འཕྲིན།
-+
-
-
-
- VerificationWidget
-
--
-
-- འཕྲིན་ཕྲན་གྱིས་ཞིབ་བཤེར་བྱེད་རོགས།
-+
-
-
-
- VerticalVerificationWidget
-
--
-
-- འཕྲིན་ཕྲན་གྱིས་ཞིབ་བཤེར་བྱེད་རོགས།
-+
-
-
-
- WeChatAuthDialog
-
--
--
-
-- ཝེ་ཆི་ཐེས་ཐོ་འགོད་བྱས་པ།
-+
-
-
--
--
--
-- ཝེ་ཆི་ཐེས་ཞིབ་བཤེར་བྱས་པ།
-+
-+
-
-
--
--
--
-- 「ཐོ་འགོད་བྱས་ཟིན་པའི་སྐད་འཕྲིན་གྱི་ཐོ་ཁོངས་ལ་བརྟེན་ནས་ཐོ་འགོད་བྱེད་པ།」
-+
-+
-
-
--
--
-
-- 「ཚོད་འཛིན་རང་བཞིན་གྱི་སྐད་འཕྲིན་ཨང་གྲངས་ལ་བརྟེན་ནས་ཞིབ་བཤེར་བྱ་དགོས།」
-+
-
-
--
--
-
-- དྲ་རྒྱ་དང་འབྲེལ་མཐུད་མི་བྱེད་པ
-+
-
-
--
-
-- ཞིབ་བཤེར་ཨང་གྲངས་ལེགས་འགྲུབ་བྱུང་བ།
-+
-
-
--
-
-- དུས་ཚོད་ཕྱིར་འགོར་སོང་། ཡང་བསྐྱར་ཚོད་ལྟ།!
-+
-
-+
-+
-+ Widget
-
--
-- 登录失败
-+
-+
-+
-+
-+
-+
-
-
-
- main
-
--
-
-- ukui ScreenSaver ལ་བཀོད་འདོམས་བྱེད་འགོ་ཚུགས།
-+ ཡོལ་སྒོའི་ཁ་འབྱེད་བཀའ་བརྡ།
-
-
--
--
--
-
-- འཕྲལ་དུ་བརྙན་ཤེལ་ལ་ཟྭ་རྒྱག་པ།
-+ མྱུར་དུ་འཆར་ངོས་ཀྱི་ཟྭ་རྒྱག་པ།
-
-
--
-
-- བརྙན་ཤེལ་གསོག་འཇོག་བྱེད་མཁན་གྱི་གནས་ཚུལ་ལ་འདྲི་རྩད་བྱས།
-+ འཆར་ངོས་ལ་ཟྭ་བརྒྱབ་པའི་གནས་ཚུལ་ལེན་པ།
-
-
--
-
-- བརྙན་ཤེལ་གསོག་འཇོག་བྱེད་མཁན་ལ་སྒོ་འབྱེད་
-+ འཆར་ངོས་ཀྱི་ཟྭ་ཕྱེ་བ།
-
-
--
--
-- བརྙན་ཤེལ་གྱི་བརྙན་ཤེལ་ལ་བལྟ་རུ་འཇུག་དགོས།
-+
-+
-
-
--
--
-- དབྱིན་ཇིའི་བརྙན་ཤེལ་གྱི་བརྙན་ཤེལ་ལ་ཁ་པར་རྒྱག་པའི་གླེང་མོལ།
-+
-+
-
-
--
--
-- སྐབས་འདིའི་ཁོམ་པའི་བརྡ་རྟགས་ཀྱིས་སྐུལ་སློང་བྱས་པ།
-+
-+
-
-
--
--
--
-- བརྙན་ཤེལ་ལ་ཟྭ་བརྒྱབ་ནས་འཕྲལ་མར་བརྙན་ཤེལ་གྱི་བརྙན་ཤེལ་སྟོན་པ།
-+
-+
-
-
--
--
-- འཕྲལ་མར་བརྙན་ཤེལ་གྱི་བརྙན་ཤེལ་སྟོན་པ།
-+
-+
-
-
--
--
-- དབྱིན་ཇིའི་བརྙན་ཤེལ་གྱི་བརྙན་ཤེལ་ལ་ལྟ་ཞིབ་བྱེད་མཁན།
-+
-+
-
-
--
--
-- རྩ་བའི་སྒེའུ་ཁུང་ནས་མངོན་པ།
-+
-+
-
-
--
--
-- སྒེའུ་ཁུང་ནས་མངོན་པ།
-+
-+
-
-
--
--
-- སྒེའུ་ཁུང་གི་ཐོབ་ཐང་
-+
-+
-
-
-
-diff --git a/i18n_ts/es.ts b/i18n_ts/es.ts
-index 57d0867..d117fe0 100644
---- a/i18n_ts/es.ts
-+++ b/i18n_ts/es.ts
-@@ -108,6 +108,25 @@
-
-
-
-+
-+ BatteryWidget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- BioAuthWidget
-
-@@ -1225,6 +1244,101 @@
-
-
-
-+
-+ EngineDevice
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- InputInfos
-
-@@ -1559,15 +1673,15 @@
-
-
-
--
-+
-
-
-
--
-+
-
-
-
--
-+
-
-
-
-@@ -1582,6 +1696,69 @@
-
-
-
-+
-+ S:
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ laptop primary battery
-+
-+
-+
-+
-+ battery-backed AC power source
-+
-+
-+
-+
-+ a monitor is a device to measure voltage and current
-+
-+
-+
-+
-+ wireless mice with internal batteries
-+
-+
-+
-+
-+ wireless keyboard with internal battery
-+
-+
-+
-+
-+ portable device
-+
-+
-+
-+
-+ cell phone (mobile...)
-+
-+
-+
-+
-+ media player, mp3 etc
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-
- Screensaver
-
-@@ -1729,6 +1906,17 @@
-
-
-
-+
-+ Widget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- main
-
-diff --git a/i18n_ts/fr.ts b/i18n_ts/fr.ts
-index 437fd21..679e732 100644
---- a/i18n_ts/fr.ts
-+++ b/i18n_ts/fr.ts
-@@ -108,6 +108,25 @@
-
-
-
-+
-+ BatteryWidget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- BioAuthWidget
-
-@@ -1225,6 +1244,101 @@
-
-
-
-+
-+ EngineDevice
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- InputInfos
-
-@@ -1559,15 +1673,15 @@
-
-
-
--
-+
-
-
-
--
-+
-
-
-
--
-+
-
-
-
-@@ -1582,6 +1696,69 @@
-
-
-
-+
-+ S:
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ laptop primary battery
-+
-+
-+
-+
-+ battery-backed AC power source
-+
-+
-+
-+
-+ a monitor is a device to measure voltage and current
-+
-+
-+
-+
-+ wireless mice with internal batteries
-+
-+
-+
-+
-+ wireless keyboard with internal battery
-+
-+
-+
-+
-+ portable device
-+
-+
-+
-+
-+ cell phone (mobile...)
-+
-+
-+
-+
-+ media player, mp3 etc
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-
- Screensaver
-
-@@ -1729,6 +1906,17 @@
-
-
-
-+
-+ Widget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- main
-
-diff --git a/i18n_ts/pt.ts b/i18n_ts/pt.ts
-index 1e49e91..c9077d7 100644
---- a/i18n_ts/pt.ts
-+++ b/i18n_ts/pt.ts
-@@ -108,6 +108,25 @@
-
-
-
-+
-+ BatteryWidget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- BioAuthWidget
-
-@@ -1225,6 +1244,101 @@
-
-
-
-+
-+ EngineDevice
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- InputInfos
-
-@@ -1559,15 +1673,15 @@
-
-
-
--
-+
-
-
-
--
-+
-
-
-
--
-+
-
-
-
-@@ -1582,6 +1696,69 @@
-
-
-
-+
-+ S:
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ laptop primary battery
-+
-+
-+
-+
-+ battery-backed AC power source
-+
-+
-+
-+
-+ a monitor is a device to measure voltage and current
-+
-+
-+
-+
-+ wireless mice with internal batteries
-+
-+
-+
-+
-+ wireless keyboard with internal battery
-+
-+
-+
-+
-+ portable device
-+
-+
-+
-+
-+ cell phone (mobile...)
-+
-+
-+
-+
-+ media player, mp3 etc
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-
- Screensaver
-
-@@ -1729,6 +1906,17 @@
-
-
-
-+
-+ Widget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- main
-
-diff --git a/i18n_ts/ru.ts b/i18n_ts/ru.ts
-index 84dd7fc..82e351f 100644
---- a/i18n_ts/ru.ts
-+++ b/i18n_ts/ru.ts
-@@ -108,6 +108,25 @@
-
-
-
-+
-+ BatteryWidget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- BioAuthWidget
-
-@@ -1225,6 +1244,101 @@
-
-
-
-+
-+ EngineDevice
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- InputInfos
-
-@@ -1559,15 +1673,15 @@
-
-
-
--
-+
-
-
-
--
-+
-
-
-
--
-+
-
-
-
-@@ -1582,6 +1696,69 @@
-
-
-
-+
-+ S:
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+ laptop primary battery
-+
-+
-+
-+
-+ battery-backed AC power source
-+
-+
-+
-+
-+ a monitor is a device to measure voltage and current
-+
-+
-+
-+
-+ wireless mice with internal batteries
-+
-+
-+
-+
-+ wireless keyboard with internal battery
-+
-+
-+
-+
-+ portable device
-+
-+
-+
-+
-+ cell phone (mobile...)
-+
-+
-+
-+
-+ media player, mp3 etc
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-
- Screensaver
-
-@@ -1729,6 +1906,17 @@
-
-
-
-+
-+ Widget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- main
-
-diff --git a/i18n_ts/tr.ts b/i18n_ts/tr.ts
-index cc6562f..f08d2ff 100644
---- a/i18n_ts/tr.ts
-+++ b/i18n_ts/tr.ts
-@@ -16,7 +16,7 @@
- Parola
-
-
--
-+
-
- Yeniden Dene
-
-@@ -41,102 +41,102 @@
- Kimlik doğrulama hatası, hala %1 kalan denemen var
-
-
--
-+
-
-
-
-
--
--
--
--
-+
-+
-+
-+
-
-
-
-
--
--
--
--
-+
-+
-+
-+
-
-
-
-
--
--
--
--
-+
-+
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -153,6 +153,29 @@
- Diğer Ayıtlar
-
-
-+
-+ BatteryWidget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- BioDevices
-
-@@ -1506,6 +1529,124 @@
-
-
-
-+
-+ EngineDevice
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- InputInfos
-
-@@ -1623,7 +1764,7 @@
-
-
-
--
-+
-
-
-
-@@ -1636,7 +1777,7 @@
-
-
-
--
-+
-
-
-
-@@ -1662,22 +1803,22 @@
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1708,17 +1849,17 @@
- Kullanıcı Değiştir
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1726,7 +1867,7 @@
-
- LoginOptionsWidget
-
--
-+
-
-
-
-@@ -1735,7 +1876,7 @@
- Parola
-
-
--
-+
-
-
-
-@@ -1915,7 +2056,7 @@
-
- PowerManager
-
--
-+
-
- kilit
-
-@@ -1944,7 +2085,7 @@
- Kullanıcı Değiştir
-
-
--
-+
-
- Çıkış
-
-@@ -1953,28 +2094,28 @@
- Yeniden Başlat
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
- Bilgisayarı Kapat
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -1992,6 +2133,81 @@
-
-
-
-+
-+ S:
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+
-+ this is only shown for laptops with multiple batteries
-+
-+
-+
-+
-+
-+ laptop primary battery
-+
-+
-+
-+
-+
-+ battery-backed AC power source
-+
-+
-+
-+
-+
-+ a monitor is a device to measure voltage and current
-+
-+
-+
-+
-+
-+ wireless mice with internal batteries
-+
-+
-+
-+
-+
-+ wireless keyboard with internal battery
-+
-+
-+
-+
-+
-+ portable device
-+
-+
-+
-+
-+
-+ cell phone (mobile...)
-+
-+
-+
-+
-+
-+ media player, mp3 etc
-+
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-+
-+
-+ tablet device
-+
-+
-+
-
- Screensaver
-
-@@ -2003,17 +2219,17 @@
- çıkış
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -2093,38 +2309,38 @@
-
- TabletLockWidget
-
--
--
--
--
--
--
-+
-+
-+
-+
-+
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-@@ -2196,6 +2412,19 @@
-
-
-
-+
-+ Widget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- main
-
-@@ -2205,8 +2434,8 @@
-
-
-
--
-
-+
-
- Ekranı hemen kilitle
-
-@@ -2226,43 +2455,43 @@
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-diff --git a/i18n_ts/zh_CN.ts b/i18n_ts/zh_CN.ts
-index 4c27468..a159196 100644
---- a/i18n_ts/zh_CN.ts
-+++ b/i18n_ts/zh_CN.ts
-@@ -16,7 +16,7 @@
- 使用密码认证
-
-
--
-+
-
- 重试
-
-@@ -45,71 +45,71 @@
- 账户锁定%1分钟由于%2次错误尝试
-
-
--
--
--
--
-+
-+
-+
-+
-
- 请%1分钟后再试
-
-
--
--
--
--
-+
-+
-+
-+
-
- 请%1秒后再试
-
-
--
--
--
--
-+
-+
-+
-+
-
- 账号已被永久锁定
-
-
--
-+
-
- 验证人脸识别或输入密码解锁
-
-
--
-+
-
- 按压指纹或输入密码解锁
-
-
--
-+
-
- 验证声纹或输入密码解锁
-
-
--
-+
-
- 验证指静脉或输入密码解锁
-
-
--
-+
-
- 验证虹膜或输入密码解锁
-
-
--
-+
-
- 输入密码
-
-
--
-+
-
- 验证%1失败,请输入密码解锁
-
-
--
-+
-
- 无法验证%1,请输入密码解锁
-
-
--
-+
-
- 网络异常
-
-@@ -118,8 +118,8 @@
- 使用绑定的微信扫码或输入密码登录
-
-
--
--
-+
-+
-
- 密码不能为空
-
-@@ -132,7 +132,7 @@
- 无法验证%1,请输入密码.
-
-
--
-+
-
- 验证%1失败,您还有%2次尝试机会
-
-@@ -161,22 +161,22 @@
- 请输入密码或者录入指纹
-
-
--
-+
-
- 认证失败,请重试
-
-
--
-+
-
- 使用绑定的微信扫码或输入密码解锁
-
-
--
-+
-
- 密码
-
-
--
-+
-
- 登录
-
-@@ -204,24 +204,22 @@
-
- BatteryWidget
-
--
--
-+
-
- 电池模式
-
-
--
--
-+
-
- 电源模式
-
-
--
-+
-
- 正在充电...
-
-
--
-+
-
- 已充满电
-
-@@ -1916,7 +1914,7 @@
-
-
-
--
-+
-
- 未连接任何网络
-
-@@ -1929,7 +1927,7 @@
-
-
-
--
-+
-
- 未连接
-
-@@ -1965,7 +1963,7 @@
- 断开无线网络
-
-
--
-+
-
- 请确认Wi-Fi密码或无线设备
-
-@@ -2021,17 +2019,17 @@
- 正在更新 Wi-Fi列表
-
-
--
-+
-
- 连接有线网络成功
-
-
--
-+
-
- 连接有线网络失败
-
-
--
-+
-
- 连接无线网络成功
-
-@@ -2062,17 +2060,17 @@
- 切换用户
-
-
--
-+
-
- 同时有多个用户登录系统,您确定要退出系统吗?
-
-
--
-+
-
- 有线网络
-
-
--
-+
-
- 无线局域网
-
-@@ -2080,7 +2078,7 @@
-
- LoginOptionsWidget
-
--
-+
-
- 登录选项
-
-@@ -2093,7 +2091,7 @@
- 微信
-
-
--
-+
-
- 校验设备已移除!
-
-@@ -2301,7 +2299,7 @@
-
- PowerManager
-
--
-+
-
- 锁定
-
-@@ -2330,37 +2328,37 @@
- 切换用户
-
-
--
-+
-
- 注销
-
-
--
-
-- 重启
-+ 重启
-
-
--
-+
-+
-
- 重启
-
-
--
-+
-
- 关机
-
-
--
-+
-
- 关机
-
-
--
-+
-
- 休眠
-
-
--
-+
-
- 睡眠
-
-@@ -2387,7 +2385,7 @@
-
-
-
-- this is only shown for laptops with multiple batteries
-+ tablet device
-
-
-
-@@ -2402,7 +2400,7 @@
- 退出
-
-
--
-+
-
- 图片不存在
-
-@@ -2419,12 +2417,12 @@
- 您有%1条未读消息
-
-
--
-+
-
- 您有新的消息
-
-
--
-+
-
- 预览
-
-@@ -2523,38 +2521,38 @@
- 向上滑动解锁
-
-
--
-+
-
- 新密码与原密码相同
-
-
--
-+
-
- 重置密码失败:%1
-
-
--
-+
-
- 请使用正确的微信扫码
-
-
--
--
--
--
--
--
-+
-+
-+
-+
-+
-+
-
- 取消
-
-
--
--
-+
-+
-
- 返回
-
-
--
-+
-
- 跳过
-
-@@ -2630,6 +2628,19 @@
- 登录失败
-
-
-+
-+ Widget
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-
- main
-
-@@ -2639,8 +2650,8 @@
-
-
-
--
-
-+
-
- 马上锁定屏幕
-
-@@ -2660,43 +2671,43 @@
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
--
-+
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-
--
-+
-
-
-
-diff --git a/screensaver/scconfiguration.cpp b/screensaver/scconfiguration.cpp
-index a348df4..09af22d 100644
---- a/screensaver/scconfiguration.cpp
-+++ b/screensaver/scconfiguration.cpp
-@@ -135,7 +135,7 @@ QString SCConfiguration::getDefaultBackground()
- if(ispicture(backgroundFile))
- return backgroundFile;
- else
-- return "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg";
-+ return "/usr/share/backgrounds/1-openkylin.jpg";
- }
-
- int SCConfiguration::getTimeType()
-diff --git a/screensaver/screensaver.cpp b/screensaver/screensaver.cpp
-index b67a12e..5c06727 100644
---- a/screensaver/screensaver.cpp
-+++ b/screensaver/screensaver.cpp
-@@ -531,25 +531,6 @@ void Screensaver::resizeEvent(QResizeEvent */*event*/)
- flag = 1;
- #ifndef USE_INTEL
- if(myTextWidget){
--
--// QColor highLightColor = palette().color(QPalette::Base);
--// QString stringColor = QString("rgba(%1,%2,%3,82%)")
--// .arg(highLightColor.red())
--// .arg(highLightColor.green())
--// .arg(highLightColor.blue());
--// QColor textColor = palette().color(QPalette::Text);
--// QString textString = QString("rgb(%1,%2,%3)")
--// .arg(textColor.red())
--// .arg(textColor.green())
--// .arg(textColor.blue());
--// QColor borderColor = palette().color(QPalette::BrightText);
--// QString borderString = QString("rgba(%1,%2,%3,85%)")
--// .arg(borderColor.red())
--// .arg(borderColor.green())
--// .arg(borderColor.blue());
--
--// myTextLabel->setStyleSheet(QString("font-size:5px;border-radius: 2px;background: %1;color: %2;padding: 4px 8px 4px 8px;border-width: 1px;border-style: solid;border-color:%3;") \
--// .arg(stringColor).arg(textString).arg(borderString));
- if(curStyle == "ukui-dark" || curStyle == "ukui-black"){
- myTextLabel->setStyleSheet(QString("QLabel{font-size:5px;border-radius: 2px;padding: 4px 8px 4px 8px;border-width: 1px;\
- background: rgba(0, 0, 0, %1); color:#FFFFFF; border-radius:16px}").arg(blur_Num * 0.01));
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index 60c0226..684f2ec 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -28,6 +28,7 @@ include_directories(
- ${GLIB_INCLUDE_DIRS}
- ${MMIX_INCLUDE_DIRS}
- ${kylin-nm-base_INCLUDE_DIRS}
-+ ${KF5Wayland_LIBRARIES}
- )
-
- set(EXTRA_LIBS
-@@ -39,9 +40,13 @@ set(EXTRA_LIBS
- ${QGS_LIBRARIES}
- ${GLIB_LIBRARIES}
- ${MMIX_LIBRARIES}
-+ ${KF5Wayland_LIBRARIES}
- -lrt
- -lpthread
-+ -lKF5WaylandServer
-+ -lKF5WaylandClient
- -llibnm-icon-kylin
-+ -lukuiinputgatherclient
- )
-
- qt5_wrap_ui(dialog_SRC
-@@ -65,7 +70,6 @@ qt5_wrap_cpp(dialog_SRC
- screensaverwidget.h
- auth.h
- auth-pam.h
-- authpamthread.h
- screensavermode.h
- screensaverwndadaptor.h
- xeventmonitor.h
-@@ -97,6 +101,7 @@ qt5_wrap_cpp(dialog_SRC
- lockchecker.h
- servicemanager.h
- mytabwidget.h
-+ plasma-shell-manager.h
- PhysicalDeviceSet/brightnessdeviceset.h
- PhysicalDeviceSet/flightmodeset.h
- PhysicalDeviceSet/sounddeviceset.h
-@@ -104,6 +109,7 @@ qt5_wrap_cpp(dialog_SRC
- device.h
- enginedevice.h
- batterywidget.h
-+ libinputswitchevent.h
- )
-
- set(dialog_SRC
-@@ -116,7 +122,6 @@ set(dialog_SRC
- loginoptionswidget.cpp
- screensaverwidget.cpp
- auth-pam.cpp
-- authpamthread.cpp
- xeventmonitor.cpp
- monitorwatcher.cpp
- grab-x11.cpp
-@@ -148,6 +153,7 @@ set(dialog_SRC
- lockchecker.cpp
- servicemanager.cpp
- mytabwidget.cpp
-+ plasma-shell-manager.cpp
- PhysicalDeviceSet/brightnessdeviceset.cpp
- PhysicalDeviceSet/flightmodeset.cpp
- PhysicalDeviceSet/sounddeviceset.cpp
-@@ -155,6 +161,7 @@ set(dialog_SRC
- device.cpp
- enginedevice.cpp
- batterywidget.cpp
-+ libinputswitchevent.cpp
- )
- add_executable(ukui-screensaver-dialog ${dialog_SRC})
- add_definitions(-DAPP_API_MAJOR=0 -DAPP_API_MINOR=11 -DAPP_API_FUNC=0)
-diff --git a/src/assets.qrc b/src/assets.qrc
-index 6059541..870f62f 100644
---- a/src/assets.qrc
-+++ b/src/assets.qrc
-@@ -5,9 +5,7 @@
-
- assets/show-password.png
- assets/hide-password.png
-- assets/keyboard.png
- assets/switchGreeter.png
-- assets/switchUser.png
- assets/waiting.png
- assets/capslock.png
- assets/combobox_down.png
-@@ -25,13 +23,8 @@
- assets/unlock-button-pressed.png
- assets/iconFace.png
- assets/iconFace.svg
-- assets/powerManager.png
- assets/lock.png
- assets/logout.png
-- assets/shutdown.png
-- assets/suspend.png
-- assets/hibernate.png
-- assets/reboot.png
- assets/bio-login.png
- assets/password-login.png
- assets/weather/68.png
-@@ -125,5 +118,10 @@
- assets/ukui-loginopt-lose.svg
- assets/01-default-commercial.png
- assets/01-default-community.png
-+ assets/suspend.svg
-+ assets/shutdown.svg
-+ assets/reboot.svg
-+ assets/hibernate.svg
-+ assets/switchuser.svg
-
-
-diff --git a/src/assets/authdialog.qss b/src/assets/authdialog.qss
-index dd3a1a0..fd14444 100644
---- a/src/assets/authdialog.qss
-+++ b/src/assets/authdialog.qss
-@@ -101,11 +101,6 @@ QLineEdit::focus{
-
- /* 登录按钮 */
- #loginButton{
-- min-width: 24px;
-- max-width: 24px;
-- min-height: 24px;
-- max-height: 24px;
-- icon-size: 24px;
- background:#3D6BE5;
- border-radius:12px;
- }
-diff --git a/src/assets/hibernate.png b/src/assets/hibernate.png
-deleted file mode 100644
-index a6338b1..0000000
---- a/src/assets/hibernate.png
-+++ /dev/null
-@@ -1,8 +0,0 @@
--PNG
--
--
IHDR 0 0 W pHYs ~ 8IDAThYq0s#hx@ A@v&77@)xAJLrH97C/ؕ,)mF ~@ ש@gvXXDf|]A]!b[l%"=! "
--px^
--kv3mk
ݦYd2fvA|.I9=@9OawZzsH oÃ\ͫKH J/QgYHiU|q[UuK8. #|&"'zi)Oe-(3*Ƚz[Oljfr!*v
-- *ާ:ތo{Ldm6t['ߟ
--b0t2:bx2)tB8?+2Ј}WG79DsP*{x18MMEgZT4VIPbf`+-Ie4Z4Xh)PAX*$:(l=R^'g5x
--rP9|p5ET ;fs*C~fqMDLDn$ 'waOa*\<$8uoE$Wt!EχȚI7#o(=J~)7J{:玩F UzI(pgL7 ?~-h"vlm ͜WQM IENDB`
-\ No newline at end of file
-diff --git a/src/assets/hibernate.svg b/src/assets/hibernate.svg
-new file mode 100644
-index 0000000..6cfad35
---- /dev/null
-+++ b/src/assets/hibernate.svg
-@@ -0,0 +1 @@
-+
-\ No newline at end of file
-diff --git a/src/assets/keyboard.png b/src/assets/keyboard.png
-deleted file mode 100644
-index 4d93f1e..0000000
---- a/src/assets/keyboard.png
-+++ /dev/null
-@@ -1,4 +0,0 @@
--PNG
--
--
IHDR ;0 rIDATHK \WFPUC͈)Y#",~۪W4Gݚ(O꼪a~&
--{gSتUȮn~U-c%vKae ]0(h IENDB`
-\ No newline at end of file
-diff --git a/src/assets/powerManager.png b/src/assets/powerManager.png
-deleted file mode 100644
-index 73089ad..0000000
---- a/src/assets/powerManager.png
-+++ /dev/null
-@@ -1,5 +0,0 @@
--PNG
--
--
IHDR ;0 IDATHAJAEkO f&Bv+/1Ⅲ'KN4+u#&?&M3ӍCV)(
--*{fK6/L 6g<(.ylPEѣGԎ-?Yi3s#>z# c
--]hxU% ǡ.8<6NyTp@Oc}g\0pY-'|% QKi&&R"-@)5Sx] bZǗa'eD*"+"2*ij}GQTɼY) k6qDz36qD6|ø["x6@=@.) ̐KۡZty-@7XA@=t %\יXOg5v1k,-BoMYeG}io6)j1or)J IENDB`
-\ No newline at end of file
-diff --git a/src/assets/reboot.png b/src/assets/reboot.png
-deleted file mode 100644
-index 5365f79..0000000
---- a/src/assets/reboot.png
-+++ /dev/null
-@@ -1,11 +0,0 @@
--PNG
--
--
IHDR : : J( IDAThMEuլ,F/ "PFqQ/&,!``zɋ=G$E0Kƈ( Yl6~]3=3==2/tUOWMou}
4@uPARk{;M
Z
--`8
~>9Μ[d%Vlk'G-H6*p`e,e^<