SILICON
Loading...
Searching...
No Matches
architectureWorkspace.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8 */
9
10#pragma once
11
12#include <ui/lifetime.hpp>
13
14#include <map>
15#include <memory>
16#include <string>
17
18#include <QTabWidget>
19
20#include <sisl/sisl.hpp>
21
23
24namespace SILICON::project {
25class DocumentStore;
26}
27
28namespace SILICON::ui {
29
31class CodeEditor;
32class SislVisualizer;
33
35class ArchitectureWorkspace : public QTabWidget {
36 Q_OBJECT
37
38public:
39 explicit ArchitectureWorkspace(QWidget* parent = nullptr);
40
41 [[nodiscard]] CodeEditor* editor(SILICON::project::DocumentType type) const noexcept;
42 [[nodiscard]] const std::map<SILICON::project::DocumentType, CodeEditor*>&
43 editors() const noexcept
44 {
45 return codeEditors;
46 }
47 [[nodiscard]] bool hasModifiedEditors() const;
48 [[nodiscard]] bool isVisualizerActive() const noexcept;
49 [[nodiscard]] bool isVisualizerTab(int index) const noexcept;
51 void loadDocument(const SILICON::project::Document& document,
53
65 [[nodiscard]] std::shared_ptr<ArchitectureLoadPlan>
68
74 void applyLoadPlan(const ArchitectureLoadPlan& plan);
75
76 void showVisualization(sisl::IsaDescription description);
77
78signals:
80
81private:
82 std::map<SILICON::project::DocumentType, CodeEditor*> codeEditors;
86};
87
88} // namespace SILICON::ui
Architecture files resolved before the editor tabs are rebuilt.
std::map< SILICON::project::DocumentType, CodeEditor * > codeEditors
void loadDocument(const SILICON::project::Document &document, const SILICON::project::DocumentStore &store)
ArchitectureWorkspace(QWidget *parent=nullptr)
CodeEditor * editor(SILICON::project::DocumentType type) const noexcept
bool isVisualizerTab(int index) const noexcept
const std::map< SILICON::project::DocumentType, CodeEditor * > & editors() const noexcept
void applyLoadPlan(const ArchitectureLoadPlan &plan)
Rebuilds the architecture tabs from a prepared plan.
std::shared_ptr< ArchitectureLoadPlan > prepareLoadPlan(const SILICON::project::Document &document, const SILICON::project::DocumentStore &store)
Resolves the architecture tabs of document without touching the tabs.
void showVisualization(sisl::IsaDescription description)