Rework privateFeature

privateFeature would add QT_NO_FEATURE to the DEFINES in the private
.pri file, which was somewhat inelegant.
Additionally, it would add the feature to the _public_ QT_CONFIG
variable, which was plain wrong.

Replace the implementation with the one just introduced for
publicFeature, with the difference that the features are written to the
private files instead.

As this entirely disposes of the old system, all usages in the project
files need to be replaced atomically as well.

Change-Id: I506b5d41054410659ea503bc6901736cd5edec6e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Lars Knoll 2016-08-18 22:25:08 +02:00
parent 606924132f
commit 56ee007b3f
15 changed files with 53 additions and 49 deletions

View File

@ -1419,12 +1419,14 @@ defineTest(qtConfOutput_privateFeature) {
name = "$$eval($${1}.name)" name = "$$eval($${1}.name)"
isEmpty(name): \ isEmpty(name): \
name = $$eval($${1}.feature) name = $$eval($${1}.feature)
feature = $$replace(name, [-+.], _)
$${2} { $${2} {
qtConfOutputVar(append, "publicPro", "QT_CONFIG", $$name) qtConfOutputVar(append, "privatePro", "QT.global.enabled_features", $$name)
qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", 1)
} else { } else {
f = $$upper($$replace(name, -, _)) qtConfOutputVar(append, "privatePro", "QT.global.disabled_features", $$name)
qtConfOutputVar(append, "privatePro", "DEFINES", "QT_NO_$$f") qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", -1)
} }
} }

View File

@ -47,7 +47,7 @@ SOURCES += \
$$PWD/xkbcommon/src/xkbcomp/xkbcomp.c \ $$PWD/xkbcommon/src/xkbcomp/xkbcomp.c \
$$PWD/xkbcommon/src/xkbcomp/parser.c $$PWD/xkbcommon/src/xkbcomp/parser.c
!contains(DEFINES, QT_NO_XKB):contains(QT_CONFIG, use-xkbcommon-x11support): { qtConfig(xkb):contains(QT_CONFIG, use-xkbcommon-x11support): {
# Build xkbcommon-x11 support library, it depends on -lxcb and -lxcb-xkb, linking is done # Build xkbcommon-x11 support library, it depends on -lxcb and -lxcb-xkb, linking is done
# in xcb-plugin.pro (linked to system libraries or if Qt was configured with -qt-xcb then # in xcb-plugin.pro (linked to system libraries or if Qt was configured with -qt-xcb then
# linked to -lxcb-static). # linked to -lxcb-static).

View File

@ -39,8 +39,9 @@
#include "qfbvthandler_p.h" #include "qfbvthandler_p.h"
#include <QtCore/QSocketNotifier> #include <QtCore/QSocketNotifier>
#include <QtCore/private/qglobal_p.h>
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) && (!defined(QT_NO_EVDEV) || !defined(QT_NO_LIBINPUT)) #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) && (QT_CONFIG(evdev) || QT_CONFIG(libinput))
#define VTH_ENABLED #define VTH_ENABLED

View File

@ -50,7 +50,7 @@
#include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qguiapplication_p.h>
#include <linux/input.h> #include <linux/input.h>
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
extern "C" { extern "C" {
#include <mtdev.h> #include <mtdev.h>
} }
@ -150,7 +150,7 @@ QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, co
#define LONG_BITS (sizeof(long) << 3) #define LONG_BITS (sizeof(long) << 3)
#define NUM_LONGS(bits) (((bits) + LONG_BITS - 1) / LONG_BITS) #define NUM_LONGS(bits) (((bits) + LONG_BITS - 1) / LONG_BITS)
#if defined(QT_NO_MTDEV) #if !QT_CONFIG(mtdev)
static inline bool testBit(long bit, const long *array) static inline bool testBit(long bit, const long *array)
{ {
return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1; return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1;
@ -159,7 +159,7 @@ static inline bool testBit(long bit, const long *array)
QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QString &spec, QObject *parent) QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QString &spec, QObject *parent)
: QObject(parent), m_notify(Q_NULLPTR), m_fd(-1), d(Q_NULLPTR), m_device(Q_NULLPTR) : QObject(parent), m_notify(Q_NULLPTR), m_fd(-1), d(Q_NULLPTR), m_device(Q_NULLPTR)
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
, m_mtdev(Q_NULLPTR) , m_mtdev(Q_NULLPTR)
#endif #endif
{ {
@ -203,7 +203,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
return; return;
} }
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
m_mtdev = static_cast<mtdev *>(calloc(1, sizeof(mtdev))); m_mtdev = static_cast<mtdev *>(calloc(1, sizeof(mtdev)));
int mtdeverr = mtdev_open(m_mtdev, m_fd); int mtdeverr = mtdev_open(m_mtdev, m_fd);
if (mtdeverr) { if (mtdeverr) {
@ -215,7 +215,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
d = new QEvdevTouchScreenData(this, args); d = new QEvdevTouchScreenData(this, args);
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
const char *mtdevStr = "(mtdev)"; const char *mtdevStr = "(mtdev)";
d->m_typeB = true; d->m_typeB = true;
#else #else
@ -312,7 +312,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler() QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler()
{ {
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
if (m_mtdev) { if (m_mtdev) {
mtdev_close(m_mtdev); mtdev_close(m_mtdev);
free(m_mtdev); free(m_mtdev);
@ -337,7 +337,7 @@ void QEvdevTouchScreenHandler::readData()
::input_event buffer[32]; ::input_event buffer[32];
int events = 0; int events = 0;
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
forever { forever {
do { do {
events = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); events = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event));

View File

@ -58,7 +58,7 @@
#include <QtCore/private/qthread_p.h> #include <QtCore/private/qthread_p.h>
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
struct mtdev; struct mtdev;
#endif #endif
@ -88,7 +88,7 @@ private:
int m_fd; int m_fd;
QEvdevTouchScreenData *d; QEvdevTouchScreenData *d;
QTouchDevice *m_device; QTouchDevice *m_device;
#if !defined(QT_NO_MTDEV) #if QT_CONFIG(mtdev)
mtdev *m_mtdev; mtdev *m_mtdev;
#endif #endif
}; };

View File

@ -48,7 +48,7 @@
#include <qpa/qplatforminputcontext.h> #include <qpa/qplatforminputcontext.h>
#include <qpa/qplatforminputcontextfactory_p.h> #include <qpa/qplatforminputcontextfactory_p.h>
#if !defined(QT_NO_TSLIB) #if QT_CONFIG(tslib)
#include <QtPlatformSupport/private/qtslib_p.h> #include <QtPlatformSupport/private/qtslib_p.h>
#endif #endif
@ -127,7 +127,7 @@ QPlatformServices *QBsdFbIntegration::services() const
void QBsdFbIntegration::createInputHandlers() void QBsdFbIntegration::createInputHandlers()
{ {
#ifndef QT_NO_TSLIB #if QT_CONFIG(tslib)
const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB"); const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB");
if (useTslib) if (useTslib)
new QTsLibMouseHandler(QLatin1String("TsLib"), QString()); new QTsLibMouseHandler(QLatin1String("TsLib"), QString());

View File

@ -70,17 +70,17 @@
#include <QtPlatformHeaders/QEGLNativeContext> #include <QtPlatformHeaders/QEGLNativeContext>
#ifndef QT_NO_LIBINPUT #if QT_CONFIG(libinput)
#include <QtPlatformSupport/private/qlibinputhandler_p.h> #include <QtPlatformSupport/private/qlibinputhandler_p.h>
#endif #endif
#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID) #if QT_CONFIG(evdev)
#include <QtPlatformSupport/private/qevdevmousemanager_p.h> #include <QtPlatformSupport/private/qevdevmousemanager_p.h>
#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h> #include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
#include <QtPlatformSupport/private/qevdevtouchmanager_p.h> #include <QtPlatformSupport/private/qevdevtouchmanager_p.h>
#endif #endif
#if !defined(QT_NO_TSLIB) && !defined(Q_OS_ANDROID) #if QT_CONFIG(tslib)
#include <QtPlatformSupport/private/qtslib_p.h> #include <QtPlatformSupport/private/qtslib_p.h>
#endif #endif
@ -386,7 +386,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::na
QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function) const QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function) const
{ {
#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID) #if QT_CONFIG(evdev)
if (function == QEglFSFunctions::loadKeymapTypeIdentifier()) if (function == QEglFSFunctions::loadKeymapTypeIdentifier())
return QFunctionPointer(loadKeymapStatic); return QFunctionPointer(loadKeymapStatic);
#else #else
@ -398,7 +398,7 @@ QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function)
void QEglFSIntegration::loadKeymapStatic(const QString &filename) void QEglFSIntegration::loadKeymapStatic(const QString &filename)
{ {
#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID) #if QT_CONFIG(evdev)
QEglFSIntegration *self = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration()); QEglFSIntegration *self = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration());
if (self->m_kbdMgr) if (self->m_kbdMgr)
self->m_kbdMgr->loadKeymap(filename); self->m_kbdMgr->loadKeymap(filename);
@ -411,22 +411,22 @@ void QEglFSIntegration::loadKeymapStatic(const QString &filename)
void QEglFSIntegration::createInputHandlers() void QEglFSIntegration::createInputHandlers()
{ {
#ifndef QT_NO_LIBINPUT #if QT_CONFIG(libinput)
if (!qEnvironmentVariableIntValue("QT_QPA_EGLFS_NO_LIBINPUT")) { if (!qEnvironmentVariableIntValue("QT_QPA_EGLFS_NO_LIBINPUT")) {
new QLibInputHandler(QLatin1String("libinput"), QString()); new QLibInputHandler(QLatin1String("libinput"), QString());
return; return;
} }
#endif #endif
#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID) #if QT_CONFIG(evdev)
m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this); m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this); new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
#ifndef QT_NO_TSLIB #if QT_CONFIG(tslib)
const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB"); const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB");
if (useTslib) if (useTslib)
new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */); new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */);
else else
#endif // QT_NO_TSLIB #endif
new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this); new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
#endif #endif
} }

View File

@ -52,17 +52,17 @@
#include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h> #include <qpa/qplatforminputcontextfactory_p.h>
#ifndef QT_NO_LIBINPUT #if QT_CONFIG(libinput)
#include <QtPlatformSupport/private/qlibinputhandler_p.h> #include <QtPlatformSupport/private/qlibinputhandler_p.h>
#endif #endif
#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID) #if QT_CONFIG(evdev) && !defined(Q_OS_ANDROID)
#include <QtPlatformSupport/private/qevdevmousemanager_p.h> #include <QtPlatformSupport/private/qevdevmousemanager_p.h>
#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h> #include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
#include <QtPlatformSupport/private/qevdevtouchmanager_p.h> #include <QtPlatformSupport/private/qevdevtouchmanager_p.h>
#endif #endif
#if !defined(QT_NO_TSLIB) && !defined(Q_OS_ANDROID) #if QT_CONFIG(tslib) && !defined(Q_OS_ANDROID)
#include <QtPlatformSupport/private/qtslib_p.h> #include <QtPlatformSupport/private/qtslib_p.h>
#endif #endif
@ -140,22 +140,22 @@ QPlatformServices *QLinuxFbIntegration::services() const
void QLinuxFbIntegration::createInputHandlers() void QLinuxFbIntegration::createInputHandlers()
{ {
#ifndef QT_NO_LIBINPUT #if QT_CONFIG(libinput)
if (!qEnvironmentVariableIntValue("QT_QPA_FB_NO_LIBINPUT")) { if (!qEnvironmentVariableIntValue("QT_QPA_FB_NO_LIBINPUT")) {
new QLibInputHandler(QLatin1String("libinput"), QString()); new QLibInputHandler(QLatin1String("libinput"), QString());
return; return;
} }
#endif #endif
#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID) #if QT_CONFIG(evdev) && !defined(Q_OS_ANDROID)
new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this); new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this);
new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this); new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this);
#ifndef QT_NO_TSLIB #if QT_CONFIG(tslib)
const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB"); const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB");
if (useTslib) if (useTslib)
new QTsLibMouseHandler(QLatin1String("TsLib"), QString()); new QTsLibMouseHandler(QLatin1String("TsLib"), QString());
else else
#endif // QT_NO_TSLIB #endif
new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this); new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
#endif #endif
} }

View File

@ -49,7 +49,7 @@
#include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h> #include <qpa/qplatforminputcontextfactory_p.h>
#include <private/qinputdevicemanager_p_p.h> #include <private/qinputdevicemanager_p_p.h>
#ifndef QT_NO_LIBINPUT #if QT_CONFIG(libinput)
#include <QtPlatformSupport/private/qlibinputhandler_p.h> #include <QtPlatformSupport/private/qlibinputhandler_p.h>
#endif #endif

View File

@ -30,6 +30,6 @@ contains(QT_CONFIG, xcb-qt) {
LIBS += -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix() LIBS += -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix()
QMAKE_USE += xcb QMAKE_USE += xcb
} else { } else {
!contains(DEFINES, QT_NO_XKB): QMAKE_USE += xcb_xkb qtConfig(xkb): QMAKE_USE += xcb_xkb
QMAKE_USE += xcb_syslibs QMAKE_USE += xcb_syslibs
} }

View File

@ -599,7 +599,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
xcb_extension_t *extensions[] = { xcb_extension_t *extensions[] = {
&xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id, &xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id,
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
&xcb_xkb_id, &xcb_xkb_id,
#endif #endif
#ifdef XCB_USE_RENDER #ifdef XCB_USE_RENDER
@ -1069,7 +1069,7 @@ Qt::MouseButton QXcbConnection::translateMouseButton(xcb_button_t s)
} }
} }
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
namespace { namespace {
typedef union { typedef union {
/* All XKB events share these fields. */ /* All XKB events share these fields. */
@ -1252,7 +1252,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
s->handleScreenChange(change_event); s->handleScreenChange(change_event);
} }
handled = true; handled = true;
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
} else if (response_type == xkb_first_event) { // https://bugs.freedesktop.org/show_bug.cgi?id=51295 } else if (response_type == xkb_first_event) { // https://bugs.freedesktop.org/show_bug.cgi?id=51295
_xkb_event *xkb_event = reinterpret_cast<_xkb_event *>(event); _xkb_event *xkb_event = reinterpret_cast<_xkb_event *>(event);
if (xkb_event->any.deviceID == m_keyboard->coreDeviceId()) { if (xkb_event->any.deviceID == m_keyboard->coreDeviceId()) {
@ -2174,7 +2174,7 @@ void QXcbConnection::initializeXShape()
void QXcbConnection::initializeXKB() void QXcbConnection::initializeXKB()
{ {
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_xkb_id); const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_xkb_id);
if (!reply || !reply->present) { if (!reply || !reply->present) {
qWarning("Qt: XKEYBOARD extension not present on the X server."); qWarning("Qt: XKEYBOARD extension not present on the X server.");

View File

@ -53,10 +53,11 @@
#include <QVarLengthArray> #include <QVarLengthArray>
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#include <QtCore/QLoggingCategory> #include <QtCore/QLoggingCategory>
#include <QtCore/private/qglobal_p.h>
// This is needed to make Qt compile together with XKB. xkb.h is using a variable // This is needed to make Qt compile together with XKB. xkb.h is using a variable
// which is called 'explicit', this is a reserved keyword in c++ // which is called 'explicit', this is a reserved keyword in c++
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
#define explicit dont_use_cxx_explicit #define explicit dont_use_cxx_explicit
#include <xcb/xkb.h> #include <xcb/xkb.h>
#undef explicit #undef explicit

View File

@ -711,7 +711,7 @@ void QXcbKeyboard::updateKeymap()
xkb_keymap = 0; xkb_keymap = 0;
struct xkb_state *new_state = 0; struct xkb_state *new_state = 0;
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
if (connection()->hasXKB()) { if (connection()->hasXKB()) {
xkb_keymap = xkb_x11_keymap_new_from_device(xkb_context, xcb_connection(), core_device_id, (xkb_keymap_compile_flags)0); xkb_keymap = xkb_x11_keymap_new_from_device(xkb_context, xcb_connection(), core_device_id, (xkb_keymap_compile_flags)0);
if (xkb_keymap) { if (xkb_keymap) {
@ -754,7 +754,7 @@ void QXcbKeyboard::updateKeymap()
checkForLatinLayout(); checkForLatinLayout();
} }
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state) void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state)
{ {
if (m_config && connection()->hasXKB()) { if (m_config && connection()->hasXKB()) {
@ -1140,7 +1140,7 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection)
, m_hasLatinLayout(false) , m_hasLatinLayout(false)
{ {
memset(&xkb_names, 0, sizeof(xkb_names)); memset(&xkb_names, 0, sizeof(xkb_names));
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
core_device_id = 0; core_device_id = 0;
if (connection->hasXKB()) { if (connection->hasXKB()) {
updateVModMapping(); updateVModMapping();
@ -1154,7 +1154,7 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection)
#endif #endif
m_key_symbols = xcb_key_symbols_alloc(xcb_connection()); m_key_symbols = xcb_key_symbols_alloc(xcb_connection());
updateModifiers(); updateModifiers();
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
} }
#endif #endif
updateKeymap(); updateKeymap();
@ -1173,7 +1173,7 @@ QXcbKeyboard::~QXcbKeyboard()
void QXcbKeyboard::updateVModMapping() void QXcbKeyboard::updateVModMapping()
{ {
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
xcb_xkb_get_names_cookie_t names_cookie; xcb_xkb_get_names_cookie_t names_cookie;
xcb_xkb_get_names_reply_t *name_reply; xcb_xkb_get_names_reply_t *name_reply;
xcb_xkb_get_names_value_list_t names_list; xcb_xkb_get_names_value_list_t names_list;
@ -1242,7 +1242,7 @@ void QXcbKeyboard::updateVModMapping()
void QXcbKeyboard::updateVModToRModMapping() void QXcbKeyboard::updateVModToRModMapping()
{ {
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
xcb_xkb_get_map_cookie_t map_cookie; xcb_xkb_get_map_cookie_t map_cookie;
xcb_xkb_get_map_reply_t *map_reply; xcb_xkb_get_map_reply_t *map_reply;
xcb_xkb_get_map_map_t map; xcb_xkb_get_map_map_t map;

View File

@ -45,7 +45,7 @@
#include <xcb/xcb_keysyms.h> #include <xcb/xcb_keysyms.h>
#include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon.h>
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
#include <xkbcommon/xkbcommon-x11.h> #include <xkbcommon/xkbcommon-x11.h>
#endif #endif
@ -77,7 +77,7 @@ public:
#ifdef XCB_USE_XINPUT22 #ifdef XCB_USE_XINPUT22
void updateXKBStateFromXI(void *modInfo, void *groupInfo); void updateXKBStateFromXI(void *modInfo, void *groupInfo);
#endif #endif
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
// when XKEYBOARD is present on the X server // when XKEYBOARD is present on the X server
int coreDeviceId() const { return core_device_id; } int coreDeviceId() const { return core_device_id; }
void updateXKBState(xcb_xkb_state_notify_event_t *state); void updateXKBState(xcb_xkb_state_notify_event_t *state);
@ -136,7 +136,7 @@ private:
xkb_mod_index_t mod5; xkb_mod_index_t mod5;
}; };
_xkb_mods xkb_mods; _xkb_mods xkb_mods;
#ifndef QT_NO_XKB #if QT_CONFIG(xkb)
// when XKEYBOARD is present on the X server // when XKEYBOARD is present on the X server
_mod_masks vmod_masks; _mod_masks vmod_masks;
int core_device_id; int core_device_id;

View File

@ -81,7 +81,7 @@ contains(QT_CONFIG, xcb-qt) {
QMAKE_USE += xcb QMAKE_USE += xcb
} else { } else {
LIBS += -lxcb-xinerama ### there is no configure test for this! LIBS += -lxcb-xinerama ### there is no configure test for this!
!contains(DEFINES, QT_NO_XKB): QMAKE_USE += xcb_xkb qtConfig(xkb): QMAKE_USE += xcb_xkb
QMAKE_USE += xcb_syslibs QMAKE_USE += xcb_syslibs
} }