Changeset View
Changeset View
Standalone View
Standalone View
backends/kwayland/plugins/wrapland-wlr/wrapland_output.h
- This file was added.
1 | /************************************************************************* | ||||
---|---|---|---|---|---|
2 | Copyright © 2020 Roman Gilg <subdiff@gmail.com> | ||||
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) any later version. | ||||
8 | | ||||
9 | This library is distributed in the hope that it will be useful, | ||||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
12 | Lesser General Public License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU Lesser General Public | ||||
15 | License along with this library; if not, write to the Free Software | ||||
16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||||
17 | **************************************************************************/ | ||||
18 | #pragma once | ||||
19 | | ||||
20 | #include "waylandoutput.h" | ||||
21 | | ||||
22 | #include "output.h" | ||||
23 | | ||||
24 | #include <Wrapland/Client/wlr_output_manager_v1.h> | ||||
25 | #include <Wrapland/Client/registry.h> | ||||
26 | | ||||
27 | namespace Wrapland | ||||
28 | { | ||||
29 | namespace Client | ||||
30 | { | ||||
31 | class WlrOutputConfigurationV1; | ||||
32 | class WlrOutputHeadV1; | ||||
33 | class WlrOutputModeV1; | ||||
34 | } | ||||
35 | } | ||||
36 | | ||||
37 | namespace KScreen | ||||
38 | { | ||||
39 | class WraplandInterface; | ||||
40 | | ||||
41 | class WraplandOutput : public WaylandOutput | ||||
42 | { | ||||
43 | Q_OBJECT | ||||
44 | | ||||
45 | public: | ||||
46 | explicit WraplandOutput(quint32 id, Wrapland::Client::WlrOutputHeadV1 *head, | ||||
47 | WraplandInterface *parent); | ||||
48 | ~WraplandOutput() override = default; | ||||
49 | | ||||
50 | void updateKScreenOutput(KScreen::OutputPtr &output) override; | ||||
51 | | ||||
52 | QString name() const; | ||||
53 | QByteArray edid() const override; | ||||
54 | bool enabled() const override; | ||||
55 | QRectF geometry() const override; | ||||
56 | | ||||
57 | Wrapland::Client::WlrOutputHeadV1* outputHead() const; | ||||
58 | | ||||
59 | bool setWlConfig(Wrapland::Client::WlrOutputConfigurationV1 *wlConfig, | ||||
60 | const KScreen::OutputPtr &output); | ||||
61 | | ||||
62 | private: | ||||
63 | void showOutput(); | ||||
64 | | ||||
65 | Wrapland::Client::WlrOutputHeadV1 *m_head; | ||||
66 | Wrapland::Client::Registry *m_registry; | ||||
67 | | ||||
68 | // left-hand-side: KScreen::Mode, right-hand-side: Wrapland's WlrOutputModeV1 | ||||
69 | QMap<QString, Wrapland::Client::WlrOutputModeV1*> m_modeIdMap; | ||||
70 | }; | ||||
71 | | ||||
72 | } |