Step 167: split EditorState into sub-states
This commit is contained in:
20
editor/src/state/AgentState.h
Normal file
20
editor/src/state/AgentState.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "WebSocketServer.h"
|
||||
#include "WorkflowRecorder.h"
|
||||
#include "AgentRegistry.h"
|
||||
#include "AgentMarketplace.h"
|
||||
#include "AgentPermissionPolicy.h"
|
||||
|
||||
struct AgentState {
|
||||
std::unique_ptr<WebSocketAgentServer> server;
|
||||
MockWebSocketTransport* transport = nullptr;
|
||||
int port = 8765;
|
||||
std::vector<std::string> log;
|
||||
std::map<std::string, AgentRole> roles;
|
||||
WorkflowRecorder workflowRecorder;
|
||||
AgentRegistry registry;
|
||||
AgentMarketplaceState marketplace;
|
||||
};
|
||||
17
editor/src/state/BuildState.h
Normal file
17
editor/src/state/BuildState.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include "TerminalPanel.h"
|
||||
#include "BuildSystem.h"
|
||||
|
||||
struct BuildState {
|
||||
bool showTerminalPanel = false;
|
||||
TerminalPanel terminal;
|
||||
bool runInProgress = false;
|
||||
bool hasRunResult = false;
|
||||
int lastRunExitCode = 0;
|
||||
std::string lastRunCommand;
|
||||
|
||||
BuildSystem::Type buildType = BuildSystem::Type::None;
|
||||
std::vector<BuildError> buildErrors;
|
||||
std::string lastBuildOutput;
|
||||
std::string lastBuildCommand;
|
||||
};
|
||||
19
editor/src/state/EmacsState.h
Normal file
19
editor/src/state/EmacsState.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include "EmacsIntegration.h"
|
||||
#include "EmacsPackageBrowser.h"
|
||||
#include "EmacsFunctionDiscovery.h"
|
||||
#include "EmacsKeybinding.h"
|
||||
#include "OrgMode.h"
|
||||
|
||||
struct EmacsState {
|
||||
EmacsConnection emacs;
|
||||
bool showEmacsPackagesPanel = false;
|
||||
EmacsPackageBrowserState emacsPackages;
|
||||
EmacsFunctionIndex emacsFunctionIndex;
|
||||
bool emacsFunctionIndexDirty = true;
|
||||
EmacsKeybindingState emacsKeys;
|
||||
bool showEmacsBridgePanel = false;
|
||||
bool showOrgPanel = true;
|
||||
OrgDocumentState orgDoc;
|
||||
int orgTempCounter = 0;
|
||||
};
|
||||
27
editor/src/state/LibraryState.h
Normal file
27
editor/src/state/LibraryState.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include "DependencyPanel.h"
|
||||
#include "LibraryBrowserPanel.h"
|
||||
#include "CompositionPanel.h"
|
||||
#include "LibraryIndexer.h"
|
||||
#include "PrimitivesRegistry.h"
|
||||
|
||||
struct LibraryState {
|
||||
bool showDependencyPanel = true;
|
||||
DependencyPanelState dependencyPanel;
|
||||
bool showLibraryBrowserPanel = true;
|
||||
LibraryBrowserState libraryBrowser;
|
||||
bool showCompositionPanel = false;
|
||||
CompositionPanelState compositionPanel;
|
||||
|
||||
struct LibraryIndexRequest {
|
||||
std::string name;
|
||||
std::string version;
|
||||
std::string source;
|
||||
int symbolsRequestId = -1;
|
||||
int completionRequestId = -1;
|
||||
};
|
||||
|
||||
std::vector<LibraryIndexRequest> libraryIndexRequests;
|
||||
LibraryIndexData libraryIndex;
|
||||
PrimitivesRegistry primitives;
|
||||
};
|
||||
22
editor/src/state/SearchState.h
Normal file
22
editor/src/state/SearchState.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
#include "ProjectSearch.h"
|
||||
|
||||
struct SearchState {
|
||||
bool showFind = false;
|
||||
char findBuf[256] = {};
|
||||
char replaceBuf[256] = {};
|
||||
int lastFindPos = 0;
|
||||
|
||||
bool showProjectSearch = false;
|
||||
char searchQuery[256] = {};
|
||||
char searchInclude[256] = {};
|
||||
char searchExclude[256] = {};
|
||||
bool searchUseRegex = true;
|
||||
std::vector<ProjectSearch::FileResult> searchResults;
|
||||
|
||||
bool showGoToLine = false;
|
||||
char goToLineBuf[64] = {};
|
||||
bool goToLineError = false;
|
||||
|
||||
ProjectSearch projectSearch;
|
||||
};
|
||||
14
editor/src/state/UIFlags.h
Normal file
14
editor/src/state/UIFlags.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include "LayoutManager.h"
|
||||
|
||||
struct UIFlags {
|
||||
bool showWhitespace = false;
|
||||
bool showMinimap = false;
|
||||
bool showAnnotations = false;
|
||||
bool showOutline = true;
|
||||
bool showLineNumbers = true;
|
||||
bool showLspSettings = false;
|
||||
bool showSettingsPanel = false;
|
||||
int bottomTab = 0; // 0=Output,1=AST,2=Highlighted
|
||||
LayoutPreset layoutPreset = LayoutPreset::VSCode;
|
||||
};
|
||||
Reference in New Issue
Block a user