From 12da0fc84f8b084f7b13702b811cbed7dae9854c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 4 Mar 2024 10:36:32 +0000 Subject: hyprctl: parse custom types in getoption --- src/config/ConfigDataValues.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/config/ConfigDataValues.hpp') diff --git a/src/config/ConfigDataValues.hpp b/src/config/ConfigDataValues.hpp index accc92ab..39c60a5a 100644 --- a/src/config/ConfigDataValues.hpp +++ b/src/config/ConfigDataValues.hpp @@ -14,6 +14,8 @@ class ICustomConfigValueData { virtual ~ICustomConfigValueData() = 0; virtual eConfigValueDataTypes getDataType() = 0; + + virtual std::string toString() = 0; }; class CGradientValueData : public ICustomConfigValueData { @@ -51,6 +53,15 @@ class CGradientValueData : public ICustomConfigValueData { return true; } + + virtual std::string toString() { + std::string result; + for (auto& c : m_vColors) { + result += std::format("{:x} ", c.getAsHex()); + } + + result += std::format("{}deg", (int)(m_fAngle * 180.0 / M_PI)); + } }; class CCssGapData : public ICustomConfigValueData { @@ -103,4 +114,8 @@ class CCssGapData : public ICustomConfigValueData { virtual eConfigValueDataTypes getDataType() { return CVD_TYPE_CSS_VALUE; } + + virtual std::string toString() { + return std::format("{} {} {} {}", top, right, bottom, left); + } }; -- cgit v1.2.3