ui/api: Added loaded plugin information to welcome screen

This commit is contained in:
WerWolv
2021-02-19 13:22:12 +01:00
parent 89643d1538
commit 0da508594b
8 changed files with 125 additions and 22 deletions

View File

@@ -24,6 +24,10 @@ namespace hex::plugin::builtin {
{ "hex.welcome.help.repo.link", "https://github.com/WerWolv/ImHex" },
{ "hex.welcome.help.gethelp", "Get Help" },
{ "hex.welcome.help.gethelp.link", "https://github.com/WerWolv/ImHex/discussions/categories/get-help" },
{ "hex.welcome.header.plugins", "Loaded Plugins" },
{ "hex.welcome.plugins.plugin", "Plugin" },
{ "hex.welcome.plugins.author", "Author" },
{ "hex.welcome.plugins.desc", "Description" },
{ "hex.welcome.header.customize", "Customize" },
{ "hex.welcome.customize.settings.title", "Settings" },
{ "hex.welcome.customize.settings.desc", "Change preferences of ImHex" },

View File

@@ -13,7 +13,7 @@ namespace hex::plugin::builtin {
}
IMHEX_PLUGIN_SETUP {
IMHEX_PLUGIN_SETUP("Built-in", "WerWolv", "Default ImHex functionality") {
using namespace hex::plugin::builtin;

View File

@@ -15,7 +15,7 @@ public:
}
};
IMHEX_PLUGIN_SETUP {
IMHEX_PLUGIN_SETUP("Example", "WerWolv", "Example plugin used as template for plugin devs") {
ContentRegistry::Views::add<ViewExample>();

View File

@@ -11,9 +11,14 @@
#include <hex/helpers/shared_data.hpp>
#include <hex/data_processor/node.hpp>
#define IMHEX_PLUGIN_SETUP IMHEX_PLUGIN_SETUP_IMPL(IMHEX_PLUGIN_NAME)
#define IMHEX_PLUGIN_SETUP(name, author, description) IMHEX_PLUGIN_SETUP_IMPL(IMHEX_PLUGIN_NAME, name, author, description)
#define IMHEX_PLUGIN_SETUP_IMPL(name) namespace hex::plugin::name::internal { \
[[gnu::visibility("default")]] void initializePlugin(); \
} \
void hex::plugin::name::internal::initializePlugin()
#define IMHEX_PLUGIN_SETUP_IMPL(namespaceName, name, author, description) \
namespace hex::plugin::namespaceName::internal { \
[[gnu::visibility("default")]] void initializePlugin(); \
\
[[gnu::visibility("default")]] const char* getPluginName() { return name; } \
[[gnu::visibility("default")]] const char* getPluginAuthor() { return author; } \
[[gnu::visibility("default")]] const char* getPluginDescription() { return description; } \
} \
void hex::plugin::namespaceName::internal::initializePlugin()