KWin
Loading...
Searching...
No Matches
workspacescene_qpainter.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
12
14#include "scene/shadowitem.h"
16
17namespace KWin
18{
19
20class KWIN_EXPORT WorkspaceSceneQPainter : public WorkspaceScene
21{
22 Q_OBJECT
23
24public:
25 explicit WorkspaceSceneQPainter(QPainterBackend *backend);
26 ~WorkspaceSceneQPainter() override;
27
28 std::unique_ptr<DecorationRenderer> createDecorationRenderer(Decoration::DecoratedClientImpl *impl) override;
29 std::unique_ptr<ShadowTextureProvider> createShadowTextureProvider(Shadow *shadow) override;
30
31 bool animationsSupported() const override
32 {
33 return false;
34 }
35
37 {
38 return m_backend;
39 }
40
41private:
42 QPainterBackend *m_backend;
43};
44
46{
47public:
49
50 void update() override;
51};
52
54{
55 Q_OBJECT
56public:
57 enum class DecorationPart : int {
58 Left,
59 Top,
60 Right,
61 Bottom,
62 Count
63 };
65
66 void render(const QRegion &region) override;
67
68 QImage image(DecorationPart part) const;
69
70private:
71 void resizeImages();
72 QImage m_images[int(DecorationPart::Count)];
73};
74
75} // KWin
Decoration::DecoratedClientImpl * client() const
void render(const QRegion &region) override
QImage image(DecorationPart part) const
SceneQPainterDecorationRenderer(Decoration::DecoratedClientImpl *client)
Class representing a Window's Shadow to be rendered by the Compositor.
Definition shadow.h:48
Shadow * shadow() const
Definition shadowitem.h:23
QPainterBackend * backend() const
bool animationsSupported() const override