Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/x11_decoration_renderer.h
- This file was copied from decorations/decorationrenderer.h.
Show All 11 Lines | |||||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 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/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_DECORATION_RENDERER_H | 20 | #ifndef KWIN_DECORATION_X11_RENDERER_H | ||
21 | #define KWIN_DECORATION_RENDERER_H | 21 | #define KWIN_DECORATION_X11_RENDERER_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include "decorations/decorationrenderer.h" | ||
24 | #include <QRegion> | | |||
25 | 24 | | |||
26 | #include <xcb/xcb.h> | 25 | #include <xcb/xcb.h> | ||
27 | 26 | | |||
28 | class QTimer; | 27 | class QTimer; | ||
29 | 28 | | |||
30 | namespace KWin | 29 | namespace KWin | ||
31 | { | 30 | { | ||
32 | 31 | | |||
33 | class Deleted; | | |||
34 | | ||||
35 | namespace Decoration | 32 | namespace Decoration | ||
36 | { | 33 | { | ||
37 | 34 | | |||
38 | class DecoratedClientImpl; | | |||
39 | | ||||
40 | class Renderer : public QObject | | |||
41 | { | | |||
42 | Q_OBJECT | | |||
43 | public: | | |||
44 | virtual ~Renderer(); | | |||
45 | | ||||
46 | void schedule(const QRect &rect); | | |||
47 | | ||||
48 | /** | | |||
49 | * Reparents this Renderer to the @p deleted. | | |||
50 | * After this call the Renderer is no longer able to render | | |||
51 | * anything, client() returns a nullptr. | | |||
52 | **/ | | |||
53 | virtual void reparent(Deleted *deleted); | | |||
54 | | ||||
55 | Q_SIGNALS: | | |||
56 | void renderScheduled(const QRect &geo); | | |||
57 | | ||||
58 | protected: | | |||
59 | explicit Renderer(DecoratedClientImpl *client); | | |||
60 | /** | | |||
61 | * @returns the scheduled paint region and resets | | |||
62 | **/ | | |||
63 | QRegion getScheduled(); | | |||
64 | | ||||
65 | virtual void render() = 0; | | |||
66 | | ||||
67 | DecoratedClientImpl *client() { | | |||
68 | return m_client; | | |||
69 | } | | |||
70 | | ||||
71 | bool areImageSizesDirty() const { | | |||
72 | return m_imageSizesDirty; | | |||
73 | } | | |||
74 | void resetImageSizesDirty() { | | |||
75 | m_imageSizesDirty = false; | | |||
76 | } | | |||
77 | QImage renderToImage(const QRect &geo); | | |||
78 | | ||||
79 | private: | | |||
80 | DecoratedClientImpl *m_client; | | |||
81 | QRegion m_scheduled; | | |||
82 | bool m_imageSizesDirty; | | |||
83 | }; | | |||
84 | | ||||
85 | class X11Renderer : public Renderer | 35 | class X11Renderer : public Renderer | ||
86 | { | 36 | { | ||
87 | Q_OBJECT | 37 | Q_OBJECT | ||
88 | public: | 38 | public: | ||
89 | explicit X11Renderer(DecoratedClientImpl *client); | 39 | explicit X11Renderer(DecoratedClientImpl *client); | ||
90 | virtual ~X11Renderer(); | 40 | virtual ~X11Renderer(); | ||
91 | 41 | | |||
92 | void reparent(Deleted *deleted) override; | 42 | void reparent(Deleted *deleted) override; | ||
Show All 13 Lines |