Numworks Epsilon  1.4.1
Graphing Calculator Operating System
container.h
Go to the documentation of this file.
1 #ifndef ESCHER_CONTAINER_H
2 #define ESCHER_CONTAINER_H
3 
4 /* Container is the entry point of a program using Escher.
5  *
6  * A container contains one or multiple App, and is responsible for running them
7  * together. Currently Container displays a single App fullscreen, but can
8  * switch to any other App.
9  *
10  * When writing an Escher program, you typically subclass Container, and your
11  * subclass owns one or more App. You then call "run()" on your container. */
12 
13 #include <escher/run_loop.h>
14 #include <escher/app.h>
15 #include <escher/window.h>
16 #include <ion/events.h>
17 
18 class Container : public RunLoop {
19 public:
20  Container();
21  virtual ~Container();
22  Container(const Container& other) = delete;
23  Container(Container&& other) = delete;
24  Container& operator=(const Container& other) = delete;
25  Container& operator=(Container&& other) = delete;
26  virtual void run();
27  App * activeApp();
28  virtual bool dispatchEvent(Ion::Events::Event event) override;
29  virtual void switchTo(App::Snapshot * snapshot);
30 protected:
31  virtual Window * window() = 0;
32 private:
33  void step();
34  int numberOfTimers() override;
35  Timer * timerAtIndex(int i) override;
36  virtual int numberOfContainerTimers();
37  virtual Timer * containerTimerAtIndex(int i);
38  App * m_activeApp;
39 };
40 
41 #endif
virtual void switchTo(App::Snapshot *snapshot)
Definition: container.cpp:16
Definition: timer.h:15
Definition: window.h:6
virtual void run()
Definition: container.cpp:46
virtual Window * window()=0
virtual ~Container()
Definition: container.cpp:10
Definition: app.h:23
Container & operator=(const Container &other)=delete
virtual bool dispatchEvent(Ion::Events::Event event) override
Definition: container.cpp:38
App * activeApp()
Definition: container.cpp:34