mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Replace horrible pattern extra data class with a more modular system
This commit is contained in:
@@ -262,6 +262,18 @@ namespace hex {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Provides access to the current provider's pattern language runtime
|
||||
* @return Runtime
|
||||
*/
|
||||
pl::PatternLanguage& getRuntime();
|
||||
|
||||
/**
|
||||
* @brief Provides access to the current provider's pattern language runtime's lock
|
||||
* @return Lock
|
||||
*/
|
||||
std::scoped_lock<std::mutex> getRuntimeLock();
|
||||
|
||||
/**
|
||||
* @brief Configures the pattern language runtime using ImHex's default settings
|
||||
* @param runtime The pattern language runtime to configure
|
||||
@@ -440,7 +452,7 @@ namespace hex {
|
||||
add(impl::Entry {
|
||||
unlocalizedCategory.c_str(),
|
||||
unlocalizedName.c_str(),
|
||||
[=] {
|
||||
[=, ...args = std::forward<Args>(args)] mutable {
|
||||
auto node = std::make_unique<T>(std::forward<Args>(args)...);
|
||||
node->setUnlocalizedName(unlocalizedName);
|
||||
return node;
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace hex {
|
||||
* @param token Token returned by subscribe
|
||||
*/
|
||||
static void unsubscribe(const EventList::iterator &token) noexcept {
|
||||
s_events.remove(*token);
|
||||
s_events.erase(token);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,6 +167,7 @@ namespace hex {
|
||||
EVENT_DEF(EventPatternEditorChanged, const std::string&);
|
||||
EVENT_DEF(EventStoreContentDownloaded, const std::fs::path&);
|
||||
EVENT_DEF(EventStoreContentRemoved, const std::fs::path&);
|
||||
EVENT_DEF(EventImHexClosing);
|
||||
|
||||
EVENT_DEF(RequestOpenWindow, std::string);
|
||||
EVENT_DEF(RequestSelectionChange, Region);
|
||||
|
||||
Reference in New Issue
Block a user