From fc1fc6c35bda40367975a9ae0bd02d3ece0e08e5 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 10 Apr 2025 12:27:31 -0500 Subject: [PATCH] remove GuiModule --- include/Archimedes.h | 1 - include/utils/GuiModule/GuiModule.h | 22 ----------------- modules/ImguiModule/src/ImguiModule.cpp | 7 +++++- modules/ImguiModule/src/ImguiModule.h | 4 +--- modules/MainGUI/src/gui.h | 24 +++++++++++++++++++ .../DependsOnPrint/src/DependsOnPrint.cpp | 0 .../DependsOnPrint/src/DependsOnPrint.h | 0 .../src/DependsOnPrintStatic.cpp | 0 .../src/DependsOnPrintStatic.h | 0 .../{Modules => }/Print/src/Print.cpp | 0 .../examples/{Modules => }/Print/src/Print.h | 0 .../TestClay/src/TestClay.cpp | 0 .../{GuiModules => }/TestClay/src/TestClay.h | 0 .../TestImgui/src/TestImgui.cpp | 9 +------ .../TestImgui/src/TestImgui.h | 8 +------ .../{Modules => }/TestMenu/src/TestMenu.cpp | 0 .../{Modules => }/TestMenu/src/TestMenu.h | 0 17 files changed, 33 insertions(+), 42 deletions(-) delete mode 100644 include/utils/GuiModule/GuiModule.h rename modules/examples/{Modules => }/DependsOnPrint/src/DependsOnPrint.cpp (100%) rename modules/examples/{Modules => }/DependsOnPrint/src/DependsOnPrint.h (100%) rename modules/examples/{Modules => }/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp (100%) rename modules/examples/{Modules => }/DependsOnPrintStatic/src/DependsOnPrintStatic.h (100%) rename modules/examples/{Modules => }/Print/src/Print.cpp (100%) rename modules/examples/{Modules => }/Print/src/Print.h (100%) rename modules/examples/{GuiModules => }/TestClay/src/TestClay.cpp (100%) rename modules/examples/{GuiModules => }/TestClay/src/TestClay.h (100%) rename modules/examples/{GuiModules => }/TestImgui/src/TestImgui.cpp (89%) rename modules/examples/{GuiModules => }/TestImgui/src/TestImgui.h (68%) rename modules/examples/{Modules => }/TestMenu/src/TestMenu.cpp (100%) rename modules/examples/{Modules => }/TestMenu/src/TestMenu.h (100%) diff --git a/include/Archimedes.h b/include/Archimedes.h index 5734b7d..bead845 100644 --- a/include/Archimedes.h +++ b/include/Archimedes.h @@ -2,7 +2,6 @@ #define ARCHIMEDES_H #include "utils/Module/Module.h" -#include "utils/GuiModule/GuiModule.h" #include "utils/App/App.h" #include "entryPoint.h" diff --git a/include/utils/GuiModule/GuiModule.h b/include/utils/GuiModule/GuiModule.h deleted file mode 100644 index 6466575..0000000 --- a/include/utils/GuiModule/GuiModule.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifdef GUIMODULE -#undef GUIMODULE - -#include "utils/Module/Module.h" - -#include "modules/WindowModule/src/WindowModule.h" - -namespace Archimedes { - - class GuiModule : public Module { - - public: - GuiModule(App* a, void* h) : Module(a, h) { - WindowModule* wm = new WindowModule(a); - deps[wm->getName()] = wm; - } - virtual ~GuiModule() {} - }; -} - - -#endif diff --git a/modules/ImguiModule/src/ImguiModule.cpp b/modules/ImguiModule/src/ImguiModule.cpp index 2b8fc6f..8bc2742 100644 --- a/modules/ImguiModule/src/ImguiModule.cpp +++ b/modules/ImguiModule/src/ImguiModule.cpp @@ -5,9 +5,14 @@ #include -ImguiModule::ImguiModule(Archimedes::App* a, void* h = nullptr) : Archimedes::GuiModule(a, h) { +#include "modules/WindowModule/src/WindowModule.h" + +ImguiModule::ImguiModule(Archimedes::App* a, void* h = nullptr) : Archimedes::Module(a, h) { name = "ImguiModule"; + + WindowModule* wm = new WindowModule(a); + deps[wm->getName()] = wm; } ImguiModule::~ImguiModule() { diff --git a/modules/ImguiModule/src/ImguiModule.h b/modules/ImguiModule/src/ImguiModule.h index cb83efe..441857b 100644 --- a/modules/ImguiModule/src/ImguiModule.h +++ b/modules/ImguiModule/src/ImguiModule.h @@ -4,11 +4,9 @@ #include "Archimedes.h" -#include "utils/Window/Window.h" - #include "imgui.h" -class ImguiModule : public Archimedes::GuiModule { +class ImguiModule : public Archimedes::Module { public: ImguiModule(Archimedes::App*, void*); diff --git a/modules/MainGUI/src/gui.h b/modules/MainGUI/src/gui.h index e69de29..034f239 100644 --- a/modules/MainGUI/src/gui.h +++ b/modules/MainGUI/src/gui.h @@ -0,0 +1,24 @@ +#ifndef GUIMODULE +#define GUIMODULE +#endif + +#include "Archimedes.h" + +#include "utils/Window/Window.h" + +class MainGUI : public Archimedes::GuiModule { + + public: + MainGUI(Archimedes::App*, void*); + + ~MainGUI(); + + void onLoad(); + + void run(); +}; + +#ifdef TESTIMGUI_DYNAMIC +#define MODULE_TYPE MainGUI +#include "endModule.h" +#endif diff --git a/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.cpp b/modules/examples/DependsOnPrint/src/DependsOnPrint.cpp similarity index 100% rename from modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.cpp rename to modules/examples/DependsOnPrint/src/DependsOnPrint.cpp diff --git a/modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h b/modules/examples/DependsOnPrint/src/DependsOnPrint.h similarity index 100% rename from modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h rename to modules/examples/DependsOnPrint/src/DependsOnPrint.h diff --git a/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp b/modules/examples/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp similarity index 100% rename from modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp rename to modules/examples/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp diff --git a/modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h b/modules/examples/DependsOnPrintStatic/src/DependsOnPrintStatic.h similarity index 100% rename from modules/examples/Modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h rename to modules/examples/DependsOnPrintStatic/src/DependsOnPrintStatic.h diff --git a/modules/examples/Modules/Print/src/Print.cpp b/modules/examples/Print/src/Print.cpp similarity index 100% rename from modules/examples/Modules/Print/src/Print.cpp rename to modules/examples/Print/src/Print.cpp diff --git a/modules/examples/Modules/Print/src/Print.h b/modules/examples/Print/src/Print.h similarity index 100% rename from modules/examples/Modules/Print/src/Print.h rename to modules/examples/Print/src/Print.h diff --git a/modules/examples/GuiModules/TestClay/src/TestClay.cpp b/modules/examples/TestClay/src/TestClay.cpp similarity index 100% rename from modules/examples/GuiModules/TestClay/src/TestClay.cpp rename to modules/examples/TestClay/src/TestClay.cpp diff --git a/modules/examples/GuiModules/TestClay/src/TestClay.h b/modules/examples/TestClay/src/TestClay.h similarity index 100% rename from modules/examples/GuiModules/TestClay/src/TestClay.h rename to modules/examples/TestClay/src/TestClay.h diff --git a/modules/examples/GuiModules/TestImgui/src/TestImgui.cpp b/modules/examples/TestImgui/src/TestImgui.cpp similarity index 89% rename from modules/examples/GuiModules/TestImgui/src/TestImgui.cpp rename to modules/examples/TestImgui/src/TestImgui.cpp index a15c38d..6383703 100644 --- a/modules/examples/GuiModules/TestImgui/src/TestImgui.cpp +++ b/modules/examples/TestImgui/src/TestImgui.cpp @@ -8,7 +8,7 @@ #include "modules/ImguiModule/src/ImguiModule.h" -TestImgui::TestImgui(Archimedes::App* a, void* h) : Archimedes::GuiModule(a, h) { +TestImgui::TestImgui(Archimedes::App* a, void* h) : Archimedes::Module(a, h) { name = "TestImgui"; @@ -22,13 +22,6 @@ TestImgui::~TestImgui() { void TestImgui::onLoad() { - WindowModule* wm = (WindowModule*) moduleInstances["WindowModule"]; - - if(!wm) { - std::cout << "No WindowModule for TestImgui!\n"; - std::abort(); - } - ImguiModule* im = (ImguiModule*) moduleInstances["ImguiModule"]; if(!im) { diff --git a/modules/examples/GuiModules/TestImgui/src/TestImgui.h b/modules/examples/TestImgui/src/TestImgui.h similarity index 68% rename from modules/examples/GuiModules/TestImgui/src/TestImgui.h rename to modules/examples/TestImgui/src/TestImgui.h index d232f4b..7584e52 100644 --- a/modules/examples/GuiModules/TestImgui/src/TestImgui.h +++ b/modules/examples/TestImgui/src/TestImgui.h @@ -1,12 +1,6 @@ -#ifndef GUIMODULE -#define GUIMODULE -#endif - #include "Archimedes.h" -#include "utils/Window/Window.h" - -class TestImgui : public Archimedes::GuiModule { +class TestImgui : public Archimedes::Module { public: TestImgui(Archimedes::App*, void*); diff --git a/modules/examples/Modules/TestMenu/src/TestMenu.cpp b/modules/examples/TestMenu/src/TestMenu.cpp similarity index 100% rename from modules/examples/Modules/TestMenu/src/TestMenu.cpp rename to modules/examples/TestMenu/src/TestMenu.cpp diff --git a/modules/examples/Modules/TestMenu/src/TestMenu.h b/modules/examples/TestMenu/src/TestMenu.h similarity index 100% rename from modules/examples/Modules/TestMenu/src/TestMenu.h rename to modules/examples/TestMenu/src/TestMenu.h