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 | SubPixel subPixel() const; | 109 | SubPixel subPixel() const; | ||
104 | Transform transform() const; | 110 | Transform transform() const; | ||
111 | ColorCurves colorCurves() const; | ||||
105 | QList<Mode> modes() const; | 112 | QList<Mode> modes() const; | ||
106 | int currentModeId() const; | 113 | int currentModeId() const; | ||
107 | 114 | | |||
108 | QByteArray edid() const; | 115 | QByteArray edid() const; | ||
109 | OutputDeviceInterface::Enablement enabled() const; | 116 | OutputDeviceInterface::Enablement enabled() const; | ||
110 | QByteArray uuid() const; | 117 | QByteArray uuid() const; | ||
111 | 118 | | |||
112 | void setPhysicalSize(const QSize &size); | 119 | void setPhysicalSize(const QSize &size); | ||
113 | void setGlobalPosition(const QPoint &pos); | 120 | void setGlobalPosition(const QPoint &pos); | ||
114 | void setManufacturer(const QString &manufacturer); | 121 | void setManufacturer(const QString &manufacturer); | ||
115 | void setModel(const QString &model); | 122 | void setModel(const QString &model); | ||
116 | void setScale(int scale); | 123 | void setScale(int scale); | ||
117 | void setSubPixel(SubPixel subPixel); | 124 | void setSubPixel(SubPixel subPixel); | ||
118 | void setTransform(Transform transform); | 125 | void setTransform(Transform transform); | ||
126 | void setColorCurves(const ColorCurves &colorCurves); | ||||
119 | void addMode(Mode &mode); | 127 | void addMode(Mode &mode); | ||
120 | void setCurrentMode(const int modeId); | 128 | void setCurrentMode(const int modeId); | ||
121 | 129 | | |||
122 | void setEdid(const QByteArray &edid); | 130 | void setEdid(const QByteArray &edid); | ||
123 | void setEnabled(OutputDeviceInterface::Enablement enabled); | 131 | void setEnabled(OutputDeviceInterface::Enablement enabled); | ||
124 | void setUuid(const QByteArray &uuid); | 132 | void setUuid(const QByteArray &uuid); | ||
125 | 133 | | |||
126 | static OutputDeviceInterface *get(wl_resource *native); | 134 | static OutputDeviceInterface *get(wl_resource *native); | ||
127 | static QList<OutputDeviceInterface *>list(); | 135 | static QList<OutputDeviceInterface *>list(); | ||
128 | 136 | | |||
129 | Q_SIGNALS: | 137 | Q_SIGNALS: | ||
130 | void physicalSizeChanged(const QSize&); | 138 | void physicalSizeChanged(const QSize&); | ||
131 | void globalPositionChanged(const QPoint&); | 139 | void globalPositionChanged(const QPoint&); | ||
132 | void manufacturerChanged(const QString&); | 140 | void manufacturerChanged(const QString&); | ||
133 | void modelChanged(const QString&); | 141 | void modelChanged(const QString&); | ||
134 | void pixelSizeChanged(const QSize&); | 142 | void pixelSizeChanged(const QSize&); | ||
135 | void refreshRateChanged(int); | 143 | void refreshRateChanged(int); | ||
136 | void scaleChanged(int); | 144 | void scaleChanged(int); | ||
137 | void subPixelChanged(SubPixel); | 145 | void subPixelChanged(SubPixel); | ||
138 | void transformChanged(Transform); | 146 | void transformChanged(Transform); | ||
147 | void colorCurvesChanged(ColorCurves); | ||||
139 | void modesChanged(); | 148 | void modesChanged(); | ||
140 | void currentModeChanged(); | 149 | void currentModeChanged(); | ||
141 | 150 | | |||
142 | void edidChanged(); | 151 | void edidChanged(); | ||
143 | void enabledChanged(); | 152 | void enabledChanged(); | ||
144 | void uuidChanged(); | 153 | void uuidChanged(); | ||
145 | 154 | | |||
146 | private: | 155 | private: | ||
147 | friend class Display; | 156 | friend class Display; | ||
148 | explicit OutputDeviceInterface(Display *display, QObject *parent = nullptr); | 157 | explicit OutputDeviceInterface(Display *display, QObject *parent = nullptr); | ||
149 | class Private; | 158 | class Private; | ||
150 | Private *d_func() const; | 159 | Private *d_func() const; | ||
151 | }; | 160 | }; | ||
152 | 161 | | |||
153 | } | 162 | } | ||
154 | } | 163 | } | ||
155 | 164 | | |||
156 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::OutputDeviceInterface::ModeFlags) | 165 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::OutputDeviceInterface::ModeFlags) | ||
157 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Enablement) | 166 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Enablement) | ||
158 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::SubPixel) | 167 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::SubPixel) | ||
159 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Transform) | 168 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::Transform) | ||
169 | Q_DECLARE_METATYPE(KWayland::Server::OutputDeviceInterface::ColorCurves) | ||||
160 | 170 | | |||
161 | #endif | 171 | #endif |