Skip to content

Commit ae3f822

Browse files
committed
Add the boilerplate for the exerciser.
1 parent 710e83c commit ae3f822

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

src/gui2/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
510510
"./controlpanelview.h",
511511
"./datastore.cc",
512512
"./datastore.h",
513+
"./exerciserview.cc",
514+
"./exerciserview.h",
513515
"./diskprovider.cc",
514516
"./diskprovider.h",
515517
"./fluxengine.cc",

src/gui2/exerciserview.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <hex/api/content_registry/user_interface.hpp>
2+
#include <hex/api/theme_manager.hpp>
3+
#include <hex/helpers/logger.hpp>
4+
#include <fonts/vscode_icons.hpp>
5+
#include <fonts/tabler_icons.hpp>
6+
#include <fmt/format.h>
7+
#include "lib/core/globals.h"
8+
#include "lib/config/config.h"
9+
#include "lib/data/disk.h"
10+
#include "lib/data/sector.h"
11+
#include "lib/config/proto.h"
12+
#include "globals.h"
13+
#include "exerciserview.h"
14+
#include "datastore.h"
15+
#include "utils.h"
16+
#include <implot.h>
17+
#include <implot_internal.h>
18+
19+
using namespace hex;
20+
21+
ExerciserView::ExerciserView(): View::Modal("fluxengine.view.exerciser.name", ICON_VS_DEBUG) {}
22+
23+
void ExerciserView::drawContent()
24+
{
25+
}

src/gui2/exerciserview.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#pragma once
2+
3+
#include <hex/ui/view.hpp>
4+
5+
class ExerciserView : public hex::View::Modal
6+
{
7+
public:
8+
ExerciserView();
9+
~ExerciserView() override = default;
10+
11+
void drawContent() override;
12+
13+
[[nodiscard]] bool shouldDraw() const override
14+
{
15+
return true;
16+
}
17+
[[nodiscard]] bool hasViewMenuItemEntry() const override
18+
{
19+
return false;
20+
}
21+
};
22+

src/gui2/fluxengine.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "controlpanelview.h"
1717
#include "logview.h"
1818
#include "visualiserview.h"
19+
#include "exerciserview.h"
1920
#include "diskprovider.h"
2021
#include "datastore.h"
2122

@@ -65,6 +66,18 @@ IMHEX_PLUGIN_SETUP("FluxEngine", "David Given", "FluxEngine integration")
6566
hex::WorkspaceManager::switchWorkspace(currentWorkspaceName);
6667
});
6768

69+
hex::ContentRegistry::UserInterface::addMenuItem(
70+
{"hex.builtin.menu.extras", "fluxengine.menu.tools.exerciser"},
71+
ICON_TA_TOOLS,
72+
2500,
73+
hex::Shortcut::None,
74+
[]
75+
{
76+
hex::ContentRegistry::Views::getViewByName(
77+
"fluxengine.view.exerciser.name")
78+
->getWindowOpenState() = true;
79+
});
80+
6881
hex::ContentRegistry::Provider::add<DiskProvider>();
6982

7083
hex::ContentRegistry::Views::add<ConfigView>();
@@ -74,6 +87,7 @@ IMHEX_PLUGIN_SETUP("FluxEngine", "David Given", "FluxEngine integration")
7487
hex::ContentRegistry::Views::add<PhysicalView>();
7588
hex::ContentRegistry::Views::add<SummaryView>();
7689
hex::ContentRegistry::Views::add<VisualiserView>();
90+
hex::ContentRegistry::Views::add<ExerciserView>();
7791

7892
Datastore::init();
7993
}

0 commit comments

Comments
 (0)