]> git.localhorst.tv Git - blank.git/blobdiff - src/app/StateControl.hpp
fix multiple application support in makefile
[blank.git] / src / app / StateControl.hpp
index 818bce5c0369ab0987d3736a28ea516bc52564c4..d679a53ba211c3ad5fd498aeaf84443a51750ef2 100644 (file)
@@ -6,30 +6,45 @@
 
 namespace blank {
 
-class Application;
+class HeadlessApplication;
 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(Application &);
+       void Commit(HeadlessApplication &);
 
 private:
        enum Command {
@@ -37,6 +52,8 @@ private:
                SWITCH,
                POP,
                POP_ALL,
+               POP_AFTER,
+               POP_UNTIL,
        };
        struct Memo {
                State *state;