diff --git a/lv_core/lv_obj.h b/lv_core/lv_obj.h index 59c1fe7039..6c3c356196 100644 --- a/lv_core/lv_obj.h +++ b/lv_core/lv_obj.h @@ -65,22 +65,24 @@ extern "C" { struct _lv_obj_t; -typedef enum +enum { LV_DESIGN_DRAW_MAIN, LV_DESIGN_DRAW_POST, LV_DESIGN_COVER_CHK, -} lv_design_mode_t; +}; +typedef uint8_t lv_design_mode_t; typedef bool (* lv_design_func_t) (struct _lv_obj_t * obj, const lv_area_t * mask_p, lv_design_mode_t mode); -typedef enum +enum { LV_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action function or an operation was failed*/ LV_RES_OK, /*The object is valid (no deleted) after the action*/ -} lv_res_t; +}; +typedef uint8_t lv_res_t; -typedef enum +enum { /*General signals*/ LV_SIGNAL_CLEANUP, @@ -105,7 +107,8 @@ typedef enum LV_SIGNAL_DEFOCUS, LV_SIGNAL_CONTROLL, LV_SIGNAL_GET_EDITABLE, -} lv_signal_t; +}; +typedef uint8_t lv_signal_t; typedef lv_res_t (* lv_signal_func_t) (struct _lv_obj_t * obj, lv_signal_t sign, void * param); @@ -150,7 +153,7 @@ typedef struct _lv_obj_t typedef lv_res_t (*lv_action_t) (struct _lv_obj_t * obj); /*Protect some attributes (max. 8 bit)*/ -typedef enum +enum { LV_PROTECT_NONE = 0x00, LV_PROTECT_CHILD_CHG = 0x01, /*Disable the child change signal. Used by the library*/ @@ -159,7 +162,8 @@ typedef enum LV_PROTECT_FOLLOW = 0x08, /*Prevent the object be followed in automatic ordering (e.g. in lv_cont PRETTY layout)*/ LV_PROTECT_PRESS_LOST= 0x10, /*If the `indev` was pressing this object but swiped out while pressing do not search other object.*/ LV_PROTECT_CLICK_FOCUS= 0x20,/*Prevent focusing the object by clicking on it*/ -} lv_protect_t; +}; +typedef uint16_t lv_protect_t; /*Used by `lv_obj_get_type()`. The object's and its ancestor types are stored here*/ @@ -167,7 +171,7 @@ typedef struct { const char * type[LV_MAX_ANCESTOR_NUM]; /*[0]: the actual type, [1]: ancestor, [2] #1's ancestor ... [x]: "lv_obj" */ } lv_obj_type_t; -typedef enum +enum { LV_ALIGN_CENTER = 0, LV_ALIGN_IN_TOP_LEFT, @@ -190,9 +194,10 @@ typedef enum LV_ALIGN_OUT_RIGHT_TOP, LV_ALIGN_OUT_RIGHT_MID, LV_ALIGN_OUT_RIGHT_BOTTOM, -} lv_align_t; +}; +typedef uint8_t lv_align_t; -typedef enum +enum { LV_ANIM_NONE = 0, LV_ANIM_FLOAT_TOP, /*Float from/to the top*/ @@ -201,7 +206,8 @@ typedef enum LV_ANIM_FLOAT_RIGHT, /*Float from/to the right*/ LV_ANIM_GROW_H, /*Grow/shrink horizontally*/ LV_ANIM_GROW_V, /*Grow/shrink vertically*/ -} lv_anim_builtin_t; +}; +typedef uint8_t lv_anim_builtin_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_core/lv_style.h b/lv_core/lv_style.h index 741f3e2bbd..032f5cb20b 100644 --- a/lv_core/lv_style.h +++ b/lv_core/lv_style.h @@ -29,7 +29,7 @@ extern "C" { **********************/ /*Border types (Use 'OR'ed values)*/ -typedef enum +enum { LV_BORDER_NONE = 0x00, LV_BORDER_BOTTOM = 0x01, @@ -37,14 +37,16 @@ typedef enum LV_BORDER_LEFT = 0x04, LV_BORDER_RIGHT = 0x08, LV_BORDER_FULL = 0x0F, -} lv_border_part_t; +}; +typedef uint8_t lv_border_part_t; /*Shadow types*/ -typedef enum +enum { LV_SHADOW_BOTTOM = 0, LV_SHADOW_FULL, -} lv_shadow_type_t; +}; +typedef uint8_t lv_shadow_type_t; typedef struct { @@ -66,7 +68,7 @@ typedef struct struct { lv_color_t color; lv_coord_t width; - uint8_t type; + lv_shadow_type_t type; } shadow; struct { diff --git a/lv_core/lv_vdb.c b/lv_core/lv_vdb.c index bbbab51d94..dc309a2041 100644 --- a/lv_core/lv_vdb.c +++ b/lv_core/lv_vdb.c @@ -20,11 +20,12 @@ /********************** * TYPEDEFS **********************/ -typedef enum { +enum { LV_VDB_STATE_FREE = 0, /*Not used*/ LV_VDB_STATE_ACTIVE, /*Being used to render*/ LV_VDB_STATE_FLUSH, /*Flushing pixels from it*/ -} lv_vdb_state_t; +}; +typedef uint8_t lv_vdb_state_t; /********************** * STATIC PROTOTYPES diff --git a/lv_draw/lv_draw.h b/lv_draw/lv_draw.h index 70527780a6..689d68e29d 100644 --- a/lv_draw/lv_draw.h +++ b/lv_draw/lv_draw.h @@ -38,12 +38,13 @@ extern "C" { * TYPEDEFS **********************/ -typedef enum { +enum { LV_IMG_SRC_VARIABLE, LV_IMG_SRC_FILE, LV_IMG_SRC_SYMBOL, LV_IMG_SRC_UNKNOWN, -} lv_img_src_t; +}; +typedef uint8_t lv_img_src_t; /********************** diff --git a/lv_draw/lv_draw_img.h b/lv_draw/lv_draw_img.h index b11a9ca22f..71ceceafcc 100644 --- a/lv_draw/lv_draw_img.h +++ b/lv_draw/lv_draw_img.h @@ -40,7 +40,7 @@ typedef struct { }lv_img_header_t; /*Image color format*/ -typedef enum { +enum { LV_IMG_CF_UNKOWN = 0, LV_IMG_CF_RAW, /*Contains the file as it is. Needs custom decoder function*/ @@ -60,7 +60,8 @@ typedef enum { LV_IMG_CF_ALPHA_2BIT, /*Can have one color but 4 different alpha value*/ LV_IMG_CF_ALPHA_4BIT, /*Can have one color but 16 different alpha value*/ LV_IMG_CF_ALPHA_8BIT, /*Can have one color but 256 different alpha value*/ -} lv_img_cf_t; +}; +typedef uint8_t lv_img_cf_t; /* Image header it is compatible with * the result image converter utility*/ diff --git a/lv_draw/lv_draw_label.c b/lv_draw/lv_draw_label.c index ad566fcba5..79b0ad1cba 100644 --- a/lv_draw/lv_draw_label.c +++ b/lv_draw/lv_draw_label.c @@ -17,11 +17,12 @@ /********************** * TYPEDEFS **********************/ -typedef enum { +enum { CMD_STATE_WAIT, CMD_STATE_PAR, CMD_STATE_IN, -} cmd_state_t; +}; +typedef uint8_t cmd_state_t; /********************** * STATIC PROTOTYPES diff --git a/lv_hal/lv_hal_indev.h b/lv_hal/lv_hal_indev.h index a7f927f5c3..43bef354a8 100644 --- a/lv_hal/lv_hal_indev.h +++ b/lv_hal/lv_hal_indev.h @@ -29,18 +29,20 @@ extern "C" { **********************/ /*Possible input device types*/ -typedef enum { +enum { LV_INDEV_TYPE_NONE, /*Show uninitialized state*/ LV_INDEV_TYPE_POINTER, /*Touch pad, mouse, external button*/ LV_INDEV_TYPE_KEYPAD, /*Keypad or keyboard*/ LV_INDEV_TYPE_BUTTON, /*External (hardware button) which is assinged to a specific point of the screen*/ -} lv_hal_indev_type_t; +}; +typedef uint8_t lv_hal_indev_type_t; /*States for input devices*/ -typedef enum { +enum { LV_INDEV_STATE_REL = 0, LV_INDEV_STATE_PR -} lv_indev_state_t; +}; +typedef uint8_t lv_indev_state_t; /*Data type when an input device is read */ typedef struct { @@ -49,8 +51,8 @@ typedef struct { uint32_t key; /*For LV_INDEV_TYPE_KEYPAD the currently pressed key*/ uint32_t btn; /*For LV_INDEV_TYPE_BUTTON the currently pressed button*/ }; - lv_indev_state_t state; /*LV_INDEV_STATE_REL or LV_INDEV_STATE_PR*/ void *user_data; /*'lv_indev_drv_t.priv' for this driver*/ + lv_indev_state_t state; /*LV_INDEV_STATE_REL or LV_INDEV_STATE_PR*/ } lv_indev_data_t; /*Initialized by the user and registered by 'lv_indev_add()'*/ diff --git a/lv_misc/lv_fs.h b/lv_misc/lv_fs.h index 2662abf842..f7e77dc71d 100644 --- a/lv_misc/lv_fs.h +++ b/lv_misc/lv_fs.h @@ -33,7 +33,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -typedef enum +enum { LV_FS_RES_OK = 0, LV_FS_RES_HW_ERR, /*Low level hardware error*/ @@ -48,7 +48,8 @@ typedef enum LV_FS_RES_OUT_OF_MEM, /*Not enough memory for an internal operation*/ LV_FS_RES_INV_PARAM, /*Invalid parameter among arguments*/ LV_FS_RES_UNKNOWN, /*Other unknown error*/ -} lv_fs_res_t; +}; +typedef uint8_t lv_fs_res_t; struct __lv_fs_drv_t; @@ -65,11 +66,12 @@ typedef struct struct __lv_fs_drv_t * drv; } lv_fs_dir_t; -typedef enum +enum { LV_FS_MODE_WR = 0x01, LV_FS_MODE_RD = 0x02, -} lv_fs_mode_t; +}; +typedef uint8_t lv_fs_mode_t; typedef struct __lv_fs_drv_t { diff --git a/lv_misc/lv_log.h b/lv_misc/lv_log.h index ae26afeaaa..0094798551 100644 --- a/lv_misc/lv_log.h +++ b/lv_misc/lv_log.h @@ -29,14 +29,15 @@ extern "C" { **********************/ /*Possible log level. For compatibility declare it independently from `USE_LV_LOG`*/ -typedef enum +enum { LV_LOG_LEVEL_TRACE, /*A lot of logs to give detailed information*/ LV_LOG_LEVEL_INFO, /*Log important events*/ LV_LOG_LEVEL_WARN, /*Log if something unwanted happened but didn't caused problem*/ LV_LOG_LEVEL_ERROR, /*Only critical issue, when the system may fail*/ _LV_LOG_LEVEL_NUM -}lv_log_level_t; +}; +typedef uint8_t lv_log_level_t; #if USE_LV_LOG diff --git a/lv_misc/lv_task.h b/lv_misc/lv_task.h index d4106c0d08..2c59b3979a 100644 --- a/lv_misc/lv_task.h +++ b/lv_misc/lv_task.h @@ -37,7 +37,7 @@ extern "C" { /** * Possible priorities for lv_tasks */ -typedef enum +enum { LV_TASK_PRIO_OFF = 0, LV_TASK_PRIO_LOWEST, @@ -46,7 +46,8 @@ typedef enum LV_TASK_PRIO_HIGH, LV_TASK_PRIO_HIGHEST, LV_TASK_PRIO_NUM, -} lv_task_prio_t; +}; +typedef uint8_t lv_task_prio_t; /** * Descriptor of a lv_task diff --git a/lv_misc/lv_txt.h b/lv_misc/lv_txt.h index 089833f256..91a90b9baa 100644 --- a/lv_misc/lv_txt.h +++ b/lv_misc/lv_txt.h @@ -32,21 +32,23 @@ extern "C" { /********************** * TYPEDEFS **********************/ -typedef enum +enum { LV_TXT_FLAG_NONE = 0x00, LV_TXT_FLAG_RECOLOR = 0x01, /*Enable parsing of recolor command*/ LV_TXT_FLAG_EXPAND = 0x02, /*Ignore width (Used by the library)*/ LV_TXT_FLAG_CENTER = 0x04, /*Align the text to the middle*/ LV_TXT_FLAG_RIGHT = 0x08, /*Align the text to the right*/ -} lv_txt_flag_t; +}; +typedef uint8_t lv_txt_flag_t; -typedef enum +enum { LV_TXT_CMD_STATE_WAIT, /*Waiting for command*/ LV_TXT_CMD_STATE_PAR, /*Processing the parameter*/ LV_TXT_CMD_STATE_IN, /*Processing the command*/ -} lv_txt_cmd_state_t; +}; +typedef uint8_t lv_txt_cmd_state_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_arc.h b/lv_objx/lv_arc.h index e9f97e9cea..70805d5e19 100644 --- a/lv_objx/lv_arc.h +++ b/lv_objx/lv_arc.h @@ -40,9 +40,11 @@ typedef struct { /*Styles*/ -typedef enum { +enum { LV_ARC_STYLE_MAIN, -} lv_arc_style_t; +}; +typedef uint8_t lv_arc_style_t; + /********************** diff --git a/lv_objx/lv_bar.h b/lv_objx/lv_bar.h index 2c0de508d8..a66d583d33 100644 --- a/lv_objx/lv_bar.h +++ b/lv_objx/lv_bar.h @@ -45,10 +45,11 @@ typedef struct lv_style_t *style_indic; /*Style of the indicator*/ } lv_bar_ext_t; -typedef enum { +enum { LV_BAR_STYLE_BG, LV_BAR_STYLE_INDIC, -} lv_bar_style_t; +}; +typedef uint8_t lv_bar_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_btn.h b/lv_objx/lv_btn.h index a726d23e00..7ec6ed9ce5 100644 --- a/lv_objx/lv_btn.h +++ b/lv_objx/lv_btn.h @@ -39,7 +39,7 @@ extern "C" { /* Button states * It can be used not only by buttons but other button-like objects too*/ -typedef enum +enum { LV_BTN_STATE_REL, LV_BTN_STATE_PR, @@ -47,16 +47,19 @@ typedef enum LV_BTN_STATE_TGL_PR, LV_BTN_STATE_INA, LV_BTN_STATE_NUM, -} lv_btn_state_t; +}; +typedef uint8_t lv_btn_state_t; -typedef enum +enum { LV_BTN_ACTION_CLICK, LV_BTN_ACTION_PR, LV_BTN_ACTION_LONG_PR, LV_BTN_ACTION_LONG_PR_REPEAT, LV_BTN_ACTION_NUM, -} lv_btn_action_t; +}; +typedef uint8_t lv_btn_action_t; + /*Data of button*/ typedef struct @@ -76,13 +79,14 @@ typedef struct } lv_btn_ext_t; /*Styles*/ -typedef enum { +enum { LV_BTN_STYLE_REL, LV_BTN_STYLE_PR, LV_BTN_STYLE_TGL_REL, LV_BTN_STYLE_TGL_PR, LV_BTN_STYLE_INA, -} lv_btn_style_t; +}; +typedef uint8_t lv_btn_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_btnm.h b/lv_objx/lv_btnm.h index 47f5671935..7ec4c776d8 100644 --- a/lv_objx/lv_btnm.h +++ b/lv_objx/lv_btnm.h @@ -62,14 +62,15 @@ typedef struct uint8_t toggle :1; /*Enable toggling*/ } lv_btnm_ext_t; -typedef enum { +enum { LV_BTNM_STYLE_BG, LV_BTNM_STYLE_BTN_REL, LV_BTNM_STYLE_BTN_PR, LV_BTNM_STYLE_BTN_TGL_REL, LV_BTNM_STYLE_BTN_TGL_PR, LV_BTNM_STYLE_BTN_INA, -} lv_btnm_style_t; +}; +typedef uint8_t lv_btnm_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_calendar.c b/lv_objx/lv_calendar.c index 53e1a5e8dc..a29a6881aa 100644 --- a/lv_objx/lv_calendar.c +++ b/lv_objx/lv_calendar.c @@ -22,11 +22,12 @@ /********************** * TYPEDEFS **********************/ -typedef enum { +enum { DAY_DRAW_PREV_MONTH, DAY_DRAW_ACT_MONTH, DAY_DRAW_NEXT_MONTH, -} day_draw_state_t; +}; +typedef uint8_t day_draw_state_t; /********************** * STATIC PROTOTYPES diff --git a/lv_objx/lv_calendar.h b/lv_objx/lv_calendar.h index 2d381e1e4c..952fce8e27 100644 --- a/lv_objx/lv_calendar.h +++ b/lv_objx/lv_calendar.h @@ -60,7 +60,7 @@ typedef struct { } lv_calendar_ext_t; /*Styles*/ -typedef enum { +enum { LV_CALENDAR_STYLE_BG, /*Also the style of the "normal" date numbers*/ LV_CALENDAR_STYLE_HEADER, LV_CALENDAR_STYLE_HEADER_PR, @@ -69,7 +69,9 @@ typedef enum { LV_CALENDAR_STYLE_INACTIVE_DAYS, LV_CALENDAR_STYLE_WEEK_BOX, LV_CALENDAR_STYLE_TODAY_BOX, -} lv_calendar_style_t; +}; +typedef uint8_t lv_calendar_style_t; + /********************** diff --git a/lv_objx/lv_cb.h b/lv_objx/lv_cb.h index 1d3b89da52..b587733417 100644 --- a/lv_objx/lv_cb.h +++ b/lv_objx/lv_cb.h @@ -51,14 +51,15 @@ typedef struct lv_obj_t * label; /*Pointer to label*/ } lv_cb_ext_t; -typedef enum { +enum { LV_CB_STYLE_BG, LV_CB_STYLE_BOX_REL, LV_CB_STYLE_BOX_PR, LV_CB_STYLE_BOX_TGL_REL, LV_CB_STYLE_BOX_TGL_PR, LV_CB_STYLE_BOX_INA, -} lv_cb_style_t; +}; +typedef uint8_t lv_cb_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_chart.h b/lv_objx/lv_chart.h index 07f5a380c1..e30ec1b1b7 100644 --- a/lv_objx/lv_chart.h +++ b/lv_objx/lv_chart.h @@ -58,12 +58,13 @@ typedef struct } lv_chart_ext_t; /*Chart types*/ -typedef enum +enum { LV_CHART_TYPE_LINE = 0x01, LV_CHART_TYPE_COLUMN = 0x02, LV_CHART_TYPE_POINT = 0x04, -} lv_chart_type_t; +}; +typedef uint8_t lv_chart_type_t; /********************** diff --git a/lv_objx/lv_cont.h b/lv_objx/lv_cont.h index 97323d7071..dea1974adf 100644 --- a/lv_objx/lv_cont.h +++ b/lv_objx/lv_cont.h @@ -32,7 +32,7 @@ extern "C" { **********************/ /*Layout options*/ -typedef enum +enum { LV_LAYOUT_OFF = 0, LV_LAYOUT_CENTER, @@ -44,7 +44,8 @@ typedef enum LV_LAYOUT_ROW_B, /*Row bottom align*/ LV_LAYOUT_PRETTY, /*Put as many object as possible in row and begin a new row*/ LV_LAYOUT_GRID, /*Align same-sized object into a grid*/ -} lv_layout_t; +}; +typedef uint8_t lv_layout_t; typedef struct { diff --git a/lv_objx/lv_ddlist.h b/lv_objx/lv_ddlist.h index 788fd28872..4833707f2e 100644 --- a/lv_objx/lv_ddlist.h +++ b/lv_objx/lv_ddlist.h @@ -57,11 +57,12 @@ typedef struct lv_coord_t fix_height; /*Height of the ddlist when opened. (0: auto-size)*/ } lv_ddlist_ext_t; -typedef enum { +enum { LV_DDLIST_STYLE_BG, LV_DDLIST_STYLE_SEL, LV_DDLIST_STYLE_SB, -} lv_ddlist_style_t; +}; +typedef uint8_t lv_ddlist_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_imgbtn.h b/lv_objx/lv_imgbtn.h index 678c3b08e1..28e3199b38 100644 --- a/lv_objx/lv_imgbtn.h +++ b/lv_objx/lv_imgbtn.h @@ -47,13 +47,14 @@ typedef struct { /*Styles*/ -typedef enum { +enum { LV_IMGBTN_STYLE_REL, LV_IMGBTN_STYLE_PR, LV_IMGBTN_STYLE_TGL_REL, LV_IMGBTN_STYLE_TGL_PR, LV_IMGBTN_STYLE_INA, -} lv_imgbtn_style_t; +}; +typedef uint8_t lv_imgbtn_style_t; /********************** diff --git a/lv_objx/lv_kb.h b/lv_objx/lv_kb.h index c4984807af..c729a4e689 100644 --- a/lv_objx/lv_kb.h +++ b/lv_objx/lv_kb.h @@ -41,11 +41,11 @@ extern "C" { * TYPEDEFS **********************/ -typedef enum { +enum { LV_KB_MODE_TEXT, LV_KB_MODE_NUM, -} lv_kb_mode_t; - +}; +typedef uint8_t lv_kb_mode_t; /*Data of keyboard*/ typedef struct { @@ -58,14 +58,16 @@ typedef struct { lv_action_t hide_action; /*Called when the "Hide" button is clicked*/ } lv_kb_ext_t; -typedef enum { +enum { LV_KB_STYLE_BG, LV_KB_STYLE_BTN_REL, LV_KB_STYLE_BTN_PR, LV_KB_STYLE_BTN_TGL_REL, LV_KB_STYLE_BTN_TGL_PR, LV_KB_STYLE_BTN_INA, -} lv_kb_style_t; +}; +typedef uint8_t lv_kb_style_t; + /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_label.h b/lv_objx/lv_label.h index 88401d5028..b8d863db88 100644 --- a/lv_objx/lv_label.h +++ b/lv_objx/lv_label.h @@ -37,21 +37,23 @@ extern "C" { **********************/ /*Long mode behaviors. Used in 'lv_label_ext_t' */ -typedef enum +enum { LV_LABEL_LONG_EXPAND, /*Expand the object size to the text size*/ LV_LABEL_LONG_BREAK, /*Keep the object width, break the too long lines and expand the object height*/ LV_LABEL_LONG_SCROLL, /*Expand the object size and scroll the text on the parent (move the label object)*/ LV_LABEL_LONG_DOT, /*Keep the size and write dots at the end if the text is too long*/ LV_LABEL_LONG_ROLL, /*Keep the size and roll the text infinitely*/ -} lv_label_long_mode_t; +}; +typedef uint8_t lv_label_long_mode_t; /*Label align policy*/ -typedef enum { +enum { LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_CENTER, LV_LABEL_ALIGN_RIGHT, -} lv_label_align_t; +}; +typedef uint8_t lv_label_align_t; /*Data of label*/ typedef struct diff --git a/lv_objx/lv_list.h b/lv_objx/lv_list.h index 7fae1a888e..44ecf1f954 100644 --- a/lv_objx/lv_list.h +++ b/lv_objx/lv_list.h @@ -61,7 +61,7 @@ typedef struct #endif } lv_list_ext_t; -typedef enum { +enum { LV_LIST_STYLE_BG, LV_LIST_STYLE_SCRL, LV_LIST_STYLE_SB, @@ -70,7 +70,9 @@ typedef enum { LV_LIST_STYLE_BTN_TGL_REL, LV_LIST_STYLE_BTN_TGL_PR, LV_LIST_STYLE_BTN_INA, -} lv_list_style_t; +}; +typedef uint8_t lv_list_style_t; + /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_mbox.h b/lv_objx/lv_mbox.h index d5c551d0c4..9ca39b6567 100644 --- a/lv_objx/lv_mbox.h +++ b/lv_objx/lv_mbox.h @@ -58,7 +58,7 @@ typedef struct uint16_t anim_time; /*Duration of close animation [ms] (0: no animation)*/ } lv_mbox_ext_t; -typedef enum { +enum { LV_MBOX_STYLE_BG, LV_MBOX_STYLE_BTN_BG, LV_MBOX_STYLE_BTN_REL, @@ -66,7 +66,8 @@ typedef enum { LV_MBOX_STYLE_BTN_TGL_REL, LV_MBOX_STYLE_BTN_TGL_PR, LV_MBOX_STYLE_BTN_INA, -} lv_mbox_style_t; +}; +typedef uint8_t lv_mbox_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_objx_templ.h b/lv_objx/lv_objx_templ.h index 17dab72f85..ab6d090661 100644 --- a/lv_objx/lv_objx_templ.h +++ b/lv_objx/lv_objx_templ.h @@ -46,10 +46,11 @@ typedef struct { /*Styles*/ -typedef enum { +enum { LV_TEMPL_STYLE_X, LV_TEMPL_STYLE_Y, -} lv_templ_style_t; +}; +typedef uint8_t lv_templ_style_t; /********************** diff --git a/lv_objx/lv_page.h b/lv_objx/lv_page.h index 98cbf21fe1..68b7d20e5c 100644 --- a/lv_objx/lv_page.h +++ b/lv_objx/lv_page.h @@ -38,7 +38,7 @@ extern "C" { **********************/ /*Scrollbar modes: shows when should the scrollbars be visible*/ -typedef enum +enum { LV_SB_MODE_OFF = 0x0, /*Never show scrollbars*/ LV_SB_MODE_ON = 0x1, /*Always show scrollbars*/ @@ -46,7 +46,8 @@ typedef enum LV_SB_MODE_AUTO = 0x3, /*Show scrollbars when the scrollable container is large enough to be scrolled*/ LV_SB_MODE_HIDE = 0x4, /*Hide the scroll bar temporally*/ LV_SB_MODE_UNHIDE = 0x5, /*Unhide the previously hidden scrollbar. Recover it's type too*/ -} lv_sb_mode_t; +}; +typedef uint8_t lv_sb_mode_t; /*Data of page*/ typedef struct @@ -62,17 +63,17 @@ typedef struct lv_area_t ver_area; /*Vertical scrollbar area relative to the page (Handled by the library)*/ uint8_t hor_draw :1; /*1: horizontal scrollbar is visible now (Handled by the library)*/ uint8_t ver_draw :1; /*1: vertical scrollbar is visible now (Handled by the library)*/ - uint8_t mode :3; /*Scrollbar visibility from 'lv_page_sb_mode_t'*/ + lv_sb_mode_t mode :3; /*Scrollbar visibility from 'lv_page_sb_mode_t'*/ } sb; uint8_t arrow_scroll :1; /*1: Enable scrolling with LV_GROUP_KEY_LEFT/RIGHT/UP/DOWN*/ } lv_page_ext_t; -typedef enum { +enum { LV_PAGE_STYLE_BG, LV_PAGE_STYLE_SCRL, LV_PAGE_STYLE_SB, -} lv_page_style_t; - +}; +typedef uint8_t lv_page_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_preload.h b/lv_objx/lv_preload.h index b6200a5fb2..393eea8e7e 100644 --- a/lv_objx/lv_preload.h +++ b/lv_objx/lv_preload.h @@ -41,9 +41,10 @@ extern "C" { * TYPEDEFS **********************/ -typedef enum { +enum { LV_PRELOAD_TYPE_SPINNING_ARC, -} lv_preloader_type_t; +}; +typedef uint8_t lv_preloader_type_t; /*Data of pre loader*/ typedef struct { @@ -55,10 +56,10 @@ typedef struct { /*Styles*/ -typedef enum { +enum { LV_PRELOAD_STYLE_MAIN, -} lv_preload_style_t; - +}; +typedef uint8_t lv_preload_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_roller.h b/lv_objx/lv_roller.h index c99f9b9e49..d0aaed42a0 100644 --- a/lv_objx/lv_roller.h +++ b/lv_objx/lv_roller.h @@ -42,10 +42,11 @@ typedef struct { /*New data for this type */ } lv_roller_ext_t; -typedef enum { +enum { LV_ROLLER_STYLE_BG, LV_ROLLER_STYLE_SEL, -} lv_roller_style_t; +}; +typedef uint8_t lv_roller_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_slider.h b/lv_objx/lv_slider.h index 8eb2bd2d7b..6336ae8a81 100644 --- a/lv_objx/lv_slider.h +++ b/lv_objx/lv_slider.h @@ -48,12 +48,13 @@ typedef struct } lv_slider_ext_t; /*Built-in styles of slider*/ -typedef enum +enum { LV_SLIDER_STYLE_BG, LV_SLIDER_STYLE_INDIC, LV_SLIDER_STYLE_KNOB, -} lv_slider_style_t; +}; +typedef uint8_t lv_slider_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_sw.h b/lv_objx/lv_sw.h index 9a2bb8a5ad..3834c72870 100644 --- a/lv_objx/lv_sw.h +++ b/lv_objx/lv_sw.h @@ -46,12 +46,13 @@ typedef struct uint8_t changed :1; /*Indicates the switch explicitly changed by drag*/ } lv_sw_ext_t; -typedef enum { +enum { LV_SW_STYLE_BG, LV_SW_STYLE_INDIC, LV_SW_STYLE_KNOB_OFF, LV_SW_STYLE_KNOB_ON, -} lv_sw_style_t; +}; +typedef uint8_t lv_sw_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_ta.h b/lv_objx/lv_ta.h index 9afb1410e9..a3e79ce42b 100644 --- a/lv_objx/lv_ta.h +++ b/lv_objx/lv_ta.h @@ -43,14 +43,15 @@ extern "C" { * TYPEDEFS **********************/ -typedef enum { +enum { LV_CURSOR_NONE, LV_CURSOR_LINE, LV_CURSOR_BLOCK, LV_CURSOR_OUTLINE, LV_CURSOR_UNDERLINE, LV_CURSOR_HIDDEN = 0x10, /*Or it to any value to hide the cursor temporally*/ -} lv_cursor_type_t; +}; +typedef uint16_t lv_cursor_type_t; /*Data of text area*/ typedef struct @@ -72,11 +73,12 @@ typedef struct } cursor; } lv_ta_ext_t; -typedef enum { +enum { LV_TA_STYLE_BG, LV_TA_STYLE_SB, LV_TA_STYLE_CURSOR, -} lv_ta_style_t; +}; +typedef uint16_t lv_ta_style_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_tabview.h b/lv_objx/lv_tabview.h index 67838a826d..da3bfffd93 100644 --- a/lv_objx/lv_tabview.h +++ b/lv_objx/lv_tabview.h @@ -65,7 +65,7 @@ typedef struct lv_tabview_action_t tab_load_action; } lv_tabview_ext_t; -typedef enum { +enum { LV_TABVIEW_STYLE_BG, LV_TABVIEW_STYLE_INDIC, LV_TABVIEW_STYLE_BTN_BG, @@ -73,12 +73,14 @@ typedef enum { LV_TABVIEW_STYLE_BTN_PR, LV_TABVIEW_STYLE_BTN_TGL_REL, LV_TABVIEW_STYLE_BTN_TGL_PR, -} lv_tabview_style_t; +}; +typedef uint8_t lv_tabview_style_t; -typedef enum { +enum { LV_TABVIEW_BTNS_POS_TOP, LV_TABVIEW_BTNS_POS_BOTTOM, -} lv_tabview_btns_pos_t; +}; +typedef uint8_t lv_tabview_btns_pos_t; /********************** * GLOBAL PROTOTYPES diff --git a/lv_objx/lv_win.h b/lv_objx/lv_win.h index bcd0f49096..9563fd3549 100644 --- a/lv_objx/lv_win.h +++ b/lv_objx/lv_win.h @@ -68,7 +68,7 @@ typedef struct lv_coord_t btn_size; /*Size of the control buttons (square)*/ } lv_win_ext_t; -typedef enum { +enum { LV_WIN_STYLE_BG, LV_WIN_STYLE_CONTENT_BG, LV_WIN_STYLE_CONTENT_SCRL, @@ -76,7 +76,8 @@ typedef enum { LV_WIN_STYLE_HEADER, LV_WIN_STYLE_BTN_REL, LV_WIN_STYLE_BTN_PR, -} lv_win_style_t; +}; +typedef uint8_t lv_win_style_t; /********************** * GLOBAL PROTOTYPES