summaryrefslogtreecommitdiff
path: root/Source/Applications/Demos
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-12-16 18:22:58 +0100
committerAlexis211 <alexis211@gmail.com>2009-12-16 18:22:58 +0100
commit3d5aca66b9712758aecb2e80bc5b2fb3df6256a4 (patch)
tree817e945218dbca029244315f36b960dd288b3cff /Source/Applications/Demos
parent5f87c447bdcb82beacbfb930942fe9995dcdb60f (diff)
downloadMelon-3d5aca66b9712758aecb2e80bc5b2fb3df6256a4.tar.gz
Melon-3d5aca66b9712758aecb2e80bc5b2fb3df6256a4.zip
New model, object-oriented, for applications
Diffstat (limited to 'Source/Applications/Demos')
-rw-r--r--Source/Applications/Demos/GOL.cpp14
-rw-r--r--Source/Applications/Demos/cxxdemo.cpp14
2 files changed, 22 insertions, 6 deletions
diff --git a/Source/Applications/Demos/GOL.cpp b/Source/Applications/Demos/GOL.cpp
index e6da3a6..cd6e719 100644
--- a/Source/Applications/Demos/GOL.cpp
+++ b/Source/Applications/Demos/GOL.cpp
@@ -1,10 +1,18 @@
-#include <Binding/VirtualTerminal.class.h>
#include <Binding/Thread.class.h>
-#include <String.class.h>
#include <ByteArray.class.h>
#include <Rand.ns.h>
-int main(Vector<String> args) {
+#include <App/ShellApp.proto.h>
+
+class GOL : public ShellApp {
+ public:
+ GOL() : ShellApp() {}
+ int run();
+};
+
+APP(GOL);
+
+int GOL::run() {
if (!outvt.isBoxed()) {
outvt << "Error : cannot display GOL on a non-boxed terminal.\n";
return 1;
diff --git a/Source/Applications/Demos/cxxdemo.cpp b/Source/Applications/Demos/cxxdemo.cpp
index 3d452e7..372e69f 100644
--- a/Source/Applications/Demos/cxxdemo.cpp
+++ b/Source/Applications/Demos/cxxdemo.cpp
@@ -1,10 +1,18 @@
#include <Syscall/Syscall.wtf.h>
-#include <String.class.h>
-#include <Binding/VirtualTerminal.class.h>
#include <Binding/Thread.class.h>
#include <Binding/File.class.h>
-int main(const Vector<String>& args) {
+#include <App/ShellApp.proto.h>
+
+class CPPDemo : public ShellApp {
+ public:
+ CPPDemo() : ShellApp() {}
+ int run();
+};
+
+APP(CPPDemo);
+
+int CPPDemo::run() {
outvt << "Enter some text plz : ";
String s = invt.readLine();
outvt << s;