diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2011-03-02 08:50:10 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2011-03-02 08:54:08 (GMT) |
commit | 12573a8860d10cf023246e9d3d7f5739d83aabe4 (patch) | |
tree | 556089ec2e50fd6df1bdb70cf09687ae9c1e519d /src/plugins | |
parent | 53741ff1983a9d0085658b96743b125daaa5e680 (diff) | |
download | Qt-12573a8860d10cf023246e9d3d7f5739d83aabe4.zip Qt-12573a8860d10cf023246e9d3d7f5739d83aabe4.tar.gz Qt-12573a8860d10cf023246e9d3d7f5739d83aabe4.tar.bz2 |
Build fixes for the Wayland plugin
Add qmake.conf variables, and use the generic font plugin.
Reviewed-by: Jørgen
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 15 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandintegration.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/wayland.pro | 10 |
3 files changed, 20 insertions, 9 deletions
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 <unistd.h> #include <fcntl.h> + +#ifndef QT_NO_WAYLAND_XKB #include <X11/extensions/XKBcommon.h> #include <X11/keysym.h> +#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 <QtGui/QWindowSystemInterface> #include <QtGui/QPlatformCursor> @@ -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 |