forked from linuxdeepin/qt5platform-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
关联了show() hide() boardRect() visible()函数 关联了keyboardRectangleChanged visibleChanged 信号 Log: 添加虚拟键盘对外接口与QPlatformInputContext接口关联 Change-Id: Ife63b6279de517b0b23e1b07b18644143a629a1f
- Loading branch information
wangpeng
committed
Jan 13, 2021
1 parent
5235ff9
commit b7d3c09
Showing
5 changed files
with
167 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="com.deepin.im"> | ||
<property name="geometry" type="(iiii)" access="read"> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName" value="QRect"/> | ||
</property> | ||
<property name="imActive" type="b" access="readwrite"/> | ||
<property name="imSignalLock" type="b" access="readwrite"/> | ||
<signal name="geometryChanged"> | ||
<arg name="rect" type="(iiii)" direction="out"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QRect"/> | ||
</signal> | ||
<signal name="imActiveChanged"> | ||
<arg name="is" type="b" direction="out"/> | ||
</signal> | ||
<signal name="imSignalLockChanged"> | ||
<arg name="is" type="b" direction="out"/> | ||
</signal> | ||
<method name="setKeyboardHeight"> | ||
<arg name="h" type="i" direction="in"/> | ||
</method> | ||
</interface> | ||
</node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (C) 2020 ~ 2020 Uniontech Software Technology Co.,Ltd. | ||
* | ||
* Author: wangpeng <[email protected]> | ||
* | ||
* Maintainer: wangpeng <[email protected]> | ||
* | ||
* 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 | ||
* 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include "dplatforminputcontexthook.h" | ||
|
||
#include "global.h" | ||
#include <qpa/qplatforminputcontext.h> | ||
|
||
DPP_BEGIN_NAMESPACE | ||
|
||
void DPlatformInputContextHook::showInputPanel(QPlatformInputContext *inputContext) | ||
{ | ||
Q_UNUSED(inputContext) | ||
instance()->setImActive(true); | ||
} | ||
|
||
void DPlatformInputContextHook::hideInputPanel(QPlatformInputContext *inputContext) | ||
{ | ||
Q_UNUSED(inputContext) | ||
instance()->setImActive(false); | ||
} | ||
|
||
bool DPlatformInputContextHook::isInputPanelVisible(QPlatformInputContext *inputContext) | ||
{ | ||
Q_UNUSED(inputContext) | ||
return instance()->imActive(); | ||
} | ||
|
||
QRectF DPlatformInputContextHook::keyboardRect(QPlatformInputContext *inputContext) | ||
{ | ||
Q_UNUSED(inputContext) | ||
return instance()->geometry(); | ||
} | ||
|
||
Q_GLOBAL_STATIC_WITH_ARGS(ComDeepinImInterface, __imInterface, | ||
(QString("com.deepin.im"), QString("/com/deepin/im"), QDBusConnection::sessionBus())) | ||
|
||
ComDeepinImInterface* DPlatformInputContextHook::instance() | ||
{ | ||
return __imInterface; | ||
} | ||
|
||
DPP_END_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) 2020 ~ 2020 Uniontech Software Technology Co.,Ltd. | ||
* | ||
* Author: wangpeng <[email protected]> | ||
* | ||
* Maintainer: wangpeng <[email protected]> | ||
* | ||
* 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 | ||
* 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef DPLATFORMINPUTCONTEXTHOOK_H | ||
#define DPLATFORMINPUTCONTEXTHOOK_H | ||
|
||
#include "global.h" | ||
|
||
#include <QRectF> | ||
#include <QtGlobal> | ||
|
||
#include "im_interface.h" | ||
|
||
|
||
QT_BEGIN_NAMESPACE | ||
class QPlatformInputContext; | ||
QT_END_NAMESPACE | ||
|
||
DPP_BEGIN_NAMESPACE | ||
|
||
class DPlatformInputContextHook | ||
{ | ||
|
||
public: | ||
static void showInputPanel(QPlatformInputContext *inputContext); | ||
static void hideInputPanel(QPlatformInputContext *inputContext); | ||
static bool isInputPanelVisible(QPlatformInputContext *inputContext); | ||
static QRectF keyboardRect(QPlatformInputContext *inputContext); | ||
|
||
static ComDeepinImInterface* instance(); | ||
}; | ||
|
||
DPP_END_NAMESPACE | ||
|
||
#endif // DPLATFORMINPUTCONTEXTHOOK_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters