#pragma once #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; } 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 eventHandlers; static std::vector> deferredCalls; static prv::Provider *currentProvider; static std::map> settingsEntries; static nlohmann::json settingsJson; static std::map customEvents; static u32 customEventsLastId; static std::vector commandPaletteCommands; static std::map patternLanguageFunctions; static std::vector views; static std::vector toolsEntries; static std::vector dataInspectorEntries; static int mainArgc; static char **mainArgv; static ImVec2 windowPos; static ImVec2 windowSize; private: static std::map sharedVariables; }; }