satdump/plugins/bitview_app/main.cpp

35 lines
940 B
C++
Raw Normal View History

2024-05-18 18:05:04 +02:00
#include "core/plugin.h"
2025-06-22 17:18:53 +02:00
#include "explorer/explorer.h"
2024-05-18 18:05:04 +02:00
#include "logger.h"
#include "bitview.h"
2025-06-22 17:18:53 +02:00
#include "explorer/explorer.h"
2024-05-18 18:05:04 +02:00
class BitViewAppPlugin : public satdump::Plugin
{
public:
2025-05-18 20:05:55 +02:00
std::string getID() { return "bitview_app"; }
2024-05-18 18:05:04 +02:00
void init()
{
2025-05-18 20:05:55 +02:00
// TODOREWORK maybe a way to call up/init a handler?
2025-07-24 21:55:57 +02:00
satdump::eventBus->register_handler<satdump::explorer::RenderLoadMenuElementsEvent>(renderExplorerLoaderButton);
2024-05-18 18:05:04 +02:00
}
2025-07-24 21:55:57 +02:00
static void renderExplorerLoaderButton(const satdump::explorer::RenderLoadMenuElementsEvent &evt)
2024-05-18 18:05:04 +02:00
{
2025-08-12 11:04:46 +02:00
if (ImGui::BeginMenu("Add"))
2025-05-18 20:05:55 +02:00
{
2025-06-22 12:21:12 +02:00
if (ImGui::BeginMenu("Tools"))
2025-05-18 20:05:55 +02:00
{
if (ImGui::MenuItem("BitView"))
evt.master_handler->addSubHandler(std::make_shared<satdump::BitViewHandler>());
ImGui::EndMenu();
}
ImGui::EndMenu();
}
2025-06-22 12:21:12 +02:00
}
2024-05-18 18:05:04 +02:00
};
PLUGIN_LOADER(BitViewAppPlugin)