Changeset View
Changeset View
Standalone View
Standalone View
abstract_wayland_output.h
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
56 | { | 56 | { | ||
57 | Q_OBJECT | 57 | Q_OBJECT | ||
58 | public: | 58 | public: | ||
59 | explicit AbstractWaylandOutput(QObject *parent = nullptr); | 59 | explicit AbstractWaylandOutput(QObject *parent = nullptr); | ||
60 | ~AbstractWaylandOutput() override; | 60 | ~AbstractWaylandOutput() override; | ||
61 | 61 | | |||
62 | QString name() const override; | 62 | QString name() const override; | ||
63 | QByteArray uuid() const override; | 63 | QByteArray uuid() const override; | ||
64 | bool isEnabled() const { | | |||
65 | return !m_waylandOutput.isNull(); | | |||
66 | } | | |||
67 | 64 | | |||
68 | QSize pixelSize() const; | 65 | QSize pixelSize() const; | ||
69 | qreal scale() const override; | 66 | qreal scale() const override; | ||
70 | 67 | | |||
71 | /** | 68 | /** | ||
72 | * The geometry of this output in global compositor co-ordinates (i.e scaled) | 69 | * The geometry of this output in global compositor co-ordinates (i.e scaled) | ||
73 | */ | 70 | */ | ||
74 | QRect geometry() const override; | 71 | QRect geometry() const override; | ||
Show All 27 Lines | |||||
102 | * The default is on. | 99 | * The default is on. | ||
103 | */ | 100 | */ | ||
104 | void setEnabled(bool enable) override; | 101 | void setEnabled(bool enable) override; | ||
105 | 102 | | |||
106 | Q_SIGNALS: | 103 | Q_SIGNALS: | ||
107 | void modeChanged(); | 104 | void modeChanged(); | ||
108 | 105 | | |||
109 | protected: | 106 | protected: | ||
110 | void initWaylandOutputDevice(const QString &model, | 107 | void initInterfaces(const QString &model, const QString &manufacturer, | ||
111 | const QString &manufacturer, | 108 | const QByteArray &uuid, const QSize &physicalSize, | ||
112 | const QByteArray &uuid, | | |||
113 | const QSize &physicalSize, | | |||
114 | const QVector<KWayland::Server::OutputDeviceInterface::Mode> &modes); | 109 | const QVector<KWayland::Server::OutputDeviceInterface::Mode> &modes); | ||
115 | 110 | | |||
116 | QPointer<KWayland::Server::XdgOutputInterface> xdgOutput() const { | 111 | QPointer<KWayland::Server::XdgOutputInterface> xdgOutput() const { | ||
117 | return m_xdgOutput; | 112 | return m_xdgOutput; | ||
118 | } | 113 | } | ||
119 | 114 | | |||
120 | QPointer<KWayland::Server::OutputDeviceInterface> waylandOutputDevice() const { | 115 | QPointer<KWayland::Server::OutputDeviceInterface> waylandOutputDevice() const { | ||
121 | return m_waylandOutputDevice; | 116 | return m_waylandOutputDevice; | ||
Show All 25 Lines | |||||
147 | 142 | | |||
148 | void setWaylandMode(const QSize &size, int refreshRate); | 143 | void setWaylandMode(const QSize &size, int refreshRate); | ||
149 | 144 | | |||
150 | QSize orientateSize(const QSize &size) const; | 145 | QSize orientateSize(const QSize &size) const; | ||
151 | 146 | | |||
152 | private: | 147 | private: | ||
153 | void createWaylandOutput(); | 148 | void createWaylandOutput(); | ||
154 | void createXdgOutput(); | 149 | void createXdgOutput(); | ||
150 | bool isEnabled() const; | ||||
155 | 151 | | |||
156 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | 152 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | ||
157 | QPointer<KWayland::Server::XdgOutputInterface> m_xdgOutput; | 153 | QPointer<KWayland::Server::XdgOutputInterface> m_xdgOutput; | ||
158 | QPointer<KWayland::Server::OutputDeviceInterface> m_waylandOutputDevice; | 154 | QPointer<KWayland::Server::OutputDeviceInterface> m_waylandOutputDevice; | ||
159 | 155 | | |||
160 | KWayland::Server::OutputInterface::DpmsMode m_dpms = KWayland::Server::OutputInterface::DpmsMode::On; | 156 | KWayland::Server::OutputInterface::DpmsMode m_dpms = KWayland::Server::OutputInterface::DpmsMode::On; | ||
161 | 157 | | |||
162 | Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; | 158 | Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; | ||
163 | bool m_internal = false; | 159 | bool m_internal = false; | ||
164 | bool m_supportsDpms = false; | 160 | bool m_supportsDpms = false; | ||
165 | }; | 161 | }; | ||
166 | 162 | | |||
167 | } | 163 | } | ||
168 | 164 | | |||
169 | #endif // KWIN_OUTPUT_H | 165 | #endif // KWIN_OUTPUT_H |