OMOTE/Platformio/src/gui_general_and_keys/guiRegistry.h

30 lines
1.3 KiB
C
Raw Normal View History

Modular approach - first version for main branch (#60) * first version of "modular-approach" * changed keyboard commands for HOME and BACK * Update README.md * only some typos in comments * readability * comment for what the mqtt keyboard is used * removed numbering of tab variables. not needed anymore * changed the default keyboard from "´mqtt keyboard" to "BLE keyboard" * updated to latest version of keypad library from Github, changes for inverted logic are explicitely marked * added comment for key repeatModes * added comment for MQTT keyboard * setting timout via GUI now works, not only dropdown without functionality * BLE indicator added; separation of BLE/WiFi activation from activation of devices using it * report battery level to BLE device * Dynamic keyboard commands, so you can safely deactivate BLE and/or WiFi and not break the example code * reorganized files into folders * moved lv_conf.h into the gui folder * added devices for appleTV and smarthome * assets.c broken up and placed them where they are used * added support for IR RC5 * reorganization of files and folder * added comment * renamed assets files * introduction of gui_registry * removed unnecessary functions from sleep.h * use gui_registry.h only once * some files renamed for better understandability * minor renaming * some more renaming * check if WiFi label was instantiated before using it * introduction of a scene registry * save prefs directly after timeout is changed * renaming of preferencesStorage * comment added * only readability * detailled definition of key layout for the diferrent scenes * made code compile for "device_smarthome" when WiFi is deactivated * fixed access violation when no scene was active * added support for IR DENON commands * increased lvgl heap from 32K to 48K
2024-02-12 13:57:51 -05:00
#ifndef __GUIREGISTRY_H__
#define __GUIREGISTRY_H__
/*
If you want to create a new GUI for the touch screen, then
- copy one of the existing GUIs, e.g. gui_numpad.cpp and gui_numpad.h
- place the files in the right folder:
- in folder "gui_general_and_keys" if they are of general purpose, not only for a specific device
- in the device folder, if the GUI is specific for a certain device
- in folder "scenes" if the GUI is intended for a specific scene
It does not really matter where the files are placed, but doing so helps to keep a clean structure
- rename the functions, they must not have the same name as the ones in the file you copied from
- call "register_gui_<nameOfGUI>();" in main.cpp
Technically spoken, to register a GUI, you need to provide two function pointers:
- one for creating the tab
- one for creating the page indicator at the bottom of the tab
*/
#include <string>
#include <lvgl.h>
typedef void (*init_gui_tab)(lv_obj_t* tabview);
typedef void (*init_gui_pageIndicator)(lv_obj_t* tabview);
void register_gui(init_gui_tab a_init_gui_tab, init_gui_pageIndicator a_gui_pageIndicator);
void create_gui_tabs_from_gui_registry(lv_obj_t* tabview);
void create_gui_pageIndicators_from_gui_registry(lv_obj_t* panel);
#endif /*__GUIREGISTRY_H__*/