Changeset View
Changeset View
Standalone View
Standalone View
xwl/databridge.h
Show All 20 Lines | |||||
21 | #define KWIN_XWL_DATABRIDGE | 21 | #define KWIN_XWL_DATABRIDGE | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | 24 | | |||
25 | #include <xcb/xcb.h> | 25 | #include <xcb/xcb.h> | ||
26 | 26 | | |||
27 | class xcb_xfixes_selection_notify_event_t; | 27 | class xcb_xfixes_selection_notify_event_t; | ||
28 | 28 | | |||
29 | class QMouseEvent; | ||||
30 | | ||||
29 | namespace KWayland { | 31 | namespace KWayland { | ||
30 | namespace Client { | 32 | namespace Client { | ||
31 | class DataDevice; | 33 | class DataDevice; | ||
32 | } | 34 | } | ||
33 | namespace Server { | 35 | namespace Server { | ||
34 | class DataDeviceInterface; | 36 | class DataDeviceInterface; | ||
35 | class SurfaceInterface; | 37 | class SurfaceInterface; | ||
36 | } | 38 | } | ||
37 | } | 39 | } | ||
38 | 40 | | |||
39 | namespace KWin | 41 | namespace KWin | ||
40 | { | 42 | { | ||
43 | class Toplevel; | ||||
41 | 44 | | |||
42 | namespace Xwl | 45 | namespace Xwl | ||
43 | { | 46 | { | ||
44 | class Xwayland; | 47 | class Xwayland; | ||
45 | class Clipboard; | 48 | class Clipboard; | ||
49 | class Dnd; | ||||
50 | enum class DragEventReply; | ||||
46 | 51 | | |||
47 | /* | 52 | /* | ||
48 | * Interface class for all data sharing in the context of X selections | 53 | * Interface class for all data sharing in the context of X selections | ||
49 | * and Wayland's internal mechanism. | 54 | * and Wayland's internal mechanism. | ||
50 | * | 55 | * | ||
51 | * Exists only once per Xwayland session. | 56 | * Exists only once per Xwayland session. | ||
52 | */ | 57 | */ | ||
53 | class DataBridge : public QObject | 58 | class DataBridge : public QObject | ||
54 | { | 59 | { | ||
55 | Q_OBJECT | 60 | Q_OBJECT | ||
56 | public: | 61 | public: | ||
57 | static DataBridge* self(); | 62 | static DataBridge* self(); | ||
58 | 63 | | |||
59 | DataBridge(QObject *parent = nullptr); | 64 | DataBridge(QObject *parent = nullptr); | ||
60 | ~DataBridge(); | 65 | ~DataBridge(); | ||
61 | 66 | | |||
62 | bool filterEvent(xcb_generic_event_t *event); | 67 | bool filterEvent(xcb_generic_event_t *event); | ||
68 | DragEventReply dragMoveFilter(Toplevel *target, QMouseEvent *event); | ||||
63 | 69 | | |||
64 | KWayland::Client::DataDevice *dataDevice() const { | 70 | KWayland::Client::DataDevice *dataDevice() const { | ||
65 | return m_dd; | 71 | return m_dd; | ||
66 | } | 72 | } | ||
67 | KWayland::Server::DataDeviceInterface *dataDeviceIface() const { | 73 | KWayland::Server::DataDeviceInterface *dataDeviceIface() const { | ||
68 | return m_ddi; | 74 | return m_ddi; | ||
69 | } | 75 | } | ||
76 | Dnd* dnd() const { | ||||
zzag: Please follow coding style. | |||||
zzag: Please follow coding style. It should be
```lang=cpp
Dnd *dnd
``` | |||||
77 | return m_dnd; | ||||
78 | } | ||||
70 | 79 | | |||
71 | private: | 80 | private: | ||
72 | void init(); | 81 | void init(); | ||
73 | 82 | | |||
74 | bool handleXfixesNotify(xcb_xfixes_selection_notify_event_t *event); | 83 | bool handleXfixesNotify(xcb_xfixes_selection_notify_event_t *event); | ||
75 | 84 | | |||
76 | Clipboard *m_clipboard = nullptr; | 85 | Clipboard *m_clipboard = nullptr; | ||
86 | Dnd *m_dnd = nullptr; | ||||
77 | 87 | | |||
78 | /* Internal data device interface */ | 88 | /* Internal data device interface */ | ||
79 | KWayland::Client::DataDevice *m_dd = nullptr; | 89 | KWayland::Client::DataDevice *m_dd = nullptr; | ||
80 | KWayland::Server::DataDeviceInterface *m_ddi = nullptr; | 90 | KWayland::Server::DataDeviceInterface *m_ddi = nullptr; | ||
81 | }; | 91 | }; | ||
82 | 92 | | |||
83 | } | 93 | } | ||
84 | } | 94 | } | ||
85 | 95 | | |||
86 | #endif | 96 | #endif |
Please follow coding style.