diff options
Diffstat (limited to 'src/layout/MasterLayout.hpp')
| -rw-r--r-- | src/layout/MasterLayout.hpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/layout/MasterLayout.hpp b/src/layout/MasterLayout.hpp index fd38b915..aa201505 100644 --- a/src/layout/MasterLayout.hpp +++ b/src/layout/MasterLayout.hpp @@ -10,8 +10,7 @@ enum eFullscreenMode : uint8_t; //orientation determines which side of the screen the master area resides -enum eOrientation : uint8_t -{ +enum eOrientation : uint8_t { ORIENTATION_LEFT = 0, ORIENTATION_TOP, ORIENTATION_RIGHT, @@ -33,7 +32,7 @@ struct SMasterNodeData { int workspaceID = -1; bool operator==(const SMasterNodeData& rhs) const { - return pWindow == rhs.pWindow; + return pWindow == rhs.pWindow; } }; @@ -42,7 +41,7 @@ struct SMasterWorkspaceData { eOrientation orientation = ORIENTATION_LEFT; bool operator==(const SMasterWorkspaceData& rhs) const { - return workspaceID == rhs.workspaceID; + return workspaceID == rhs.workspaceID; } }; @@ -89,3 +88,19 @@ class CHyprMasterLayout : public IHyprLayout { friend struct SMasterNodeData; friend struct SMasterWorkspaceData; }; + +template <typename CharT> +struct std::formatter<SMasterNodeData*, CharT> : std::formatter<CharT> { + template <typename FormatContext> + auto format(const SMasterNodeData* 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->isMaster) + std::format_to(out, ", master"); + if (node->pWindow) + std::format_to(out, ", window: {:x}", node->pWindow); + return std::format_to(out, "]"); + } +};
\ No newline at end of file |
