Update LVGL to 9.2.2
110
unl0kr/lv_conf.defaults
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Manual post-processing steps for the generated lv_conf.h
|
||||
# 1. Comment LV_USE_LINUX_DRM (handled by meson.build)
|
||||
# 2. Remove LV_BIG_ENDIAN_SYSTEM (handled by meson.build)
|
||||
# 3. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py)
|
||||
|
||||
LV_COLOR_DEPTH 32
|
||||
LV_USE_DRAW_SW 1
|
||||
LV_DRAW_SW_COMPLEX 1
|
||||
LV_DRAW_SW_SUPPORT_RGB565 0
|
||||
LV_DRAW_SW_SUPPORT_RGB565A8 0
|
||||
LV_DRAW_SW_SUPPORT_RGB888 1
|
||||
LV_DRAW_SW_SUPPORT_XRGB8888 1
|
||||
LV_DRAW_SW_SUPPORT_ARGB8888 1
|
||||
LV_DRAW_SW_SUPPORT_L8 0
|
||||
LV_DRAW_SW_SUPPORT_AL88 0
|
||||
LV_DRAW_SW_SUPPORT_A8 0
|
||||
LV_DRAW_SW_SUPPORT_I1 0
|
||||
|
||||
LV_USE_LOG 1
|
||||
LV_LOG_LEVEL LV_LOG_LEVEL_WARN
|
||||
LV_USE_PRIVATE_API 1
|
||||
|
||||
LV_FONT_MONTSERRAT_8 0
|
||||
LV_FONT_MONTSERRAT_10 0
|
||||
LV_FONT_MONTSERRAT_12 0
|
||||
LV_FONT_MONTSERRAT_14 0
|
||||
LV_FONT_MONTSERRAT_16 0
|
||||
LV_FONT_MONTSERRAT_18 0
|
||||
LV_FONT_MONTSERRAT_20 0
|
||||
LV_FONT_MONTSERRAT_22 0
|
||||
LV_FONT_MONTSERRAT_24 0
|
||||
LV_FONT_MONTSERRAT_26 0
|
||||
LV_FONT_MONTSERRAT_28 0
|
||||
LV_FONT_MONTSERRAT_30 0
|
||||
LV_FONT_MONTSERRAT_32 0
|
||||
LV_FONT_MONTSERRAT_34 0
|
||||
LV_FONT_MONTSERRAT_36 0
|
||||
LV_FONT_MONTSERRAT_38 0
|
||||
LV_FONT_MONTSERRAT_40 0
|
||||
LV_FONT_MONTSERRAT_42 0
|
||||
LV_FONT_MONTSERRAT_44 0
|
||||
LV_FONT_MONTSERRAT_46 0
|
||||
LV_FONT_MONTSERRAT_48 0
|
||||
LV_FONT_MONTSERRAT_28_COMPRESSED 0
|
||||
LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0
|
||||
LV_FONT_SIMSUN_14_CJK 0
|
||||
LV_FONT_SIMSUN_16_CJK 0
|
||||
LV_FONT_UNSCII_8 0
|
||||
LV_FONT_UNSCII_16 0
|
||||
|
||||
#LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)
|
||||
LV_FONT_DEFAULT &bbx_font_32
|
||||
|
||||
LV_WIDGETS_HAS_DEFAULT_VALUE 0
|
||||
LV_USE_ANIMIMG 0
|
||||
LV_USE_ARC 0
|
||||
LV_USE_BAR 0
|
||||
LV_USE_BUTTON 1
|
||||
LV_USE_BUTTONMATRIX 1
|
||||
LV_USE_CALENDAR 0
|
||||
LV_USE_CANVAS 0
|
||||
LV_USE_CHART 0
|
||||
LV_USE_CHECKBOX 0
|
||||
LV_USE_DROPDOWN 1
|
||||
LV_USE_IMAGE 1
|
||||
LV_USE_IMAGEBUTTON 0
|
||||
LV_USE_KEYBOARD 1
|
||||
LV_USE_LABEL 1
|
||||
LV_LABEL_TEXT_SELECTION 0
|
||||
LV_LABEL_LONG_TXT_HINT 0
|
||||
LV_USE_LED 0
|
||||
LV_USE_LINE 0
|
||||
LV_USE_LIST 0
|
||||
LV_USE_LOTTIE 0
|
||||
LV_USE_MENU 0
|
||||
LV_USE_MSGBOX 1
|
||||
LV_USE_ROLLER 0
|
||||
LV_USE_SCALE 0
|
||||
LV_USE_SLIDER 0
|
||||
LV_USE_SPAN 0
|
||||
LV_USE_SPINBOX 0
|
||||
LV_USE_SPINNER 0
|
||||
LV_USE_SWITCH 0
|
||||
LV_USE_TEXTAREA 1
|
||||
LV_TEXTAREA_DEF_PWD_SHOW_TIME 0 /*ms*/
|
||||
LV_USE_TABLE 0
|
||||
LV_USE_TABVIEW 0
|
||||
LV_USE_TILEVIEW 0
|
||||
LV_USE_WIN 0
|
||||
|
||||
LV_USE_THEME_DEFAULT 0
|
||||
LV_USE_THEME_SIMPLE 0
|
||||
LV_USE_THEME_MONO 0
|
||||
|
||||
LV_USE_FLEX 1
|
||||
LV_USE_GRID 0
|
||||
|
||||
LV_USE_LINUX_FBDEV 1
|
||||
LV_LINUX_FBDEV_BSD 0
|
||||
LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
|
||||
|
||||
LV_USE_LINUX_DRM 0
|
||||
|
||||
LV_USE_LIBINPUT 1
|
||||
LV_LIBINPUT_BSD 0
|
||||
LV_LIBINPUT_XKB 1
|
||||
|
||||
LV_BUILD_EXAMPLES 0
|
||||
1200
unl0kr/lv_conf.h
|
|
@ -52,11 +52,6 @@ int32_t content_pad_bottom_without_kb;
|
|||
* Static prototypes
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides the number of milliseconds for LVGL timers
|
||||
*/
|
||||
static uint32_t millis();
|
||||
|
||||
/**
|
||||
* Handle LV_EVENT_CLICKED events from the theme toggle button.
|
||||
*
|
||||
|
|
@ -203,13 +198,6 @@ static void sigaction_handler(int signum);
|
|||
* Static functions
|
||||
*/
|
||||
|
||||
|
||||
static uint32_t millis() {
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
|
||||
}
|
||||
|
||||
static void toggle_theme_btn_clicked_cb(lv_event_t *event) {
|
||||
LV_UNUSED(event);
|
||||
toggle_theme();
|
||||
|
|
@ -335,8 +323,8 @@ static void shutdown_mbox_declined_cb(lv_event_t *event) {
|
|||
static void keyboard_value_changed_cb(lv_event_t *event) {
|
||||
lv_obj_t *kb = lv_event_get_target(event);
|
||||
|
||||
uint16_t btn_id = lv_btnmatrix_get_selected_btn(kb);
|
||||
if (btn_id == LV_BTNMATRIX_BTN_NONE) {
|
||||
uint16_t btn_id = lv_buttonmatrix_get_selected_button(kb);
|
||||
if (btn_id == LV_BUTTONMATRIX_BUTTON_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -362,7 +350,7 @@ static void print_password_and_exit(lv_obj_t *textarea) {
|
|||
|
||||
/* Clear the screen so that when the password field was unobscured, it cannot
|
||||
* leak via stale display buffers after we've exited */
|
||||
lv_obj_t *rect = lv_obj_create(lv_scr_act());
|
||||
lv_obj_t *rect = lv_obj_create(lv_screen_active());
|
||||
lv_obj_set_size(rect, LV_PCT(100), LV_PCT(100));
|
||||
lv_obj_set_pos(rect, 0, 0);
|
||||
lv_obj_set_style_bg_opa(rect, LV_OPA_COVER, LV_PART_MAIN);
|
||||
|
|
@ -427,7 +415,6 @@ int main(int argc, char *argv[]) {
|
|||
/* Initialise LVGL and set up logging callback */
|
||||
lv_init();
|
||||
lv_log_register_print_cb(bbx_log_print_cb);
|
||||
lv_tick_set_cb(millis);
|
||||
|
||||
/* Initialise display */
|
||||
lv_display_t *disp = NULL;
|
||||
|
|
@ -473,7 +460,7 @@ int main(int argc, char *argv[]) {
|
|||
/* Override display properties with command line options if necessary */
|
||||
lv_display_set_offset(disp, cli_opts.x_offset, cli_opts.y_offset);
|
||||
if (cli_opts.hor_res > 0 || cli_opts.ver_res > 0) {
|
||||
lv_display_set_physical_resolution(disp, lv_disp_get_hor_res(disp), lv_disp_get_ver_res(disp));
|
||||
lv_display_set_physical_resolution(disp, lv_display_get_horizontal_resolution(disp), lv_display_get_vertical_resolution(disp));
|
||||
lv_display_set_resolution(disp, cli_opts.hor_res, cli_opts.ver_res);
|
||||
}
|
||||
if (cli_opts.dpi > 0) {
|
||||
|
|
@ -499,13 +486,15 @@ int main(int argc, char *argv[]) {
|
|||
set_theme(is_alternate_theme);
|
||||
|
||||
/* Figure out a few numbers for sizing and positioning */
|
||||
const int32_t hor_res = lv_disp_get_hor_res(disp);
|
||||
const int32_t ver_res = lv_disp_get_ver_res(disp);
|
||||
const int32_t hor_res = lv_display_get_horizontal_resolution(disp);
|
||||
const int32_t ver_res = lv_display_get_vertical_resolution(disp);
|
||||
const int32_t keyboard_height = ver_res > hor_res ? ver_res / 2.5 : ver_res / 1.8; /* Height for 5 rows */
|
||||
|
||||
/* Prevent scrolling when keyboard is off-screen */
|
||||
lv_obj_t *screen = lv_screen_active();
|
||||
lv_obj_clear_flag(screen, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_theme_apply(screen);
|
||||
lv_obj_set_flex_flow(screen, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_remove_flag(screen, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
/* Header flexbox */
|
||||
lv_obj_t *header = lv_obj_create(screen);
|
||||
|
|
@ -515,14 +504,14 @@ int main(int argc, char *argv[]) {
|
|||
lv_obj_set_size(header, LV_PCT(100), LV_SIZE_CONTENT);
|
||||
|
||||
/* Theme switcher button */
|
||||
lv_obj_t *toggle_theme_btn = lv_btn_create(header);
|
||||
lv_obj_t *toggle_theme_btn = lv_button_create(header);
|
||||
lv_obj_add_event_cb(toggle_theme_btn, toggle_theme_btn_clicked_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_t *toggle_theme_btn_label = lv_label_create(toggle_theme_btn);
|
||||
lv_label_set_text(toggle_theme_btn_label, UL_SYMBOL_ADJUST);
|
||||
lv_obj_center(toggle_theme_btn_label);
|
||||
|
||||
/* Show / hide keyboard button */
|
||||
lv_obj_t *toggle_kb_btn = lv_btn_create(header);
|
||||
lv_obj_t *toggle_kb_btn = lv_button_create(header);
|
||||
lv_obj_add_event_cb(toggle_kb_btn, toggle_kb_btn_clicked_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_t *toggle_kb_btn_label = lv_label_create(toggle_kb_btn);
|
||||
lv_label_set_text(toggle_kb_btn_label, LV_SYMBOL_KEYBOARD);
|
||||
|
|
@ -540,7 +529,7 @@ int main(int argc, char *argv[]) {
|
|||
lv_obj_set_flex_grow(spacer, 1);
|
||||
|
||||
/* Shutdown button */
|
||||
lv_obj_t *shutdown_btn = lv_btn_create(header);
|
||||
lv_obj_t *shutdown_btn = lv_button_create(header);
|
||||
lv_obj_add_event_cb(shutdown_btn, shutdown_btn_clicked_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_t *shutdown_btn_label = lv_label_create(shutdown_btn);
|
||||
lv_label_set_text(shutdown_btn_label, LV_SYMBOL_POWER);
|
||||
|
|
@ -561,10 +550,17 @@ int main(int argc, char *argv[]) {
|
|||
lv_obj_set_flex_flow(container, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(container, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_size(container, LV_PCT(100), is_keyboard_hidden? content_height_without_kb : content_height_with_kb);
|
||||
lv_obj_set_style_pad_top(container, 10, LV_PART_MAIN);
|
||||
lv_obj_set_style_pad_left(container, 20, LV_PART_MAIN);
|
||||
lv_obj_set_style_pad_right(container, 20, LV_PART_MAIN);
|
||||
|
||||
int32_t content_pad_row = 10;
|
||||
|
||||
/* Message for a user */
|
||||
lv_obj_t *message_label;
|
||||
if (cli_opts.message) {
|
||||
lv_obj_set_style_pad_row(container, content_pad_row, LV_PART_MAIN);
|
||||
|
||||
/* lv_label does not support wrapping and scrolling simultaneously,
|
||||
so we place it in a scrollable container */
|
||||
lv_obj_t *message_container = lv_obj_create(container);
|
||||
|
|
@ -603,7 +599,7 @@ int main(int argc, char *argv[]) {
|
|||
const int32_t textarea_height = lv_obj_get_height(textarea);
|
||||
|
||||
/* Reveal / obscure password button */
|
||||
lv_obj_t *toggle_pw_btn = lv_btn_create(textarea_container);
|
||||
lv_obj_t *toggle_pw_btn = lv_button_create(textarea_container);
|
||||
lv_obj_set_size(toggle_pw_btn, textarea_height, textarea_height);
|
||||
lv_obj_t *toggle_pw_btn_label = lv_label_create(toggle_pw_btn);
|
||||
lv_obj_center(toggle_pw_btn_label);
|
||||
|
|
@ -612,12 +608,6 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
/* The bottom pad is used to center content when the keyboard is hidden */
|
||||
content_pad_bottom_with_kb = 20;
|
||||
int32_t content_pad_row = 10;
|
||||
|
||||
lv_obj_set_style_pad_top(container, 10, LV_PART_MAIN);
|
||||
lv_obj_set_style_pad_left(container, 20, LV_PART_MAIN);
|
||||
lv_obj_set_style_pad_right(container, 20, LV_PART_MAIN);
|
||||
lv_obj_set_style_pad_row(container, content_pad_row, LV_PART_MAIN);
|
||||
|
||||
int32_t content_native_height = textarea_height;
|
||||
if (cli_opts.message) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ deplibdrm = dependency('libdrm', required: get_option('with-drm'))
|
|||
if deplibdrm.found()
|
||||
unl0kr_dependencies += deplibdrm
|
||||
unl0kr_args += '-DLV_USE_LINUX_DRM=1'
|
||||
else
|
||||
unl0kr_args += '-DLV_USE_LINUX_DRM=0'
|
||||
endif
|
||||
|
||||
executable('unl0kr',
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |