ImHex/lib/libimhex/include/hex/plugin.hpp

18 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
#include <imgui.h>
#define IMGUI_DEFINE_MATH_OPERATORS
2021-08-20 22:52:11 +00:00
#include <imgui_internal.h>
#include <hex.hpp>
#define IMHEX_PLUGIN_SETUP(name, author, description) IMHEX_PLUGIN_SETUP_IMPL(IMHEX_PLUGIN_NAME, name, author, description)
#define IMHEX_PLUGIN_SETUP_IMPL(namespaceName, name, author, description) \
extern "C" [[gnu::visibility("default")]] const char* getPluginName() { return name; } \
extern "C" [[gnu::visibility("default")]] const char* getPluginAuthor() { return author; } \
extern "C" [[gnu::visibility("default")]] const char* getPluginDescription() { return description; } \
extern "C" [[gnu::visibility("default")]] const char* getCompatibleVersion() { return IMHEX_VERSION; } \
extern "C" [[gnu::visibility("default")]] void setImGuiContext(ImGuiContext *ctx) { ImGui::SetCurrentContext(ctx); GImGui = ctx; } \
extern "C" [[gnu::visibility("default")]] void initializePlugin()