X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FStateControl.hpp;h=d679a53ba211c3ad5fd498aeaf84443a51750ef2;hb=d2f4c8720ae2326fac4203fa4984d835e875b355;hp=c072040bc12f57de2a31abc6a9465fbfa1e3a551;hpb=9ebe2c320fd9f94266ab93fa2f9d9908a0a284d3;p=blank.git diff --git a/src/app/StateControl.hpp b/src/app/StateControl.hpp index c072040..d679a53 100644 --- a/src/app/StateControl.hpp +++ b/src/app/StateControl.hpp @@ -12,22 +12,37 @@ class State; class StateControl { public: + // add state to the front void Push(State *s) { cue.emplace(PUSH, s); } + // swap state at the front void Switch(State *s) { cue.emplace(SWITCH, s); } + // remove state at the front void Pop() { cue.emplace(POP); } + // remove all states + // application will exit if nothing is pushed after this void PopAll() { cue.emplace(POP_ALL); } + // pop states until this one is on top + void PopAfter(State *s) { + cue.emplace(POP_AFTER, s); + } + + // pop states until this one is removed + void PopUntil(State *s) { + cue.emplace(POP_UNTIL, s); + } + void Commit(HeadlessApplication &); @@ -37,6 +52,8 @@ private: SWITCH, POP, POP_ALL, + POP_AFTER, + POP_UNTIL, }; struct Memo { State *state;