| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#ifndef KISWAYLANDOUTPUTCOLORINFO_H |
| 7 |
#define KISWAYLANDOUTPUTCOLORINFO_H |
| 8 |
|
| 9 |
#include <surfacecolormanagement/KisOutputColorInfoInterface.h> |
| 10 |
|
| 11 |
#include <unordered_map> |
| 12 |
|
| 13 |
class KisWaylandAPIOutput; |
| 14 |
class KisWaylandAPIColorManager; |
| 15 |
|
| 16 |
class KisWaylandOutputColorInfo : public KisOutputColorInfoInterface |
| 17 |
{ |
| 18 |
Q_OBJECT |
| 19 |
public: |
| 20 |
KisWaylandOutputColorInfo(QObject *parent = nullptr); |
| 21 |
~KisWaylandOutputColorInfo() override; |
| 22 |
|
| 23 |
bool isReady() const override; |
| 24 |
std::optional<KisSurfaceColorimetry::SurfaceDescription> outputDescription(const QScreen *screen) const override; |
| 25 |
|
| 26 |
private: |
| 27 |
void reinitialize(); |
| 28 |
void initScreenConnection(QScreen *screen); |
| 29 |
void slotScreenAdded(QScreen *screen); |
| 30 |
void slotScreenRemoved(QScreen *screen); |
| 31 |
|
| 32 |
void setReadyImpl(bool value); |
| 33 |
bool checkIfAllReady() const; |
| 34 |
|
| 35 |
private: |
| 36 |
std::shared_ptr<KisWaylandAPIColorManager> m_waylandManager; |
| 37 |
std::unordered_map<const QScreen*, std::unique_ptr<KisWaylandAPIOutput>> m_waylandOutputs; |
| 38 |
bool m_isReady {false}; |
| 39 |
}; |
| 40 |
|
| 41 |
#endif |