1/********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
7Copyright (C) 2012 Martin Gräßlin <mgraesslin@kde.org>
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program. If not, see <http://www.gnu.org/licenses/>.
21*********************************************************************/
22
23#ifndef KWIN_KILLWINDOW_H
24#define KWIN_KILLWINDOW_H
25
26#include <xcb/xcb.h>
27
28typedef union _XEvent XEvent;
29
30namespace KWin
31{
32
33class KillWindow
34{
35public:
36
37 KillWindow();
38 ~KillWindow();
39
40 void start();
41 bool isActive() const {
42 return m_active;
43 }
44 bool isResponsibleForEvent(int eventType) const;
45 // TODO: remove once event handling is ported to XCB
46 void processEvent(XEvent *event);
47 void processEvent(xcb_generic_event_t *event);
48
49private:
50 xcb_cursor_t createCursor();
51 void release();
52 void performKill();
53 void handleKeyPress(xcb_keycode_t keycode, uint16_t state);
54 void handleButtonRelease(xcb_button_t button, xcb_window_t window);
55 void killWindowId(xcb_window_t window_to_kill);
56 bool m_active;
57};
58
59} // namespace
60
61#endif
62