| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef QWAYLANDABSTRACTDECORATION_H |
| 6 |
#define QWAYLANDABSTRACTDECORATION_H |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#include <QtCore/QMargins> |
| 20 |
#include <QtCore/QPointF> |
| 21 |
#include <QtGui/QGuiApplication> |
| 22 |
#include <QtGui/QCursor> |
| 23 |
#include <QtGui/QColor> |
| 24 |
#include <QtGui/QStaticText> |
| 25 |
#include <QtGui/QImage> |
| 26 |
#include <QtWaylandClient/qtwaylandclientglobal.h> |
| 27 |
|
| 28 |
#include <wayland-client.h> |
| 29 |
|
| 30 |
#include <QtCore/QDebug> |
| 31 |
|
| 32 |
QT_BEGIN_NAMESPACE |
| 33 |
|
| 34 |
class QWindow; |
| 35 |
class QPaintDevice; |
| 36 |
class QPainter; |
| 37 |
class QEvent; |
| 38 |
|
| 39 |
namespace QtWaylandClient { |
| 40 |
|
| 41 |
class QWaylandScreen; |
| 42 |
class QWaylandWindow; |
| 43 |
class QWaylandInputDevice; |
| 44 |
class QWaylandAbstractDecorationPrivate; |
| 45 |
|
| 46 |
class Q_WAYLAND_CLIENT_EXPORT QWaylandAbstractDecoration : public QObject |
| 47 |
{ |
| 48 |
Q_OBJECT |
| 49 |
Q_DECLARE_PRIVATE(QWaylandAbstractDecoration) |
| 50 |
public: |
| 51 |
QWaylandAbstractDecoration(); |
| 52 |
~QWaylandAbstractDecoration() override; |
| 53 |
|
| 54 |
void setWaylandWindow(QWaylandWindow *window); |
| 55 |
QWaylandWindow *waylandWindow() const; |
| 56 |
|
| 57 |
void update(); |
| 58 |
bool isDirty() const; |
| 59 |
|
| 60 |
virtual QMargins margins() const = 0; |
| 61 |
QWindow *window() const; |
| 62 |
const QImage &contentImage(); |
| 63 |
|
| 64 |
virtual bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) = 0; |
| 65 |
virtual bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) = 0; |
| 66 |
|
| 67 |
protected: |
| 68 |
virtual void paint(QPaintDevice *device) = 0; |
| 69 |
|
| 70 |
void setMouseButtons(Qt::MouseButtons mb); |
| 71 |
|
| 72 |
void startResize(QWaylandInputDevice *inputDevice,enum wl_shell_surface_resize resize, Qt::MouseButtons buttons); |
| 73 |
void startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons); |
| 74 |
|
| 75 |
bool isLeftClicked(Qt::MouseButtons newMouseButtonState); |
| 76 |
bool isLeftReleased(Qt::MouseButtons newMouseButtonState); |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
QT_END_NAMESPACE |
| 82 |
|
| 83 |
#endif |