diff --git a/src/draw/lv_draw.h b/src/draw/lv_draw.h index d394de87c8..edf9b754bb 100644 --- a/src/draw/lv_draw.h +++ b/src/draw/lv_draw.h @@ -73,15 +73,26 @@ typedef enum { } lv_draw_task_state_t; struct _lv_layer_t { - - /** Target draw buffer of the layer*/ + /** Target draw buffer of the layer */ lv_draw_buf_t * draw_buf; + /** Linked list of draw tasks */ + lv_draw_task_t * draw_task_head; + + /** Parent layer */ + lv_layer_t * parent; + + /** Next layer */ + lv_layer_t * next; + + /** User data */ + void * user_data; + /** The absolute coordinates of the buffer */ lv_area_t buf_area; - /** The color format of the layer. LV_COLOR_FORMAT_... */ - lv_color_format_t color_format; + /** The physical clipping area relative to the display */ + lv_area_t phy_clip_area; /** * NEVER USE IT DRAW UNITS. USED INTERNALLY DURING DRAW TASK CREATION. @@ -93,32 +104,25 @@ struct _lv_layer_t { */ lv_area_t _clip_area; - /** - * The physical clipping area relative to the display. - */ - lv_area_t phy_clip_area; - #if LV_DRAW_TRANSFORM_USE_MATRIX /** Transform matrix to be applied when rendering the layer */ lv_matrix_t matrix; #endif - /** Opacity of the layer */ - lv_opa_t opa; - - /*Recolor of the layer*/ - lv_color32_t recolor; - /** Partial y offset */ int32_t partial_y_offset; - /** Linked list of draw tasks */ - lv_draw_task_t * draw_task_head; + /** Recolor of the layer */ + lv_color32_t recolor; - lv_layer_t * parent; - lv_layer_t * next; + /** The color format of the layer. LV_COLOR_FORMAT_... */ + lv_color_format_t color_format; + + /** Flag indicating all tasks are added */ bool all_tasks_added; - void * user_data; + + /** Opacity of the layer */ + lv_opa_t opa; }; typedef struct { diff --git a/src/draw/lv_draw_arc.h b/src/draw/lv_draw_arc.h index 1178ecb3ae..9041b24c18 100644 --- a/src/draw/lv_draw_arc.h +++ b/src/draw/lv_draw_arc.h @@ -45,12 +45,12 @@ typedef struct { /**The center point of the arc. */ lv_point_t center; - /**The outer radius of the arc*/ - uint16_t radius; - /**An image source to be used instead of `color`. `NULL` if unused*/ const void * img_src; + /**The outer radius of the arc*/ + uint16_t radius; + /**Opacity of the arc in 0...255 range. * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/ lv_opa_t opa; diff --git a/src/draw/lv_draw_label.h b/src/draw/lv_draw_label.h index 3420bd5b26..8fe4b68943 100644 --- a/src/draw/lv_draw_label.h +++ b/src/draw/lv_draw_label.h @@ -74,16 +74,19 @@ typedef struct { /**The number of characters to render. 0: means render until reaching the `\0` termination.*/ uint32_t text_length; - /**Opacity of the text in 0...255 range. - * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/ - lv_opa_t opa; - /**The alignment of the text `LV_TEXT_ALIGN_LEFT/RIGHT/CENTER`*/ lv_text_align_t align; /**The base direction. Used when type setting Right-to-left (e.g. Arabic) texts*/ lv_base_dir_t bidi_dir; + /**Opacity of the text in 0...255 range. + * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/ + lv_opa_t opa; + + /**Letter outline stroke opacity */ + lv_opa_t outline_stroke_opa; + /**Text decoration, e.g. underline*/ lv_text_decor_t decor : 3; @@ -105,7 +108,6 @@ typedef struct { lv_draw_label_hint_t * hint; /* Properties of the letter outlines */ - lv_opa_t outline_stroke_opa; lv_color_t outline_stroke_color; int32_t outline_stroke_width; diff --git a/src/draw/lv_draw_rect.h b/src/draw/lv_draw_rect.h index 85ec3af171..7712079886 100644 --- a/src/draw/lv_draw_rect.h +++ b/src/draw/lv_draw_rect.h @@ -33,11 +33,6 @@ typedef struct { int32_t radius; - /*Background*/ - lv_opa_t bg_opa; - lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/ - lv_grad_dsc_t bg_grad; - /*Background img*/ const void * bg_image_src; const void * bg_image_symbol_font; @@ -45,11 +40,22 @@ typedef struct { lv_opa_t bg_image_opa; lv_opa_t bg_image_recolor_opa; uint8_t bg_image_tiled; + /*Background*/ + lv_opa_t bg_opa; + /*Border*/ + lv_opa_t border_opa; + /*Outline */ + lv_opa_t outline_opa; + /*Shadow*/ + lv_opa_t shadow_opa; + + /*Background*/ + lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/ + lv_grad_dsc_t bg_grad; /*Border*/ lv_color_t border_color; int32_t border_width; - lv_opa_t border_opa; lv_border_side_t border_side : 5; uint8_t border_post : 1; /*The border will be drawn later*/ @@ -57,7 +63,6 @@ typedef struct { lv_color_t outline_color; int32_t outline_width; int32_t outline_pad; - lv_opa_t outline_opa; /*Shadow*/ lv_color_t shadow_color; @@ -65,7 +70,6 @@ typedef struct { int32_t shadow_offset_x; int32_t shadow_offset_y; int32_t shadow_spread; - lv_opa_t shadow_opa; } lv_draw_rect_dsc_t; typedef struct { diff --git a/src/indev/lv_indev.h b/src/indev/lv_indev.h index d6c60c4049..e7e7ed24e1 100644 --- a/src/indev/lv_indev.h +++ b/src/indev/lv_indev.h @@ -61,17 +61,17 @@ typedef enum { /** Data structure passed to an input driver to fill*/ typedef struct { + lv_indev_gesture_type_t gesture_type[LV_INDEV_GESTURE_CNT]; /* Current gesture types, per gesture */ + void * gesture_data[LV_INDEV_GESTURE_CNT]; /* Used to store data per gesture */ + + lv_indev_state_t state; /**< LV_INDEV_STATE_RELEASED or LV_INDEV_STATE_PRESSED*/ + lv_point_t point; /**< For LV_INDEV_TYPE_POINTER the currently pressed point*/ uint32_t key; /**< For LV_INDEV_TYPE_KEYPAD the currently pressed key*/ uint32_t btn_id; /**< For LV_INDEV_TYPE_BUTTON the currently pressed button*/ int16_t enc_diff; /**< For LV_INDEV_TYPE_ENCODER number of steps since the previous read*/ - lv_indev_state_t state; /**< LV_INDEV_STATE_RELEASED or LV_INDEV_STATE_PRESSED*/ bool continue_reading; /**< If set to true, the read callback is invoked again, unless the device is in event-driven mode*/ - - lv_indev_gesture_type_t gesture_type[LV_INDEV_GESTURE_CNT]; /* Current gesture types, per gesture */ - void * gesture_data[LV_INDEV_GESTURE_CNT]; /* Used to store data per gesture */ - } lv_indev_data_t; typedef void (*lv_indev_read_cb_t)(lv_indev_t * indev, lv_indev_data_t * data);