Move xkbcommon to QtGui

Task-number: QTBUG-83255
Change-Id: Ia1c6a49af6be4aaa6b988537c38db3a2c0a646a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Friedemann Kleint 2020-07-03 08:32:08 +02:00
parent 90f1ef14aa
commit 864466d2e5
20 changed files with 46 additions and 103 deletions

View File

@ -751,6 +751,14 @@ qt_extend_target(Gui CONDITION QT_FEATURE_systemtrayicon AND TARGET Qt::DBus AND
platform/unix/dbustray/qxdgnotificationproxy.cpp platform/unix/dbustray/qxdgnotificationproxy_p.h
)
qt_extend_target(Gui CONDITION QT_FEATURE_xkbcommon AND UNIX
SOURCES
platform/unix/qxkbcommon.cpp platform/unix/qxkbcommon_p.h
platform/unix/qxkbcommon_3rdparty.cpp
PUBLIC_LIBRARIES
XKB::XKB
)
qt_extend_target(Gui CONDITION IOS OR MACOS
SOURCES
rhi/qrhimetal.mm rhi/qrhimetal_p.h

View File

@ -898,6 +898,14 @@ qt_extend_target(Gui CONDITION QT_FEATURE_systemtrayicon AND TARGET Qt::DBus AND
platform/unix/dbustray/qxdgnotificationproxy.cpp platform/unix/dbustray/qxdgnotificationproxy_p.h
)
qt_extend_target(Gui CONDITION QT_FEATURE_xkbcommon AND UNIX
SOURCES
platform/unix/qxkbcommon.cpp platform/unix/qxkbcommon_p.h
platform/unix/qxkbcommon_3rdparty.cpp
PUBLIC_LIBRARIES
XKB::XKB
)
qt_extend_target(Gui CONDITION IOS OR MACOS
SOURCES
rhi/qrhimetal.mm rhi/qrhimetal_p.h

View File

@ -459,9 +459,9 @@ QString QXkbCommon::lookupStringNoKeysymTransformations(xkb_keysym_t keysym)
return QString::fromUtf8(chars.constData(), size - 1);
}
QVector<xkb_keysym_t> QXkbCommon::toKeysym(QKeyEvent *event)
QList<xkb_keysym_t> QXkbCommon::toKeysym(QKeyEvent *event)
{
QVector<xkb_keysym_t> keysyms;
QList<xkb_keysym_t> keysyms;
int qtKey = event->key();
if (qtKey >= Qt::Key_F1 && qtKey <= Qt::Key_F35) {

View File

@ -101,6 +101,8 @@
#include <QtCore/QChar>
QT_BEGIN_NAMESPACE
static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper)
{
*lower = QChar::toLower(code);
@ -217,3 +219,5 @@ void QXkbCommon::xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, x
break;
}
}
QT_END_NAMESPACE

View File

@ -44,17 +44,17 @@
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/QString>
#include <QtCore/QVector>
#include <QtCore/QLoggingCategory>
#include <QtCore/QList>
#include <QtGui/qtguiglobal.h>
#include <QtCore/qstring.h>
#include <QtCore/qloggingcategory.h>
#include <QtCore/qlist.h>
#include <xkbcommon/xkbcommon.h>
@ -68,13 +68,13 @@ class QEvent;
class QKeyEvent;
class QPlatformInputContext;
class QXkbCommon
class Q_GUI_EXPORT QXkbCommon
{
public:
static QString lookupString(struct xkb_state *state, xkb_keycode_t code);
static QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym);
static QVector<xkb_keysym_t> toKeysym(QKeyEvent *event);
static QList<xkb_keysym_t> toKeysym(QKeyEvent *event);
static int keysymToQtKey(xkb_keysym_t keysym, Qt::KeyboardModifiers modifiers);
static int keysymToQtKey(xkb_keysym_t keysym, Qt::KeyboardModifiers modifiers,

View File

@ -34,3 +34,12 @@ if(unix:!uikit:!macos)|qtConfig(xcb) {
qtConfig(systemtrayicon): include(dbustray/dbustray.pri)
}
}
qtConfig(xkbcommon) {
SOURCES += \
platform/unix/qxkbcommon_3rdparty.cpp \
platform/unix/qxkbcommon.cpp
HEADERS += \
platform/unix/qxkbcommon_p.h
QMAKE_USE += xkbcommon
}

View File

@ -17,7 +17,7 @@ qt_add_module(InputSupport
"../../corelib/global/qt_pch.h"
)
#### Keys ignored in scope 3:.:.:input-support.pro:<TRUE>:
#### Keys ignored in scope 2:.:.:input-support.pro:<TRUE>:
# MODULE = "input_support"
## Scopes:
@ -77,13 +77,6 @@ qt_extend_target(InputSupport CONDITION QT_FEATURE_libinput
PkgConfig::Libudev
)
qt_extend_target(InputSupport CONDITION QT_FEATURE_libinput AND QT_FEATURE_xkbcommon
LIBRARIES
XKB::XKB
PUBLIC_LIBRARIES
Qt::XkbCommonSupportPrivate
)
qt_extend_target(InputSupport CONDITION QT_FEATURE_evdev OR QT_FEATURE_libinput
SOURCES
shared/devicehandlerlist_p.h
@ -97,6 +90,3 @@ qt_extend_target(InputSupport CONDITION QT_FEATURE_integrityhid
LIBRARIES
integrityhid
)
if(QT_FEATURE_xkbcommon)
add_subdirectory(xkbcommon)
endif()

View File

@ -22,7 +22,7 @@ qt_add_module(InputSupport
"../../corelib/global/qt_pch.h"
)
#### Keys ignored in scope 3:.:.:input-support.pro:<TRUE>:
#### Keys ignored in scope 2:.:.:input-support.pro:<TRUE>:
# MODULE = "input_support"
## Scopes:
@ -82,13 +82,6 @@ qt_extend_target(InputSupport CONDITION QT_FEATURE_libinput
PkgConfig::Libudev
)
qt_extend_target(InputSupport CONDITION QT_FEATURE_libinput AND QT_FEATURE_xkbcommon
LIBRARIES
XKB::XKB
PUBLIC_LIBRARIES
Qt::XkbCommonSupportPrivate
)
qt_extend_target(InputSupport CONDITION QT_FEATURE_evdev OR QT_FEATURE_libinput
SOURCES
shared/devicehandlerlist_p.h
@ -102,6 +95,3 @@ qt_extend_target(InputSupport CONDITION QT_FEATURE_integrityhid
LIBRARIES
integrityhid
)
if(QT_FEATURE_xkbcommon)
add_subdirectory(xkbcommon)
endif()

View File

@ -1,8 +1,6 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += gui-private
qtConfig(xkbcommon): SUBDIRS += xkbcommon
SUBDIRS += input-support.pro ### FIXME - QTBUG-52657
CONFIG += ordered

View File

@ -13,8 +13,3 @@ SOURCES += \
QMAKE_USE_PRIVATE += libudev libinput
INCLUDEPATH += $$PWD/../shared
qtConfig(xkbcommon): {
QMAKE_USE_PRIVATE += xkbcommon
QT += xkbcommon_support-private
}

View File

@ -46,7 +46,7 @@
#if QT_CONFIG(xkbcommon)
#include <xkbcommon/xkbcommon-keysyms.h>
#include <xkbcommon/xkbcommon-names.h>
#include <QtXkbCommonSupport/private/qxkbcommon_p.h>
#include <QtGui/private/qxkbcommon_p.h>
#endif
QT_BEGIN_NAMESPACE

View File

@ -1,32 +0,0 @@
# Generated from xkbcommon.pro.
#####################################################################
## XkbCommonSupport Module:
#####################################################################
qt_add_module(XkbCommonSupport
STATIC
INTERNAL_MODULE
SOURCES
qxkbcommon.cpp qxkbcommon_p.h
qxkbcommon_3rdparty.cpp
DEFINES
QT_NO_CAST_FROM_ASCII
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
XKB::XKB
PRECOMPILED_HEADER
"../../../corelib/global/qt_pch.h"
)
#### Keys ignored in scope 1:.:.:xkbcommon.pro:<TRUE>:
# MODULE = "xkbcommon_support"
## Scopes:
#####################################################################
qt_extend_target(XkbCommonSupport CONDITION CLANG AND NOT ICC
COMPILE_OPTIONS
-ftemplate-depth=1024
)

View File

@ -1,23 +0,0 @@
TARGET = QtXkbCommonSupport
MODULE = xkbcommon_support
QT = core-private gui-private
CONFIG += static internal_module
DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../../../corelib/global/qt_pch.h
QMAKE_USE += xkbcommon
HEADERS += \
qxkbcommon_p.h
SOURCES += \
qxkbcommon.cpp \
qxkbcommon_3rdparty.cpp
# qxkbcommon.cpp::KeyTbl has more than 256 levels of expansion and older
# Clang uses that as a limit (it's 1024 in current versions).
clang:!intel_icc: QMAKE_CXXFLAGS += -ftemplate-depth=1024
load(qt_module)

View File

@ -19,7 +19,6 @@ qt_internal_add_plugin(QIbusPlatformInputContextPlugin
Qt::DBus
Qt::Gui
Qt::GuiPrivate
Qt::XkbCommonSupportPrivate
)
#### Keys ignored in scope 1:.:.:ibus.pro:<TRUE>:

View File

@ -1,6 +1,6 @@
TARGET = ibusplatforminputcontextplugin
QT += dbus gui-private xkbcommon_support-private
QT += dbus gui-private
SOURCES += $$PWD/qibusplatforminputcontext.cpp \
$$PWD/qibusproxy.cpp \
$$PWD/qibusproxyportal.cpp \

View File

@ -51,7 +51,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <QtXkbCommonSupport/private/qxkbcommon_p.h>
#include <QtGui/private/qxkbcommon_p.h>
#include "qibusproxy.h"
#include "qibusproxyportal.h"

View File

@ -42,7 +42,6 @@ qt_add_module(XcbQpa
PkgConfig::XKB_COMMON_X11
Qt::CorePrivate
Qt::GuiPrivate
Qt::XkbCommonSupportPrivate
XCB::ICCCM
XCB::IMAGE
XCB::KEYSYMS

View File

@ -42,7 +42,6 @@ qt_add_module(XcbQpa
PkgConfig::XKB_COMMON_X11
Qt::CorePrivate
Qt::GuiPrivate
Qt::XkbCommonSupportPrivate
XCB::ICCCM
XCB::IMAGE
XCB::KEYSYMS

View File

@ -47,7 +47,7 @@
#include <xcb/xkb.h>
#undef explicit
#include <QtXkbCommonSupport/private/qxkbcommon_p.h>
#include <QtGui/private/qxkbcommon_p.h>
#include <xkbcommon/xkbcommon-x11.h>
#include <QEvent>

View File

@ -3,8 +3,7 @@ CONFIG += no_module_headers internal_module
DEFINES += QT_NO_FOREACH
QT += \
core-private gui-private \
xkbcommon_support-private
core-private gui-private
qtConfig(opengl): QT += opengl-private