Changeset View
Changeset View
Standalone View
Standalone View
xwl/drag.h
- This file was copied from xwl/xwayland_iface.h.
Show All 11 Lines | |||||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
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_XWAYLAND_IFACE | 20 | #ifndef KWIN_XWL_DRAG | ||
21 | #define KWIN_XWL_XWAYLAND_IFACE | 21 | #define KWIN_XWL_DRAG | ||
22 | 22 | | |||
23 | #include <kwinglobals.h> | 23 | #include <KWayland/Client/datadevicemanager.h> | ||
24 | 24 | | |||
25 | #include <QObject> | 25 | #include <xcb/xcb.h> | ||
26 | | ||||
27 | class QMouseEvent; | ||||
26 | 28 | | |||
27 | namespace KWin | 29 | namespace KWin | ||
28 | { | 30 | { | ||
31 | class Toplevel; | ||||
32 | | ||||
33 | namespace Xwl | ||||
34 | { | ||||
35 | enum class DragEventReply; | ||||
29 | 36 | | |||
30 | class KWIN_EXPORT XwaylandIface : public QObject | 37 | using CAction = KWayland::Client::DataDeviceManager::DnDAction; | ||
38 | | ||||
39 | /* | ||||
40 | * An ongoing drag operation. | ||||
41 | */ | ||||
42 | class Drag : public QObject | ||||
zzag: /** | |||||
Thanks, looks better in my IDE. 8) I changed it at other similar places as well. In the other patches are other ones as well. But let us redo these after the merge. romangg: Thanks, looks better in my IDE. 8) I changed it at other similar places as well. In the other… | |||||
31 | { | 43 | { | ||
32 | Q_OBJECT | 44 | Q_OBJECT | ||
33 | public: | 45 | public: | ||
34 | static XwaylandIface *self(); | 46 | static void sendClientMessage(xcb_window_t target, xcb_atom_t type, xcb_client_message_data_t *data); | ||
47 | static CAction atomToClientAction(xcb_atom_t atom); | ||||
48 | static xcb_atom_t clientActionToAtom(CAction action); | ||||
49 | | ||||
50 | virtual ~Drag() = default; | ||||
51 | virtual bool handleClientMessage(xcb_client_message_event_t *event) = 0; | ||||
52 | virtual DragEventReply moveFilter(Toplevel *target, QMouseEvent *event) = 0; | ||||
53 | | ||||
54 | virtual bool end() = 0; | ||||
35 | 55 | | |||
36 | protected: | 56 | Q_SIGNALS: | ||
37 | explicit XwaylandIface(QObject *parent = nullptr); | 57 | void finish(Drag *self); | ||
38 | virtual ~XwaylandIface(); | | |||
39 | }; | 58 | }; | ||
40 | 59 | | |||
41 | inline | | |||
42 | XwaylandIface *xwayland() { | | |||
43 | return XwaylandIface::self(); | | |||
44 | } | 60 | } | ||
45 | | ||||
46 | } | 61 | } | ||
47 | 62 | | |||
48 | #endif | 63 | #endif |
/**