Changeset View
Changeset View
Standalone View
Standalone View
shadow.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2011 Martin Gräßlin <mgraesslin@kde.org> | 5 | Copyright (C) 2011 Martin Gräßlin <mgraesslin@kde.org> | ||
6 | Copyright (C) 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org> | ||||
6 | 7 | | |||
7 | This program is free software; you can redistribute it and/or modify | 8 | 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 | 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 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | 11 | (at your option) any later version. | ||
11 | 12 | | |||
12 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Line(s) | 125 | protected: | |||
163 | virtual bool prepareBackend() = 0; | 164 | virtual bool prepareBackend() = 0; | ||
164 | WindowQuadList m_shadowQuads; | 165 | WindowQuadList m_shadowQuads; | ||
165 | void setShadowElement(const QPixmap &shadow, ShadowElements element); | 166 | void setShadowElement(const QPixmap &shadow, ShadowElements element); | ||
166 | 167 | | |||
167 | private: | 168 | private: | ||
168 | static Shadow *createShadowFromX11(Toplevel *toplevel); | 169 | static Shadow *createShadowFromX11(Toplevel *toplevel); | ||
169 | static Shadow *createShadowFromDecoration(Toplevel *toplevel); | 170 | static Shadow *createShadowFromDecoration(Toplevel *toplevel); | ||
170 | static Shadow *createShadowFromWayland(Toplevel *toplevel); | 171 | static Shadow *createShadowFromWayland(Toplevel *toplevel); | ||
172 | static Shadow *createShadowFromInternalWindow(Toplevel *toplevel); | ||||
171 | static QVector<uint32_t> readX11ShadowProperty(xcb_window_t id); | 173 | static QVector<uint32_t> readX11ShadowProperty(xcb_window_t id); | ||
172 | bool init(const QVector<uint32_t> &data); | 174 | bool init(const QVector<uint32_t> &data); | ||
173 | bool init(KDecoration2::Decoration *decoration); | 175 | bool init(KDecoration2::Decoration *decoration); | ||
174 | bool init(const QPointer<KWayland::Server::ShadowInterface> &shadow); | 176 | bool init(const QPointer<KWayland::Server::ShadowInterface> &shadow); | ||
177 | bool init(const QWindow *window); | ||||
175 | Toplevel *m_topLevel; | 178 | Toplevel *m_topLevel; | ||
176 | // shadow pixmaps | 179 | // shadow pixmaps | ||
177 | QPixmap m_shadowElements[ShadowElementsCount]; | 180 | QPixmap m_shadowElements[ShadowElementsCount]; | ||
178 | // shadow offsets | 181 | // shadow offsets | ||
179 | int m_topOffset; | 182 | int m_topOffset; | ||
180 | int m_rightOffset; | 183 | int m_rightOffset; | ||
181 | int m_bottomOffset; | 184 | int m_bottomOffset; | ||
182 | int m_leftOffset; | 185 | int m_leftOffset; | ||
Show All 10 Lines |