aboutsummaryrefslogtreecommitdiffstats
path: root/base_app.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'base_app.hpp')
-rw-r--r--base_app.hpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/base_app.hpp b/base_app.hpp
index c9d8e85..06f608a 100644
--- a/base_app.hpp
+++ b/base_app.hpp
@@ -8,13 +8,19 @@ class BaseApp {
uint id = 0;
bool destroy_on_exit = true;
};
+ enum AppReturnValues {
+ OK = 0,
+ CLOSE, // Close app from foreground, not respecting AppAttribues::destroy_on_exit.
+ QUIT // Completely quit app; stop running in background
+ };
+
// CHECK: Following have to be overwritten by derived classes
virtual const AppAttributes& app_get_attributes() = 0;
// Could be implemented as:
// {return app_attributes;}
// where app_attribues is an instance of AppAttributes
- virtual int render(Api *app_api) = 0; // Has to be implemented
- virtual int btnpressed(Api *app_api, uint gpio, unsigned long delta) {};
- virtual int bgrefresh(Api *app_api, bool in_foreground) {};
+ virtual AppReturnValues render(Api *app_api) = 0; // Has to be implemented
+ virtual AppReturnValues btnpressed(Api *app_api, uint gpio, unsigned long delta) {return AppReturnValues::OK;};
+ virtual AppReturnValues bgrefresh(Api *app_api, bool in_foreground) {return AppReturnValues::OK;};
};