diff options
author | ancarola <raffaele.ancarola@epfl.ch> | 2019-01-21 23:55:52 +0100 |
---|---|---|
committer | ancarola <raffaele.ancarola@epfl.ch> | 2019-01-21 23:55:52 +0100 |
commit | a4df955c227efe409976a82e4f9ecb073319557a (patch) | |
tree | 0036a91a3b48f1aca53586c6f3eed4f7c0b311b9 /engine | |
parent | Test 3 partially executed (diff) | |
download | flatland-a4df955c227efe409976a82e4f9ecb073319557a.tar.gz flatland-a4df955c227efe409976a82e4f9ecb073319557a.zip |
Flat removed
Diffstat (limited to 'engine')
-rw-r--r-- | engine/flatcomponent.cpp | 36 | ||||
-rw-r--r-- | engine/flatland.cpp | 2 | ||||
-rw-r--r-- | engine/flatsignal.cpp | 8 | ||||
-rw-r--r-- | engine/include/flatcomponent.h | 27 | ||||
-rw-r--r-- | engine/include/flatsignal.h | 2 | ||||
-rw-r--r-- | engine/include/symbasic/.test.cpp.swp | bin | 12288 -> 0 bytes |
6 files changed, 71 insertions, 4 deletions
diff --git a/engine/flatcomponent.cpp b/engine/flatcomponent.cpp new file mode 100644 index 0000000..16969ff --- /dev/null +++ b/engine/flatcomponent.cpp @@ -0,0 +1,36 @@ +#include "flatcomponent.h" +#include "flatsignal.h" + +Component::Component(Component *parent, const std::string& id) + : parent(parent) +{ + // TODO, check flatland initialization + + if (id.empty()) + setID(FlatObject::randomID()); + + if (parent == 0) + { + // TODO set screen as parent layer + } +} + +Component~Component() +{ + +} + +void Component::setParent(Component *parent) +{ + if (parent == 0) + // TODO set screen as parent layer + ; + + this->parent = parent; +} + +Component * getParent() +{ + return parent; +} + diff --git a/engine/flatland.cpp b/engine/flatland.cpp index 2f1c920..489fd82 100644 --- a/engine/flatland.cpp +++ b/engine/flatland.cpp @@ -71,7 +71,7 @@ public: QuitListener() { addFilter("quit"); - core->connect(this); + core.connect(this); } }; diff --git a/engine/flatsignal.cpp b/engine/flatsignal.cpp index cdbc800..a739efc 100644 --- a/engine/flatsignal.cpp +++ b/engine/flatsignal.cpp @@ -10,7 +10,7 @@ bool sig_prior_cmp::operator()(const FlatSignal& s, const FlatSignal& g) const map<string, SignalChannel*> SignalChannel::channels; -SignalChannel::SignalChannel(const string& id) +SignalChannel::SignalChannel(const string& id, bool pre_process) { SignalChannel * other = findChannel(id); @@ -19,7 +19,11 @@ SignalChannel::SignalChannel(const string& id) ; /* Initialize task, post-process, fifth priority */ - checker = new FlatTask<SignalChannel>(this, &SignalChannel::post_processing, 0, false, 4); + checker = new FlatTask<SignalChannel>( this, + &SignalChannel::post_processing, + 0, + pre_process, + pre_process ? 2 : 10); string ID = (id.empty()) ? FlatObject::randomID() : id; diff --git a/engine/include/flatcomponent.h b/engine/include/flatcomponent.h new file mode 100644 index 0000000..8a14d90 --- /dev/null +++ b/engine/include/flatcomponent.h @@ -0,0 +1,27 @@ +#ifndef __FLAT_COMPONENT_H__ +#define __FLAT_COMPONENT_H__ + +#include "flatobject.h" +#include <string> + +class Component : virtual public FlatObject +{ + + Component * parent; + +public: + + /* Zero means attach to main window layer */ + /* Send a 'created' signal in component reserved channel */ + Component(Component *parent = 0, const std::string& id = ""); + + /* Send a 'deleted' signal in component reserved channel */ + virtual ~Component(); + + void setParent(Component*); + Component * getParent(); + + virtual void render() = 0; +}; + +#endif diff --git a/engine/include/flatsignal.h b/engine/include/flatsignal.h index a1d7ec3..b20d082 100644 --- a/engine/include/flatsignal.h +++ b/engine/include/flatsignal.h @@ -59,7 +59,7 @@ class SignalChannel : virtual public FlatObject public: - SignalChannel(const std::string& id = ""); + SignalChannel(const std::string& id = "", bool pre_process = false); ~SignalChannel(); void emit(const FlatSignal&); diff --git a/engine/include/symbasic/.test.cpp.swp b/engine/include/symbasic/.test.cpp.swp Binary files differdeleted file mode 100644 index b30055c..0000000 --- a/engine/include/symbasic/.test.cpp.swp +++ /dev/null |