mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
refactor(obj draw)rename lv_obj_draw_dsc_t to lv_obj_draw_part_dsc_t
This commit is contained in:
parent
bdffb2c932
commit
1b38632b6f
@ -324,9 +324,9 @@ lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part)
|
||||
return s;
|
||||
}
|
||||
|
||||
void lv_obj_draw_dsc_init(lv_obj_draw_dsc_t * dsc, const lv_area_t * clip_area)
|
||||
void lv_obj_draw_dsc_init(lv_obj_draw_part_dsc_t * dsc, const lv_area_t * clip_area)
|
||||
{
|
||||
lv_memset_00(dsc, sizeof(lv_obj_draw_dsc_t));
|
||||
lv_memset_00(dsc, sizeof(lv_obj_draw_part_dsc_t));
|
||||
dsc->clip_area = clip_area;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ typedef struct
|
||||
uint32_t id;
|
||||
uint32_t part;
|
||||
const void * sub_part_ptr;
|
||||
}lv_obj_draw_dsc_t;
|
||||
}lv_obj_draw_part_dsc_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
@ -118,7 +118,7 @@ lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint32_t part)
|
||||
* @param dsc pointer to a descriptor. Later it should be passed as parameter to an `LV_EEVNT_DRAW_PART_BEGIN/END` event.
|
||||
* @param clip_area the current clip area of the drawing
|
||||
*/
|
||||
void lv_obj_draw_dsc_init(lv_obj_draw_dsc_t * dsc, const lv_area_t * clip_area);
|
||||
void lv_obj_draw_dsc_init(lv_obj_draw_part_dsc_t * dsc, const lv_area_t * clip_area);
|
||||
|
||||
/**
|
||||
* Send a 'LV_EVENT_REFR_EXT_DRAW_SIZE' Call the ancestor's event handler to the object to refresh the value of the extended draw size.
|
||||
|
@ -590,21 +590,21 @@ void lv_obj_get_content_coords(const lv_obj_t * obj, lv_area_t * area)
|
||||
|
||||
}
|
||||
|
||||
lv_coord_t lv_obj_get_self_width(struct _lv_obj_t * obj)
|
||||
lv_coord_t lv_obj_get_self_width(const lv_obj_t * obj)
|
||||
{
|
||||
lv_point_t p = {0, LV_COORD_MIN};
|
||||
lv_event_send((lv_obj_t * )obj, LV_EVENT_REFR_SELF_SIZE, &p);
|
||||
return p.x;
|
||||
}
|
||||
|
||||
lv_coord_t lv_obj_get_self_height(struct _lv_obj_t * obj)
|
||||
lv_coord_t lv_obj_get_self_height(const lv_obj_t * obj)
|
||||
{
|
||||
lv_point_t p = {LV_COORD_MIN, 0};
|
||||
lv_event_send((lv_obj_t * )obj, LV_EVENT_REFR_SELF_SIZE, &p);
|
||||
return p.y;
|
||||
}
|
||||
|
||||
bool lv_obj_refresh_self_size(struct _lv_obj_t * obj)
|
||||
bool lv_obj_refresh_self_size(lv_obj_t * obj)
|
||||
{
|
||||
lv_coord_t w_set = lv_obj_get_style_width(obj, LV_PART_MAIN);
|
||||
lv_coord_t h_set = lv_obj_get_style_height(obj, LV_PART_MAIN);
|
||||
|
@ -277,7 +277,7 @@ void lv_obj_get_content_coords(const struct _lv_obj_t * obj, lv_area_t * area);
|
||||
* @note This size independent from the real size of the widget.
|
||||
* It just tells how large the internal ("virtual") content is.
|
||||
*/
|
||||
lv_coord_t lv_obj_get_self_width(struct _lv_obj_t * obj);
|
||||
lv_coord_t lv_obj_get_self_width(const struct _lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Get the height occupied by the "parts" of the widget. E.g. the height of all rows of a table.
|
||||
@ -286,7 +286,7 @@ lv_coord_t lv_obj_get_self_width(struct _lv_obj_t * obj);
|
||||
* @note This size independent from the real size of the widget.
|
||||
* It just tells how large the internal ("virtual") content is.
|
||||
*/
|
||||
lv_coord_t lv_obj_get_self_height(struct _lv_obj_t * obj);
|
||||
lv_coord_t lv_obj_get_self_height(const struct _lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Handle if the size of the internal ("virtual") content of an object has changed.
|
||||
|
@ -255,7 +255,7 @@ static void lv_calendar_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
|
||||
static void draw_part_begin_event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param(e);
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e);
|
||||
if(dsc->part == LV_PART_ITEMS) {
|
||||
/*Day name styles*/
|
||||
if(dsc->id < 7) {
|
||||
|
@ -682,7 +682,7 @@ static void draw_div_lines(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
lv_draw_line_dsc_init(&line_dsc);
|
||||
lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc);
|
||||
|
||||
lv_obj_draw_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_part_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_dsc_init(&obj_draw_dsc, clip_area);
|
||||
obj_draw_dsc.line_dsc = &line_dsc;
|
||||
obj_draw_dsc.part = LV_PART_MAIN;
|
||||
@ -804,7 +804,7 @@ static void draw_series_line(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
y_tmp = y_tmp / (chart->ymax[ser->y_axis] - chart->ymin[ser->y_axis]);
|
||||
p2.y = h - y_tmp + y_ofs;
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
dsc.line_dsc = &line_dsc_default;
|
||||
@ -941,7 +941,7 @@ static void draw_series_bar(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
bool mask_ret = _lv_area_intersect(&series_mask, &obj->coords, clip_area);
|
||||
if(mask_ret == false) return;
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, &series_mask);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
|
||||
@ -1009,7 +1009,7 @@ static void draw_cursors(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
lv_coord_t point_w = lv_obj_get_style_width(obj, LV_PART_CURSOR) / 2;
|
||||
lv_coord_t point_h = lv_obj_get_style_width(obj, LV_PART_CURSOR) / 2;
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.line_dsc = &line_dsc_tmp;
|
||||
dsc.rect_dsc = &point_dsc_tmp;
|
||||
@ -1106,7 +1106,7 @@ static void draw_y_ticks(lv_obj_t * obj, const lv_area_t * clip_area, lv_chart_a
|
||||
minor_len *= -1;
|
||||
}
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.id = axis;
|
||||
dsc.part = LV_PART_TICKS;
|
||||
@ -1212,7 +1212,7 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
line_dsc.dash_gap = 0;
|
||||
line_dsc.dash_width = 0;
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.id = LV_CHART_AXIS_X;
|
||||
dsc.part = LV_PART_TICKS;
|
||||
|
@ -359,7 +359,7 @@ static void draw_ticks_and_labels(lv_obj_t * obj, const lv_area_t * clip_area, c
|
||||
|
||||
lv_meter_scale_t * scale;
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
|
@ -687,7 +687,7 @@ static void lv_arc_draw(lv_event_t * e)
|
||||
lv_coord_t arc_r;
|
||||
get_center(obj, ¢er, &arc_r);
|
||||
|
||||
lv_obj_draw_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_part_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_dsc_init(&obj_draw_dsc, clip_area);
|
||||
|
||||
/*Draw the background arc*/
|
||||
|
@ -382,7 +382,7 @@ static void draw_indic(lv_event_t * e)
|
||||
/*Do not draw a zero length indicator but at least call the draw part events*/
|
||||
if(!sym && indic_length_calc(&bar->indic_area) <= 1) {
|
||||
|
||||
lv_obj_draw_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_part_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_dsc_init(&obj_draw_dsc, clip_area);
|
||||
obj_draw_dsc.part = LV_PART_INDICATOR;
|
||||
obj_draw_dsc.draw_area = &bar->indic_area;
|
||||
@ -403,7 +403,7 @@ static void draw_indic(lv_event_t * e)
|
||||
lv_draw_rect_dsc_init(&draw_rect_dsc);
|
||||
lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &draw_rect_dsc);
|
||||
|
||||
lv_obj_draw_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_part_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_dsc_init(&obj_draw_dsc, clip_area);
|
||||
obj_draw_dsc.part = LV_PART_INDICATOR;
|
||||
obj_draw_dsc.rect_dsc = &draw_rect_dsc;
|
||||
|
@ -661,7 +661,7 @@ static void draw_main(lv_event_t * e)
|
||||
char * txt_ap = lv_mem_buf_get(txt_ap_size);
|
||||
#endif
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
dsc.rect_dsc = &draw_rect_dsc_act;
|
||||
|
@ -234,7 +234,7 @@ static void lv_checkbox_draw(lv_event_t * e)
|
||||
marker_area_transf.y1 -= transf_h;
|
||||
marker_area_transf.y2 += transf_h;
|
||||
|
||||
lv_obj_draw_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_part_dsc_t obj_draw_dsc;
|
||||
lv_obj_draw_dsc_init(&obj_draw_dsc, clip_area);
|
||||
obj_draw_dsc.rect_dsc = &indic_dsc;
|
||||
obj_draw_dsc.draw_area = &marker_area_transf;
|
||||
|
@ -372,7 +372,7 @@ static void draw_knob(lv_event_t * e)
|
||||
position_knob(obj, &knob_area, knob_size, hor);
|
||||
lv_area_copy(&slider->right_knob_area, &knob_area);
|
||||
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_KNOB;
|
||||
dsc.id = 0;
|
||||
|
@ -619,7 +619,7 @@ static void draw_main(lv_event_t * e)
|
||||
bool rtl = lv_obj_get_base_dir(obj) == LV_BIDI_DIR_RTL ? true : false;
|
||||
|
||||
/*Handle custom drawer*/
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_part_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
dsc.rect_dsc = &rect_dsc_act;
|
||||
|
Loading…
x
Reference in New Issue
Block a user