Use bbx prefix for shared code
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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,
|
||||
};
|
@@ -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 */
|
Binary file not shown.
Before Width: | Height: | Size: 10 KiB |
@@ -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.
|
||||
|
@@ -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);
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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 */
|
||||
|
2
shared/cursor/package-lock.json
generated
2
shared/cursor/package-lock.json
generated
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "shared",
|
||||
"name": "cursor",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
@@ -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
|
||||
|
@@ -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*/
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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 */
|
||||
|
10
shared/log.c
10
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);
|
||||
}
|
||||
|
20
shared/log.h
20
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 */
|
||||
|
@@ -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;
|
||||
|
@@ -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 <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#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 */
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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 */
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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.
|
||||
|
@@ -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);
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user