2020-01-18 18:17:52 +01:00
|
|
|
#pragma once
|
2020-08-21 11:55:59 +02:00
|
|
|
|
|
|
|
#include <cstdint>
|
2020-03-15 21:01:24 +01:00
|
|
|
#include "../TouchEvents.h"
|
2020-01-18 18:17:52 +01:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
2020-02-16 18:32:36 +01:00
|
|
|
class DisplayApp;
|
2020-01-18 18:17:52 +01:00
|
|
|
namespace Screens {
|
|
|
|
class Screen {
|
|
|
|
public:
|
2020-02-23 13:44:39 +01:00
|
|
|
Screen(DisplayApp* app) : app{app} {}
|
2020-02-16 18:32:36 +01:00
|
|
|
virtual ~Screen() = default;
|
2020-02-23 13:44:39 +01:00
|
|
|
|
|
|
|
// Return false if the app can be closed, true if it must continue to run
|
2020-02-23 16:14:03 +01:00
|
|
|
virtual bool Refresh() = 0;
|
2020-02-23 13:44:39 +01:00
|
|
|
|
|
|
|
// Return false if the button hasn't been handled by the app, true if it has been handled
|
|
|
|
virtual bool OnButtonPushed() { return false; }
|
2020-01-18 18:17:52 +01:00
|
|
|
|
2020-03-15 21:01:24 +01:00
|
|
|
// Return false if the event hasn't been handled by the app, true if it has been handled
|
|
|
|
virtual bool OnTouchEvent(TouchEvents event) { return false; }
|
2020-08-21 11:55:59 +02:00
|
|
|
virtual bool OnTouchEvent(uint16_t x, uint16_t y) { return false; }
|
2020-03-15 21:01:24 +01:00
|
|
|
|
2020-01-18 18:17:52 +01:00
|
|
|
protected:
|
2020-02-16 18:32:36 +01:00
|
|
|
DisplayApp* app;
|
2020-01-18 18:17:52 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|