1 | /******************************************************************** |
2 | KWin - the KDE window manager |
3 | This file is part of the KDE project. |
4 | |
5 | Copyright (C) 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de> |
6 | |
7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. |
11 | |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. |
16 | |
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/>. |
19 | *********************************************************************/ |
20 | |
21 | #ifndef KWIN_OVERLAYWINDOW_H |
22 | #define KWIN_OVERLAYWINDOW_H |
23 | |
24 | #include <QRegion> |
25 | // xcb |
26 | #include <xcb/xcb.h> |
27 | |
28 | namespace KWin { |
29 | class OverlayWindow { |
30 | public: |
31 | OverlayWindow(); |
32 | ~OverlayWindow(); |
33 | /// Creates XComposite overlay window, call initOverlay() afterwards |
34 | bool create(); |
35 | /// Init overlay and the destination window in it |
36 | void setup(xcb_window_t window); |
37 | void show(); |
38 | void hide(); // hides and resets overlay window |
39 | void setShape(const QRegion& reg); |
40 | void resize(const QSize &size); |
41 | /// Destroys XComposite overlay window |
42 | void destroy(); |
43 | xcb_window_t window() const; |
44 | bool isVisible() const; |
45 | void setVisibility(bool visible); |
46 | private: |
47 | void setNoneBackgroundPixmap(xcb_window_t window); |
48 | void setupInputShape(xcb_window_t window); |
49 | bool m_visible; |
50 | bool m_shown; // For showOverlay() |
51 | QRegion m_shape; |
52 | xcb_window_t m_window; |
53 | }; |
54 | } // namespace |
55 | |
56 | #endif //KWIN_OVERLAYWINDOW_H |
57 | |