restructure modules. make GuiModules depend on WindowModule
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#include "DependsOnPrint.h"
|
||||
|
||||
DependsOnPrint::DependsOnPrint(void* h, Archimedes::App* a) : Module(h, a) {
|
||||
name = "DependsOnPrint";
|
||||
|
||||
deps["Print"] = "/home/nathan/Projects/Archimedes/result-1/bin/Print";
|
||||
}
|
||||
|
||||
DependsOnPrint::~DependsOnPrint() {
|
||||
std::cout << "DependsOnPrint Destroyed!\n";
|
||||
}
|
||||
|
||||
void DependsOnPrint::run() {
|
||||
std::cout << "DependsOnPrint lib loaded and run!\n";
|
||||
app->stopModule(self);
|
||||
}
|
||||
16
modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h
Normal file
16
modules/examples/Modules/DependsOnPrint/src/DependsOnPrint.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "Archimedes.h"
|
||||
|
||||
class DependsOnPrint : public Archimedes::Module {
|
||||
|
||||
public:
|
||||
DependsOnPrint(void*, Archimedes::App*);
|
||||
~DependsOnPrint();
|
||||
void run();
|
||||
void onLoad() {}
|
||||
|
||||
};
|
||||
|
||||
#ifndef DEPENDSONPRINT_STATIC
|
||||
#define MODULE_TYPE DependsOnPrint
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "DependsOnPrintStatic.h"
|
||||
#include "modules/Print/src/Print.h"
|
||||
|
||||
DependsOnPrintStatic::DependsOnPrintStatic(void* h, Archimedes::App* a) : Module(h, a) {
|
||||
name = "DependsOnPrintStatic";
|
||||
|
||||
deps["Print"] = new Print(nullptr, a);
|
||||
}
|
||||
|
||||
DependsOnPrintStatic::~DependsOnPrintStatic() {
|
||||
std::cout << "DependsOnPrintStatic Destroyed!\n";
|
||||
}
|
||||
|
||||
void DependsOnPrintStatic::run() {
|
||||
std::cout << "DependsOnPrintStatic lib loaded and run!\n";
|
||||
app->stopModule(self);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "Archimedes.h"
|
||||
|
||||
class DependsOnPrintStatic : public Archimedes::Module {
|
||||
|
||||
public:
|
||||
DependsOnPrintStatic(void*, Archimedes::App*);
|
||||
~DependsOnPrintStatic();
|
||||
void run();
|
||||
void onLoad() {}
|
||||
|
||||
};
|
||||
|
||||
#ifndef DEPENDSONPRINTSTATIC_STATIC
|
||||
#define MODULE_TYPE DependsOnPrintStatic
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
15
modules/examples/Modules/Print/src/Print.cpp
Normal file
15
modules/examples/Modules/Print/src/Print.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "Print.h"
|
||||
|
||||
Print::Print(void* h, Archimedes::App* a) : Archimedes::Module(h, a) {
|
||||
name = "Print";
|
||||
}
|
||||
|
||||
Print::~Print() {
|
||||
std::cout << "Print Destroyed!\n";
|
||||
}
|
||||
|
||||
void Print::run() {
|
||||
std::cout << "Print lib loaded and run!\n";
|
||||
|
||||
app->stopModule(self);
|
||||
}
|
||||
16
modules/examples/Modules/Print/src/Print.h
Normal file
16
modules/examples/Modules/Print/src/Print.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "Archimedes.h"
|
||||
|
||||
class Print : public Archimedes::Module {
|
||||
|
||||
public:
|
||||
Print(void*, Archimedes::App*);
|
||||
~Print();
|
||||
void run();
|
||||
void onLoad() {}
|
||||
|
||||
};
|
||||
|
||||
#ifndef PRINT_STATIC
|
||||
#define MODULE_TYPE Print
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
37
modules/examples/Modules/TestMenu/src/TestMenu.cpp
Normal file
37
modules/examples/Modules/TestMenu/src/TestMenu.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "TestMenu.h"
|
||||
|
||||
TestMenu::TestMenu(void* h, App& a) : Module(h, a) {
|
||||
name = "TestMenu";
|
||||
}
|
||||
|
||||
TestMenu::~TestMenu() {
|
||||
std::cout << "TestMenu Destroyed!\n";
|
||||
}
|
||||
|
||||
void TestMenu::run() {
|
||||
|
||||
std::cout << "Your number is: " << num << "\n"
|
||||
<< "1. Add 1\n"
|
||||
<< "2. Subtract 1\n"
|
||||
<< "3. Unload Module\n\n"
|
||||
<< "4. Quit\n\n";
|
||||
|
||||
std::cin >> choice;
|
||||
|
||||
switch(choice) {
|
||||
case 1:
|
||||
num++;
|
||||
break;
|
||||
case 2:
|
||||
num--;
|
||||
break;
|
||||
case 3:
|
||||
app.stopModule(self);
|
||||
break;
|
||||
case 4:
|
||||
app.end();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
20
modules/examples/Modules/TestMenu/src/TestMenu.h
Normal file
20
modules/examples/Modules/TestMenu/src/TestMenu.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "Archimedes.h"
|
||||
|
||||
class TestMenu : public Module {
|
||||
|
||||
public:
|
||||
TestMenu(void*, App&);
|
||||
~TestMenu();
|
||||
void run();
|
||||
void onLoad() {}
|
||||
|
||||
private:
|
||||
int choice;
|
||||
int num = 5;
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
Module* create(void* handle, App& app) {
|
||||
return new TestMenu(handle, app);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user