Changeset View
Changeset View
Standalone View
Standalone View
src/server/outputdevice_interface.h
Show All 17 Lines | |||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef WAYLAND_SERVER_OUTPUTDEVICE_INTERFACE_H | 20 | #ifndef WAYLAND_SERVER_OUTPUTDEVICE_INTERFACE_H | ||
21 | #define WAYLAND_SERVER_OUTPUTDEVICE_INTERFACE_H | 21 | #define WAYLAND_SERVER_OUTPUTDEVICE_INTERFACE_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QPoint> | 24 | #include <QPoint> | ||
25 | #include <QSize> | 25 | #include <QSize> | ||
26 | #include <QVector> | ||||
26 | 27 | | |||
27 | #include <KWayland/Server/kwaylandserver_export.h> | 28 | #include <KWayland/Server/kwaylandserver_export.h> | ||
28 | #include "global.h" | 29 | #include "global.h" | ||
29 | 30 | | |||
30 | struct wl_resource; | 31 | struct wl_resource; | ||
31 | 32 | | |||
32 | namespace KWayland | 33 | namespace KWayland | ||
33 | { | 34 | { | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 61 | public: | |||
86 | }; | 87 | }; | ||
87 | Q_DECLARE_FLAGS(ModeFlags, ModeFlag) | 88 | Q_DECLARE_FLAGS(ModeFlags, ModeFlag) | ||
88 | struct Mode { | 89 | struct Mode { | ||
89 | QSize size = QSize(); | 90 | QSize size = QSize(); | ||
90 | int refreshRate = 60000; | 91 | int refreshRate = 60000; | ||
91 | ModeFlags flags; | 92 | ModeFlags flags; | ||
92 | int id = -1; | 93 | int id = -1; | ||
93 | }; | 94 | }; | ||
95 | struct ColorCurves { | ||||
96 | QVector<quint16> red, green, blue; | ||||
97 | bool operator==(const ColorCurves &cc) const; | ||||
98 | bool operator!=(const ColorCurves &cc) const; | ||||
99 | }; | ||||
94 | virtual ~OutputDeviceInterface(); | 100 | virtual ~OutputDeviceInterface(); | ||
95 | 101 | | |||
96 | QSize physicalSize() const; | 102 | QSize physicalSize() const; | ||
97 | QPoint globalPosition() const; | 103 | QPoint globalPosition() const; | ||
98 | QString manufacturer() const; | 104 | QString manufacturer() const; | ||
99 | QString model() const; | 105 | QString model() const; | ||
100 | QSize pixelSize() const; | 106 | QSize pixelSize() const; | ||
101 | int refreshRate() const; | 107 | int refreshRate() const; | ||
102 | int scale() const; | 108 | int scale() const; | ||
103 | qreal scaleF() const; | 109 | qreal scaleF() const; | ||
104 | SubPixel subPixel() const; | 110 | SubPixel subPixel() const; | ||
105 | Transform transform() const; | 111 | Transform transform() const; | ||
112 | ColorCurves colorCurves() const; | ||||
106 | QList<Mode> modes() const; | 113 | QList<Mode> modes() const; | ||
107 | int currentModeId() const; | 114 | int currentModeId() const; | ||
108 | 115 | | |||
109 | QByteArray edid() const; | 116 | QByteArray edid() const; | ||
110 | OutputDeviceInterface::Enablement enabled() const; | 117 | OutputDeviceInterface::Enablement enabled() const; | ||
111 | QByteArray uuid() const; | 118 | QByteArray uuid() const; | ||
112 | 119 | | |||
113 | void setPhysicalSize(const QSize &size); | 120 | void setPhysicalSize(const QSize &size); | ||
114 | void setGlobalPosition(const QPoint &pos); | 121 | void setGlobalPosition(const QPoint &pos); | ||
115 | void setManufacturer(const QString &manufacturer); | 122 | void setManufacturer(const QString &manufacturer); | ||
116 | void setModel(const QString &model); | 123 | void setModel(const QString &model); | ||
117 | void setScale(int scale); | 124 | void setScale(int scale); | ||
118 | void setScaleF(qreal scale); | 125 | void setScaleF(qreal scale); | ||
119 | void setSubPixel(SubPixel subPixel); | 126 | void setSubPixel(SubPixel subPixel); | ||
120 | void setTransform(Transform transform); | 127 | void setTransform(Transform transform); | ||
128 | void setColorCurves(const ColorCurves &colorCurves); | ||||
121 | void addMode(Mode &mode); | 129 | void addMode(Mode &mode); | ||
122 | void setCurrentMode(const int modeId); | 130 | void setCurrentMode(const int modeId); | ||
123 | 131 | | |||
124 | void setEdid(const QByteArray &edid); | 132 | void setEdid(const QByteArray &edid); | ||
125 | void setEnabled(OutputDeviceInterface::Enablement enabled); | 133 | void setEnabled(OutputDeviceInterface::Enablement enabled); | ||
126 | void setUuid(const QByteArray &uuid); | 134 | void setUuid(const QByteArray &uuid); | ||
127 | 135 | | |||
128 | static OutputDeviceInterface *get(wl_resource *native); | 136 | static OutputDeviceInterface *get(wl_resource *native); | ||
129 | static QList<OutputDeviceInterface *>list(); | 137 | static QList<OutputDeviceInterface *>list(); | ||
130 | 138 | | |||
131 | Q_SIGNALS: | 139 | Q_SIGNALS: | ||
132 | void physicalSizeChanged(const QSize&); | 140 | void physicalSizeChanged(const QSize&); | ||
133 | void globalPositionChanged(const QPoint&); | 141 | void globalPositionChanged(const QPoint&); | ||
134 | void manufacturerChanged(const QString&); | 142 | void manufacturerChanged(const QString&); | ||
135 | void modelChanged(const QString&); | 143 | void modelChanged(const QString&); | ||
136 | void pixelSizeChanged(const QSize&); | 144 | void pixelSizeChanged(const QSize&); | ||
137 | void refreshRateChanged(int); | 145 | void refreshRateChanged(int); | ||
138 | //@deprecated see scaleChanged(real) | 146 | //@deprecated see scaleChanged(real) | ||
139 | void scaleChanged(int); | 147 | void scaleChanged(int); | ||
140 | void scaleFChanged(qreal); | 148 | void scaleFChanged(qreal); | ||
141 | void subPixelChanged(SubPixel); | 149 | void subPixelChanged(SubPixel); | ||
142 | void transformChanged(Transform); | 150 | void transformChanged(Transform); | ||
151 | void colorCurvesChanged(ColorCurves); | ||||
143 | void modesChanged(); | 152 | void modesChanged(); | ||
144 | void currentModeChanged(); | 153 | void currentModeChanged(); | ||
145 | 154 | | |||
146 | void edidChanged(); | 155 | void edidChanged(); | ||
147 | void enabledChanged(); | 156 | void enabledChanged(); | ||
148 | void uuidChanged(); | 157 | void uuidChanged(); | ||
149 | 158 | | |||
150 | private: | 159 | private: | ||
151 | friend class Display; | 160 | friend class Display; | ||
152 | explicit OutputDeviceInterface(Display *display, QObject *parent = nullptr); | 161 | explicit OutputDeviceInterface(Display *display, QObject *parent = nullptr); | ||
153 | class Private; | 162 | class Private; | ||
154 | Private *d_func() const; | 163 | Private *d_func() const; | ||
155 | }; | 164 | }; | ||
156 | 165 | | |||
157 | } | 166 | } | ||
158 | } | 167 | } | ||
159 | 168 | | |||
160 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::OutputDeviceInterface::ModeFlags) | 169 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::OutputDeviceInterface::ModeFlags) | ||
161 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Enablement) | 170 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Enablement) | ||
162 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::SubPixel) | 171 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::SubPixel) | ||
163 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Transform) | 172 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Transform) | ||
173 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::ColorCurves) | ||||
164 | 174 | | |||
165 | #endif | 175 | #endif |