mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
ui: Added toolbar
This commit is contained in:
@@ -191,9 +191,11 @@ namespace hex {
|
||||
|
||||
static void addWelcomeScreenEntry(const DrawCallback &function);
|
||||
static void addFooterItem(const DrawCallback &function);
|
||||
static void addToolbarItem(const DrawCallback &function);
|
||||
|
||||
static std::vector<DrawCallback>& getWelcomeScreenEntries();
|
||||
static std::vector<DrawCallback>& getFooterItems();
|
||||
static std::vector<DrawCallback>& getToolbarItems();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace hex {
|
||||
|
||||
static std::vector<ContentRegistry::Interface::DrawCallback> welcomeScreenEntries;
|
||||
static std::vector<ContentRegistry::Interface::DrawCallback> footerItems;
|
||||
static std::vector<ContentRegistry::Interface::DrawCallback> toolbarItems;
|
||||
|
||||
static std::vector<ContentRegistry::DataProcessorNode::Entry> dataProcessorNodes;
|
||||
static u32 dataProcessorNodeIdCounter;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <hex.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
@@ -20,5 +21,6 @@
|
||||
[[gnu::visibility("default")]] const char* getPluginName() { return name; } \
|
||||
[[gnu::visibility("default")]] const char* getPluginAuthor() { return author; } \
|
||||
[[gnu::visibility("default")]] const char* getPluginDescription() { return description; } \
|
||||
[[gnu::visibility("default")]] void setImGuiContext(ImGuiContext *ctx) { ImGui::SetCurrentContext(ctx); GImGui = ctx; } \
|
||||
} \
|
||||
void hex::plugin::namespaceName::internal::initializePlugin()
|
||||
|
||||
@@ -233,6 +233,10 @@ namespace hex {
|
||||
getFooterItems().push_back(function);
|
||||
}
|
||||
|
||||
void ContentRegistry::Interface::addToolbarItem(const ContentRegistry::Interface::DrawCallback &function){
|
||||
getToolbarItems().push_back(function);
|
||||
}
|
||||
|
||||
|
||||
std::vector<ContentRegistry::Interface::DrawCallback>& ContentRegistry::Interface::getWelcomeScreenEntries() {
|
||||
return SharedData::welcomeScreenEntries;
|
||||
@@ -240,4 +244,7 @@ namespace hex {
|
||||
std::vector<ContentRegistry::Interface::DrawCallback>& ContentRegistry::Interface::getFooterItems() {
|
||||
return SharedData::footerItems;
|
||||
}
|
||||
std::vector<ContentRegistry::Interface::DrawCallback>& ContentRegistry::Interface::getToolbarItems() {
|
||||
return SharedData::toolbarItems;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ namespace hex {
|
||||
|
||||
std::vector<ContentRegistry::Interface::DrawCallback> SharedData::welcomeScreenEntries;
|
||||
std::vector<ContentRegistry::Interface::DrawCallback> SharedData::footerItems;
|
||||
std::vector<ContentRegistry::Interface::DrawCallback> SharedData::toolbarItems;
|
||||
|
||||
std::vector<ContentRegistry::DataProcessorNode::Entry> SharedData::dataProcessorNodes;
|
||||
u32 SharedData::dataProcessorNodeIdCounter = 1;
|
||||
|
||||
Reference in New Issue
Block a user