#pragma once #include #include #include #include #include #include #include #include using ImGuiID = unsigned int; struct ImVec2; namespace hex { namespace prv { class Provider; } namespace ImHexApi { namespace Common { void closeImHex(bool noQuestions = false); void restartImHex(); } namespace HexEditor { class Highlighting { public: Highlighting() = default; Highlighting(Region region, color_t color, std::string tooltip = ""); [[nodiscard]] const Region &getRegion() const { return this->m_region; } [[nodiscard]] const color_t &getColor() const { return this->m_color; } [[nodiscard]] const std::string &getTooltip() const { return this->m_tooltip; } private: Region m_region = {}; color_t m_color = 0x00; std::string m_tooltip; }; namespace impl { using HighlightingFunction = std::function(u64)>; std::map &getHighlights(); std::map &getHighlightingFunctions(); } u32 addHighlight(const Region ®ion, color_t color, const std::string &tooltip = ""); void removeHighlight(u32 id); u32 addHighlightingProvider(const impl::HighlightingFunction &function); void removeHighlightingProvider(u32 id); Region getSelection(); void setSelection(const Region ®ion); void setSelection(u64 address, size_t size); } namespace Bookmarks { struct Entry { Region region; std::string name; std::string comment; u32 color; bool locked; u32 highlightId; }; void add(Region region, const std::string &name, const std::string &comment, color_t color = 0x00000000); void add(u64 address, size_t size, const std::string &name, const std::string &comment, color_t color = 0x00000000); } namespace Provider { prv::Provider *get(); const std::vector &getProviders(); void setCurrentProvider(u32 index); bool isValid(); void add(prv::Provider *provider); template T> void add(auto &&...args) { add(new T(std::forward(args)...)); } void remove(prv::Provider *provider); } namespace Tasks { Task createTask(const std::string &unlocalizedName, u64 maxValue); void doLater(const std::function &function); std::vector> &getDeferredCalls(); } namespace System { namespace impl { void setMainWindowPosition(u32 x, u32 y); void setMainWindowSize(u32 width, u32 height); void setMainDockSpaceId(ImGuiID id); void setGlobalScale(float scale); void setProgramArguments(int argc, char **argv, char **envp); void setBorderlessWindowMode(bool enabled); } struct ProgramArguments { int argc; char **argv; char **envp; }; const ProgramArguments &getProgramArguments(); float getTargetFPS(); void setTargetFPS(float fps); float getGlobalScale(); ImVec2 getMainWindowPosition(); ImVec2 getMainWindowSize(); ImGuiID getMainDockSpaceId(); bool isBorderlessWindowModeEnabled(); std::map &getInitArguments(); } } }