diff options
| author | memchr <118117622+memchr@users.noreply.github.com> | 2023-09-20 15:25:03 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-20 16:25:03 +0100 |
| commit | 3785defaf12b9d99137b2f4c74ab82c51cf733e1 (patch) | |
| tree | c064adb3ec5eedd612bbc850976bc73ddbe7d15a /src/layout/DwindleLayout.hpp | |
| parent | 6594b50e57935dd66930ccd35dba7a1b4131399d (diff) | |
logging: implement std::formatter for some types (#3380)
Diffstat (limited to 'src/layout/DwindleLayout.hpp')
| -rw-r--r-- | src/layout/DwindleLayout.hpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp index 66c117fc..993f8cb7 100644 --- a/src/layout/DwindleLayout.hpp +++ b/src/layout/DwindleLayout.hpp @@ -1,11 +1,12 @@ #pragma once #include "IHyprLayout.hpp" + #include <list> #include <deque> -#include "../render/decorations/CHyprGroupBarDecoration.hpp" #include <array> #include <optional> +#include <format> class CHyprDwindleLayout; enum eFullscreenMode : uint8_t; @@ -85,3 +86,17 @@ class CHyprDwindleLayout : public IHyprLayout { friend struct SDwindleNodeData; }; + +template <typename CharT> +struct std::formatter<SDwindleNodeData*, CharT> : std::formatter<CharT> { + template <typename FormatContext> + auto format(const SDwindleNodeData* const& node, FormatContext& ctx) const { + auto out = ctx.out(); + if (!node) + return std::format_to(out, "[Node nullptr]"); + std::format_to(out, "[Node {:x}: workspace: {}, pos: {:j2}, size: {:j2}", (uintptr_t)node, node->workspaceID, node->position, node->size); + if (!node->isNode && node->pWindow) + std::format_to(out, ", window: {:x}", node->pWindow); + return std::format_to(out, "]"); + } +};
\ No newline at end of file |
