#pragma once #include #include #include #include #include #include #include #include #include #include #include namespace hex { class SharedData; } namespace hex::plugin::internal { void initializePlugin(SharedData &sharedData); } namespace hex { namespace prv { class Provider; } namespace dp { class Node; } namespace lang { class PatternData; } class View; class SharedData { SharedData() = default; public: SharedData(const SharedData&) = delete; SharedData(SharedData&&) = delete; friend class Window; template static T& getVariable(std::string variableName) { return std::any_cast(SharedData::sharedVariables[variableName]); } template static void setVariable(std::string variableName, T value) { SharedData::sharedVariables[variableName] = value; } public: static std::vector> deferredCalls; static prv::Provider *currentProvider; static std::map> settingsEntries; static nlohmann::json settingsJson; static std::vector commandPaletteCommands; static std::map patternLanguageFunctions; static std::vector views; static std::vector toolsEntries; static std::vector dataInspectorEntries; static u32 patternPaletteOffset; static std::string errorPopupMessage; static std::list bookmarkEntries; static std::vector patternData; static std::map languageNames; static std::map> languageDefinitions; static std::map loadedLanguageStrings; static std::vector welcomeScreenEntries; static std::vector footerItems; static std::vector dataProcessorNodes; static u32 dataProcessorNodeIdCounter; static std::list recentFilePaths; static int mainArgc; static char **mainArgv; static ImVec2 windowPos; static ImVec2 windowSize; private: static std::map sharedVariables; }; }