From 15786175605dd6d7dadcd50b9179fc5415033133 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Sat, 30 Mar 2024 20:52:01 +0100 Subject: [PATCH] Use bbx prefix for shared code --- buffyboard/command_line.c | 6 +- buffyboard/config.c | 18 ++--- buffyboard/config.h | 2 +- buffyboard/cursor.c | 115 -------------------------------- buffyboard/cursor.h | 15 ----- buffyboard/cursor.png | Bin 10340 -> 0 bytes buffyboard/lv_conf.h | 4 +- buffyboard/main.c | 6 +- shared/cursor/cursor.c | 10 +-- shared/cursor/cursor.h | 8 +-- shared/cursor/package-lock.json | 2 +- shared/cursor/regenerate.sh | 2 +- shared/fonts/font_32.c | 4 +- shared/fonts/regenerate.sh | 2 +- shared/indev.c | 72 ++++++++++---------- shared/indev.h | 22 +++--- shared/log.c | 10 +-- shared/log.h | 20 +++--- shared/theme.c | 24 +++---- shared/theme.h | 98 +++++++++++++-------------- shared/themes.c | 24 +++---- shared/themes.h | 28 ++++---- unl0kr/backends.c | 4 +- unl0kr/command_line.c | 6 +- unl0kr/config.c | 24 +++---- unl0kr/config.h | 4 +- unl0kr/lv_conf.h | 4 +- unl0kr/main.c | 26 ++++---- unl0kr/terminal.c | 18 ++--- 29 files changed, 224 insertions(+), 354 deletions(-) delete mode 100644 buffyboard/cursor.c delete mode 100644 buffyboard/cursor.h delete mode 100644 buffyboard/cursor.png diff --git a/buffyboard/command_line.c b/buffyboard/command_line.c index aa2f432..747aa9c 100644 --- a/buffyboard/command_line.c +++ b/buffyboard/command_line.c @@ -100,7 +100,7 @@ void bb_cli_parse_opts(int argc, char *argv[], bb_cli_opts *opts) { case 'C': opts->config_files = realloc(opts->config_files, (opts->num_config_files + 1) * sizeof(char *)); if (!opts->config_files) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not allocate memory for config file paths"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not allocate memory for config file paths"); exit(EXIT_FAILURE); } opts->config_files[opts->num_config_files] = optarg; @@ -109,14 +109,14 @@ void bb_cli_parse_opts(int argc, char *argv[], bb_cli_opts *opts) { case 'g': if (sscanf(optarg, "%ix%i@%i,%i", &(opts->hor_res), &(opts->ver_res), &(opts->x_offset), &(opts->y_offset)) != 4) { if (sscanf(optarg, "%ix%i", &(opts->hor_res), &(opts->ver_res)) != 2) { - bb_log(BB_LOG_LEVEL_ERROR, "Invalid geometry argument \"%s\"\n", optarg); + bbx_log(BBX_LOG_LEVEL_ERROR, "Invalid geometry argument \"%s\"\n", optarg); exit(EXIT_FAILURE); } } break; case 'd': if (sscanf(optarg, "%i", &(opts->dpi)) != 1) { - bb_log(BB_LOG_LEVEL_ERROR, "Invalid dpi argument \"%s\"\n", optarg); + bbx_log(BBX_LOG_LEVEL_ERROR, "Invalid dpi argument \"%s\"\n", optarg); exit(EXIT_FAILURE); } break; diff --git a/buffyboard/config.c b/buffyboard/config.c index 571e0ad..5f2fd5d 100644 --- a/buffyboard/config.c +++ b/buffyboard/config.c @@ -95,7 +95,7 @@ static void find_files(const char *path, char ***found, int *num_found) { /* Open directory */ DIR *d = opendir(path); if (!d) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not read contents of folder %s", path); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not read contents of folder %s", path); return; } @@ -110,7 +110,7 @@ static void find_files(const char *path, char ***found, int *num_found) { /* Grow output array */ char **tmp = realloc(*found, (*num_found + 1) * sizeof(char *)); if (!tmp) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not reallocate memory for configuration file paths"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not reallocate memory for configuration file paths"); break; } *found = tmp; @@ -122,7 +122,7 @@ static void find_files(const char *path, char ***found, int *num_found) { /* Allocate memory for full path */ char *found_path = malloc(path_length + name_length + 2); /* +1 for path separator and null terminator, respectively */ if (!found_path) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not allocate memory for configuration file path"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not allocate memory for configuration file path"); break; } @@ -145,8 +145,8 @@ static int parsing_handler(void* user_data, const char* section, const char* key if (strcmp(section, "theme") == 0) { if (strcmp(key, "default") == 0) { - bb_themes_theme_id_t id = bb_themes_find_theme_with_name(value); - if (id != BB_THEMES_THEME_NONE) { + bbx_themes_theme_id_t id = bbx_themes_find_theme_with_name(value); + if (id != BBX_THEMES_THEME_NONE) { opts->theme.default_id = id; return 1; } @@ -169,7 +169,7 @@ static int parsing_handler(void* user_data, const char* section, const char* key } } - bb_log(BB_LOG_LEVEL_ERROR, "Ignoring invalid config value \"%s\" for key \"%s\" in section \"%s\"", value, key, section); + bbx_log(BBX_LOG_LEVEL_ERROR, "Ignoring invalid config value \"%s\" for key \"%s\" in section \"%s\"", value, key, section); return 1; /* Return 1 (true) so that we can use the return value of ini_parse exclusively for file-level errors (e.g. file not found) */ } @@ -193,7 +193,7 @@ static bool parse_bool(const char *value, bool *result) { */ void bb_config_init_opts(bb_config_opts *opts) { - opts->theme.default_id = BB_THEMES_THEME_BREEZY_DARK; + opts->theme.default_id = BBX_THEMES_THEME_BREEZY_DARK; opts->input.pointer = true; opts->input.touchscreen = true; opts->quirks.fbdev_force_refresh = false; @@ -223,8 +223,8 @@ void bb_config_parse_files(const char **files, int num_files, bb_config_opts *op } void bb_config_parse_file(const char *path, bb_config_opts *opts) { - bb_log(BB_LOG_LEVEL_VERBOSE, "Parsing config file %s", path); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Parsing config file %s", path); if (ini_parse(path, parsing_handler, opts) != 0) { - bb_log(BB_LOG_LEVEL_ERROR, "Ignoring invalid config file %s", path); + bbx_log(BBX_LOG_LEVEL_ERROR, "Ignoring invalid config file %s", path); } } diff --git a/buffyboard/config.h b/buffyboard/config.h index 5b17722..d319a4f 100644 --- a/buffyboard/config.h +++ b/buffyboard/config.h @@ -16,7 +16,7 @@ */ typedef struct { /* Default theme */ - bb_themes_theme_id_t default_id; + bbx_themes_theme_id_t default_id; } bb_config_opts_theme; /** diff --git a/buffyboard/cursor.c b/buffyboard/cursor.c deleted file mode 100644 index 63ab6e1..0000000 --- a/buffyboard/cursor.c +++ /dev/null @@ -1,115 +0,0 @@ -#ifdef __has_include - #if __has_include("lvgl.h") - #ifndef LV_LVGL_H_INCLUDE_SIMPLE - #define LV_LVGL_H_INCLUDE_SIMPLE - #endif - #endif -#endif - -#if defined(LV_LVGL_H_INCLUDE_SIMPLE) - #include "lvgl.h" -#else - #include "lvgl/lvgl.h" -#endif - - -#ifndef LV_ATTRIBUTE_MEM_ALIGN -#define LV_ATTRIBUTE_MEM_ALIGN -#endif - -#ifndef LV_ATTRIBUTE_IMG_BB_CURSOR_IMG_DSC -#define LV_ATTRIBUTE_IMG_BB_CURSOR_IMG_DSC -#endif - -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BB_CURSOR_IMG_DSC uint8_t bb_cursor_img_dsc_map[] = { -#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 - /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/ - 0xff, 0xf7, 0xff, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xf7, 0xdb, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x49, 0xff, 0xff, 0xf8, 0xdb, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x24, 0xff, 0x6d, 0xff, 0xff, 0xf8, 0xdb, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x25, 0xff, 0x25, 0xff, 0x6d, 0xff, 0xff, 0xf8, 0xdb, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x6d, 0xff, 0xff, 0xf8, 0xdb, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x6d, 0xff, 0xff, 0xf8, 0xdb, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x6d, 0xff, 0xff, 0xf8, 0xdb, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x6d, 0xff, 0xff, 0xf8, 0xdb, 0x57, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x6e, 0xff, 0xff, 0xf8, 0xdb, 0x57, 0x00, 0x00, - 0xff, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x6e, 0xff, 0xff, 0xf8, 0xff, 0x53, - 0xff, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, - 0xff, 0xff, 0x49, 0xff, 0x49, 0xff, 0xdb, 0xff, 0x92, 0xff, 0x49, 0xff, 0xb6, 0xff, 0xdb, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x49, 0xff, 0xdb, 0xff, 0xff, 0xef, 0xff, 0xff, 0x49, 0xff, 0x49, 0xff, 0xff, 0xfa, 0x6d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xdb, 0xff, 0xff, 0xe1, 0x00, 0x00, 0xff, 0xeb, 0x6e, 0xff, 0x49, 0xff, 0xdb, 0xff, 0xff, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xda, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x9d, 0xdb, 0xff, 0x49, 0xff, 0x6e, 0xff, 0xff, 0xe6, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfa, 0x6d, 0xff, 0x49, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xb2, 0xff, 0xff, 0xdb, 0xff, 0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 - /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit*/ - 0xff, 0xff, 0xf7, 0xdb, 0xde, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xbe, 0xf7, 0xf7, 0x59, 0xce, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x8a, 0x52, 0xff, 0x9e, 0xf7, 0xf8, 0x59, 0xce, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x04, 0x21, 0xff, 0x8a, 0x52, 0xff, 0x9e, 0xf7, 0xf8, 0x39, 0xce, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x04, 0x21, 0xff, 0x04, 0x21, 0xff, 0xaa, 0x52, 0xff, 0x9e, 0xf7, 0xf8, 0x39, 0xce, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x25, 0x29, 0xff, 0x25, 0x29, 0xff, 0x25, 0x29, 0xff, 0xcb, 0x5a, 0xff, 0x9e, 0xf7, 0xf8, 0x39, 0xce, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x45, 0x29, 0xff, 0x45, 0x29, 0xff, 0x45, 0x29, 0xff, 0x45, 0x29, 0xff, 0xcb, 0x5a, 0xff, 0x9e, 0xf7, 0xf8, 0x39, 0xce, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x66, 0x31, 0xff, 0x66, 0x31, 0xff, 0x66, 0x31, 0xff, 0x66, 0x31, 0xff, 0x66, 0x31, 0xff, 0xec, 0x62, 0xff, 0x9e, 0xf7, 0xf8, 0x39, 0xce, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x86, 0x31, 0xff, 0x86, 0x31, 0xff, 0x86, 0x31, 0xff, 0x86, 0x31, 0xff, 0x86, 0x31, 0xff, 0x86, 0x31, 0xff, 0x0c, 0x63, 0xff, 0x9e, 0xf7, 0xf8, 0x59, 0xce, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xa6, 0x31, 0xff, 0xa6, 0x31, 0xff, 0xa6, 0x31, 0xff, 0xa6, 0x31, 0xff, 0xa6, 0x31, 0xff, 0xa6, 0x31, 0xff, 0xa6, 0x31, 0xff, 0x0c, 0x63, 0xff, 0xbe, 0xf7, 0xf8, 0x59, 0xce, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xc7, 0x39, 0xff, 0xc7, 0x39, 0xff, 0xc7, 0x39, 0xff, 0xc7, 0x39, 0xff, 0xc7, 0x39, 0xff, 0xc7, 0x39, 0xff, 0xc7, 0x39, 0xff, 0xc7, 0x39, 0xff, 0x2d, 0x6b, 0xff, 0xbe, 0xf7, 0xf8, 0x9a, 0xd6, 0x53, - 0xff, 0xff, 0xff, 0xe7, 0x39, 0xff, 0xe7, 0x39, 0xff, 0xe8, 0x41, 0xff, 0x08, 0x42, 0xff, 0xe7, 0x39, 0xff, 0x1c, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, - 0xff, 0xff, 0xff, 0xe8, 0x41, 0xff, 0x08, 0x42, 0xff, 0xd7, 0xbd, 0xff, 0x71, 0x8c, 0xff, 0xe8, 0x41, 0xff, 0xb2, 0x94, 0xff, 0x7a, 0xd6, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x28, 0x42, 0xff, 0xd7, 0xbd, 0xff, 0x3d, 0xef, 0xef, 0xfc, 0xe6, 0xff, 0x08, 0x42, 0xff, 0x6a, 0x52, 0xff, 0xbf, 0xff, 0xfa, 0x0c, 0x63, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xf7, 0xbd, 0xff, 0xfb, 0xde, 0xe1, 0x00, 0x00, 0x00, 0x7d, 0xef, 0xeb, 0x8e, 0x73, 0xff, 0x29, 0x4a, 0xff, 0xd7, 0xbd, 0xff, 0xfb, 0xde, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xfb, 0xde, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7, 0xbd, 0x9d, 0xf8, 0xc5, 0xff, 0x49, 0x4a, 0xff, 0x6d, 0x6b, 0xff, 0xdf, 0xff, 0xe6, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7e, 0xf7, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0xfa, 0xeb, 0x5a, 0xff, 0x69, 0x4a, 0xff, 0x9e, 0xf7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0xce, 0xb2, 0xdb, 0xde, 0xff, 0x79, 0xce, 0xff, 0x7d, 0xef, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0 - /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 color bytes are swapped*/ - 0xff, 0xff, 0xf7, 0xde, 0xdb, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xf7, 0xce, 0x59, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x52, 0x8a, 0xff, 0xf7, 0x9e, 0xf8, 0xce, 0x59, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x21, 0x04, 0xff, 0x52, 0x8a, 0xff, 0xf7, 0x9e, 0xf8, 0xce, 0x39, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x21, 0x04, 0xff, 0x21, 0x04, 0xff, 0x52, 0xaa, 0xff, 0xf7, 0x9e, 0xf8, 0xce, 0x39, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x29, 0x25, 0xff, 0x29, 0x25, 0xff, 0x29, 0x25, 0xff, 0x5a, 0xcb, 0xff, 0xf7, 0x9e, 0xf8, 0xce, 0x39, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x29, 0x45, 0xff, 0x29, 0x45, 0xff, 0x29, 0x45, 0xff, 0x29, 0x45, 0xff, 0x5a, 0xcb, 0xff, 0xf7, 0x9e, 0xf8, 0xce, 0x39, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x31, 0x66, 0xff, 0x31, 0x66, 0xff, 0x31, 0x66, 0xff, 0x31, 0x66, 0xff, 0x31, 0x66, 0xff, 0x62, 0xec, 0xff, 0xf7, 0x9e, 0xf8, 0xce, 0x39, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x31, 0x86, 0xff, 0x31, 0x86, 0xff, 0x31, 0x86, 0xff, 0x31, 0x86, 0xff, 0x31, 0x86, 0xff, 0x31, 0x86, 0xff, 0x63, 0x0c, 0xff, 0xf7, 0x9e, 0xf8, 0xce, 0x59, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x31, 0xa6, 0xff, 0x31, 0xa6, 0xff, 0x31, 0xa6, 0xff, 0x31, 0xa6, 0xff, 0x31, 0xa6, 0xff, 0x31, 0xa6, 0xff, 0x31, 0xa6, 0xff, 0x63, 0x0c, 0xff, 0xf7, 0xbe, 0xf8, 0xce, 0x59, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x39, 0xc7, 0xff, 0x39, 0xc7, 0xff, 0x39, 0xc7, 0xff, 0x39, 0xc7, 0xff, 0x39, 0xc7, 0xff, 0x39, 0xc7, 0xff, 0x39, 0xc7, 0xff, 0x39, 0xc7, 0xff, 0x6b, 0x2d, 0xff, 0xf7, 0xbe, 0xf8, 0xd6, 0x9a, 0x53, - 0xff, 0xff, 0xff, 0x39, 0xe7, 0xff, 0x39, 0xe7, 0xff, 0x41, 0xe8, 0xff, 0x42, 0x08, 0xff, 0x39, 0xe7, 0xff, 0xe7, 0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, - 0xff, 0xff, 0xff, 0x41, 0xe8, 0xff, 0x42, 0x08, 0xff, 0xbd, 0xd7, 0xff, 0x8c, 0x71, 0xff, 0x41, 0xe8, 0xff, 0x94, 0xb2, 0xff, 0xd6, 0x7a, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x42, 0x28, 0xff, 0xbd, 0xd7, 0xff, 0xef, 0x3d, 0xef, 0xe6, 0xfc, 0xff, 0x42, 0x08, 0xff, 0x52, 0x6a, 0xff, 0xff, 0xbf, 0xfa, 0x63, 0x0c, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xbd, 0xf7, 0xff, 0xde, 0xfb, 0xe1, 0x00, 0x00, 0x00, 0xef, 0x7d, 0xeb, 0x73, 0x8e, 0xff, 0x4a, 0x29, 0xff, 0xbd, 0xd7, 0xff, 0xde, 0xfb, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xde, 0xfb, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xd7, 0x9d, 0xc5, 0xf8, 0xff, 0x4a, 0x49, 0xff, 0x6b, 0x6d, 0xff, 0xff, 0xdf, 0xe6, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf7, 0x7e, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xbf, 0xfa, 0x5a, 0xeb, 0xff, 0x4a, 0x69, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x39, 0xb2, 0xde, 0xdb, 0xff, 0xce, 0x79, 0xff, 0xef, 0x7d, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 32 - 0xfd, 0xfd, 0xfd, 0xf7, 0xd6, 0xd6, 0xd6, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xf2, 0xf2, 0xf2, 0xf7, 0xc9, 0xc9, 0xc9, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x4e, 0x4e, 0x4e, 0xff, 0xf0, 0xf0, 0xf0, 0xf8, 0xc7, 0xc7, 0xc7, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x1e, 0x1e, 0x1e, 0xff, 0x51, 0x51, 0x51, 0xff, 0xf1, 0xf1, 0xf1, 0xf8, 0xc5, 0xc5, 0xc5, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x21, 0x21, 0x21, 0xff, 0x21, 0x21, 0x21, 0xff, 0x53, 0x53, 0x53, 0xff, 0xf1, 0xf1, 0xf1, 0xf8, 0xc5, 0xc5, 0xc5, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x25, 0x25, 0x25, 0xff, 0x25, 0x25, 0x25, 0xff, 0x25, 0x25, 0x25, 0xff, 0x57, 0x57, 0x57, 0xff, 0xf1, 0xf1, 0xf1, 0xf8, 0xc5, 0xc5, 0xc5, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x28, 0x28, 0x28, 0xff, 0x28, 0x28, 0x28, 0xff, 0x28, 0x28, 0x28, 0xff, 0x28, 0x28, 0x28, 0xff, 0x59, 0x59, 0x59, 0xff, 0xf1, 0xf1, 0xf1, 0xf8, 0xc5, 0xc5, 0xc5, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x2c, 0x2c, 0x2c, 0xff, 0x2c, 0x2c, 0x2c, 0xff, 0x2c, 0x2c, 0x2c, 0xff, 0x2c, 0x2c, 0x2c, 0xff, 0x2c, 0x2c, 0x2c, 0xff, 0x5c, 0x5c, 0x5c, 0xff, 0xf1, 0xf1, 0xf1, 0xf8, 0xc5, 0xc5, 0xc5, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x2f, 0x2f, 0x2f, 0xff, 0x2f, 0x2f, 0x2f, 0xff, 0x2f, 0x2f, 0x2f, 0xff, 0x2f, 0x2f, 0x2f, 0xff, 0x2f, 0x2f, 0x2f, 0xff, 0x2f, 0x2f, 0x2f, 0xff, 0x5e, 0x5e, 0x5e, 0xff, 0xf1, 0xf1, 0xf1, 0xf8, 0xc7, 0xc7, 0xc7, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x33, 0x33, 0x33, 0xff, 0x33, 0x33, 0x33, 0xff, 0x33, 0x33, 0x33, 0xff, 0x33, 0x33, 0x33, 0xff, 0x33, 0x33, 0x33, 0xff, 0x33, 0x33, 0x33, 0xff, 0x33, 0x33, 0x33, 0xff, 0x61, 0x61, 0x61, 0xff, 0xf2, 0xf2, 0xf2, 0xf8, 0xc7, 0xc7, 0xc7, 0x57, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0xff, 0x64, 0x64, 0x64, 0xff, 0xf2, 0xf2, 0xf2, 0xf8, 0xd0, 0xd0, 0xd0, 0x53, - 0xff, 0xff, 0xff, 0xff, 0x3a, 0x3a, 0x3a, 0xff, 0x3a, 0x3a, 0x3a, 0xff, 0x3c, 0x3c, 0x3c, 0xff, 0x3f, 0x3f, 0x3f, 0xff, 0x3b, 0x3b, 0x3b, 0xff, 0xe1, 0xe1, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xfd, 0xfd, 0xf7, - 0xff, 0xff, 0xff, 0xff, 0x3d, 0x3d, 0x3d, 0xff, 0x3f, 0x3f, 0x3f, 0xff, 0xb7, 0xb7, 0xb7, 0xff, 0x8b, 0x8b, 0x8b, 0xff, 0x3d, 0x3d, 0x3d, 0xff, 0x92, 0x92, 0x92, 0xff, 0xcd, 0xcd, 0xcd, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0x42, 0x42, 0x42, 0xff, 0xb8, 0xb8, 0xb8, 0xff, 0xe5, 0xe5, 0xe5, 0xef, 0xdc, 0xdc, 0xdc, 0xff, 0x41, 0x41, 0x41, 0xff, 0x4d, 0x4d, 0x4d, 0xff, 0xf4, 0xf4, 0xf4, 0xfa, 0x5f, 0x5f, 0x5f, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xba, 0xba, 0xba, 0xff, 0xda, 0xda, 0xda, 0xe1, 0x00, 0x00, 0x00, 0x00, 0xea, 0xea, 0xea, 0xeb, 0x6f, 0x6f, 0x6f, 0xff, 0x44, 0x44, 0x44, 0xff, 0xb6, 0xb6, 0xb6, 0xff, 0xda, 0xda, 0xda, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xda, 0xda, 0xda, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0xb7, 0xb7, 0x9d, 0xbd, 0xbd, 0xbd, 0xff, 0x48, 0x48, 0x48, 0xff, 0x6a, 0x6a, 0x6a, 0xff, 0xf7, 0xf7, 0xf7, 0xe6, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xec, 0xec, 0xec, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0xf4, 0xf4, 0xfa, 0x5b, 0x5b, 0x5b, 0xff, 0x4b, 0x4b, 0x4b, 0xff, 0xf1, 0xf1, 0xf1, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0xc4, 0xc4, 0xb2, 0xd9, 0xd9, 0xd9, 0xff, 0xcb, 0xcb, 0xcb, 0xff, 0xea, 0xea, 0xea, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -}; - -const lv_img_dsc_t bb_cursor_img_dsc = { - .header.cf = LV_COLOR_FORMAT_NATIVE_WITH_ALPHA, - .header.w = 12, - .header.h = 18, - .data = bb_cursor_img_dsc_map, -}; diff --git a/buffyboard/cursor.h b/buffyboard/cursor.h deleted file mode 100644 index cd19fd7..0000000 --- a/buffyboard/cursor.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright 2021 Johannes Marbach - * SPDX-License-Identifier: GPL-3.0-or-later - */ - - -#ifndef BB_CURSOR_H -#define BB_CURSOR_H - -#include "lvgl/lvgl.h" - -/* Image description of the mouse cursor */ -extern const lv_img_dsc_t bb_cursor_img_dsc; - -#endif /* BB_CURSOR_H */ diff --git a/buffyboard/cursor.png b/buffyboard/cursor.png deleted file mode 100644 index 0bac28e357af9514b4c7c1663de6941aff061a37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10340 zcmeAS@N?(olHy`uVBq!ia0y~yVBle3U=ZS9V_;y&Uun<7z##5j6%tVrlvu7%P?VpR znUkteQdy9ykXn(M#=uZx3#k$&i z5#RScs5tfc#ryfHdym)KrZQg6otxx7}zi_>_=6?O*1KTh5Z#=hC{&(El-}e=T_exe?vfggv|M_xt zx%h*xZ+r9qJo=eg`^4e3_Wt9aFaPeJAuu8S=*!RXsjku9y!&llc!$|-`(+y~zklZY zn_TZ~kJNJ){i^x%^z*S}@##-n{w>#T|Mc(KKD+&Ud&^z#FIxY8Z~D#j^KTZlx~#ao zd*%5Rb0@#KxwAztmdD%M|Cx1BSIs`H_|{c&Qw}YeWF3Dv?6t@BZ3q2szuETMhR-@8 zso?aEGy3OvpP!$6G(G(8hg0zvrr*_@eE21|r=0rRgS*dfy-|Gg7f|Bv&$?v3+!CYV+oR{NdueA8BzO%oOzyEK=7 z-DF1T#j|xTvA!4Hsp&WUneNSb&aovnxfOB-%EA}b=bz+_b=&0BamAmnRVwS^ae-tX z!{ba++nxk_7%rVM*R7D z+?|T@#|_tZz24U@=j(6#{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5a8? zx#9NPOQm<;hi~=LjE%i+&)krE`~0#@r_j(6D_NJt7xNhor6+H`*>iup5X-^noiS-< xvzNaAz2|o`d-K81NgE%e7%hBWdHVF-_&>=H&(8nndmhwl_H^}gS?83{1OVmrvUC6d diff --git a/buffyboard/lv_conf.h b/buffyboard/lv_conf.h index 0915ff1..64247c4 100644 --- a/buffyboard/lv_conf.h +++ b/buffyboard/lv_conf.h @@ -392,10 +392,10 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ /*Optionally declare custom fonts here. *You can use these fonts as default font too and they will be available globally. *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ -#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bb_font_32) +#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32) /*Always set a default font*/ -#define LV_FONT_DEFAULT &bb_font_32 +#define LV_FONT_DEFAULT &bbx_font_32 /*Enable handling large font and/or fonts with a lot of characters. *The limit depends on the font size, font face and bpp. diff --git a/buffyboard/main.c b/buffyboard/main.c index 59c1572..1599c03 100644 --- a/buffyboard/main.c +++ b/buffyboard/main.c @@ -248,10 +248,10 @@ int main(int argc, char *argv[]) { } /* Start input device monitor and auto-connect available devices */ - bb_indev_start_monitor_and_autoconnect(false, conf_opts.input.pointer, conf_opts.input.touchscreen); + bbx_indev_start_monitor_and_autoconnect(false, conf_opts.input.pointer, conf_opts.input.touchscreen); /* Initialise theme */ - bb_theme_apply(bb_themes_themes[conf_opts.theme.default_id]); + bbx_theme_apply(bbx_themes_themes[conf_opts.theme.default_id]); /* Add keyboard */ keyboard = lv_keyboard_create(lv_scr_act()); @@ -265,7 +265,7 @@ int main(int argc, char *argv[]) { lv_obj_add_event_cb(keyboard, keyboard_value_changed_cb, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_set_pos(keyboard, 0, 0); lv_obj_set_size(keyboard, LV_HOR_RES, LV_VER_RES); - bb_theme_prepare_keyboard(keyboard); + bbx_theme_prepare_keyboard(keyboard); /* Apply default keyboard layout */ sq2lv_switch_layout(keyboard, SQ2LV_LAYOUT_TERMINAL_US); diff --git a/shared/cursor/cursor.c b/shared/cursor/cursor.c index 63ab6e1..838e97d 100644 --- a/shared/cursor/cursor.c +++ b/shared/cursor/cursor.c @@ -17,11 +17,11 @@ #define LV_ATTRIBUTE_MEM_ALIGN #endif -#ifndef LV_ATTRIBUTE_IMG_BB_CURSOR_IMG_DSC -#define LV_ATTRIBUTE_IMG_BB_CURSOR_IMG_DSC +#ifndef LV_ATTRIBUTE_IMG_BBX_CURSOR_IMG_DSC +#define LV_ATTRIBUTE_IMG_BBX_CURSOR_IMG_DSC #endif -const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BB_CURSOR_IMG_DSC uint8_t bb_cursor_img_dsc_map[] = { +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BBX_CURSOR_IMG_DSC uint8_t bbx_cursor_img_dsc_map[] = { #if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/ 0xff, 0xf7, 0xff, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -107,9 +107,9 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BB_CURSOR #endif }; -const lv_img_dsc_t bb_cursor_img_dsc = { +const lv_img_dsc_t bbx_cursor_img_dsc = { .header.cf = LV_COLOR_FORMAT_NATIVE_WITH_ALPHA, .header.w = 12, .header.h = 18, - .data = bb_cursor_img_dsc_map, + .data = bbx_cursor_img_dsc_map, }; diff --git a/shared/cursor/cursor.h b/shared/cursor/cursor.h index cd19fd7..835d06e 100644 --- a/shared/cursor/cursor.h +++ b/shared/cursor/cursor.h @@ -4,12 +4,12 @@ */ -#ifndef BB_CURSOR_H -#define BB_CURSOR_H +#ifndef BBX_CURSOR_H +#define BBX_CURSOR_H #include "lvgl/lvgl.h" /* Image description of the mouse cursor */ -extern const lv_img_dsc_t bb_cursor_img_dsc; +extern const lv_img_dsc_t bbx_cursor_img_dsc; -#endif /* BB_CURSOR_H */ +#endif /* BBX_CURSOR_H */ diff --git a/shared/cursor/package-lock.json b/shared/cursor/package-lock.json index 243e9eb..eb7bdc1 100644 --- a/shared/cursor/package-lock.json +++ b/shared/cursor/package-lock.json @@ -1,5 +1,5 @@ { - "name": "shared", + "name": "cursor", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/shared/cursor/regenerate.sh b/shared/cursor/regenerate.sh index ce91b90..04d11e1 100755 --- a/shared/cursor/regenerate.sh +++ b/shared/cursor/regenerate.sh @@ -7,7 +7,7 @@ npm i ./node_modules/lv_img_conv/lv_img_conv.js -f \ - -i bb_cursor_img_dsc \ + -i bbx_cursor_img_dsc \ -c CF_TRUE_COLOR_ALPHA \ -o cursor.c \ cursor.png diff --git a/shared/fonts/font_32.c b/shared/fonts/font_32.c index 7c64cac..ee7735c 100644 --- a/shared/fonts/font_32.c +++ b/shared/fonts/font_32.c @@ -15499,9 +15499,9 @@ static lv_font_fmt_txt_dsc_t font_dsc = { /*Initialize a public general font descriptor*/ #if LV_VERSION_CHECK(8, 0, 0) -const lv_font_t bb_font_32 = { +const lv_font_t bbx_font_32 = { #else -const lv_font_t bb_font_32 = { +const lv_font_t bbx_font_32 = { #endif .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ diff --git a/shared/fonts/regenerate.sh b/shared/fonts/regenerate.sh index 7ddc70b..54c5273 100755 --- a/shared/fonts/regenerate.sh +++ b/shared/fonts/regenerate.sh @@ -20,6 +20,6 @@ npx lv_font_conv --bpp 4 --size 32 --no-compress -o font_32.c --format lvgl \ # Fix type qualifier for compatibility with LV_FONT_DECLARE and add prefix sed 's/^lv_font_t /const lv_font_t /g' font_32.c \ - | sed 's/lv_font_t font_32/lv_font_t bb_font_32/g' \ + | sed 's/lv_font_t font_32/lv_font_t bbx_font_32/g' \ > font_32.c.tmp mv font_32.c.tmp font_32.c diff --git a/shared/indev.c b/shared/indev.c index 692158f..926320a 100644 --- a/shared/indev.c +++ b/shared/indev.c @@ -169,7 +169,7 @@ static void connect_udev_device(struct udev_device *device) { /* Obtain and verify device node */ const char *node = udev_device_get_devnode(device); if (!node || strncmp(node, INPUT_DEVICE_NODE_PREFIX, strlen(INPUT_DEVICE_NODE_PREFIX)) != 0) { - bb_log(BB_LOG_LEVEL_VERBOSE, "Ignoring unsupported input device %s", udev_device_get_syspath(device)); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Ignoring unsupported input device %s", udev_device_get_syspath(device)); return; } @@ -181,7 +181,7 @@ static void connect_devnode(const char *node) { /* Check if the device is already connected */ for (int i = 0; i < num_connected_devices; ++i) { if (strcmp(devices[i]->node, node) == 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Ignoring already connected input device %s", node); + bbx_log(BBX_LOG_LEVEL_WARNING, "Ignoring already connected input device %s", node); return; } } @@ -191,7 +191,7 @@ static void connect_devnode(const char *node) { /* Re-allocate array */ struct input_device **tmp = realloc(devices, (2 * num_devices + 1) * sizeof(struct input_device *)); if (!tmp) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not reallocate memory for input device array"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not reallocate memory for input device array"); return; } devices = tmp; @@ -214,14 +214,14 @@ static void connect_devnode(const char *node) { /* Initialise the indev and obtain the libinput device */ device->indev = lv_libinput_create(LV_INDEV_TYPE_NONE, device->node); if (!device->indev) { - bb_log(BB_LOG_LEVEL_WARNING, "Aborting connection of input device %s because libinput failed to connect it", node); + bbx_log(BBX_LOG_LEVEL_WARNING, "Aborting connection of input device %s because libinput failed to connect it", node); disconnect_idx(num_connected_devices); return; } lv_libinput_t *dsc = lv_indev_get_driver_data(device->indev); struct libinput_device *device_libinput = dsc->libinput_device; if (!device_libinput) { - bb_log(BB_LOG_LEVEL_WARNING, "Aborting connection of input device %s because libinput failed to connect it", node); + bbx_log(BBX_LOG_LEVEL_WARNING, "Aborting connection of input device %s because libinput failed to connect it", node); disconnect_idx(num_connected_devices); return; } @@ -231,7 +231,7 @@ static void connect_devnode(const char *node) { /* If the device doesn't have any supported capabilities, exit */ if ((device->capability & allowed_capability) == LV_LIBINPUT_CAPABILITY_NONE) { - bb_log(BB_LOG_LEVEL_WARNING, "Aborting connection of input device %s because it has no allowed capabilities", node); + bbx_log(BBX_LOG_LEVEL_WARNING, "Aborting connection of input device %s because it has no allowed capabilities", node); disconnect_idx(num_connected_devices); return; } @@ -269,14 +269,14 @@ static void connect_devnode(const char *node) { /* Increment connected device count */ num_connected_devices++; - bb_log(BB_LOG_LEVEL_VERBOSE, "Connected input device %s (%s)", node, capability_to_str(device->capability)); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Connected input device %s (%s)", node, capability_to_str(device->capability)); } static void disconnect_udev_device(struct udev_device *device) { /* Obtain and verify device node */ const char *node = udev_device_get_devnode(device); if (!node || strncmp(node, INPUT_DEVICE_NODE_PREFIX, strlen(INPUT_DEVICE_NODE_PREFIX)) != 0) { - bb_log(BB_LOG_LEVEL_VERBOSE, "Ignoring unsupported input device %s", udev_device_get_syspath(device)); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Ignoring unsupported input device %s", udev_device_get_syspath(device)); return; } @@ -296,7 +296,7 @@ static void disconnect_devnode(const char *node) { /* If no matching device was found, exit */ if (idx < 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Ignoring already disconnected input device %s", node); + bbx_log(BBX_LOG_LEVEL_WARNING, "Ignoring already disconnected input device %s", node); return; } @@ -316,7 +316,7 @@ static void disconnect_devnode(const char *node) { /* Decrement connected device count */ --num_connected_devices; - bb_log(BB_LOG_LEVEL_VERBOSE, "Disconnected input device %s", node); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Disconnected input device %s", node); } static void disconnect_idx(int idx) { @@ -354,7 +354,7 @@ static void set_mouse_cursor(struct input_device *device) { /* Initialise cursor image if needed */ if (!cursor_obj) { cursor_obj = lv_img_create(lv_scr_act()); - lv_img_set_src(cursor_obj, &bb_cursor_img_dsc); + lv_img_set_src(cursor_obj, &bbx_cursor_img_dsc); } /* Apply the cursor image */ @@ -363,7 +363,7 @@ static void set_mouse_cursor(struct input_device *device) { static void query_device_monitor(lv_timer_t *timer) { LV_UNUSED(timer); - bb_indev_query_monitor(); + bbx_indev_query_monitor(); } @@ -371,7 +371,7 @@ static void query_device_monitor(lv_timer_t *timer) { * Public functions */ -void bb_indev_set_allowed_device_capability(bool keyboard, bool pointer, bool touchscreen) { +void bbx_indev_set_allowed_device_capability(bool keyboard, bool pointer, bool touchscreen) { allowed_capability = LV_LIBINPUT_CAPABILITY_NONE; if (keyboard) { allowed_capability |= LV_LIBINPUT_CAPABILITY_KEYBOARD; @@ -384,7 +384,7 @@ void bb_indev_set_allowed_device_capability(bool keyboard, bool pointer, bool to } } -void bb_indev_set_keyboard_input_group(lv_group_t *group) { +void bbx_indev_set_keyboard_input_group(lv_group_t *group) { /* Store the group */ keyboard_input_group = group; @@ -396,21 +396,21 @@ void bb_indev_set_keyboard_input_group(lv_group_t *group) { } } -void bb_indev_start_monitor_and_autoconnect(bool keyboard, bool pointer, bool touchscreen) { - bb_indev_set_allowed_device_capability(keyboard, pointer, touchscreen); - bb_indev_start_monitor(); +void bbx_indev_start_monitor_and_autoconnect(bool keyboard, bool pointer, bool touchscreen) { + bbx_indev_set_allowed_device_capability(keyboard, pointer, touchscreen); + bbx_indev_start_monitor(); lv_timer_create(query_device_monitor, 1000, NULL); - bb_indev_auto_connect(); + bbx_indev_auto_connect(); } -void bb_indev_auto_connect() { - bb_log(BB_LOG_LEVEL_VERBOSE, "Auto-connecting supported input devices"); +void bbx_indev_auto_connect() { + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Auto-connecting supported input devices"); /* Make sure udev context is initialised */ if (!context) { context = udev_new(); if (!context) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not create udev context"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not create udev context"); return; } } @@ -431,7 +431,7 @@ void bb_indev_auto_connect() { /* Create udev device */ struct udev_device *device = udev_device_new_from_syspath(context, path); if (!device) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not create udev device for %s", path); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not create udev device for %s", path); continue; } @@ -446,51 +446,51 @@ void bb_indev_auto_connect() { udev_enumerate_unref(enumerate); } -void bb_indev_start_monitor() { +void bbx_indev_start_monitor() { /* Make sure udev context is initialised */ if (!context) { context = udev_new(); if (!context) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not create udev context"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not create udev context"); return; } } /* Check if monitor is already running */ if (monitor) { - bb_log(BB_LOG_LEVEL_WARNING, "Not starting udev monitor because it is already running"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Not starting udev monitor because it is already running"); return; } /* Create new monitor */ monitor = udev_monitor_new_from_netlink(context, "udev"); if (!monitor) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not create udev monitor"); - bb_indev_stop_monitor(); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not create udev monitor"); + bbx_indev_stop_monitor(); return; } /* Apply input subsystem filter */ if (udev_monitor_filter_add_match_subsystem_devtype(monitor, "input", NULL) < 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not add input subsystem filter for udev monitor"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not add input subsystem filter for udev monitor"); } /* Start monitor */ if (udev_monitor_enable_receiving(monitor) < 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not enable udev monitor"); - bb_indev_stop_monitor(); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not enable udev monitor"); + bbx_indev_stop_monitor(); return; } /* Obtain monitor file descriptor */ if ((monitor_fd = udev_monitor_get_fd(monitor)) < 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not acquire file descriptor for udev monitor"); - bb_indev_stop_monitor(); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not acquire file descriptor for udev monitor"); + bbx_indev_stop_monitor(); return; } } -void bb_indev_stop_monitor() { +void bbx_indev_stop_monitor() { /* Unreference monitor */ if (monitor) { udev_monitor_unref(monitor); @@ -509,10 +509,10 @@ void bb_indev_stop_monitor() { } } -void bb_indev_query_monitor() { +void bbx_indev_query_monitor() { /* Make sure the monitor is running */ if (!monitor) { - bb_log(BB_LOG_LEVEL_ERROR, "Cannot query udev monitor because it is not running"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Cannot query udev monitor because it is not running"); return; } @@ -547,7 +547,7 @@ void bb_indev_query_monitor() { } } -bool bb_indev_is_keyboard_connected() { +bool bbx_indev_is_keyboard_connected() { for (int i = 0; i < num_connected_devices; ++i) { if (is_keyboard_device(devices[i])) { return true; diff --git a/shared/indev.h b/shared/indev.h index 2733444..e0796ae 100644 --- a/shared/indev.h +++ b/shared/indev.h @@ -4,8 +4,8 @@ */ -#ifndef BB_INDEV_H -#define BB_INDEV_H +#ifndef BBX_INDEV_H +#define BBX_INDEV_H #include "lvgl/lvgl.h" @@ -18,14 +18,14 @@ * @param pointer if true, allow connection of pointer devices * @param touchscreen if true, allow connection of touchscreen devices */ -void bb_indev_set_allowed_device_capability(bool keyboard, bool pointer, bool touchscreen); +void bbx_indev_set_allowed_device_capability(bool keyboard, bool pointer, bool touchscreen); /** * Set the group for receiving input from keyboard devices. * * @param group group that should receive input */ -void bb_indev_set_keyboard_input_group(lv_group_t *group); +void bbx_indev_set_keyboard_input_group(lv_group_t *group); /** * Start the udev device monitor and auto-connect currently available devices. @@ -34,33 +34,33 @@ void bb_indev_set_keyboard_input_group(lv_group_t *group); * @param pointer if true, allow connection of pointer devices * @param touchscreen if true, allow connection of touchscreen devices */ -void bb_indev_start_monitor_and_autoconnect(bool keyboard, bool pointer, bool touchscreen); +void bbx_indev_start_monitor_and_autoconnect(bool keyboard, bool pointer, bool touchscreen); /** * Auto-connect currently available keyboard, pointer and touchscreen input devices. */ -void bb_indev_auto_connect(); +void bbx_indev_auto_connect(); /** * Start the udev device monitor. */ -void bb_indev_start_monitor(); +void bbx_indev_start_monitor(); /** * Stop the udev device monitor. */ -void bb_indev_stop_monitor(); +void bbx_indev_stop_monitor(); /** * Query the udev device monitor and (dis)connect added or removed devices */ -void bb_indev_query_monitor(); +void bbx_indev_query_monitor(); /** * Check if any keyboard devices are connected. * * @return true if at least one keyboard device is connected, false otherwise */ -bool bb_indev_is_keyboard_connected(); +bool bbx_indev_is_keyboard_connected(); -#endif /* BB_INDEV_H */ +#endif /* BBX_INDEV_H */ diff --git a/shared/log.c b/shared/log.c index 47a94f5..fce7bf0 100644 --- a/shared/log.c +++ b/shared/log.c @@ -15,18 +15,18 @@ * Static variables */ -static bb_log_level log_level = BB_LOG_LEVEL_ERROR; +static bbx_log_level log_level = BBX_LOG_LEVEL_ERROR; /** * Public functions */ -void bb_log_set_level(bb_log_level level) { +void bbx_log_set_level(bbx_log_level level) { log_level = level; } -void bb_log(bb_log_level level, const char *format, ...) { +void bbx_log(bbx_log_level level, const char *format, ...) { if (level > log_level) { return; } @@ -42,7 +42,7 @@ void bb_log(bb_log_level level, const char *format, ...) { } } -void bb_log_print_cb(lv_log_level_t level, const char *msg) { +void bbx_log_print_cb(lv_log_level_t level, const char *msg) { LV_UNUSED(level); - bb_log(BB_LOG_LEVEL_VERBOSE, msg); + bbx_log(BBX_LOG_LEVEL_VERBOSE, msg); } diff --git a/shared/log.h b/shared/log.h index 2951cb5..ccf73e3 100644 --- a/shared/log.h +++ b/shared/log.h @@ -4,8 +4,8 @@ */ -#ifndef BB_LOG_H -#define BB_LOG_H +#ifndef BBX_LOG_H +#define BBX_LOG_H #include "lvgl/lvgl.h" @@ -14,19 +14,19 @@ */ typedef enum { /* Errors only */ - BB_LOG_LEVEL_ERROR = 0, + BBX_LOG_LEVEL_ERROR = 0, /* Warnings and errors */ - BB_LOG_LEVEL_WARNING = 1, + BBX_LOG_LEVEL_WARNING = 1, /* Include non-errors in log */ - BB_LOG_LEVEL_VERBOSE = 2 -} bb_log_level; + BBX_LOG_LEVEL_VERBOSE = 2 +} bbx_log_level; /** * Set the log level. * * @param level new log level value */ -void bb_log_set_level(bb_log_level level); +void bbx_log_set_level(bbx_log_level level); /** * Log a message. A newline character is appended unless the message ends in one. @@ -35,7 +35,7 @@ void bb_log_set_level(bb_log_level level); * @param format message format string * @param ... parameters to fill into the format string */ -void bb_log(bb_log_level level, const char *format, ...); +void bbx_log(bbx_log_level level, const char *format, ...); /** * Handle an LVGL log message. @@ -43,6 +43,6 @@ void bb_log(bb_log_level level, const char *format, ...); * @param level LVGL log level * @param msg message to print */ -void bb_log_print_cb(lv_log_level_t level, const char *msg); +void bbx_log_print_cb(lv_log_level_t level, const char *msg); -#endif /* BB_LOG_H */ +#endif /* BBX_LOG_H */ diff --git a/shared/theme.c b/shared/theme.c index 5407182..d2424f2 100644 --- a/shared/theme.c +++ b/shared/theme.c @@ -16,7 +16,7 @@ * Static variables */ -static bb_theme current_theme; +static bbx_theme current_theme; static lv_theme_t lv_theme; static struct { @@ -55,7 +55,7 @@ static bool are_styles_initialised = false; * * @param theme theme to derive the styles from */ -static void init_styles(const bb_theme *theme); +static void init_styles(const bbx_theme *theme); /** * Initialise or reset a style. @@ -84,9 +84,9 @@ static void keyboard_draw_task_added_cb(lv_event_t *event); * Static functions */ -static void init_styles(const bb_theme *theme) { +static void init_styles(const bbx_theme *theme) { reset_style(&(styles.widget)); - lv_style_set_text_font(&(styles.widget), &bb_font_32); + lv_style_set_text_font(&(styles.widget), &bbx_font_32); reset_style(&(styles.window)); lv_style_set_bg_opa(&(styles.window), LV_OPA_COVER); @@ -236,7 +236,7 @@ static void apply_theme_cb(lv_theme_t *theme, lv_obj_t *obj) { return; } - if (lv_obj_has_flag(obj, BB_WIDGET_HEADER)) { + if (lv_obj_has_flag(obj, BBX_WIDGET_HEADER)) { lv_obj_add_style(obj, &(styles.header), 0); return; } @@ -329,7 +329,7 @@ static void keyboard_draw_task_added_cb(lv_event_t *event) { return; } - bb_theme_key *key = NULL; + bbx_theme_key *key = NULL; if ((btnm->ctrl_bits[dsc->id1] & SQ2LV_CTRL_MOD_INACTIVE) == SQ2LV_CTRL_MOD_INACTIVE) { key = &(current_theme.keyboard.keys.key_mod_inact); @@ -364,21 +364,21 @@ static void keyboard_draw_task_added_cb(lv_event_t *event) { * Public functions */ -void bb_theme_prepare_keyboard(lv_obj_t *keyboard) { +void bbx_theme_prepare_keyboard(lv_obj_t *keyboard) { lv_obj_add_event_cb(keyboard, keyboard_draw_task_added_cb, LV_EVENT_DRAW_TASK_ADDED, NULL); lv_obj_add_flag(keyboard, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); } -void bb_theme_apply(const bb_theme *theme) { +void bbx_theme_apply(const bbx_theme *theme) { if (!theme) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not apply theme from NULL pointer"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not apply theme from NULL pointer"); return; } lv_theme.disp = NULL; - lv_theme.font_small = &bb_font_32; - lv_theme.font_normal = &bb_font_32; - lv_theme.font_large = &bb_font_32; + lv_theme.font_small = &bbx_font_32; + lv_theme.font_normal = &bbx_font_32; + lv_theme.font_large = &bbx_font_32; lv_theme.apply_cb = apply_theme_cb; current_theme = *theme; diff --git a/shared/theme.h b/shared/theme.h index 1b62d3c..d4e6aed 100644 --- a/shared/theme.h +++ b/shared/theme.h @@ -4,15 +4,15 @@ */ -#ifndef BB_THEME_H -#define BB_THEME_H +#ifndef BBX_THEME_H +#define BBX_THEME_H #include "lvgl/lvgl.h" #include #include -#define BB_WIDGET_HEADER LV_OBJ_FLAG_USER_1 +#define BBX_WIDGET_HEADER LV_OBJ_FLAG_USER_1 /** * Theming structs @@ -21,7 +21,7 @@ /* Window theme */ typedef struct { uint32_t bg_color; -} bb_theme_window; +} bbx_theme_window; /* Header theme */ typedef struct { @@ -30,30 +30,30 @@ typedef struct { uint32_t border_color; lv_coord_t pad; lv_coord_t gap; -} bb_theme_header; +} bbx_theme_header; /* Key theme for one specific key type and state */ typedef struct { uint32_t fg_color; uint32_t bg_color; uint32_t border_color; -} bb_theme_key_state; +} bbx_theme_key_state; /* Key theme for one specific key type and all states */ typedef struct { - bb_theme_key_state normal; - bb_theme_key_state pressed; -} bb_theme_key; + bbx_theme_key_state normal; + bbx_theme_key_state pressed; +} bbx_theme_key; /* Key theme */ typedef struct { lv_coord_t border_width; lv_coord_t corner_radius; - bb_theme_key key_char; - bb_theme_key key_non_char; - bb_theme_key key_mod_act; - bb_theme_key key_mod_inact; -} bb_theme_keys; + bbx_theme_key key_char; + bbx_theme_key key_non_char; + bbx_theme_key key_mod_act; + bbx_theme_key key_mod_inact; +} bbx_theme_keys; /* Keyboard theme */ typedef struct { @@ -62,31 +62,31 @@ typedef struct { uint32_t border_color; lv_coord_t pad; lv_coord_t gap; - bb_theme_keys keys; -} bb_theme_keyboard; + bbx_theme_keys keys; +} bbx_theme_keyboard; /* Button theme for one specific button state */ typedef struct { uint32_t fg_color; uint32_t bg_color; uint32_t border_color; -} bb_theme_button_state; +} bbx_theme_button_state; /* Button theme */ typedef struct { lv_coord_t border_width; lv_coord_t corner_radius; lv_coord_t pad; - bb_theme_button_state normal; - bb_theme_button_state pressed; -} bb_theme_button; + bbx_theme_button_state normal; + bbx_theme_button_state pressed; +} bbx_theme_button; /* Text area cursor theme */ typedef struct { lv_coord_t width; uint32_t color; int period; -} bb_theme_textarea_cursor; +} bbx_theme_textarea_cursor; /* Text area theme */ typedef struct { @@ -97,8 +97,8 @@ typedef struct { lv_coord_t corner_radius; lv_coord_t pad; uint32_t placeholder_color; - bb_theme_textarea_cursor cursor; -} bb_theme_textarea; + bbx_theme_textarea_cursor cursor; +} bbx_theme_textarea; /* Dropdown list theme */ typedef struct { @@ -110,29 +110,29 @@ typedef struct { uint32_t border_color; lv_coord_t corner_radius; lv_coord_t pad; -} bb_theme_dropdown_list; +} bbx_theme_dropdown_list; /* Dropdown theme */ typedef struct { - bb_theme_button button; - bb_theme_dropdown_list list; -} bb_theme_dropdown; + bbx_theme_button button; + bbx_theme_dropdown_list list; +} bbx_theme_dropdown; /* Label */ typedef struct { uint32_t fg_color; -} bb_theme_label; +} bbx_theme_label; /* Message box buttons theme */ typedef struct { lv_coord_t gap; -} bb_theme_msgbox_buttons; +} bbx_theme_msgbox_buttons; /* Message box dimming theme */ typedef struct { uint32_t color; short opacity; -} bb_theme_msgbox_dimming; +} bbx_theme_msgbox_dimming; /* Message box theme */ typedef struct { @@ -143,49 +143,49 @@ typedef struct { lv_coord_t corner_radius; lv_coord_t pad; lv_coord_t gap; - bb_theme_msgbox_buttons buttons; - bb_theme_msgbox_dimming dimming; -} bb_theme_msgbox; + bbx_theme_msgbox_buttons buttons; + bbx_theme_msgbox_dimming dimming; +} bbx_theme_msgbox; /* Progress bar indicator theme */ typedef struct { uint32_t bg_color; -} bb_theme_bar_indicator; +} bbx_theme_bar_indicator; /* Progress bar theme */ typedef struct { lv_coord_t border_width; uint32_t border_color; lv_coord_t corner_radius; - bb_theme_bar_indicator indicator; -} bb_theme_bar; + bbx_theme_bar_indicator indicator; +} bbx_theme_bar; /* Full theme */ typedef struct { char *name; - bb_theme_window window; - bb_theme_header header; - bb_theme_keyboard keyboard; - bb_theme_button button; - bb_theme_textarea textarea; - bb_theme_dropdown dropdown; - bb_theme_label label; - bb_theme_msgbox msgbox; - bb_theme_bar bar; -} bb_theme; + bbx_theme_window window; + bbx_theme_header header; + bbx_theme_keyboard keyboard; + bbx_theme_button button; + bbx_theme_textarea textarea; + bbx_theme_dropdown dropdown; + bbx_theme_label label; + bbx_theme_msgbox msgbox; + bbx_theme_bar bar; +} bbx_theme; /** * Prepare a keyboard widget to be themed with a theme. * * @param keyboard keyboard widget */ -void bb_theme_prepare_keyboard(lv_obj_t *keyboard); +void bbx_theme_prepare_keyboard(lv_obj_t *keyboard); /** * Apply a UI theme. * * @param theme the theme to apply */ -void bb_theme_apply(const bb_theme *theme); +void bbx_theme_apply(const bbx_theme *theme); -#endif /* BB_THEME_H */ +#endif /* BBX_THEME_H */ diff --git a/shared/themes.c b/shared/themes.c index 0629e78..b25ffa8 100644 --- a/shared/themes.c +++ b/shared/themes.c @@ -16,7 +16,7 @@ */ /* Breezy light (based on KDE Breeze color palette, see https://develop.kde.org/hig/style/color/default/) */ -static const bb_theme breezy_light = { +static const bbx_theme breezy_light = { .name = "breezy-light", .window = { .bg_color = 0xeff0f1 @@ -174,7 +174,7 @@ static const bb_theme breezy_light = { /* Breezy dark (based on KDE Breeze Dark color palette, see https://develop.kde.org/hig/style/color/dark/) */ -static const bb_theme breezy_dark = { +static const bbx_theme breezy_dark = { .name = "breezy-dark", .window = { .bg_color = 0x31363b @@ -331,7 +331,7 @@ static const bb_theme breezy_dark = { }; /* pmOS light (based on palette https://coolors.co/009900-395e66-db504a-e3b505-ebf5ee) */ -static const bb_theme pmos_light = { +static const bbx_theme pmos_light = { .name = "pmos-light", .window = { .bg_color = 0xf2f7f8, @@ -488,7 +488,7 @@ static const bb_theme pmos_light = { }; /* pmOS dark (based on palette https://coolors.co/009900-395e66-db504a-e3b505-ebf5ee) */ -static const bb_theme pmos_dark = { +static const bbx_theme pmos_dark = { .name = "pmos-dark", .window = { .bg_color = 0x070c0d @@ -648,21 +648,21 @@ static const bb_theme pmos_dark = { * Public interface */ -const int bb_themes_num_themes = 4; -const bb_theme *bb_themes_themes[] = { +const int bbx_themes_num_themes = 4; +const bbx_theme *bbx_themes_themes[] = { &breezy_light, &breezy_dark, &pmos_light, &pmos_dark }; -bb_themes_theme_id_t bb_themes_find_theme_with_name(const char *name) { - for (int i = 0; i < bb_themes_num_themes; ++i) { - if (strcmp(bb_themes_themes[i]->name, name) == 0) { - bb_log(BB_LOG_LEVEL_VERBOSE, "Found theme: %s\n", name); +bbx_themes_theme_id_t bbx_themes_find_theme_with_name(const char *name) { + for (int i = 0; i < bbx_themes_num_themes; ++i) { + if (strcmp(bbx_themes_themes[i]->name, name) == 0) { + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Found theme: %s\n", name); return i; } } - bb_log(BB_LOG_LEVEL_WARNING, "Theme %s not found\n", name); - return BB_THEMES_THEME_NONE; + bbx_log(BBX_LOG_LEVEL_WARNING, "Theme %s not found\n", name); + return BBX_THEMES_THEME_NONE; } diff --git a/shared/themes.h b/shared/themes.h index 0addaa6..5d592cf 100644 --- a/shared/themes.h +++ b/shared/themes.h @@ -4,30 +4,30 @@ */ -#ifndef BB_THEMES_H -#define BB_THEMES_H +#ifndef BBX_THEMES_H +#define BBX_THEMES_H #include "theme.h" -/* Theme IDs, values can be used as indexes into the bb_themes_themes array */ +/* Theme IDs, values can be used as indexes into the bbx_themes_themes array */ typedef enum { - BB_THEMES_THEME_NONE = -1, - BB_THEMES_THEME_BREEZY_LIGHT = 0, - BB_THEMES_THEME_BREEZY_DARK = 1, - BB_THEMES_THEME_PMOS_LIGHT = 2, - BB_THEMES_THEME_PMOS_DARK = 3 -} bb_themes_theme_id_t; + BBX_THEMES_THEME_NONE = -1, + BBX_THEMES_THEME_BREEZY_LIGHT = 0, + BBX_THEMES_THEME_BREEZY_DARK = 1, + BBX_THEMES_THEME_PMOS_LIGHT = 2, + BBX_THEMES_THEME_PMOS_DARK = 3 +} bbx_themes_theme_id_t; /* Themes */ -extern const int bb_themes_num_themes; -extern const bb_theme *bb_themes_themes[]; +extern const int bbx_themes_num_themes; +extern const bbx_theme *bbx_themes_themes[]; /** * Find the first theme with a given name. * * @param name theme name - * @return ID of the first matching theme or BB_THEMES_THEME_NONE if no theme matched + * @return ID of the first matching theme or BBX_THEMES_THEME_NONE if no theme matched */ -bb_themes_theme_id_t bb_themes_find_theme_with_name(const char *name); +bbx_themes_theme_id_t bbx_themes_find_theme_with_name(const char *name); -#endif /* BB_THEMES_H */ +#endif /* BBX_THEMES_H */ diff --git a/unl0kr/backends.c b/unl0kr/backends.c index b14b28c..3fa21b1 100644 --- a/unl0kr/backends.c +++ b/unl0kr/backends.c @@ -28,10 +28,10 @@ const char *ul_backends_backends[] = { ul_backends_backend_id_t ul_backends_find_backend_with_name(const char *name) { for (int i = 0; ul_backends_backends[i] != NULL; ++i) { if (strcmp(ul_backends_backends[i], name) == 0) { - bb_log(BB_LOG_LEVEL_VERBOSE, "Found backend: %s\n", name); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Found backend: %s\n", name); return i; } } - bb_log(BB_LOG_LEVEL_WARNING, "Backend %s not found\n", name); + bbx_log(BBX_LOG_LEVEL_WARNING, "Backend %s not found\n", name); return UL_BACKENDS_BACKEND_NONE; } diff --git a/unl0kr/command_line.c b/unl0kr/command_line.c index 7db1fdf..1831a40 100644 --- a/unl0kr/command_line.c +++ b/unl0kr/command_line.c @@ -97,7 +97,7 @@ void ul_cli_parse_opts(int argc, char *argv[], ul_cli_opts *opts) { case 'C': opts->config_files = realloc(opts->config_files, (opts->num_config_files + 1) * sizeof(char *)); if (!opts->config_files) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not allocate memory for config file paths"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not allocate memory for config file paths"); exit(EXIT_FAILURE); } opts->config_files[opts->num_config_files] = optarg; @@ -106,14 +106,14 @@ void ul_cli_parse_opts(int argc, char *argv[], ul_cli_opts *opts) { case 'g': if (sscanf(optarg, "%ix%i@%i,%i", &(opts->hor_res), &(opts->ver_res), &(opts->x_offset), &(opts->y_offset)) != 4) { if (sscanf(optarg, "%ix%i", &(opts->hor_res), &(opts->ver_res)) != 2) { - bb_log(BB_LOG_LEVEL_ERROR, "Invalid geometry argument \"%s\"\n", optarg); + bbx_log(BBX_LOG_LEVEL_ERROR, "Invalid geometry argument \"%s\"\n", optarg); exit(EXIT_FAILURE); } } break; case 'd': if (sscanf(optarg, "%i", &(opts->dpi)) != 1) { - bb_log(BB_LOG_LEVEL_ERROR, "Invalid dpi argument \"%s\"\n", optarg); + bbx_log(BBX_LOG_LEVEL_ERROR, "Invalid dpi argument \"%s\"\n", optarg); exit(EXIT_FAILURE); } break; diff --git a/unl0kr/config.c b/unl0kr/config.c index ea81ddc..9ac83b6 100644 --- a/unl0kr/config.c +++ b/unl0kr/config.c @@ -95,7 +95,7 @@ static void find_files(const char *path, char ***found, int *num_found) { /* Open directory */ DIR *d = opendir(path); if (!d) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not read contents of folder %s", path); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not read contents of folder %s", path); return; } @@ -110,7 +110,7 @@ static void find_files(const char *path, char ***found, int *num_found) { /* Grow output array */ char **tmp = realloc(*found, (*num_found + 1) * sizeof(char *)); if (!tmp) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not reallocate memory for configuration file paths"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not reallocate memory for configuration file paths"); break; } *found = tmp; @@ -122,7 +122,7 @@ static void find_files(const char *path, char ***found, int *num_found) { /* Allocate memory for full path */ char *found_path = malloc(path_length + name_length + 2); /* +1 for path separator and null terminator, respectively */ if (!found_path) { - bb_log(BB_LOG_LEVEL_ERROR, "Could not allocate memory for configuration file path"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not allocate memory for configuration file path"); break; } @@ -189,14 +189,14 @@ static int parsing_handler(void* user_data, const char* section, const char* key } } else if (strcmp(section, "theme") == 0) { if (strcmp(key, "default") == 0) { - bb_themes_theme_id_t id = bb_themes_find_theme_with_name(value); - if (id != BB_THEMES_THEME_NONE) { + bbx_themes_theme_id_t id = bbx_themes_find_theme_with_name(value); + if (id != BBX_THEMES_THEME_NONE) { opts->theme.default_id = id; return 1; } } else if (strcmp(key, "alternate") == 0) { - bb_themes_theme_id_t id = bb_themes_find_theme_with_name(value); - if (id != BB_THEMES_THEME_NONE) { + bbx_themes_theme_id_t id = bbx_themes_find_theme_with_name(value); + if (id != BBX_THEMES_THEME_NONE) { opts->theme.alternate_id = id; return 1; } @@ -231,7 +231,7 @@ static int parsing_handler(void* user_data, const char* section, const char* key } } - bb_log(BB_LOG_LEVEL_ERROR, "Ignoring invalid config value \"%s\" for key \"%s\" in section \"%s\"", value, key, section); + bbx_log(BBX_LOG_LEVEL_ERROR, "Ignoring invalid config value \"%s\" for key \"%s\" in section \"%s\"", value, key, section); return 1; /* Return 1 (true) so that we can use the return value of ini_parse exclusively for file-level errors (e.g. file not found) */ } @@ -263,8 +263,8 @@ void ul_config_init_opts(ul_config_opts *opts) { opts->keyboard.popovers = true; opts->textarea.obscured = true; opts->textarea.bullet = LV_SYMBOL_BULLET; - opts->theme.default_id = BB_THEMES_THEME_BREEZY_DARK; - opts->theme.alternate_id = BB_THEMES_THEME_BREEZY_LIGHT; + opts->theme.default_id = BBX_THEMES_THEME_BREEZY_DARK; + opts->theme.alternate_id = BBX_THEMES_THEME_BREEZY_LIGHT; opts->input.keyboard = true; opts->input.pointer = true; opts->input.touchscreen = true; @@ -297,8 +297,8 @@ void ul_config_parse_files(const char **files, int num_files, ul_config_opts *op } void ul_config_parse_file(const char *path, ul_config_opts *opts) { - bb_log(BB_LOG_LEVEL_VERBOSE, "Parsing config file %s", path); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "Parsing config file %s", path); if (ini_parse(path, parsing_handler, opts) != 0) { - bb_log(BB_LOG_LEVEL_ERROR, "Ignoring invalid config file %s", path); + bbx_log(BBX_LOG_LEVEL_ERROR, "Ignoring invalid config file %s", path); } } diff --git a/unl0kr/config.h b/unl0kr/config.h index 30a251e..e4ff5b9 100644 --- a/unl0kr/config.h +++ b/unl0kr/config.h @@ -55,9 +55,9 @@ typedef struct { */ typedef struct { /* Default theme */ - bb_themes_theme_id_t default_id; + bbx_themes_theme_id_t default_id; /* Alternate theme */ - bb_themes_theme_id_t alternate_id; + bbx_themes_theme_id_t alternate_id; } ul_config_opts_theme; /** diff --git a/unl0kr/lv_conf.h b/unl0kr/lv_conf.h index dc8657d..069a993 100644 --- a/unl0kr/lv_conf.h +++ b/unl0kr/lv_conf.h @@ -286,10 +286,10 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ /*Optionally declare custom fonts here. *You can use these fonts as default font too and they will be available globally. *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ -#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bb_font_32) +#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32) /*Always set a default font*/ -#define LV_FONT_DEFAULT &bb_font_32 +#define LV_FONT_DEFAULT &bbx_font_32 /*Enable handling large font and/or fonts with a lot of characters. *The limit depends on the font size, font face and bpp. diff --git a/unl0kr/main.c b/unl0kr/main.c index 3321919..b1b11bb 100644 --- a/unl0kr/main.c +++ b/unl0kr/main.c @@ -78,7 +78,7 @@ static void set_theme(bool is_alternate); * * @param is_alternate true if the alternate theme should be selected, false if the default theme should be selected */ -static const bb_theme * get_theme(bool is_alternate); +static const bbx_theme * get_theme(bool is_alternate); /** * Handle LV_EVENT_CLICKED events from the show/hide password toggle button. @@ -220,11 +220,11 @@ static void toggle_theme(void) { } static void set_theme(bool is_alternate) { - bb_theme_apply(get_theme(is_alternate)); + bbx_theme_apply(get_theme(is_alternate)); } -static const bb_theme * get_theme(bool is_alternate) { - return bb_themes_themes[is_alternate ? conf_opts.theme.alternate_id : conf_opts.theme.default_id]; +static const bbx_theme * get_theme(bool is_alternate) { + return bbx_themes_themes[is_alternate ? conf_opts.theme.alternate_id : conf_opts.theme.default_id]; } static void toggle_pw_btn_clicked_cb(lv_event_t *event) { @@ -363,11 +363,11 @@ int main(int argc, char *argv[]) { /* Set up log level */ if (cli_opts.verbose) { - bb_log_set_level(BB_LOG_LEVEL_VERBOSE); + bbx_log_set_level(BBX_LOG_LEVEL_VERBOSE); } /* Announce ourselves */ - bb_log(BB_LOG_LEVEL_VERBOSE, "unl0kr %s", UL_VERSION); + bbx_log(BBX_LOG_LEVEL_VERBOSE, "unl0kr %s", UL_VERSION); /* Parse config files */ ul_config_init_opts(&conf_opts); @@ -385,7 +385,7 @@ int main(int argc, char *argv[]) { /* Initialise LVGL and set up logging callback */ lv_init(); - lv_log_register_print_cb(bb_log_print_cb); + lv_log_register_print_cb(bbx_log_print_cb); /* Start the tick thread */ pthread_t ticker; @@ -410,7 +410,7 @@ int main(int argc, char *argv[]) { break; #endif /* LV_USE_LINUX_DRM */ default: - bb_log(BB_LOG_LEVEL_ERROR, "Unable to find suitable backend"); + bbx_log(BBX_LOG_LEVEL_ERROR, "Unable to find suitable backend"); exit(EXIT_FAILURE); } @@ -430,13 +430,13 @@ int main(int argc, char *argv[]) { /* Prepare for routing physical keyboard input into the textarea */ lv_group_t *keyboard_input_group = lv_group_create(); - bb_indev_set_keyboard_input_group(keyboard_input_group); + bbx_indev_set_keyboard_input_group(keyboard_input_group); /* Start input device monitor and auto-connect available devices */ - bb_indev_start_monitor_and_autoconnect(conf_opts.input.keyboard, conf_opts.input.pointer, conf_opts.input.touchscreen); + bbx_indev_start_monitor_and_autoconnect(conf_opts.input.keyboard, conf_opts.input.pointer, conf_opts.input.touchscreen); /* Hide the on-screen keyboard by default if a physical keyboard is connected */ - if (conf_opts.keyboard.autohide && bb_indev_is_keyboard_connected()) { + if (conf_opts.keyboard.autohide && bbx_indev_is_keyboard_connected()) { is_keyboard_hidden = true; } @@ -462,7 +462,7 @@ int main(int argc, char *argv[]) { /* Header flexbox */ lv_obj_t *header = lv_obj_create(container); - lv_obj_add_flag(header, BB_WIDGET_HEADER); + lv_obj_add_flag(header, BBX_WIDGET_HEADER); lv_theme_apply(header); /* Force re-apply theme after setting flag so that the widget can be identified */ lv_obj_set_flex_flow(header, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(header, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); @@ -561,7 +561,7 @@ int main(int argc, char *argv[]) { lv_obj_add_event_cb(keyboard, keyboard_ready_cb, LV_EVENT_READY, NULL); lv_obj_set_pos(keyboard, 0, is_keyboard_hidden ? keyboard_height : 0); lv_obj_set_size(keyboard, hor_res, keyboard_height); - bb_theme_prepare_keyboard(keyboard); + bbx_theme_prepare_keyboard(keyboard); /* Apply textarea options */ set_password_obscured(conf_opts.textarea.obscured); diff --git a/unl0kr/terminal.c b/unl0kr/terminal.c index 78b6def..4cff459 100644 --- a/unl0kr/terminal.c +++ b/unl0kr/terminal.c @@ -53,7 +53,7 @@ static bool reopen_current_terminal(void) { current_fd = open("/dev/tty0", O_RDWR); if (current_fd < 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not open /dev/tty0"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not open /dev/tty0"); return false; } @@ -84,29 +84,29 @@ void ul_terminal_prepare_current_terminal(bool enable_graphics_mode, bool disabl reopen_current_terminal(); if (current_fd < 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not prepare current terminal"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not prepare current terminal"); return; } /* Disable terminal keyboard input (hides entered text) */ if (disable_keyboard_input) { if (ioctl(current_fd, KDGKBMODE, &original_kb_mode) != 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not get terminal keyboard mode"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not get terminal keyboard mode"); } if (ioctl(current_fd, KDSKBMODE, K_OFF) != 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not set terminal keyboard mode to off"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not set terminal keyboard mode to off"); } } /* Switch terminal into graphics mode (hides command prompt) */ if (enable_graphics_mode) { if (ioctl(current_fd, KDGETMODE, &original_mode) != 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not get terminal mode"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not get terminal mode"); } if (ioctl(current_fd, KDSETMODE, KD_GRAPHICS) != 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not set terminal mode to graphics"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not set terminal mode to graphics"); } } } @@ -114,18 +114,18 @@ void ul_terminal_prepare_current_terminal(bool enable_graphics_mode, bool disabl void ul_terminal_reset_current_terminal(void) { /* If we haven't previously opened the current terminal, exit */ if (current_fd < 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not reset current terminal"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not reset current terminal"); return; } /* Reset terminal mode if needed */ if (original_mode >= 0 && ioctl(current_fd, KDSETMODE, original_mode) != 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not reset terminal mode"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not reset terminal mode"); } /* Reset terminal keyboard mode if needed */ if (original_kb_mode >= 0 && ioctl(current_fd, KDSKBMODE, original_kb_mode) != 0) { - bb_log(BB_LOG_LEVEL_WARNING, "Could not reset terminal keyboard mode"); + bbx_log(BBX_LOG_LEVEL_WARNING, "Could not reset terminal keyboard mode"); } close_current_terminal();