1
0
Fork 0
InfiniTime/src/displayapp/screens/Screen.h

49 lines
1.1 KiB
C
Raw Normal View History

#pragma once
2020-08-21 11:55:59 +02:00
#include <cstdint>
#include "displayapp/TouchEvents.h"
2021-07-19 16:26:12 +03:00
#include <lvgl/lvgl.h>
namespace Pinetime {
namespace Applications {
class DisplayApp;
namespace Screens {
class Screen {
2021-07-19 16:26:12 +03:00
private:
virtual void Refresh() {
}
2021-04-24 12:00:45 +03:00
public:
explicit Screen() = default;
virtual ~Screen() = default;
2021-07-19 16:26:12 +03:00
static void RefreshTaskCallback(lv_task_t* task);
bool IsRunning() const {
return running;
}
/** @return false if the button hasn't been handled by the app, true if it has been handled */
virtual bool OnButtonPushed() {
return false;
}
/** @return false if the event hasn't been handled by the app, true if it has been handled */
2021-07-16 00:07:55 +03:00
// Returning true will cancel lvgl tap
virtual bool OnTouchEvent(TouchEvents /*event*/) {
return false;
}
virtual bool OnTouchEvent(uint16_t /*x*/, uint16_t /*y*/) {
return false;
}
2021-04-24 12:00:45 +03:00
protected:
bool running = true;
};
}
}
}