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