Fix build when some features are disabled
Make QtWaylandClient compile when Qt is configured with: -no-opengl -no-accessibility -D QT_NO_CLIPBOARD -D QT_NO_DRAGANDDROP -D QT_NO_SESSIONMANAGER Task-number: QTBUG-56192 Change-Id: Idc6aae6b36a35515109a27bed31a22e3e909ef27 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
This commit is contained in:
parent
bac96606a6
commit
c1444d272e
@ -38,6 +38,8 @@
|
||||
#include "qwaylanddatasource_p.h"
|
||||
#include "qwaylanddatadevice_p.h"
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -109,3 +111,5 @@ bool QWaylandClipboard::ownsMode(QClipboard::Mode mode) const
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
@ -51,6 +51,7 @@
|
||||
|
||||
#include <QtWaylandClient/private/qwaylandclientexport_p.h>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -78,4 +79,6 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
||||
#endif // QWAYLANDCLIPBOARD_H
|
||||
|
@ -55,6 +55,8 @@
|
||||
#include <qpa/qplatformdrag.h>
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -254,3 +256,5 @@ void QWaylandDataDevice::dragSourceTargetChanged(const QString &mimeType)
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
@ -57,6 +57,8 @@
|
||||
|
||||
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QMimeData;
|
||||
@ -117,4 +119,6 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
||||
#endif // QWAYLANDDATADEVICE_H
|
||||
|
@ -40,6 +40,8 @@
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -74,3 +76,5 @@ QWaylandDisplay *QWaylandDataDeviceManager::display() const
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
@ -48,6 +48,8 @@
|
||||
#include <QtWaylandClient/private/qwaylandclientexport_p.h>
|
||||
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -75,4 +77,6 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
||||
#endif // QWAYLANDDATADEVICEMANAGER_H
|
||||
|
@ -41,6 +41,8 @@
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -175,3 +177,5 @@ int QWaylandMimeData::readData(int fd, QByteArray &data) const
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include <QtWaylandClient/private/qwaylandclientexport_p.h>
|
||||
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -99,5 +100,5 @@ private:
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
#endif
|
||||
|
@ -43,6 +43,8 @@
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtWaylandClient {
|
||||
@ -90,3 +92,5 @@ void QWaylandDataSource::data_source_target(const QString &mime_type)
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
@ -50,6 +50,8 @@
|
||||
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||
#include <QtWaylandClient/private/qwaylandclientexport_p.h>
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QMimeData;
|
||||
@ -86,4 +88,6 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
||||
#endif // QWAYLANDDATASOURCE_H
|
||||
|
@ -112,7 +112,9 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co
|
||||
|
||||
QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
|
||||
: mWaylandIntegration(waylandIntegration)
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
, mDndSelectionHandler(0)
|
||||
#endif
|
||||
, mWindowExtension(0)
|
||||
, mSubCompositor(0)
|
||||
, mTouchExtension(0)
|
||||
@ -150,7 +152,9 @@ QWaylandDisplay::~QWaylandDisplay(void)
|
||||
mWaylandIntegration->destroyScreen(screen);
|
||||
}
|
||||
mScreens.clear();
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
delete mDndSelectionHandler.take();
|
||||
#endif
|
||||
wl_display_disconnect(mDisplay);
|
||||
}
|
||||
|
||||
@ -243,8 +247,10 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
|
||||
} else if (interface == QStringLiteral("wl_seat")) {
|
||||
QWaylandInputDevice *inputDevice = mWaylandIntegration->createInputDevice(this, version, id);
|
||||
mInputDevices.append(inputDevice);
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
} else if (interface == QStringLiteral("wl_data_device_manager")) {
|
||||
mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id));
|
||||
#endif
|
||||
} else if (interface == QStringLiteral("qt_surface_extension")) {
|
||||
mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id, 1));
|
||||
} else if (interface == QStringLiteral("wl_subcompositor")) {
|
||||
|
@ -131,9 +131,9 @@ public:
|
||||
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
|
||||
QWaylandInputDevice *defaultInputDevice() const;
|
||||
QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); }
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); }
|
||||
|
||||
#endif
|
||||
QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); }
|
||||
QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); }
|
||||
QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager.data(); }
|
||||
@ -196,7 +196,9 @@ private:
|
||||
QList<QWaylandInputDevice *> mInputDevices;
|
||||
QList<Listener> mRegistryListeners;
|
||||
QWaylandIntegration *mWaylandIntegration;
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QScopedPointer<QWaylandDataDeviceManager> mDndSelectionHandler;
|
||||
#endif
|
||||
QScopedPointer<QtWayland::qt_surface_extension> mWindowExtension;
|
||||
QScopedPointer<QtWayland::wl_subcompositor> mSubCompositor;
|
||||
QScopedPointer<QWaylandTouchExtension> mTouchExtension;
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
namespace QtWaylandClient {
|
||||
|
||||
QWaylandDrag::QWaylandDrag(QWaylandDisplay *display)
|
||||
@ -124,5 +124,5 @@ void QWaylandDrag::finishDrag(const QPlatformDropQtResponse &response)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
QT_END_NAMESPACE
|
||||
|
@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
|
||||
namespace QtWaylandClient {
|
||||
|
||||
class QWaylandDisplay;
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag
|
||||
{
|
||||
public:
|
||||
@ -82,7 +82,7 @@ protected:
|
||||
private:
|
||||
QWaylandDisplay *m_display;
|
||||
};
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -178,10 +178,11 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version,
|
||||
, mSerial(0)
|
||||
, mTouchDevice(0)
|
||||
{
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
if (mQDisplay->dndSelectionHandler()) {
|
||||
mDataDevice = mQDisplay->dndSelectionHandler()->getDataDevice(this);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
QWaylandInputDevice::~QWaylandInputDevice()
|
||||
|
@ -126,9 +126,10 @@ QWaylandIntegration::QWaylandIntegration()
|
||||
{
|
||||
initializeInputDeviceIntegration();
|
||||
mDisplay = new QWaylandDisplay(this);
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
mClipboard = new QWaylandClipboard(mDisplay);
|
||||
mDrag = new QWaylandDrag(mDisplay);
|
||||
|
||||
#endif
|
||||
QString icStr = QPlatformInputContextFactory::requested();
|
||||
icStr.isNull() ? mInputContext.reset(new QWaylandInputContext(mDisplay))
|
||||
: mInputContext.reset(QPlatformInputContextFactory::create(icStr));
|
||||
@ -136,8 +137,10 @@ QWaylandIntegration::QWaylandIntegration()
|
||||
|
||||
QWaylandIntegration::~QWaylandIntegration()
|
||||
{
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
delete mDrag;
|
||||
delete mClipboard;
|
||||
#endif
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
delete mAccessibility;
|
||||
#endif
|
||||
@ -213,6 +216,7 @@ QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
|
||||
return mFontDb;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QPlatformClipboard *QWaylandIntegration::clipboard() const
|
||||
{
|
||||
return mClipboard;
|
||||
@ -222,6 +226,7 @@ QPlatformDrag *QWaylandIntegration::drag() const
|
||||
{
|
||||
return mDrag;
|
||||
}
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
||||
QPlatformInputContext *QWaylandIntegration::inputContext() const
|
||||
{
|
||||
|
@ -79,11 +79,10 @@ public:
|
||||
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
|
||||
|
||||
QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE;
|
||||
|
||||
QPlatformDrag *drag() const Q_DECL_OVERRIDE;
|
||||
|
||||
#endif
|
||||
QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
|
||||
|
||||
QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
|
||||
@ -120,8 +119,10 @@ private:
|
||||
QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
|
||||
|
||||
QPlatformFontDatabase *mFontDb;
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QPlatformClipboard *mClipboard;
|
||||
QPlatformDrag *mDrag;
|
||||
#endif
|
||||
QWaylandDisplay *mDisplay;
|
||||
QPlatformNativeInterface *mNativeInterface;
|
||||
QScopedPointer<QPlatformInputContext> mInputContext;
|
||||
|
@ -106,6 +106,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
|
||||
{
|
||||
QByteArray lowerCaseResource = resource.toLower();
|
||||
@ -121,6 +122,7 @@ void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resour
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif // QT_NO_OPENGL
|
||||
|
||||
QVariantMap QWaylandNativeInterface::windowProperties(QPlatformWindow *window) const
|
||||
{
|
||||
|
@ -66,8 +66,9 @@ public:
|
||||
QWindow *window) Q_DECL_OVERRIDE;
|
||||
void *nativeResourceForScreen(const QByteArray &resourceString,
|
||||
QScreen *screen) Q_DECL_OVERRIDE;
|
||||
#ifndef QT_NO_OPENGL
|
||||
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE;
|
||||
|
||||
#endif
|
||||
QVariantMap windowProperties(QPlatformWindow *window) const Q_DECL_OVERRIDE;
|
||||
QVariant windowProperty(QPlatformWindow *window, const QString &name) const Q_DECL_OVERRIDE;
|
||||
QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const Q_DECL_OVERRIDE;
|
||||
|
@ -782,10 +782,12 @@ void QWaylandWindow::requestActivateWindow()
|
||||
|
||||
void QWaylandWindow::unfocus()
|
||||
{
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
QWaylandInputDevice *inputDevice = mDisplay->currentInputDevice();
|
||||
if (inputDevice && inputDevice->dataDevice()) {
|
||||
inputDevice->dataDevice()->invalidateSelectionOffer();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool QWaylandWindow::isExposed() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user