KWin
Loading...
Searching...
No Matches
outline.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: 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9
10#pragma once
11#include "effect/globals.h"
12#include <QObject>
13#include <QRect>
14#include <memory>
15
16#include <kwin_export.h>
17#include <memory>
18
19class QQmlContext;
20class QQmlComponent;
21
22namespace KWin
23{
24class OutlineVisual;
25
37class KWIN_EXPORT Outline : public QObject
38{
39 Q_OBJECT
40 Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged)
41 Q_PROPERTY(QRect visualParentGeometry READ visualParentGeometry NOTIFY visualParentGeometryChanged)
42 Q_PROPERTY(QRect unifiedGeometry READ unifiedGeometry NOTIFY unifiedGeometryChanged)
43 Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
44public:
46 ~Outline() override;
47
54 void setGeometry(const QRect &outlineGeometry);
55
62 void setVisualParentGeometry(const QRect &visualParentGeometry);
63
69 void show();
70
78 void show(const QRect &outlineGeometry);
79
90 void show(const QRect &outlineGeometry, const QRect &visualParentGeometry);
91
96 void hide();
97
98 const QRect &geometry() const;
99 const QRect &visualParentGeometry() const;
100 QRect unifiedGeometry() const;
101
102 bool isActive() const;
103
104private Q_SLOTS:
105 void compositingChanged();
106
107Q_SIGNALS:
108 void activeChanged();
109 void geometryChanged();
110 void unifiedGeometryChanged();
111 void visualParentGeometryChanged();
112
113private:
114 void createHelper();
115 std::unique_ptr<OutlineVisual> m_visual;
116 QRect m_outlineGeometry;
117 QRect m_visualParentGeometry;
118 bool m_active;
119};
120
121class KWIN_EXPORT OutlineVisual
122{
123public:
124 OutlineVisual(Outline *outline);
125 virtual ~OutlineVisual();
126 virtual void show() = 0;
127 virtual void hide() = 0;
128
129protected:
131};
132
134{
135public:
137 ~CompositedOutlineVisual() override;
138 void show() override;
139 void hide() override;
140
141private:
142 std::unique_ptr<QQmlContext> m_qmlContext;
143 std::unique_ptr<QQmlComponent> m_qmlComponent;
144 std::unique_ptr<QObject> m_mainItem;
145};
146}
This class is used to show the outline of a given geometry.
Definition outline.h:38
virtual void hide()=0
virtual void show()=0
Outline *const m_outline
Definition outline.h:130
#define private
#define explicit