#pragma once #include #include #include #include "WaylandProtocol.hpp" #include "protocols/core/Compositor.hpp" #include "xx-color-management-v4.hpp" #include "types/ColorManagement.hpp" class CColorManager; class CColorManagementOutput; class CColorManagementImageDescription; class CColorManagementProtocol; class CColorManager { public: CColorManager(SP resource_); bool good(); private: SP resource; }; class CColorManagementOutput { public: CColorManagementOutput(SP resource_); bool good(); wl_client* client(); WP self; WP imageDescription; private: SP resource; wl_client* pClient = nullptr; friend class CColorManagementProtocol; friend class CColorManagementImageDescription; }; class CColorManagementSurface { public: CColorManagementSurface(SP surface_); // temporary interface for frog CM CColorManagementSurface(SP resource_, SP surface_); bool good(); wl_client* client(); WP self; WP surface; const SImageDescription& imageDescription(); bool hasImageDescription(); private: SP resource; wl_client* pClient = nullptr; SImageDescription m_imageDescription; bool m_hasImageDescription = false; friend class CFrogColorManagementSurface; }; class CColorManagementFeedbackSurface { public: CColorManagementFeedbackSurface(SP resource_, SP surface_); bool good(); wl_client* client(); WP self; WP surface; private: SP resource; wl_client* pClient = nullptr; WP m_currentPreferred; friend class CColorManagementProtocol; }; class CColorManagementParametricCreator { public: CColorManagementParametricCreator(SP resource_); bool good(); wl_client* client(); WP self; SImageDescription settings; private: enum eValuesSet : uint32_t { // NOLINT PC_TF = (1 << 0), PC_TF_POWER = (1 << 1), PC_PRIMARIES = (1 << 2), PC_LUMINANCES = (1 << 3), PC_MASTERING_PRIMARIES = (1 << 4), PC_MASTERING_LUMINANCES = (1 << 5), PC_CLL = (1 << 6), PC_FALL = (1 << 7), }; SP resource; wl_client* pClient = nullptr; uint32_t valuesSet = 0; // enum eValuesSet }; class CColorManagementImageDescription { public: CColorManagementImageDescription(SP resource_, bool allowGetInformation = false); bool good(); wl_client* client(); SP resource(); WP self; SImageDescription settings; private: SP m_resource; wl_client* pClient = nullptr; bool m_allowGetInformation = false; friend class CColorManagementOutput; }; class CColorManagementImageDescriptionInfo { public: CColorManagementImageDescriptionInfo(SP resource_, const SImageDescription& settings_); bool good(); wl_client* client(); private: SP m_resource; wl_client* pClient = nullptr; SImageDescription settings; }; class CColorManagementProtocol : public IWaylandProtocol { public: CColorManagementProtocol(const wl_interface* iface, const int& ver, const std::string& name); virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id); void onImagePreferredChanged(); private: void destroyResource(CColorManager* resource); void destroyResource(CColorManagementOutput* resource); void destroyResource(CColorManagementSurface* resource); void destroyResource(CColorManagementFeedbackSurface* resource); void destroyResource(CColorManagementParametricCreator* resource); void destroyResource(CColorManagementImageDescription* resource); std::vector> m_vManagers; std::vector> m_vOutputs; std::vector> m_vSurfaces; std::vector> m_vFeedbackSurfaces; std::vector> m_vParametricCreators; std::vector> m_vImageDescriptions; friend class CColorManager; friend class CColorManagementOutput; friend class CColorManagementSurface; friend class CColorManagementFeedbackSurface; friend class CColorManagementParametricCreator; friend class CColorManagementImageDescription; friend class CFrogColorManagementSurface; }; namespace PROTO { inline UP colorManagement; };