aboutsummaryrefslogtreecommitdiff
path: root/src/ui/workspace.h
blob: 134d517967d703dd4721311ec1660072f438b6cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
    };
}