Changeset View
Changeset View
Standalone View
Standalone View
abstract_wayland_output.h
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 58 | public: | |||
---|---|---|---|---|---|
68 | }; | 68 | }; | ||
69 | 69 | | |||
70 | explicit AbstractWaylandOutput(QObject *parent = nullptr); | 70 | explicit AbstractWaylandOutput(QObject *parent = nullptr); | ||
71 | ~AbstractWaylandOutput() override; | 71 | ~AbstractWaylandOutput() override; | ||
72 | 72 | | |||
73 | QString name() const override; | 73 | QString name() const override; | ||
74 | QByteArray uuid() const override; | 74 | QByteArray uuid() const override; | ||
75 | 75 | | |||
76 | /** | ||||
77 | * The mode size is the current hardware mode of the output in pixel | ||||
78 | * and is dependent on hardware parameters but can often be adjusted. In most | ||||
79 | * cases running the maximum resolution is preferred though since this has the | ||||
80 | * best picture quality. | ||||
81 | * | ||||
82 | * @return output mode size | ||||
83 | */ | ||||
76 | QSize pixelSize() const; | 84 | QSize pixelSize() const; | ||
85 | | ||||
86 | /** | ||||
87 | * Describes the viewable rectangle on the output relative to the output's mode size. | ||||
88 | * | ||||
89 | * Per default the view spans the full output. | ||||
90 | * | ||||
91 | * @return viewable geometry on the output | ||||
92 | */ | ||||
93 | QRect viewGeometry() const; | ||||
94 | QSize logicalSize() const; | ||||
95 | | ||||
77 | qreal scale() const override; | 96 | qreal scale() const override; | ||
78 | 97 | | |||
79 | /** | 98 | /** | ||
80 | * The geometry of this output in global compositor co-ordinates (i.e scaled) | 99 | * The geometry of this output in global compositor co-ordinates (i.e scaled) | ||
81 | */ | 100 | */ | ||
82 | QRect geometry() const override; | 101 | QRect geometry() const override; | ||
83 | QSize physicalSize() const override; | 102 | QSize physicalSize() const override; | ||
84 | 103 | | |||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 165 | virtual void updateMode(int modeIndex) { | |||
147 | Q_UNUSED(modeIndex); | 166 | Q_UNUSED(modeIndex); | ||
148 | } | 167 | } | ||
149 | virtual void updateTransform(Transform transform) { | 168 | virtual void updateTransform(Transform transform) { | ||
150 | Q_UNUSED(transform); | 169 | Q_UNUSED(transform); | ||
151 | } | 170 | } | ||
152 | 171 | | |||
153 | void setWaylandMode(const QSize &size, int refreshRate); | 172 | void setWaylandMode(const QSize &size, int refreshRate); | ||
154 | void setTransform(Transform transform); | 173 | void setTransform(Transform transform); | ||
174 | void setLogicalSize(const QSizeF &size); | ||||
155 | 175 | | |||
156 | QSize orientateSize(const QSize &size) const; | 176 | QSize orientateSize(const QSize &size) const; | ||
157 | 177 | | |||
158 | /** | 178 | /** | ||
159 | * Returns the orientation of this output. | 179 | * Returns the orientation of this output. | ||
160 | * | 180 | * | ||
161 | * - Flipped along the vertical axis is landscape + inv. portrait. | 181 | * - Flipped along the vertical axis is landscape + inv. portrait. | ||
162 | * - Rotated 90° and flipped along the horizontal axis is portrait + inv. landscape | 182 | * - Rotated 90° and flipped along the horizontal axis is portrait + inv. landscape | ||
163 | * - Rotated 180° and flipped along the vertical axis is inv. landscape + inv. portrait | 183 | * - Rotated 180° and flipped along the vertical axis is inv. landscape + inv. portrait | ||
164 | * - Rotated 270° and flipped along the horizontal axis is inv. portrait + inv. landscape + | 184 | * - Rotated 270° and flipped along the horizontal axis is inv. portrait + inv. landscape + | ||
165 | * portrait | 185 | * portrait | ||
166 | */ | 186 | */ | ||
167 | Transform transform() const; | 187 | Transform transform() const; | ||
168 | 188 | | |||
169 | private: | 189 | private: | ||
170 | void createWaylandOutput(); | 190 | void createWaylandOutput(); | ||
171 | void createXdgOutput(); | 191 | void createXdgOutput(); | ||
172 | 192 | | |||
173 | void setTransform(KWayland::Server::OutputDeviceInterface::Transform transform); | 193 | void setTransform(KWayland::Server::OutputDeviceInterface::Transform transform); | ||
194 | void updateViewGeometry(); | ||||
174 | 195 | | |||
175 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | 196 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | ||
176 | QPointer<KWayland::Server::XdgOutputInterface> m_xdgOutput; | 197 | QPointer<KWayland::Server::XdgOutputInterface> m_xdgOutput; | ||
177 | QPointer<KWayland::Server::OutputDeviceInterface> m_waylandOutputDevice; | 198 | QPointer<KWayland::Server::OutputDeviceInterface> m_waylandOutputDevice; | ||
178 | 199 | | |||
179 | KWayland::Server::OutputInterface::DpmsMode m_dpms = KWayland::Server::OutputInterface::DpmsMode::On; | 200 | KWayland::Server::OutputInterface::DpmsMode m_dpms = KWayland::Server::OutputInterface::DpmsMode::On; | ||
201 | QRect m_viewGeometry; | ||||
180 | 202 | | |||
181 | bool m_internal = false; | 203 | bool m_internal = false; | ||
182 | bool m_supportsDpms = false; | 204 | bool m_supportsDpms = false; | ||
183 | }; | 205 | }; | ||
184 | 206 | | |||
185 | } | 207 | } | ||
186 | 208 | | |||
187 | #endif // KWIN_OUTPUT_H | 209 | #endif // KWIN_OUTPUT_H |