| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#ifndef KISWAYLANDAPICOLORMANAGER_H |
| 7 |
#define KISWAYLANDAPICOLORMANAGER_H |
| 8 |
|
| 9 |
#include <QWaylandClientExtension> |
| 10 |
#include <qwayland-color-management-v1.h> |
| 11 |
|
| 12 |
#include <QSet> |
| 13 |
|
| 14 |
class KisWaylandAPIColorManager |
| 15 |
: public QWaylandClientExtensionTemplate<KisWaylandAPIColorManager, &QtWayland::wp_color_manager_v1::destroy> |
| 16 |
, public QtWayland::wp_color_manager_v1 |
| 17 |
{ |
| 18 |
Q_OBJECT |
| 19 |
public: |
| 20 |
explicit KisWaylandAPIColorManager(); |
| 21 |
~KisWaylandAPIColorManager(); |
| 22 |
|
| 23 |
bool isReady() const { |
| 24 |
return m_isReady; |
| 25 |
} |
| 26 |
|
| 27 |
bool isFeatureSupported(feature f) const |
| 28 |
{ |
| 29 |
return m_supportedFeatures.contains(f); |
| 30 |
} |
| 31 |
|
| 32 |
bool isIntentSupported(render_intent ri) const |
| 33 |
{ |
| 34 |
return m_supportedIntents.contains(ri); |
| 35 |
} |
| 36 |
|
| 37 |
bool isTransferFunctionNamedSupported(transfer_function tf) const |
| 38 |
{ |
| 39 |
return m_supportedTransferFunctionsNamed.contains(tf); |
| 40 |
} |
| 41 |
|
| 42 |
bool isPrimariesNamedSupported(primaries p) const |
| 43 |
{ |
| 44 |
return m_supportedPrimariesNamed.contains(p); |
| 45 |
} |
| 46 |
|
| 47 |
Q_SIGNALS: |
| 48 |
void sigReadyChanged(bool value); |
| 49 |
|
| 50 |
protected: |
| 51 |
void wp_color_manager_v1_supported_intent(uint32_t _render_intent) override; |
| 52 |
void wp_color_manager_v1_supported_feature(uint32_t _feature) override; |
| 53 |
void wp_color_manager_v1_supported_tf_named(uint32_t tf) override; |
| 54 |
void wp_color_manager_v1_supported_primaries_named(uint32_t _primaries) override; |
| 55 |
void wp_color_manager_v1_done() override; |
| 56 |
|
| 57 |
private: |
| 58 |
QSet<render_intent> m_supportedIntents; |
| 59 |
QSet<feature> m_supportedFeatures; |
| 60 |
QSet<transfer_function> m_supportedTransferFunctionsNamed; |
| 61 |
QSet<primaries> m_supportedPrimariesNamed; |
| 62 |
bool m_isReady {false}; |
| 63 |
}; |
| 64 |
|
| 65 |
#endif |