From 12573a8860d10cf023246e9d3d7f5739d83aabe4 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 2 Mar 2011 09:50:10 +0100 Subject: Build fixes for the Wayland plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add qmake.conf variables, and use the generic font plugin. Reviewed-by: Jørgen --- mkspecs/common/linux.conf | 5 +++++ src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 15 ++++++++++++--- src/plugins/platforms/wayland/qwaylandintegration.cpp | 4 ++-- src/plugins/platforms/wayland/wayland.pro | 10 ++++++---- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index e443be1..283cf83 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -35,6 +35,11 @@ QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread +QMAKE_CFLAGS_WAYLAND = +QMAKE_INCDIR_WAYLAND = +QMAKE_LIBS_WAYLAND = -lwayland-client -lxkbcommon +QMAKE_DEFINES_WAYLAND = + QMAKE_MOC = $$[QT_INSTALL_BINS]/moc QMAKE_UIC = $$[QT_INSTALL_BINS]/uic diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 102a213..47f9c91 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -52,8 +52,11 @@ #include #include + +#ifndef QT_NO_WAYLAND_XKB #include #include +#endif QWaylandInputDevice::QWaylandInputDevice(struct wl_display *display, uint32_t id) @@ -63,13 +66,13 @@ QWaylandInputDevice::QWaylandInputDevice(struct wl_display *display, , mKeyboardFocus(NULL) , mButtons(0) { - struct xkb_rule_names names; - wl_input_device_add_listener(mInputDevice, &inputDeviceListener, this); wl_input_device_set_user_data(mInputDevice, this); +#ifndef QT_NO_WAYLAND_XKB + struct xkb_rule_names names; names.rules = "evdev"; names.model = "pc105"; names.layout = "us"; @@ -77,6 +80,7 @@ QWaylandInputDevice::QWaylandInputDevice(struct wl_display *display, names.options = ""; mXkb = xkb_compile_keymap_from_rules(&names); +#endif } void QWaylandInputDevice::inputHandleMotion(void *data, @@ -135,6 +139,7 @@ void QWaylandInputDevice::inputHandleButton(void *data, inputDevice->mButtons); } +#ifndef QT_NO_WAYLAND_XKB static Qt::KeyboardModifiers translateModifiers(int s) { const uchar qt_alt_mask = XKB_COMMON_MOD1_MASK; @@ -201,11 +206,13 @@ static uint32_t translateKey(uint32_t sym, char *string, size_t size) return toupper(sym); } } +#endif void QWaylandInputDevice::inputHandleKey(void *data, struct wl_input_device *input_device, uint32_t time, uint32_t key, uint32_t state) { +#ifndef QT_NO_WAYLAND_XKB Q_UNUSED(input_device); QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data; QWaylandWindow *window = inputDevice->mKeyboardFocus; @@ -244,6 +251,7 @@ void QWaylandInputDevice::inputHandleKey(void *data, inputDevice->mModifiers, QString::fromLatin1(s)); } +#endif } void QWaylandInputDevice::inputHandlePointerFocus(void *data, @@ -280,6 +288,7 @@ void QWaylandInputDevice::inputHandleKeyboardFocus(void *data, struct wl_surface *surface, struct wl_array *keys) { +#ifndef QT_NO_WAYLAND_XKB Q_UNUSED(input_device); Q_UNUSED(time); QWaylandInputDevice *inputDevice = (QWaylandInputDevice *) data; @@ -303,7 +312,7 @@ void QWaylandInputDevice::inputHandleKeyboardFocus(void *data, inputDevice->mKeyboardFocus = NULL; QWindowSystemInterface::handleWindowActivated(0); } - +#endif } const struct wl_input_device_listener QWaylandInputDevice::inputDeviceListener = { diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index 3383410..267a037 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -47,7 +47,7 @@ #include "qwaylandshmwindow.h" #include "qwaylandeglwindow.h" -#include "qfontconfigdatabase.h" +#include "qgenericunixfontdatabase.h" #include #include @@ -59,7 +59,7 @@ #endif QWaylandIntegration::QWaylandIntegration(bool useOpenGL) - : mFontDb(new QFontconfigDatabase()) + : mFontDb(new QGenericUnixFontDatabase()) , mDisplay(new QWaylandDisplay()) , mUseOpenGL(useOpenGL) { diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro index 9faa59b..face860 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland/wayland.pro @@ -4,6 +4,7 @@ include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms DEFINES += Q_PLATFORM_WAYLAND +DEFINES += $$QMAKE_DEFINES_WAYLAND SOURCES = main.cpp \ qwaylandintegration.cpp \ @@ -27,8 +28,9 @@ HEADERS = qwaylandintegration.h \ qwaylandeglwindow.h \ qwaylandshmwindow.h -LIBS += -lwayland-client -LIBS += -lxkbcommon +INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND +LIBS += $$QMAKE_LIBS_WAYLAND +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND contains(QT_CONFIG, opengles2) { QT += opengl @@ -45,12 +47,12 @@ contains(QT_CONFIG, opengles2) { DEFINES += QT_WAYLAND_GL_SUPPORT } -unix { +unix:isEmpty(QMAKE_INCDIR_WAYLAND) { CONFIG += link_pkgconfig PKGCONFIG += libdrm } -include (../fontdatabases/fontconfig/fontconfig.pri) +include (../fontdatabases/genericunix/genericunix.pri) target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target -- cgit v0.12