GCC Code Coverage Report


Directory: ./
File: server/plasma_shell.h
Date: 2024-01-22 17:25:27
Exec Total Coverage
Lines: 2 2 100.0%
Branches: 6 12 50.0%

Line Branch Exec Source
1 /********************************************************************
2 Copyright 2020 Faveraux Adrien <ad1rie3@hotmail.fr>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) version 3, or any
8 later version accepted by the membership of KDE e.V. (or its
9 successor approved by the membership of KDE e.V.), which shall
10 act as a proxy defined in Section 6 of version 3 of the license.
11
12 This library 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 GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 *********************************************************************/
20 #pragma once
21
22 #include <QObject>
23 #include <Wrapland/Server/wraplandserver_export.h>
24 #include <memory>
25
26 struct wl_resource;
27
28 namespace Wrapland::Server
29 {
30
31 class Display;
32 class Client;
33 class Surface;
34 class PlasmaShellSurface;
35
36 class WRAPLANDSERVER_EXPORT PlasmaShell : public QObject
37 {
38 Q_OBJECT
39 public:
40 explicit PlasmaShell(Display* display);
41 ~PlasmaShell() override;
42
43 Q_SIGNALS:
44 void surfaceCreated(Wrapland::Server::PlasmaShellSurface*);
45
46 private:
47 class Private;
48 std::unique_ptr<Private> d_ptr;
49 };
50
51 class WRAPLANDSERVER_EXPORT PlasmaShellSurface : public QObject
52 {
53 Q_OBJECT
54 public:
55 Surface* surface() const;
56 PlasmaShell* shell() const;
57 wl_resource* resource() const;
58 Client* client() const;
59 QPoint position() const;
60 bool isPositionSet() const;
61
62 enum class Role {
63 Normal,
64 Desktop,
65 Panel,
66 OnScreenDisplay,
67 Notification,
68 ToolTip,
69 CriticalNotification,
70 AppletPopup,
71 };
72
73 Role role() const;
74
75 enum class PanelBehavior {
76 AlwaysVisible,
77 AutoHide,
78 WindowsCanCover,
79 WindowsGoBelow,
80 };
81
82 PanelBehavior panelBehavior() const;
83 bool skipTaskbar() const;
84 bool skipSwitcher() const;
85 void hideAutoHidingPanel();
86 void showAutoHidingPanel();
87
88 // TODO(unknown author): KF6 rename to something generic
89 bool panelTakesFocus() const;
90 bool open_under_cursor() const;
91
92 static PlasmaShellSurface* get(wl_resource* native);
93
94 Q_SIGNALS:
95 void positionChanged();
96 void open_under_cursor_requested();
97 void roleChanged();
98 void panelBehaviorChanged();
99 void skipTaskbarChanged();
100 void skipSwitcherChanged();
101 void panelAutoHideHideRequested();
102 void panelAutoHideShowRequested();
103 void panelTakesFocusChanged();
104 void resourceDestroyed();
105
106 private:
107 friend class PlasmaShell;
108 PlasmaShellSurface(Client* client,
109 uint32_t version,
110 uint32_t id,
111 Surface* surface,
112 PlasmaShell* shell);
113
114 class Private;
115 Private* d_ptr;
116 };
117
118 }
119
120
3/6
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 Q_DECLARE_METATYPE(Wrapland::Server::PlasmaShellSurface::Role)
121
3/6
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 Q_DECLARE_METATYPE(Wrapland::Server::PlasmaShellSurface::PanelBehavior)
122