mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
api: Refactored providers to allow for loading interfaces and config views
This commit is contained in:
@@ -68,6 +68,8 @@ namespace hex {
|
||||
void ImHexApi::Provider::add(prv::Provider *provider) {
|
||||
SharedData::providers.push_back(provider);
|
||||
SharedData::currentProvider = SharedData::providers.size() - 1;
|
||||
|
||||
EventManager::post<EventProviderCreated>(provider);
|
||||
}
|
||||
|
||||
void ImHexApi::Provider::remove(prv::Provider *provider) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <hex/providers/provider.hpp>
|
||||
|
||||
#include <hex.hpp>
|
||||
#include <hex/api/event.hpp>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
@@ -12,6 +13,9 @@ namespace hex::prv {
|
||||
|
||||
Provider::Provider() {
|
||||
this->m_patches.emplace_back();
|
||||
|
||||
if (this->hasLoadInterface())
|
||||
EventManager::post<RequestOpenPopup>(View::toWindowName("hex.builtin.view.provider_settings.load_popup"));
|
||||
}
|
||||
|
||||
Provider::~Provider() {
|
||||
@@ -142,4 +146,21 @@ namespace hex::prv {
|
||||
return this->m_patchTreeOffset > 0;
|
||||
}
|
||||
|
||||
|
||||
bool Provider::hasLoadInterface() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Provider::hasInterface() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Provider::drawLoadInterface() {
|
||||
|
||||
}
|
||||
|
||||
void Provider::drawInterface() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user