diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-11-15 15:59:13 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-11-23 08:42:05 +0000 |
commit | 2333c58fff009435503c3b7ef3d86569227056eb (patch) | |
tree | c98fd555af28f6324b24a3884bc8f40fa18bde24 /src/compositor | |
parent | 1d5b44cbb1e834bc8db94d8ec1ac140b8ca9ed37 (diff) |
Use the feature system internally
Get rid of almost all DEFINES += ... in the pro files,
instead use the proper QT_CONFIG() macro to determine
whether a feature is available.
Change-Id: I867769be2085c6ba93b6815e223e2b89edcb245d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor')
42 files changed, 199 insertions, 132 deletions
diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro index 935fc2527..dc9000d90 100644 --- a/src/compositor/compositor.pro +++ b/src/compositor/compositor.pro @@ -5,8 +5,6 @@ QT = core gui-private qtHaveModule(quick): QT += quick -qtConfig(opengl):MODULE_DEFINES = QT_WAYLAND_COMPOSITOR_GL - CONFIG -= precompile_header CONFIG += link_pkgconfig diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp index 6f175de95..9a40fe77d 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.cpp +++ b/src/compositor/compositor_api/qwaylandbufferref.cpp @@ -259,7 +259,7 @@ QImage QWaylandBufferRef::image() const return d->buffer->image(); } -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) /*! * Returns an OpenGL texture for the buffer. \a plane is the index for multi-plane formats, such as YUV. * diff --git a/src/compositor/compositor_api/qwaylandbufferref.h b/src/compositor/compositor_api/qwaylandbufferref.h index 06486ef3a..7dd3a8206 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.h +++ b/src/compositor/compositor_api/qwaylandbufferref.h @@ -37,14 +37,15 @@ #ifndef QWAYLANDBUFFERREF_H #define QWAYLANDBUFFERREF_H +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QImage> -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) #include <QtGui/qopengl.h> #endif #include <QtWaylandCompositor/QWaylandSurface> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> struct wl_resource; @@ -99,7 +100,7 @@ public: bool isSharedMemory() const; QImage image() const; -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QOpenGLTexture *toOpenGLTexture(int plane = 0) const; #endif diff --git a/src/compositor/compositor_api/qwaylandclient.h b/src/compositor/compositor_api/qwaylandclient.h index 50e7baf72..ac651b2b3 100644 --- a/src/compositor/compositor_api/qwaylandclient.h +++ b/src/compositor/compositor_api/qwaylandclient.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDCLIENT_H #define QWAYLANDCLIENT_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QObject> diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index bcee61d8b..29397f64f 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -35,6 +35,7 @@ ** ****************************************************************************/ +#include "qtwaylandcompositorglobal_p.h" #include "qwaylandcompositor.h" #include "qwaylandcompositor_p.h" @@ -60,7 +61,7 @@ #include "hardware_integration/qwlserverbufferintegration_p.h" #include "hardware_integration/qwlserverbufferintegrationfactory_p.h" -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) #include "hardware_integration/qwlhwintegration_p.h" #endif @@ -80,7 +81,7 @@ #include <QtGui/qpa/qplatformnativeinterface.h> #include <QtGui/private/qguiapplication_p.h> -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) # include <QOpenGLTextureBlitter> # include <QOpenGLTexture> # include <QOpenGLContext> @@ -107,7 +108,7 @@ public: uint32_t code = ke->nativeScanCode; bool isDown = ke->keyType == QEvent::KeyPress; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) QString text; Qt::KeyboardModifiers modifiers = QWaylandXkb::modifiers(keyb->xkbState()); @@ -143,7 +144,7 @@ public: QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) : display(0) -#if defined (QT_WAYLAND_COMPOSITOR_GL) +#if QT_CONFIG(opengl) , use_hw_integration_extension(true) , client_buffer_integration(0) , server_buffer_integration(0) @@ -354,7 +355,7 @@ QWaylandSurface *QWaylandCompositorPrivate::createDefaultSurface() void QWaylandCompositorPrivate::initializeHardwareIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_Q(QWaylandCompositor); if (use_hw_integration_extension) hw_integration.reset(new QtWayland::HardwareIntegration(q)); @@ -377,7 +378,7 @@ void QWaylandCompositorPrivate::initializeSeats() void QWaylandCompositorPrivate::loadClientBufferIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_Q(QWaylandCompositor); QStringList keys = QtWayland::ClientBufferIntegrationFactory::keys(); QString targetKey; @@ -406,7 +407,7 @@ void QWaylandCompositorPrivate::loadClientBufferIntegration() void QWaylandCompositorPrivate::loadServerBufferIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QStringList keys = QtWayland::ServerBufferIntegrationFactory::keys(); QString targetKey; QByteArray serverBufferIntegration = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION"); @@ -852,7 +853,7 @@ QWaylandSeat *QWaylandCompositor::seatFor(QInputEvent *inputEvent) */ bool QWaylandCompositor::useHardwareIntegrationExtension() const { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_D(const QWaylandCompositor); return d->use_hw_integration_extension; #else @@ -862,7 +863,7 @@ bool QWaylandCompositor::useHardwareIntegrationExtension() const void QWaylandCompositor::setUseHardwareIntegrationExtension(bool use) { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_D(QWaylandCompositor); if (use == d->use_hw_integration_extension) return; @@ -892,7 +893,7 @@ void QWaylandCompositor::grabSurface(QWaylandSurfaceGrabber *grabber, const QWay if (buffer.isSharedMemory()) { emit grabber->success(buffer.image()); } else { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) if (QOpenGLContext::currentContext()) { QOpenGLFramebufferObject fbo(buffer.size()); fbo.bind(); diff --git a/src/compositor/compositor_api/qwaylandcompositor.h b/src/compositor/compositor_api/qwaylandcompositor.h index 8b190d1d2..d0ec85f35 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.h +++ b/src/compositor/compositor_api/qwaylandcompositor.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDCOMPOSITOR_H #define QWAYLANDCOMPOSITOR_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/qwaylandcompositorextension.h> #include <QtWaylandCompositor/QWaylandOutput> diff --git a/src/compositor/compositor_api/qwaylandcompositor_p.h b/src/compositor/compositor_api/qwaylandcompositor_p.h index 5255f3d58..e59fdcbb5 100644 --- a/src/compositor/compositor_api/qwaylandcompositor_p.h +++ b/src/compositor/compositor_api/qwaylandcompositor_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/QWaylandCompositor> #include <QtCore/private/qobject_p.h> #include <QtCore/QSet> @@ -139,7 +139,7 @@ protected: QList<QWaylandClient *> clients; -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) bool use_hw_integration_extension; QScopedPointer<QtWayland::HardwareIntegration> hw_integration; QScopedPointer<QtWayland::ClientBufferIntegration> client_buffer_integration; @@ -159,7 +159,7 @@ protected: QtWayland::ClientBufferIntegration * QWaylandCompositorPrivate::clientBufferIntegration() const { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) return client_buffer_integration.data(); #else return 0; @@ -168,7 +168,7 @@ QtWayland::ClientBufferIntegration * QWaylandCompositorPrivate::clientBufferInte QtWayland::ServerBufferIntegration * QWaylandCompositorPrivate::serverBufferIntegration() const { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) return server_buffer_integration.data(); #else return 0; diff --git a/src/compositor/compositor_api/qwaylanddestroylistener.h b/src/compositor/compositor_api/qwaylanddestroylistener.h index 580a5c46a..81bbb7bc8 100644 --- a/src/compositor/compositor_api/qwaylanddestroylistener.h +++ b/src/compositor/compositor_api/qwaylanddestroylistener.h @@ -39,7 +39,7 @@ #define QWAYLANDDESTROYLISTENER_H #include <QtCore/QObject> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> struct wl_resource; diff --git a/src/compositor/compositor_api/qwaylanddrag.h b/src/compositor/compositor_api/qwaylanddrag.h index 08ad11018..df1924740 100644 --- a/src/compositor/compositor_api/qwaylanddrag.h +++ b/src/compositor/compositor_api/qwaylanddrag.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDDRAG_H #define QWAYLANDDRAG_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/QObject> #include <QtCore/QPointF> diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h index a4f9ce877..4517f5eee 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/qwaylandinputmethodcontrol.h> #include <QtCore/private/qobject_p.h> diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index 5bbec0a45..55381b450 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -35,6 +35,7 @@ ** ****************************************************************************/ +#include "qtwaylandcompositorglobal_p.h" #include "qwaylandkeyboard.h" #include "qwaylandkeyboard_p.h" #include <QtWaylandCompositor/QWaylandKeymap> @@ -47,7 +48,7 @@ #include <fcntl.h> #include <unistd.h> -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) #include <sys/mman.h> #include <sys/types.h> #endif @@ -65,7 +66,7 @@ QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) , modsLocked() , group() , pendingKeymap(false) -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) , keymap_fd(-1) , xkb_state(0) #endif @@ -76,7 +77,7 @@ QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) QWaylandKeyboardPrivate::~QWaylandKeyboardPrivate() { -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (xkb_context) { if (keymap_area) munmap(keymap_area, keymap_size); @@ -146,7 +147,7 @@ void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *reso if (resource->version() >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) send_repeat_info(resource->handle, repeatRate, repeatDelay); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (xkb_context) { send_keymap(resource->handle, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, keymap_fd, keymap_size); @@ -201,7 +202,7 @@ void QWaylandKeyboardPrivate::modifiers(uint32_t serial, uint32_t mods_depressed void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state) { -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (!xkb_context) return; @@ -241,7 +242,7 @@ void QWaylandKeyboardPrivate::maybeUpdateKeymap() return; pendingKeymap = false; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) if (!xkb_context) return; @@ -261,7 +262,7 @@ void QWaylandKeyboardPrivate::maybeUpdateKeymap() #endif } -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) static int createAnonymousFile(size_t size) { QString path = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); @@ -404,7 +405,7 @@ QWaylandKeyboard::QWaylandKeyboard(QWaylandSeat *seat, QObject *parent) connect(keymap, &QWaylandKeymap::optionsChanged, this, &QWaylandKeyboard::updateKeymap); connect(keymap, &QWaylandKeymap::rulesChanged, this, &QWaylandKeyboard::updateKeymap); connect(keymap, &QWaylandKeymap::modelChanged, this, &QWaylandKeyboard::updateKeymap); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) d->initXKB(); #endif } diff --git a/src/compositor/compositor_api/qwaylandkeyboard_p.h b/src/compositor/compositor_api/qwaylandkeyboard_p.h index fc43853cc..b65dab440 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard_p.h +++ b/src/compositor/compositor_api/qwaylandkeyboard_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h> #include <QtWaylandCompositor/qwaylandseat.h> #include <QtWaylandCompositor/qwaylandkeyboard.h> #include <QtWaylandCompositor/qwaylanddestroylistener.h> @@ -59,7 +59,7 @@ #include <QtCore/QVector> -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) #include <xkbcommon/xkbcommon.h> #endif @@ -83,7 +83,7 @@ public: void modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) struct xkb_state *xkbState() const { return xkb_state; } uint32_t xkbModsMask() const { return modsDepressed | modsLatched | modsLocked; } #endif @@ -102,7 +102,7 @@ protected: void keyboard_release(Resource *resource) Q_DECL_OVERRIDE; private: -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) void initXKB(); void createXKBKeymap(); void createXKBState(xkb_keymap *keymap); @@ -124,7 +124,7 @@ private: uint32_t group; bool pendingKeymap; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) size_t keymap_size; int keymap_fd; char *keymap_area; diff --git a/src/compositor/compositor_api/qwaylandkeymap.h b/src/compositor/compositor_api/qwaylandkeymap.h index c543691df..b72807a9b 100644 --- a/src/compositor/compositor_api/qwaylandkeymap.h +++ b/src/compositor/compositor_api/qwaylandkeymap.h @@ -38,7 +38,7 @@ #define QWAYLANDKEYMAP_H #include <QtCore/QObject> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h index 638575db9..dffde7f98 100644 --- a/src/compositor/compositor_api/qwaylandoutput_p.h +++ b/src/compositor/compositor_api/qwaylandoutput_p.h @@ -50,7 +50,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/QWaylandOutput> #include <QtWaylandCompositor/QWaylandClient> #include <QtWaylandCompositor/QWaylandSurface> diff --git a/src/compositor/compositor_api/qwaylandoutputmode.h b/src/compositor/compositor_api/qwaylandoutputmode.h index aa44be920..0bcdaa6c3 100644 --- a/src/compositor/compositor_api/qwaylandoutputmode.h +++ b/src/compositor/compositor_api/qwaylandoutputmode.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDOUTPUTMODE_H #define QWAYLANDOUTPUTMODE_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/QSize> QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandpointer_p.h b/src/compositor/compositor_api/qwaylandpointer_p.h index 54ac72d11..c02f831b7 100644 --- a/src/compositor/compositor_api/qwaylandpointer_p.h +++ b/src/compositor/compositor_api/qwaylandpointer_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/QWaylandDestroyListener> #include <QtWaylandCompositor/QWaylandPointer> diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h index 821826d69..524813c4c 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.h +++ b/src/compositor/compositor_api/qwaylandquickitem.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDSURFACEITEM_H #define QWAYLANDSURFACEITEM_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtQuick/QQuickItem> #include <QtQuick/qsgtexture.h> diff --git a/src/compositor/compositor_api/qwaylandresource.h b/src/compositor/compositor_api/qwaylandresource.h index bfb4b0969..32a6d53f4 100644 --- a/src/compositor/compositor_api/qwaylandresource.h +++ b/src/compositor/compositor_api/qwaylandresource.h @@ -38,7 +38,7 @@ #define QWAYLANDRESOURCE_H #include <QtCore/QObject> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> struct wl_resource; diff --git a/src/compositor/compositor_api/qwaylandseat.h b/src/compositor/compositor_api/qwaylandseat.h index 3e90342c7..49c63260e 100644 --- a/src/compositor/compositor_api/qwaylandseat.h +++ b/src/compositor/compositor_api/qwaylandseat.h @@ -41,7 +41,7 @@ #include <QtCore/QPoint> #include <QtCore/QString> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/qwaylandcompositorextension.h> #include <QtWaylandCompositor/qwaylandkeyboard.h> diff --git a/src/compositor/compositor_api/qwaylandseat_p.h b/src/compositor/compositor_api/qwaylandseat_p.h index eb86aec37..1d6870802 100644 --- a/src/compositor/compositor_api/qwaylandseat_p.h +++ b/src/compositor/compositor_api/qwaylandseat_p.h @@ -50,7 +50,7 @@ #include <stdint.h> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h> #include <QtWaylandCompositor/qwaylandseat.h> #include <QtCore/QList> @@ -58,10 +58,6 @@ #include <QtCore/QScopedPointer> #include <QtCore/private/qobject_p.h> -#ifndef QT_NO_WAYLAND_XKB -#include <xkbcommon/xkbcommon.h> -#endif - #include <QtWaylandCompositor/private/qwayland-server-wayland.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h index 40753ad47..380436956 100644 --- a/src/compositor/compositor_api/qwaylandsurface.h +++ b/src/compositor/compositor_api/qwaylandsurface.h @@ -38,7 +38,7 @@ #ifndef QWAYLANDSURFACE_H #define QWAYLANDSURFACE_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/qwaylandcompositorextension.h> #include <QtWaylandCompositor/qwaylandclient.h> diff --git a/src/compositor/compositor_api/qwaylandsurface_p.h b/src/compositor/compositor_api/qwaylandsurface_p.h index 94ec287bd..232631077 100644 --- a/src/compositor/compositor_api/qwaylandsurface_p.h +++ b/src/compositor/compositor_api/qwaylandsurface_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <private/qobject_p.h> #include <private/qwlclientbuffer_p.h> diff --git a/src/compositor/compositor_api/qwaylandsurfacegrabber.h b/src/compositor/compositor_api/qwaylandsurfacegrabber.h index 28f984102..512bd2ab9 100644 --- a/src/compositor/compositor_api/qwaylandsurfacegrabber.h +++ b/src/compositor/compositor_api/qwaylandsurfacegrabber.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDSURFACEGRABBER_H #define QWAYLANDSURFACEGRABBER_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/QObject> QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandtouch_p.h b/src/compositor/compositor_api/qwaylandtouch_p.h index 75529134b..9ee3e9c17 100644 --- a/src/compositor/compositor_api/qwaylandtouch_p.h +++ b/src/compositor/compositor_api/qwaylandtouch_p.h @@ -49,7 +49,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/QWaylandDestroyListener> #include <QtWaylandCompositor/QWaylandTouch> #include <QtWaylandCompositor/QWaylandSeat> diff --git a/src/compositor/compositor_api/qwaylandview.h b/src/compositor/compositor_api/qwaylandview.h index 987340034..e19f1ec4b 100644 --- a/src/compositor/compositor_api/qwaylandview.h +++ b/src/compositor/compositor_api/qwaylandview.h @@ -38,7 +38,7 @@ #define QWAYLANDSURFACEVIEW_H #include <QtWaylandCompositor/QWaylandBufferRef> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/QPointF> #include <QtCore/QObject> diff --git a/src/compositor/extensions/qwaylandwlshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index a087f6f75..77229ef03 100644 --- a/src/compositor/extensions/qwaylandwlshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDWLSHELL_P_H #define QWAYLANDWLSHELL_P_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/qwaylandsurface.h> #include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h> #include <QtWaylandCompositor/QWaylandWlShellSurface> diff --git a/src/compositor/global/global.pri b/src/compositor/global/global.pri index e48b8a8c2..29d4f4376 100644 --- a/src/compositor/global/global.pri +++ b/src/compositor/global/global.pri @@ -1,7 +1,7 @@ INCLUDEPATH += global/ HEADERS += \ - global/qwaylandexport.h \ + global/qtwaylandcompositorglobal.h \ global/qwaylandcompositorextension.h \ global/qwaylandcompositorextension_p.h \ global/qwaylandquickextension.h \ diff --git a/src/compositor/global/qtwaylandcompositorglobal.h b/src/compositor/global/qtwaylandcompositorglobal.h new file mode 100644 index 000000000..403f1962a --- /dev/null +++ b/src/compositor/global/qtwaylandcompositorglobal.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCOMPOSITORGLOBAL_H +#define QWAYLANDCOMPOSITORGLOBAL_H + +// +// 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 +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtGui/qtguiglobal.h> +#include <QtWaylandCompositor/qtwaylandcompositor-config.h> + +QT_BEGIN_NAMESPACE + +#if !defined(Q_WAYLAND_COMPOSITOR_EXPORT) +# if defined(QT_SHARED) && defined(QT_BUILD_COMPOSITOR_LIB) +# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_EXPORT +# elif defined(QT_SHARED) +# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_IMPORT +# else +# define Q_WAYLAND_COMPOSITOR_EXPORT +# endif +#endif + +QT_END_NAMESPACE + +#endif // QWAYLANDCOMPOSITORGLOBAL_H + diff --git a/src/compositor/global/qtwaylandcompositorglobal_p.h b/src/compositor/global/qtwaylandcompositorglobal_p.h new file mode 100644 index 000000000..629d58292 --- /dev/null +++ b/src/compositor/global/qtwaylandcompositorglobal_p.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWAYLANDCOMPOSITORGLOBAL_P_H +#define QWAYLANDCOMPOSITORGLOBAL_P_H + +// +// 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 +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> +#include <QtGui/private/qtguiglobal_p.h> +#include <QtWaylandCompositor/private/qtwaylandcompositor-config_p.h> + +#endif // QWAYLANDCOMPOSITORGLOBAL_P_H + diff --git a/src/compositor/global/qwaylandcompositorextension.h b/src/compositor/global/qwaylandcompositorextension.h index d666b4f2a..e9aa84609 100644 --- a/src/compositor/global/qwaylandcompositorextension.h +++ b/src/compositor/global/qwaylandcompositorextension.h @@ -37,7 +37,7 @@ #ifndef QWAYLANDEXTENSION_H #define QWAYLANDEXTENSION_H -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/QObject> #include <QtCore/QVector> diff --git a/src/compositor/global/qwaylandexport.h b/src/compositor/global/qwaylandexport.h deleted file mode 100644 index ddfa6aa77..000000000 --- a/src/compositor/global/qwaylandexport.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WAYLANDEXPORT_H -#define WAYLANDEXPORT_H - -#include <QtCore/qglobal.h> - -QT_BEGIN_NAMESPACE - -#if !defined(Q_WAYLAND_COMPOSITOR_EXPORT) -# if defined(QT_SHARED) && defined(QT_BUILD_COMPOSITOR_LIB) -# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_EXPORT -# elif defined(QT_SHARED) -# define Q_WAYLAND_COMPOSITOR_EXPORT Q_DECL_IMPORT -# else -# define Q_WAYLAND_COMPOSITOR_EXPORT -# endif -#endif - -QT_END_NAMESPACE - -#endif //WAYLANDEXPORT_H diff --git a/src/compositor/hardware_integration/hardware_integration.pri b/src/compositor/hardware_integration/hardware_integration.pri index 624190a6e..dd892e07a 100644 --- a/src/compositor/hardware_integration/hardware_integration.pri +++ b/src/compositor/hardware_integration/hardware_integration.pri @@ -1,4 +1,4 @@ -contains(QT_CONFIG, opengl) { +qtConfig(opengl) { CONFIG += wayland-scanner WAYLANDSERVERSOURCES += \ ../extensions/server-buffer-extension.xml \ @@ -21,8 +21,6 @@ contains(QT_CONFIG, opengl) { hardware_integration/qwlserverbufferintegrationfactory.cpp \ hardware_integration/qwlserverbufferintegrationplugin.cpp \ hardware_integration/qwlhwintegration.cpp \ - - DEFINES += QT_WAYLAND_COMPOSITOR_GL } else { system(echo "Qt-Compositor configured as raster only compositor") } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h index a7de2c0e3..c4bed1002 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtWaylandCompositor/qwaylandsurface.h> #include <QtWaylandCompositor/qwaylandbufferref.h> #include <QtCore/QSize> diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h index 3c1d856c7..1ed99083b 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/QStringList> QT_BEGIN_NAMESPACE diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h index d8bc33fbe..e8fca43f6 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/qplugin.h> #include <QtCore/qfactoryinterface.h> diff --git a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h index 3a71f18f7..9a1287fa4 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h @@ -52,7 +52,7 @@ #include <QtCore/QSize> #include <QtGui/qopengl.h> -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> struct wl_client; struct wl_resource; diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h index b29ddd041..15d54a292 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/QStringList> QT_BEGIN_NAMESPACE diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h index fc8c3bf1e..6c144d74c 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtCore/qplugin.h> #include <QtCore/qfactoryinterface.h> diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp index 589ab825b..d52950388 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp @@ -36,7 +36,7 @@ #include "qwlclientbuffer_p.h" -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) #include "hardware_integration/qwlclientbufferintegration_p.h" #include <qpa/qplatformopenglcontext.h> #include <QOpenGLTexture> @@ -150,7 +150,7 @@ QImage SharedMemoryBuffer::image() const return QImage(); } -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QOpenGLTexture *SharedMemoryBuffer::toOpenGlTexture(int plane) { Q_UNUSED(plane); diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h index 78e07ee98..dafb3c5e5 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h @@ -97,7 +97,7 @@ public: bool isSharedMemory() const { return wl_shm_buffer_get(m_buffer); } -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) virtual QOpenGLTexture *toOpenGlTexture(int plane = 0) = 0; #endif @@ -132,7 +132,7 @@ public: QWaylandSurface::Origin origin() const Q_DECL_OVERRIDE; QImage image() const; -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QOpenGLTexture *toOpenGlTexture(int plane = 0) Q_DECL_OVERRIDE; private: diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h index ca14c7a51..c63cdbc45 100644 --- a/src/compositor/wayland_wrapper/qwlregion_p.h +++ b/src/compositor/wayland_wrapper/qwlregion_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtWaylandCompositor/qwaylandexport.h> +#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QRegion> diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 388303405..48e55e513 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -24,8 +24,5 @@ SOURCES += \ INCLUDEPATH += wayland_wrapper -qtConfig(xkbcommon-evdev) { +qtConfig(xkbcommon-evdev): \ QMAKE_USE += xkbcommon_evdev -} else { - DEFINES += QT_NO_WAYLAND_XKB -} |