From a8016196a867caae7c31af017f4e02eeb6b6d33b Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sun, 2 May 2021 21:59:04 +0200 Subject: [PATCH] refactor(meter, chart) make them extra widgets instead of core --- lv_conf_template.h | 7 ++++--- lvgl.h | 2 -- src/{widgets => extra/widgets/chart}/lv_chart.c | 7 ------- src/{widgets => extra/widgets/chart}/lv_chart.h | 5 +---- src/extra/widgets/lv_widgets.h | 2 ++ src/{widgets => extra/widgets/meter}/lv_meter.c | 6 ------ src/{widgets => extra/widgets/meter}/lv_meter.h | 4 +--- src/widgets/lv_widgets.mk | 2 -- 8 files changed, 8 insertions(+), 27 deletions(-) rename src/{widgets => extra/widgets/chart}/lv_chart.c (99%) rename src/{widgets => extra/widgets/chart}/lv_chart.h (99%) rename src/{widgets => extra/widgets/meter}/lv_meter.c (99%) rename src/{widgets => extra/widgets/meter}/lv_meter.h (99%) diff --git a/lv_conf_template.h b/lv_conf_template.h index acf9bcc87..ff1b5a391 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -381,7 +381,6 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ #define LV_USE_CHECKBOX 1 -#define LV_USE_CHART 1 #define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ @@ -395,8 +394,6 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ #define LV_USE_LINE 1 -#define LV_USE_METER 1 - #define LV_USE_ROLLER 1 /*Requires: lv_label*/ #if LV_USE_ROLLER # define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ @@ -434,6 +431,8 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ # define LV_USE_CALENDAR_HEADER_DROPDOWN 1 #endif /*LV_USE_CALENDAR*/ +#define LV_USE_CHART 1 + #define LV_USE_COLORWHEEL 1 #define LV_USE_IMGBTN 1 @@ -444,6 +443,8 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ #define LV_USE_LIST 1 +#define LV_USE_METER 1 + #define LV_USE_MSGBOX 1 #define LV_USE_SPINBOX 1 diff --git a/lvgl.h b/lvgl.h index 5cf72e160..668a5c589 100644 --- a/lvgl.h +++ b/lvgl.h @@ -47,7 +47,6 @@ extern "C" { #include "src/widgets/lv_img.h" #include "src/widgets/lv_label.h" #include "src/widgets/lv_line.h" -#include "src/widgets/lv_chart.h" #include "src/widgets/lv_table.h" #include "src/widgets/lv_checkbox.h" #include "src/widgets/lv_bar.h" @@ -57,7 +56,6 @@ extern "C" { #include "src/widgets/lv_roller.h" #include "src/widgets/lv_textarea.h" #include "src/widgets/lv_canvas.h" -#include "src/widgets/lv_meter.h" #include "src/widgets/lv_switch.h" #include "src/draw/lv_img_cache.h" diff --git a/src/widgets/lv_chart.c b/src/extra/widgets/chart/lv_chart.c similarity index 99% rename from src/widgets/lv_chart.c rename to src/extra/widgets/chart/lv_chart.c index 526a5704f..f6908e172 100644 --- a/src/widgets/lv_chart.c +++ b/src/extra/widgets/chart/lv_chart.c @@ -9,13 +9,6 @@ #include "lv_chart.h" #if LV_USE_CHART != 0 -#include "../misc/lv_assert.h" -#include "../core/lv_refr.h" -#include "../draw/lv_draw.h" -#include "../core/lv_disp.h" -#include "../core/lv_indev.h" -#include "../misc/lv_math.h" - /********************* * DEFINES *********************/ diff --git a/src/widgets/lv_chart.h b/src/extra/widgets/chart/lv_chart.h similarity index 99% rename from src/widgets/lv_chart.h rename to src/extra/widgets/chart/lv_chart.h index de7b64f15..7ca9c9ebe 100644 --- a/src/widgets/lv_chart.h +++ b/src/extra/widgets/chart/lv_chart.h @@ -13,13 +13,10 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_conf_internal.h" +#include "../../../lvgl.h" #if LV_USE_CHART != 0 -#include "../core/lv_obj.h" -#include "lv_line.h" - /********************* * DEFINES *********************/ diff --git a/src/extra/widgets/lv_widgets.h b/src/extra/widgets/lv_widgets.h index a0a3725fd..21042e831 100644 --- a/src/extra/widgets/lv_widgets.h +++ b/src/extra/widgets/lv_widgets.h @@ -16,9 +16,11 @@ extern "C" { #include "calendar/lv_calendar.h" #include "calendar/lv_calendar_header_arrow.h" #include "calendar/lv_calendar_header_dropdown.h" +#include "chart/lv_chart.h" #include "keyboard/lv_keyboard.h" #include "list/lv_list.h" #include "msgbox/lv_msgbox.h" +#include "meter/lv_meter.h" #include "spinbox/lv_spinbox.h" #include "spinner/lv_spinner.h" #include "tabview/lv_tabview.h" diff --git a/src/widgets/lv_meter.c b/src/extra/widgets/meter/lv_meter.c similarity index 99% rename from src/widgets/lv_meter.c rename to src/extra/widgets/meter/lv_meter.c index d4fe2b11b..fcdc83696 100644 --- a/src/widgets/lv_meter.c +++ b/src/extra/widgets/meter/lv_meter.c @@ -9,12 +9,6 @@ #include "lv_meter.h" #if LV_USE_METER != 0 -#include "../misc/lv_assert.h" -#include "../draw/lv_draw.h" -#include "../core/lv_group.h" -#include "../misc/lv_math.h" -#include "../core/lv_disp.h" - /********************* * DEFINES *********************/ diff --git a/src/widgets/lv_meter.h b/src/extra/widgets/meter/lv_meter.h similarity index 99% rename from src/widgets/lv_meter.h rename to src/extra/widgets/meter/lv_meter.h index 69c97f5d2..62cc1e72b 100644 --- a/src/widgets/lv_meter.h +++ b/src/extra/widgets/meter/lv_meter.h @@ -13,12 +13,10 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_conf_internal.h" +#include "../../../lvgl.h" #if LV_USE_METER != 0 -#include "../core/lv_obj.h" - /********************* * DEFINES *********************/ diff --git a/src/widgets/lv_widgets.mk b/src/widgets/lv_widgets.mk index 2ce351461..4e62dc583 100644 --- a/src/widgets/lv_widgets.mk +++ b/src/widgets/lv_widgets.mk @@ -3,13 +3,11 @@ CSRCS += lv_bar.c CSRCS += lv_btn.c CSRCS += lv_btnmatrix.c CSRCS += lv_canvas.c -CSRCS += lv_chart.c CSRCS += lv_checkbox.c CSRCS += lv_dropdown.c CSRCS += lv_img.c CSRCS += lv_label.c CSRCS += lv_line.c -CSRCS += lv_meter.c CSRCS += lv_roller.c CSRCS += lv_slider.c CSRCS += lv_switch.c