/* SPDX-FileCopyrightText: 2019 Roman Gilg SPDX-FileCopyrightText: 2021 David Redondo SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "../common/control.h" #include "../common/globals.h" #include #include #include #include #include class Output { public: static void readInOutputs(KScreen::ConfigPtr config, const QVariantList &outputsInfo); static void writeGlobal(const KScreen::OutputPtr &output, bool hasDuplicate); static bool writeGlobalPart(const KScreen::OutputPtr &output, QVariantMap &info, const KScreen::OutputPtr &fallback); static QString dirPath(); static bool updateOrientation(KScreen::OutputPtr &output, QOrientationReading::Orientation orientation); struct GlobalConfig { std::optional scale; std::optional modeId; std::optional rotation; std::optional vrrPolicy; std::optional overscan; std::optional rgbRange; }; static GlobalConfig readGlobal(const KScreen::OutputPtr &output); private: static QVariantMap getGlobalData(KScreen::OutputPtr output); static void readIn(KScreen::OutputPtr output, const QVariantMap &info); static bool readInGlobal(KScreen::OutputPtr output); static void readInGlobalPartFromInfo(KScreen::OutputPtr output, const QVariantMap &info); /* * When a global output value (scale, rotation) is changed we might * need to reposition the outputs when another config is read. */ static void adjustPositions(KScreen::ConfigPtr config, const QVariantList &outputsInfo); static QString s_dirName; };