diff options
Diffstat (limited to 'apps/home_menu.hpp')
-rw-r--r-- | apps/home_menu.hpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/apps/home_menu.hpp b/apps/home_menu.hpp index 78aed40..dce83e4 100644 --- a/apps/home_menu.hpp +++ b/apps/home_menu.hpp @@ -1,17 +1,26 @@ -#ifndef __HOME_MENU_H__ -#define __HOME_MENU_H__ +#pragma once #include "pico/util/datetime.h" #include "../oled/ss_oled.h" #include "../api.hpp" +#include "../base_app.hpp" -namespace app_home_menu { - int init(Api *app_api); - int render(Api *app_api); - int btnpressed(Api *app_api, uint gpio, unsigned long delta); - int bgrefresh(Api *app_api, bool in_foreground); - int destroy(Api *app_api); -} +#define NUMBER_OF_APPS 3 +#define SIZE_APP_NAME 12 -#endif +class app_home_menu : public BaseApp { + private: + const char *APPS_NAME[NUMBER_OF_APPS] = {"Home", "Clock", "Settings"}; + int selected_app = 0; + char display_app_name[SIZE_APP_NAME]; + void title_str(char *buf, uint buf_size, const datetime_t *t); + void show_title(Api *app_api); + public: + uint app_id = 0; + app_home_menu(Api *app_api); + int render(Api *app_api); + int btnpressed(Api *app_api, uint gpio, unsigned long delta); + int bgrefresh(Api *app_api, bool in_foreground); + ~app_home_menu(); +}; |