#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 pl { 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; } static void clearVariables() { SharedData::sharedVariables.clear(); } 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 toolbarItems; static std::vector dataProcessorNodes; static u32 dataProcessorNodeIdCounter; static u32 dataProcessorLinkIdCounter; static u32 dataProcessorAttrIdCounter; static std::list recentFilePaths; static int mainArgc; static char **mainArgv; static ImFontAtlas *fontAtlas; static ImFontConfig fontConfig; static ImVec2 windowPos; static ImVec2 windowSize; static float globalScale; static float fontScale; private: static std::map sharedVariables; }; }