GCC Code Coverage Report


Directory: ./
File: backends/wayland/waylandoutput.h
Date: 2023-04-20 22:59:23
Exec Total Coverage
Lines: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*************************************************************************
2 Copyright © 2014-2015 Sebastian Kügler <sebas@kde.org>
3 Copyright © 2019-2020 Roman Gilg <subdiff@gmail.com>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 **************************************************************************/
19 #pragma once
20
21 #include <output.h>
22
23 #include <QString>
24 #include <Wrapland/Client/registry.h>
25 #include <Wrapland/Client/wlr_output_manager_v1.h>
26
27 namespace Disman
28 {
29
30 class WaylandInterface;
31
32 class WaylandOutput : public QObject
33 {
34 Q_OBJECT
35 public:
36 WaylandOutput(uint32_t id, Wrapland::Client::WlrOutputHeadV1& head);
37 4 ~WaylandOutput() override = default;
38
39 Disman::OutputPtr toDismanOutput();
40 void updateDismanOutput(Disman::OutputPtr& output);
41
42 QRectF geometry() const;
43
44 bool setWlConfig(Wrapland::Client::WlrOutputConfigurationV1* wlConfig,
45 const Disman::OutputPtr& output);
46
47 Disman::Output::Type guessType(const QString& type, const QString& name) const;
48
49 uint32_t id;
50 Wrapland::Client::WlrOutputHeadV1& head;
51 bool supports_adapt_sync_toggle{false};
52
53 Q_SIGNALS:
54 void removed();
55
56 private:
57 void showOutput();
58 QString hash() const;
59
60 Wrapland::Client::Registry* m_registry;
61
62 // left-hand-side: Disman::Mode, right-hand-side: Wrapland's WlrOutputModeV1
63 std::map<std::string, Wrapland::Client::WlrOutputModeV1*> m_modeIdMap;
64 };
65
66 }
67