rename a lot of functions in lv_misc

This commit is contained in:
Gabor Kiss-Vamosi
2017-11-23 21:28:36 +01:00
parent c3471fd04e
commit 1fcda8092e
175 changed files with 2257 additions and 2289 deletions

View File

@@ -23,7 +23,7 @@
**********************/
typedef struct
{
area_t area;
lv_area_t area;
uint8_t joined;
}lv_join_t;
@@ -34,14 +34,14 @@ static void lv_refr_task(void * param);
static void lv_refr_join_area(void);
static void lv_refr_areas(void);
#if LV_VDB_SIZE == 0
static void lv_refr_area_no_vdb(const area_t * area_p);
static void lv_refr_area_no_vdb(const lv_area_t * area_p);
#else
static void lv_refr_area_with_vdb(const area_t * area_p);
static void lv_refr_area_part_vdb(const area_t * area_p);
static void lv_refr_area_with_vdb(const lv_area_t * area_p);
static void lv_refr_area_part_vdb(const lv_area_t * area_p);
#endif
static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj);
static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p);
static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p);
static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj);
static void lv_refr_make(lv_obj_t * top_p, const lv_area_t * mask_p);
static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p);
/**********************
* STATIC VARIABLES
@@ -76,7 +76,7 @@ void lv_refr_init(void)
* Invalidate an area
* @param area_p pointer to area which should be invalidated
*/
void lv_inv_area(const area_t * area_p)
void lv_inv_area(const lv_area_t * area_p)
{
/*Clear the invalidate buffer if the parameter is NULL*/
if(area_p == NULL) {
@@ -84,16 +84,16 @@ void lv_inv_area(const area_t * area_p)
return;
}
area_t scr_area;
lv_area_t scr_area;
scr_area.x1 = 0;
scr_area.y1 = 0;
scr_area.x2 = LV_HOR_RES - 1;
scr_area.y2 = LV_VER_RES - 1;
area_t com_area;
lv_area_t com_area;
bool suc;
suc = area_union(&com_area, area_p, &scr_area);
suc = lv_area_union(&com_area, area_p, &scr_area);
/*The area is truncated to the screen*/
if(suc != false)
@@ -109,7 +109,7 @@ void lv_inv_area(const area_t * area_p)
/*Save only if this area is not in one of the saved areas*/
uint16_t i;
for(i = 0; i < inv_buf_p; i++) {
if(area_is_in(&com_area, &inv_buf[i].area) != false) return;
if(lv_area_is_in(&com_area, &inv_buf[i].area) != false) return;
}
@@ -175,7 +175,7 @@ static void lv_refr_join_area(void)
{
uint32_t join_from;
uint32_t join_in;
area_t joined_area;
lv_area_t joined_area;
for(join_in = 0; join_in < inv_buf_p; join_in++) {
if(inv_buf[join_in].joined != 0) continue;
@@ -187,18 +187,18 @@ static void lv_refr_join_area(void)
}
/*Check if the areas are on each other*/
if(area_is_on(&inv_buf[join_in].area,
if(lv_area_is_on(&inv_buf[join_in].area,
&inv_buf[join_from].area) == false)
{
continue;
}
area_join(&joined_area, &inv_buf[join_in].area,
lv_area_join(&joined_area, &inv_buf[join_in].area,
&inv_buf[join_from].area);
/*Join two area only if the joined area size is smaller*/
if(area_get_size(&joined_area) <
(area_get_size(&inv_buf[join_in].area) + area_get_size(&inv_buf[join_from].area))) {
if(lv_area_get_size(&joined_area) <
(lv_area_get_size(&inv_buf[join_in].area) + lv_area_get_size(&inv_buf[join_from].area))) {
area_cpy(&inv_buf[join_in].area, &joined_area);
/*Mark 'join_form' is joined into 'join_in'*/
@@ -226,7 +226,7 @@ static void lv_refr_areas(void)
/*If VDB is used...*/
lv_refr_area_with_vdb(&inv_buf[i].area);
#endif
if(monitor_cb != NULL) px_num += area_get_size(&inv_buf[i].area);
if(monitor_cb != NULL) px_num += lv_area_get_size(&inv_buf[i].area);
}
}
@@ -237,7 +237,7 @@ static void lv_refr_areas(void)
* Refresh an area if there is no Virtual Display Buffer
* @param area_p pointer to an area to refresh
*/
static void lv_refr_area_no_vdb(const area_t * area_p)
static void lv_refr_area_no_vdb(const lv_area_t * area_p)
{
lv_obj_t * top_p;
@@ -254,7 +254,7 @@ static void lv_refr_area_no_vdb(const area_t * area_p)
* Refresh an area if there is Virtual Display Buffer
* @param area_p pointer to an area to refresh
*/
static void lv_refr_area_with_vdb(const area_t * area_p)
static void lv_refr_area_with_vdb(const lv_area_t * area_p)
{
/*Calculate the max row num*/
uint32_t max_row = (uint32_t) LV_VDB_SIZE / (area_get_width(area_p));
@@ -266,8 +266,8 @@ static void lv_refr_area_with_vdb(const area_t * area_p)
#endif
/*Always use the full row*/
cord_t row;
cord_t row_last = 0;
lv_coord_t row;
lv_coord_t row_last = 0;
for(row = area_p->y1; row + max_row - 1 <= area_p->y2; row += max_row) {
lv_vdb_t * vdb_p = lv_vdb_get();
@@ -299,15 +299,15 @@ static void lv_refr_area_with_vdb(const area_t * area_p)
* Refresh a part of an area which is on the actual Virtual Display Buffer
* @param area_p pointer to an area to refresh
*/
static void lv_refr_area_part_vdb(const area_t * area_p)
static void lv_refr_area_part_vdb(const lv_area_t * area_p)
{
lv_vdb_t * vdb_p = lv_vdb_get();
lv_obj_t * top_p;
/*Get the new mask from the original area and the act. VDB
It will be a part of 'area_p'*/
area_t start_mask;
area_union(&start_mask, area_p, &vdb_p->area);
lv_area_t start_mask;
lv_area_union(&start_mask, area_p, &vdb_p->area);
/*Get the most top object which is not covered by others*/
top_p = lv_refr_get_top_obj(&start_mask, lv_scr_act());
@@ -332,13 +332,13 @@ static void lv_refr_area_part_vdb(const area_t * area_p)
* @param obj the first object to start the searching (typically a screen)
* @return
*/
static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj)
{
lv_obj_t * i;
lv_obj_t * found_p = NULL;
/*If this object is fully cover the draw area check the children too */
if(area_is_in(area_p, &obj->coords) && obj->hidden == 0)
if(lv_area_is_in(area_p, &obj->coords) && obj->hidden == 0)
{
LL_READ(obj->child_ll, i) {
found_p = lv_refr_get_top_obj(area_p, i);
@@ -352,7 +352,7 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
/*If no better children check this object*/
if(found_p == NULL) {
lv_style_t * style = lv_obj_get_style(obj);
if(style->body.opa == OPA_COVER &&
if(style->body.opa == LV_OPA_COVER &&
obj->design_func(obj, area_p, LV_DESIGN_COVER_CHK) != false) {
found_p = obj;
}
@@ -367,7 +367,7 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
* @param top_p pointer to an objects. Start the drawing from it.
* @param mask_p pointer to an area, the objects will be drawn only here
*/
static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p)
static void lv_refr_make(lv_obj_t * top_p, const lv_area_t * mask_p)
{
/* Normally always will be a top_obj (at least the screen)
* but in special cases (e.g. if the screen has alpha) it won't.
@@ -415,7 +415,7 @@ static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p)
* @param obj pointer to an object to refresh
* @param mask_ori_p pointer to an area, the objects will be drawn only here
*/
static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p)
{
/*Do not refresh hidden objects*/
if(obj->hidden != 0) return;
@@ -423,34 +423,34 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
bool union_ok; /* Store the return value of area_union */
/* Truncate the original mask to the coordinates of the parent
* because the parent and its children are visible only here */
area_t obj_mask;
area_t obj_ext_mask;
area_t obj_area;
cord_t ext_size = obj->ext_size;
lv_area_t obj_mask;
lv_area_t obj_ext_mask;
lv_area_t obj_area;
lv_coord_t ext_size = obj->ext_size;
lv_obj_get_coords(obj, &obj_area);
obj_area.x1 -= ext_size;
obj_area.y1 -= ext_size;
obj_area.x2 += ext_size;
obj_area.y2 += ext_size;
union_ok = area_union(&obj_ext_mask, mask_ori_p, &obj_area);
union_ok = lv_area_union(&obj_ext_mask, mask_ori_p, &obj_area);
/*Draw the parent and its children only if they ore on 'mask_parent'*/
if(union_ok != false) {
/* Redraw the object */
lv_style_t * style = lv_obj_get_style(obj);
if(style->body.opa != OPA_TRANSP) {
if(style->body.opa != LV_OPA_TRANSP) {
obj->design_func(obj, &obj_ext_mask, LV_DESIGN_DRAW_MAIN);
//tick_wait_ms(100); /*DEBUG: Wait after every object draw to see the order of drawing*/
}
/*Create a new 'obj_mask' without 'ext_size' because the children can't be visible there*/
lv_obj_get_coords(obj, &obj_area);
union_ok = area_union(&obj_mask, mask_ori_p, &obj_area);
union_ok = lv_area_union(&obj_mask, mask_ori_p, &obj_area);
if(union_ok != false) {
area_t mask_child; /*Mask from obj and its child*/
lv_area_t mask_child; /*Mask from obj and its child*/
lv_obj_t * child_p;
area_t child_area;
lv_area_t child_area;
LL_READ_BACK(obj->child_ll, child_p)
{
lv_obj_get_coords(child_p, &child_area);
@@ -461,7 +461,7 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
child_area.y2 += ext_size;
/* Get the union (common parts) of original mask (from obj)
* and its child */
union_ok = area_union(&mask_child, &obj_mask, &child_area);
union_ok = lv_area_union(&mask_child, &obj_mask, &child_area);
/*If the parent and the child has common area then refresh the child */
if(union_ok) {
@@ -472,7 +472,7 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
}
/* If all the children are redrawn make 'post draw' design */
if(style->body.opa != OPA_TRANSP) {
if(style->body.opa != LV_OPA_TRANSP) {
obj->design_func(obj, &obj_ext_mask, LV_DESIGN_DRAW_POST);
}
}