BigW Consortium Gitlab

Commit ca11c7ff by Gabor

Update conf. file template

parent b23b9866
......@@ -556,18 +556,6 @@ static lv_action_res_t lv_app_menu_rel_action(lv_obj_t * app_btn, lv_dispi_t * d
elem = lv_list_add(app_list, NULL, (*dsc)->name, lv_app_menu_elem_rel_action);
lv_obj_set_free_p(elem, *dsc);
lv_obj_set_opa(elem, app_style.menu_btn_opa);
elem = lv_list_add(app_list, NULL, (*dsc)->name, lv_app_menu_elem_rel_action);
lv_obj_set_free_p(elem, *dsc);
lv_obj_set_opa(elem, app_style.menu_btn_opa);
elem = lv_list_add(app_list, NULL, (*dsc)->name, lv_app_menu_elem_rel_action);
lv_obj_set_free_p(elem, *dsc);
lv_obj_set_opa(elem, app_style.menu_btn_opa);
elem = lv_list_add(app_list, NULL, (*dsc)->name, lv_app_menu_elem_rel_action);
lv_obj_set_free_p(elem, *dsc);
lv_obj_set_opa(elem, app_style.menu_btn_opa);
}
}
}
......
......@@ -3,12 +3,12 @@
*
*/
#if 0 /*Remove this to enable the content (Delete the last #endif too!)*/
#ifndef LV_CONF_H
#define LV_CONF_H
#if 0 /*Remove this to enable the content*/
/*=====================
/*===================
Graphical settings
*=====================*/
......@@ -18,71 +18,75 @@
#define LV_VER_RES (320 * LV_DOWNSCALE)
/* Buffered rendering: >= LV_DOWNSCALE * LV_HOR_RES or 0 to disable buffering*/
#define LV_VDB_SIZE (LV_HOR_RES * LV_VER_RES / 20)
#define LV_VDB_SIZE (LV_HOR_RES * (LV_VER_RES / 20))
/* Anti-aliasing with downscaling everything
* 1: disabled
* 2: 2x anti-alias -> half size
* 4: 4x anti-alias -> quarter size */
#define LV_DOWNSCALE 2
#define LV_DOWNSCALE 2
#define LV_UPSCALE_FONT 0 /*Scale up fonts to compensate LV_DOWNSCALE*/
#define LV_UPSCALE_MAP 0 /*Scale up maps (e.g. images) elements to compensate LV_DOWNSCALE*/
#define LV_UPSCALE_SYTLE 1 /*Scale up default styles to compensate LV_DOWNSCALE*/
#define LV_REFR_PERIOD 50 /*Screen refresh period in milliseconds*/
#define LV_UPSCALE_MAP 0 /*Scale up maps (e.g. images) elements to compensate LV_DOWNSCALE*/
#define LV_REFR_PERIOD 40 /*Screen refresh period in milliseconds*/
#define LV_INV_FIFO_SIZE 32 /*The average number of objects on a screen */
/*=================
Misc. setting
*=================*/
/*Display Input settings*/
#define LV_DISPI_READ_PERIOD 50 /*Input device read period milliseconds*/
#define LV_DISPI_TP_MARKER 0 /*Mark the pressed points*/
#define LV_DISPI_DRAG_LIMIT 10 /*Drag threshold in pixels */
#define LV_DISPI_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
#define LV_DISPI_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
#define LV_DISPI_READ_PERIOD 50 /*Input device read period milliseconds*/
#define LV_DISPI_TP_MARKER 0 /*Mark the pressed points*/
#define LV_DISPI_DRAG_LIMIT 10 /*Drag threshold in pixels */
#define LV_DISPI_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
#define LV_DISPI_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
#define LV_DISPI_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
/*Coordinates*/
#define LV_CORD_TYPE int16_t /*Coordinate type*/
#define LV_CORD_TYPE int16_t /*Coordinate type*/
#define LV_CORD_MAX (32000)
#define LV_CORD_MIN (-32000)
/*Fonts and texts*/
#define USE_FONT_DEJAVU_8 1
#define USE_FONT_DEJAVU_10 1
#define USE_FONT_DEJAVU_14 1
#define USE_FONT_DEJAVU_20 1
#define USE_FONT_DEJAVU_30 1
#define USE_FONT_DEJAVU_40 1
#define USE_FONT_DEJAVU_60 1
#define USE_FONT_DEJAVU_80 1
#define LV_FONT_DEFAULT FONT_DEJAVU_40 /*Always set a default font*/
#define LV_TXT_BREAK_CHARS " ,.;-" /*Can break texts on these chars*/
#define LV_FONT_DEFAULT FONT_DEJAVU_30 /*Always set a default font*/
#define LV_TXT_BREAK_CHARS " ,.;-" /*Can break texts on these chars*/
/*lv_obj (base object) settings*/
#define LV_OBJ_FREE_P 1 /*Enable the free pointer attribute*/
#define LV_OBJ_DEF_SCR_COLOR COLOR_WHITE /*Default screen color*/
#define LV_OBJ_FREE_P 1 /*Enable the free pointer attribute*/
#define LV_OBJ_DEF_SCR_COLOR COLOR_SILVER /*Default screen color*/
/*Others*/
#define LV_COLOR_TRANSP COLOR_LIME
/*==================
* LV OBJ X USAGE
* ================*/
#define USE_LV_RECT 1
#define USE_LV_LABEL 1
#if USE_LV_LABEL != 0
#define LV_LABEL_SCROLL_SPEED (25 * LV_DOWNSCALE) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL' mode*/
#define LV_LABEL_SCROLL_SPEED (25 * LV_DOWNSCALE) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL' mode*/
#define LV_LABEL_SCROLL_SPEED_VER (10 * LV_DOWNSCALE) /*Ver. scroll speed if hor. scroll is applied too*/
#define LV_LABEL_SCROLL_PLAYBACK_PAUSE 500 /*Wait before the scroll turns back in ms*/
#define LV_LABEL_SCROLL_REPEAT_PAUSE 500 /*Wait before the scroll begins again in ms*/
#define LV_LABEL_SCROLL_PLAYBACK_PAUSE 500 /*Wait before the scroll turns back in ms*/
#define LV_LABEL_SCROLL_REPEAT_PAUSE 500 /*Wait before the scroll begins again in ms*/
#endif
#define USE_LV_BTN 1
#define USE_LV_LINE 1
#define USE_LV_IMG 1
#define USE_LV_IMG 1 /*In misc_conf.h USE_FSINT 1 and USE_UFS 1 are required*/
#if USE_LV_IMG != 0
#define LV_IMG_COLOR_TRANSP COLOR_LIME
#define LV_IMG_DEF_WALLPAPER img_bubbles_vflip
//#define LV_IMG_DEF_WALLPAPER img_wallpaper_var /*Comment this line to NOT use wallpaper*/
#endif /*USE_LV_IMG*/
#define USE_LV_PAGE 1
......@@ -90,45 +94,85 @@
#define LV_PAGE_ANIM_FOCUS_TIME 300 /*List focus animation time [ms] (0: turn off the animation)*/
#endif
#define USE_LV_LED 1
#define USE_LV_LIST 1
#define USE_LV_CB 1
#define USE_LV_PB 1
#define USE_LV_PB 1
#define USE_LV_CB 1
#define USE_LV_LED 1
#define USE_LV_LIST 1
#define USE_LV_CHARTBG 1
#define USE_LV_BTNM 1
#define USE_LV_CHART 1
#define USE_LV_WIN 1
#define USE_LV_TA 1
#if USE_LV_TA != 0
#define LV_TA_MAX_LENGTH 8
#define LV_TA_CUR_BLINK_TIME 400 /*ms*/
#endif
#define USE_LV_TA 1
#define USE_LV_BTNM 1
#define USE_LV_MBOX 1
#define USE_LV_WIN 1
#define USE_LV_MBOX 1
/*==================
* LV APP SETTINGS
* =================*/
#define LV_APP_SC_WIDTH (LV_HOR_RES / 4)
#define LV_APP_SC_HEIGHT (LV_VER_RES / 3)
#define LV_APP_USE_INTERNAL_ICONS 1
#define LV_APP_ANIM_WIN_OPEN 300 /*Animation time in milliseconds (0: turn off animation)*/
#define LV_APP_ANIM_WIN_OPEN_COMPLEX 1 /*1: Make more complex animation on window open*/
#define LV_APP_ANIM_WIN_MINIM 300 /*Animation time in milliseconds (0: turn off animation)*/
#define LV_APP_ANIM_WIN_CLOSE 300 /*Animation time in milliseconds (0: turn off animation)*/
/* If the internal icons are not used
* set others */
#if LV_APP_USE_INTERNAL_ICONS == 0
#endif
/*Enable the application system*/
#define LV_APP_ENABLE 1
#if LV_APP_ENABLE != 0
#define LV_APP_SC_WIDTH (LV_HOR_RES / 4) /*Shortcut width*/
#define LV_APP_SC_HEIGHT (LV_VER_RES / 3) /*Shortcut height*/
#define LV_APP_FONT_SMALL FONT_DEJAVU_20
#define LV_APP_FONT_MEDIUM FONT_DEJAVU_30
#define LV_APP_FONT_LARGE FONT_DEJAVU_40
/* Internal icons:
* 0: Do not use internal icons (img_close, img_add etc. icons have to be provided)
* 1: Reserved
* 2: Use double sized icons
* 4: Reserved */
#define LV_APP_USE_INTERNAL_ICONS 2
/*Animation settings*/
#define LV_APP_EFFECT_OPA 1 /*Enable the opacity in the application style (can be modified)*/
#define LV_APP_EFFECT_ANIM 1 /*Enable the animation of the applications*/
#define LV_APP_EFFECT_OPA_ANIM 1 /*Enable the using opacity in the application animations*/
#define LV_APP_ANIM_WIN 200 /*Animation time in milliseconds (0: turn off animation)*/
#define LV_APP_ANIM_SC 200 /*Animation time in milliseconds (0: turn off animation)*/
#define LV_APP_ANIM_NOTICE 300 /*How fast animate out a notice [ms]*/
/* App. utility settings */
#define LV_APP_NOTICE_SHOW_TIME 4000 /*Notices will be shown for this time [ms]*/
/*==================
* LV APP X USAGE
* ================*/
#define USE_LV_APP_EXAMPLE 1
#define USE_LV_APP_SYSMON 1
#if USE_LV_APP_SYSMON != 0
#define LV_APP_SYSMON_REFR_TIME 500 /*[ms]*/
#define LV_APP_SYSMON_PNUM 64
#define LV_APP_SYSMON_MEM_WARN (4 * 1024)
#define LV_APP_SYSMON_FRAG_WARN (70) /*[%]*/
#define LV_APP_SYSMON_DEFRAG_PERIOD (5000) /*[%]*/
#endif /*USE_LV_APP_SYSMON != 0*/
#define USE_LV_APP_TERMINAL 1
#if USE_LV_APP_TERMINAL != 0
#define LV_APP_TERMINAL_LENGTH 512 /*Memory of the terminal*/
#endif /*USE_LV_APP_TERMINAL != 0*/
#endif /*LV_APP_ENABLE != 0*/
#endif /*LV_CONF_H*/
#endif /*Remove this to enable the content*/
#endif
......@@ -58,24 +58,35 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
{
/*Create the ancestor template*/
/*TODO modify it to the ancestor create function */
lv_obj_t * new_templ = lv_obj_create(par, copy);
lv_obj_t * new_templ = lv_ANCESTOR_create(par, copy);
dm_assert(new_templ);
/*Allocate the template type specific extended data*/
lv_templ_ext_t * ext = lv_obj_alloc_ext(new_templ, sizeof(lv_templ_ext_t));
dm_assert(ext);
/*Initialize the allocated 'ext' */
/*The signal and design functions are not copied so set them here*/
lv_obj_set_signal_f(new_templ, lv_templ_signal);
lv_obj_set_design_f(new_templ, lv_templ_design);
/*Init the new template template*/
if(copy == NULL) {
lv_obj_set_style(new_templ, lv_templs_get(LV_TEMPLS_DEF, NULL));
}
/*Copy an existing template*/
else {
lv_templ_ext_t * copy_ext = lv_obj_get_ext(copy);
/*Set the style of 'copy' and isolate it if it is necessary*/
if(lv_obj_get_style_iso(new_templ) == false) {
lv_obj_set_style(new_templ, lv_obj_get_style(copy));
} else {
lv_obj_set_style(new_templ, lv_obj_get_style(copy));
lv_obj_iso_style(new_templ, sizeof(lv_templs_t));
}
}
return new_templ;
......@@ -94,7 +105,7 @@ bool lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param)
/* Include the ancient signal function */
/* TODO update it to the ancestor's signal function*/
valid = lv_obj_signal(templ, sign, param);
valid = lv_ANCESTOR_signal(templ, sign, param);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
......@@ -171,20 +182,25 @@ lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy)
*/
static bool lv_templ_design(lv_obj_t * templ, const area_t * mask, lv_design_mode_t mode)
{
/*Return false if the object is not covers the mask_p area*/
if(mode == LV_DESIGN_COVER_CHK) {
/*Return false if the object is not covers the mask_p area*/
return false;
}
/*Draw the object*/
else if(mode == LV_DESIGN_DRAW_MAIN) {
}
/*Post draw when the children are drawn*/
else if(mode == LV_DESIGN_DRAW_POST) {
/*Draw the object*/
}
return true;
}
/**
* Initialize the template styles
* Initialize the built-in template styles
*/
static void lv_temps_init(void)
{
......
......@@ -17,6 +17,8 @@
/*********************
* DEFINES
*********************/
#define LV_TA_DEF_WIDTH (120 * LV_DOWNSCALE)
#define LV_TA_DEF_HEIGHT (80 * LV_DOWNSCALE)
/**********************
* TYPEDEFS
......@@ -89,7 +91,7 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy)
lv_page_glue_obj(ext->label, true);
lv_obj_set_click(ext->label, false);
lv_obj_set_style(new_ta, lv_tas_get(LV_TAS_DEF, NULL));
lv_obj_set_size_us(new_ta, LV_TA_DEF_WIDTH, LV_TA_DEF_HEIGHT);
lv_obj_set_size(new_ta, LV_TA_DEF_WIDTH, LV_TA_DEF_HEIGHT);
}
/*Copy an existing object*/
else {
......@@ -183,10 +185,13 @@ void lv_ta_add_char(lv_obj_t * ta, char c)
{
lv_ta_ext_t * ext = lv_obj_get_ext(ta);
/*Insert the character*/
char buf[LV_TA_MAX_LENGTH];
const char * label_txt = lv_label_get_text(ext->label);
/*Test the new length: txt length + 1 (closing'\0') + 1 (c character)*/
if((strlen(label_txt) + 2) > LV_TA_MAX_LENGTH) return;
char buf[LV_TA_MAX_LENGTH];
/*Insert the character*/
memcpy(buf, label_txt, ext->cursor_pos);
buf[ext->cursor_pos] = c;
memcpy(buf+ext->cursor_pos+1, label_txt+ext->cursor_pos, strlen(label_txt) - ext->cursor_pos + 1);
......@@ -210,15 +215,19 @@ void lv_ta_add_text(lv_obj_t * ta, const char * txt)
{
lv_ta_ext_t * ext = lv_obj_get_ext(ta);
/*Insert the text*/
char buf[LV_TA_MAX_LENGTH];
const char * label_txt = lv_label_get_text(ext->label);
uint16_t label_len = strlen(label_txt);
uint16_t txt_len = strlen(txt);
uint16_t label_len = strlen(label_txt);
uint16_t txt_len = strlen(txt);
/*Test the new length (+ 1 for the closing '\0')*/
if((label_len + txt_len + 1) > LV_TA_MAX_LENGTH) return;
/*Insert the text*/
char buf[LV_TA_MAX_LENGTH];
memcpy(buf, label_txt, ext->cursor_pos);
memcpy(buf+ext->cursor_pos, txt, txt_len);
memcpy(buf+ext->cursor_pos + txt_len, label_txt+ext->cursor_pos, label_len - ext->cursor_pos + 1);
memcpy(buf + ext->cursor_pos, txt, txt_len);
memcpy(buf + ext->cursor_pos + txt_len, label_txt+ext->cursor_pos, label_len - ext->cursor_pos + 1);
/*Refresh the label*/
lv_label_set_text(ext->label, buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment