diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-03-16 13:59:20 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-03-23 13:37:00 +0000 |
commit | 1e1785c8d2b077c34a8ca1d4f93e5a75b269eac8 (patch) | |
tree | a4264362c3ef1b070da05ab46edab612d53501dc /src/client/qwaylanddatadevice_p.h | |
parent | dfcda81c5b13ad15517a37bcc45f3bf5f550466c (diff) | |
download | qtwayland-1e1785c8d2b077c34a8ca1d4f93e5a75b269eac8.tar.gz |
Clean up draganddrop and clipboard features
Don't assume that no-draganddrop implies no-clipboard. Introduce
a new private feature wayland-datadevice which contains the
common functionality. This feature cannot be controlled independently,
but is automatically disabled when both clipboard and draganddrop are
disabled.
Change-Id: I6aac09c7ee524e3b11f0a1caa4a6c62fc3f1d10f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/client/qwaylanddatadevice_p.h')
-rw-r--r-- | src/client/qwaylanddatadevice_p.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index 1ec8761b..7fb0003b 100644 --- a/src/client/qwaylanddatadevice_p.h +++ b/src/client/qwaylanddatadevice_p.h @@ -52,14 +52,14 @@ // We mean it. // -#include <qtwaylandclientglobal.h> +#include <qtwaylandclientglobal_p.h> #include <QObject> #include <QPointer> #include <QPoint> #include <QtWaylandClient/private/qwayland-wayland.h> -#if QT_CONFIG(draganddrop) +QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE @@ -87,25 +87,35 @@ public: QWaylandDataSource *selectionSource() const; void setSelectionSource(QWaylandDataSource *source); +#if QT_CONFIG(draganddrop) QWaylandDataOffer *dragOffer() const; void startDrag(QMimeData *mimeData, QWaylandWindow *icon); void cancelDrag(); +#endif protected: void data_device_data_offer(struct ::wl_data_offer *id) override; + +#if QT_CONFIG(draganddrop) void data_device_drop() override; void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id) override; void data_device_leave() override; void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y) override; +#endif void data_device_selection(struct ::wl_data_offer *id) override; private Q_SLOTS: void selectionSourceCancelled(); + +#if QT_CONFIG(draganddrop) void dragSourceCancelled(); void dragSourceTargetChanged(const QString &mimeType); +#endif private: +#if QT_CONFIG(draganddrop) QPoint calculateDragPosition(int x, int y, QWindow *wnd) const; +#endif QWaylandDisplay *m_display; QWaylandInputDevice *m_inputDevice; @@ -123,6 +133,4 @@ private: QT_END_NAMESPACE -#endif // draganddrop - #endif // QWAYLANDDATADEVICE_H |