aboutsummaryrefslogtreecommitdiff
path: root/src/ui/workspace.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/workspace.h')
-rw-r--r--src/ui/workspace.h29
1 files changed, 29 insertions, 0 deletions
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 <string>
+
+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;
+ };
+}