Merge branch 'master' into dev-6.0

This commit is contained in:
Themba Dube
2019-02-13 18:20:06 -05:00
18 changed files with 145 additions and 107 deletions

View File

@@ -20,6 +20,10 @@
* DEFINES
*********************/
#if LV_INDEV_DRAG_THROW <= 0
#warning "LV_INDEV_DRAG_THROW must be greater than 0"
#endif
/**********************
* TYPEDEFS
**********************/

View File

@@ -38,9 +38,9 @@
/**********************
* STATIC PROTOTYPES
**********************/
static void refresh_childen_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff);
static void refresh_children_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff);
static void report_style_mod_core(void * style_p, lv_obj_t * obj);
static void refresh_childen_style(lv_obj_t * obj);
static void refresh_children_style(lv_obj_t * obj);
static void delete_children(lv_obj_t * obj);
static bool lv_obj_design(lv_obj_t * obj, const lv_area_t * mask_p, lv_design_mode_t mode);
static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
@@ -49,6 +49,8 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
* STATIC VARIABLES
**********************/
static bool _lv_initialized = false;
/**********************
* MACROS
**********************/
@@ -62,6 +64,10 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
*/
void lv_init(void)
{
/* Do nothing if already initialized */
if (_lv_initialized)
return;
LV_GC_ROOT(_lv_def_scr) = NULL;
LV_GC_ROOT(_lv_act_scr) = NULL;
LV_GC_ROOT(_lv_top_layer) = NULL;
@@ -111,7 +117,7 @@ void lv_init(void)
lv_indev_init();
#endif
_lv_initialized = true;
LV_LOG_INFO("lv_init ready");
}
@@ -545,7 +551,7 @@ void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
obj->coords.x2 += diff.x;
obj->coords.y2 += diff.y;
refresh_childen_position(obj, diff.x, diff.y);
refresh_children_position(obj, diff.x, diff.y);
/*Inform the object about its new coordinates*/
obj->signal_func(obj, LV_SIGNAL_CORD_CHG, &ori);
@@ -981,7 +987,7 @@ void lv_obj_set_style(lv_obj_t * obj, lv_style_t * style)
obj->style_p = style;
/*Send a signal about style change to every children with NULL style*/
refresh_childen_style(obj);
refresh_children_style(obj);
/*Notify the object about the style change too*/
lv_obj_refresh_style(obj);
@@ -1866,7 +1872,7 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
* @param x_diff x coordinate shift
* @param y_diff y coordinate shift
*/
static void refresh_childen_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff)
static void refresh_children_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff)
{
lv_obj_t * i;
LL_READ(obj->child_ll, i) {
@@ -1875,7 +1881,7 @@ static void refresh_childen_position(lv_obj_t * obj, lv_coord_t x_diff, lv_coord
i->coords.x2 += x_diff;
i->coords.y2 += y_diff;
refresh_childen_position(i, x_diff, y_diff);
refresh_children_position(i, x_diff, y_diff);
}
}
@@ -1889,7 +1895,7 @@ static void report_style_mod_core(void * style_p, lv_obj_t * obj)
lv_obj_t * i;
LL_READ(obj->child_ll, i) {
if(i->style_p == style_p || style_p == NULL) {
refresh_childen_style(i);
refresh_children_style(i);
lv_obj_refresh_style(i);
}
@@ -1902,16 +1908,16 @@ static void report_style_mod_core(void * style_p, lv_obj_t * obj)
* because the NULL styles are inherited from the parent
* @param obj pointer to an object
*/
static void refresh_childen_style(lv_obj_t * obj)
static void refresh_children_style(lv_obj_t * obj)
{
lv_obj_t * child = lv_obj_get_child(obj, NULL);
while(child != NULL) {
if(child->style_p == NULL) {
refresh_childen_style(child); /*Check children too*/
refresh_children_style(child); /*Check children too*/
lv_obj_refresh_style(child); /*Notify the child about the style change*/
} else if(child->style_p->glass) {
/*Children with 'glass' parent might be effected if their style == NULL*/
refresh_childen_style(child);
refresh_children_style(child);
}
child = lv_obj_get_child(obj, child);
}

View File

@@ -20,6 +20,10 @@
#define LV_ATTRIBUTE_FLUSH_READY
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
/**********************
* TYPEDEFS
**********************/
@@ -36,7 +40,7 @@
#if LV_VDB_DOUBLE == 0
# if LV_VDB_ADR == 0
/*If the buffer address is not specified simply allocate it*/
static uint8_t vdb_buf[LV_VDB_SIZE_IN_BYTES];
static LV_ATTRIBUTE_MEM_ALIGN uint8_t vdb_buf[LV_VDB_SIZE_IN_BYTES];
static lv_vdb_t vdb = {.buf = (lv_color_t *)vdb_buf};
# else /*LV_VDB_ADR != 0*/
/*If the buffer address is specified use that address*/
@@ -49,8 +53,8 @@ static lv_vdb_t vdb = {.buf = (lv_color_t *)LV_VDB_ADR};
static uint8_t vdb_active = 0;
# if LV_VDB_ADR == 0
/*If the buffer address is not specified simply allocate it*/
static uint8_t vdb_buf1[LV_VDB_SIZE_IN_BYTES];
static uint8_t vdb_buf2[LV_VDB_SIZE_IN_BYTES];
static LV_ATTRIBUTE_MEM_ALIGN uint8_t vdb_buf1[LV_VDB_SIZE_IN_BYTES];
static LV_ATTRIBUTE_MEM_ALIGN uint8_t vdb_buf2[LV_VDB_SIZE_IN_BYTES];
static lv_vdb_t vdb[2] = {{.buf = (lv_color_t *) vdb_buf1}, {.buf = (lv_color_t *) vdb_buf2}};
# else /*LV_VDB_ADR != 0*/
/*If the buffer address is specified use that address*/