satdump/plugins/bitview_app/main.cpp
2025-05-18 20:05:55 +02:00

36 lines
No EOL
994 B
C++

#include "core/module.h"
#include "core/plugin.h"
#include "logger.h"
#include "app.h"
#include "bitview.h"
#include "viewer2/viewer.h"
class BitViewAppPlugin : public satdump::Plugin
{
public:
std::string getID() { return "bitview_app"; }
void init()
{
// TODOREWORK maybe a way to call up/init a handler?
satdump::eventBus->register_handler<satdump::viewer::ViewerApplication::RenderLoadMenuElementsEvent>(renderViewerLoaderButton);
}
static void renderViewerLoaderButton(const satdump::viewer::ViewerApplication::RenderLoadMenuElementsEvent &evt)
{
if (ImGui::BeginMenu("File"))
{
if (ImGui::BeginMenu("Others"))
{
if (ImGui::MenuItem("BitView"))
evt.master_handler->addSubHandler(std::make_shared<satdump::BitViewHandler>());
ImGui::EndMenu();
}
ImGui::EndMenu();
}
} // TODOREWORK
};
PLUGIN_LOADER(BitViewAppPlugin)