mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 23:51:55 -07:00
logging: implement std::formatter for some types (#3380)
This commit is contained in:
@@ -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, "]");
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user