File indexing completed on 2024-05-12 05:32:34

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include <QObject>
0012 #include <QPoint>
0013 
0014 #include <xcb/xcb.h>
0015 
0016 namespace KWin
0017 {
0018 class Window;
0019 
0020 namespace Xwl
0021 {
0022 enum class DragEventReply;
0023 
0024 /**
0025  * An ongoing drag operation.
0026  */
0027 class Drag : public QObject
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit Drag(QObject *parent = nullptr);
0033     ~Drag() override;
0034 
0035     static void sendClientMessage(xcb_window_t target, xcb_atom_t type, xcb_client_message_data_t *data);
0036 
0037     virtual bool handleClientMessage(xcb_client_message_event_t *event) = 0;
0038     virtual DragEventReply moveFilter(Window *target) = 0;
0039 
0040 Q_SIGNALS:
0041     void finish(Drag *self);
0042 
0043 private:
0044     Q_DISABLE_COPY(Drag)
0045 };
0046 
0047 } // namespace Xwl
0048 } // namespace KWin