KWin
Loading...
Searching...
No Matches
dnd.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "selection.h"
12
14
15#include <QPoint>
16
17namespace KWin
18{
19class SurfaceInterface;
20class Window;
21
22namespace Xwl
23{
24class Drag;
25enum class DragEventReply;
26
27class XwlDropHandler;
28
33class Dnd : public Selection
34{
35 Q_OBJECT
36
37public:
38 explicit Dnd(xcb_atom_t atom, QObject *parent);
39
40 static uint32_t version();
42
43 void doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) override;
44 void x11OfferLost() override;
45 void x11OffersChanged(const QStringList &added, const QStringList &removed) override;
46 bool handleClientMessage(xcb_client_message_event_t *event) override;
47
49
51 using DnDActions = DataDeviceManagerInterface::DnDActions;
52 static DnDAction atomToClientAction(xcb_atom_t atom);
53 static xcb_atom_t clientActionToAtom(DnDAction action);
54
55private:
56 // start and end Wl native client drags (Wl -> Xwl)
57 void startDrag();
58 void endDrag();
59 void clearOldDrag(Drag *drag);
60
61 // active drag or null when no drag active
62 Drag *m_currentDrag = nullptr;
63 QList<Drag *> m_oldDrags;
64
65 XwlDropHandler *m_dropHandler;
66
67 Q_DISABLE_COPY(Dnd)
68};
69
70} // namespace Xwl
71} // namespace KWin
DataDeviceManagerInterface::DnDActions DnDActions
Definition dnd.h:51
static uint32_t version()
Definition dnd.cpp:38
static DnDAction atomToClientAction(xcb_atom_t atom)
Definition dnd.cpp:185
Dnd(xcb_atom_t atom, QObject *parent)
Definition dnd.cpp:48
void doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) override
Definition dnd.cpp:80
XwlDropHandler * dropHandler() const
Definition dnd.cpp:43
DragEventReply dragMoveFilter(Window *target)
Definition dnd.cpp:137
void x11OfferLost() override
Definition dnd.cpp:116
bool handleClientMessage(xcb_client_message_event_t *event) override
Definition dnd.cpp:124
static xcb_atom_t clientActionToAtom(DnDAction action)
Definition dnd.cpp:199
void x11OffersChanged(const QStringList &added, const QStringList &removed) override
Definition dnd.cpp:120
xcb_atom_t atom() const
Definition selection.h:59