From 5ea6c14c0e14bacee766ce1280ab2c71564e05ec Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 23 Aug 2026 21:55:36 +0200 Subject: [feat]: implement ui layer arch --- src/ui/workspace.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/ui/workspace.h (limited to 'src/ui/workspace.h') diff --git a/src/ui/workspace.h b/src/ui/workspace.h new file mode 100644 index 0000000..134d517 --- /dev/null +++ b/src/ui/workspace.h @@ -0,0 +1,29 @@ +#pragma once + +#include "rendering/view.h" +#include + +namespace Donut +{ + class Scene; + + // What a workspace gets each frame to build its panels. `scene` is mutable — + // workspaces edit the document through it. + struct UIContext + { + Scene& scene; + std::string device_name; + }; + + // A Dorico-style workspace: one tab that owns its side panels and declares + // which viewport View it shows. Switching tabs switches both. Concrete + // workspaces (Setup / Scene / Simulation / Export) live in ui_layer.cpp. + class Workspace + { + public: + virtual ~Workspace() = default; + virtual auto name() const -> const char* = 0; + virtual auto view() const -> View = 0; + virtual auto on_ui(const UIContext& ctx) -> void = 0; + }; +} -- cgit v1.3