Changeset View
Changeset View
Standalone View
Standalone View
abstract_wayland_output.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | 51 | | |||
52 | /** | 52 | /** | ||
53 | * Generic output representation in a Wayland session | 53 | * Generic output representation in a Wayland session | ||
54 | */ | 54 | */ | ||
55 | class KWIN_EXPORT AbstractWaylandOutput : public AbstractOutput | 55 | class KWIN_EXPORT AbstractWaylandOutput : public AbstractOutput | ||
56 | { | 56 | { | ||
57 | Q_OBJECT | 57 | Q_OBJECT | ||
58 | public: | 58 | public: | ||
59 | enum class Transform { | ||||
60 | Normal, | ||||
61 | Rotated90, | ||||
62 | Rotated180, | ||||
63 | Rotated270, | ||||
64 | Flipped, | ||||
65 | Flipped90, | ||||
66 | Flipped180, | ||||
67 | Flipped270 | ||||
68 | }; | ||||
69 | | ||||
59 | explicit AbstractWaylandOutput(QObject *parent = nullptr); | 70 | explicit AbstractWaylandOutput(QObject *parent = nullptr); | ||
60 | ~AbstractWaylandOutput() override; | 71 | ~AbstractWaylandOutput() override; | ||
61 | 72 | | |||
62 | QString name() const override; | 73 | QString name() const override; | ||
63 | QByteArray uuid() const override; | 74 | QByteArray uuid() const override; | ||
64 | 75 | | |||
65 | QSize pixelSize() const; | 76 | QSize pixelSize() const; | ||
66 | qreal scale() const override; | 77 | qreal scale() const override; | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 140 | virtual void updateEnablement(bool enable) { | |||
130 | Q_UNUSED(enable); | 141 | Q_UNUSED(enable); | ||
131 | } | 142 | } | ||
132 | virtual void updateDpms(KWayland::Server::OutputInterface::DpmsMode mode) { | 143 | virtual void updateDpms(KWayland::Server::OutputInterface::DpmsMode mode) { | ||
133 | Q_UNUSED(mode); | 144 | Q_UNUSED(mode); | ||
134 | } | 145 | } | ||
135 | virtual void updateMode(int modeIndex) { | 146 | virtual void updateMode(int modeIndex) { | ||
136 | Q_UNUSED(modeIndex); | 147 | Q_UNUSED(modeIndex); | ||
137 | } | 148 | } | ||
138 | virtual void transform(KWayland::Server::OutputDeviceInterface::Transform transform) { | 149 | virtual void updateTransform(Transform transform) { | ||
139 | Q_UNUSED(transform); | 150 | Q_UNUSED(transform); | ||
140 | } | 151 | } | ||
141 | 152 | | |||
142 | void setWaylandMode(const QSize &size, int refreshRate); | 153 | void setWaylandMode(const QSize &size, int refreshRate); | ||
154 | void setTransform(Transform transform); | ||||
143 | 155 | | |||
144 | void setOrientation(Qt::ScreenOrientations orientation); | | |||
145 | QSize orientateSize(const QSize &size) const; | 156 | QSize orientateSize(const QSize &size) const; | ||
146 | 157 | | |||
147 | /** | 158 | /** | ||
148 | * Returns the orientation of this output. | 159 | * Returns the orientation of this output. | ||
149 | * | 160 | * | ||
150 | * - Flipped along the vertical axis is landscape + inv. portrait. | 161 | * - Flipped along the vertical axis is landscape + inv. portrait. | ||
151 | * - Rotated 90° and flipped along the horizontal axis is portrait + inv. landscape | 162 | * - Rotated 90° and flipped along the horizontal axis is portrait + inv. landscape | ||
152 | * - Rotated 180° and flipped along the vertical axis is inv. landscape + inv. portrait | 163 | * - Rotated 180° and flipped along the vertical axis is inv. landscape + inv. portrait | ||
153 | * - Rotated 270° and flipped along the horizontal axis is inv. portrait + inv. landscape + | 164 | * - Rotated 270° and flipped along the horizontal axis is inv. portrait + inv. landscape + | ||
154 | * portrait | 165 | * portrait | ||
155 | */ | 166 | */ | ||
156 | Qt::ScreenOrientations orientation() const; | 167 | Transform transform() const; | ||
157 | 168 | | |||
158 | private: | 169 | private: | ||
159 | void createWaylandOutput(); | 170 | void createWaylandOutput(); | ||
160 | void createXdgOutput(); | 171 | void createXdgOutput(); | ||
161 | 172 | | |||
162 | void setTransform(KWayland::Server::OutputDeviceInterface::Transform transform); | 173 | void setTransform(KWayland::Server::OutputDeviceInterface::Transform transform); | ||
163 | 174 | | |||
164 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | 175 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | ||
Show All 12 Lines |