Move LV_GC_INCLUDE to the common place(gc.h) (#2010)
* Move LV_GC_INCLUDE to the common place(gc.h) to avoid the duplication in many source files * fix(theme template): Always initialize _lv_theme_material_styles just like what other theme do
This commit is contained in:
@@ -13,10 +13,6 @@
|
|||||||
#include "../lv_themes/lv_theme.h"
|
#include "../lv_themes/lv_theme.h"
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -30,10 +30,6 @@
|
|||||||
#include "../lv_gpu/lv_gpu_nxp_pxp_osa.h"
|
#include "../lv_gpu/lv_gpu_nxp_pxp_osa.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
#if defined(LV_USER_DATA_FREE_INCLUDE)
|
#if defined(LV_USER_DATA_FREE_INCLUDE)
|
||||||
#include LV_USER_DATA_FREE_INCLUDE
|
#include LV_USER_DATA_FREE_INCLUDE
|
||||||
#endif /* LV_USE_USER_DATA_FREE */
|
#endif /* LV_USE_USER_DATA_FREE */
|
||||||
|
|||||||
@@ -23,10 +23,6 @@
|
|||||||
#include "../lv_widgets/lv_label.h"
|
#include "../lv_widgets/lv_label.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -12,10 +12,6 @@
|
|||||||
#include "../lv_misc/lv_debug.h"
|
#include "../lv_misc/lv_debug.h"
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -13,9 +13,6 @@
|
|||||||
#include "../lv_hal/lv_hal_tick.h"
|
#include "../lv_hal/lv_hal_tick.h"
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
#include "../lv_misc/lv_color.h"
|
#include "../lv_misc/lv_color.h"
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -16,10 +16,6 @@
|
|||||||
#include "../lv_misc/lv_utils.h"
|
#include "../lv_misc/lv_utils.h"
|
||||||
#include "../lv_misc/lv_mem.h"
|
#include "../lv_misc/lv_mem.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -19,10 +19,6 @@
|
|||||||
#include "../lv_core/lv_refr.h"
|
#include "../lv_core/lv_refr.h"
|
||||||
#include "../lv_themes/lv_theme.h"
|
#include "../lv_themes/lv_theme.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -15,10 +15,6 @@
|
|||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
#include "lv_hal_disp.h"
|
#include "lv_hal_disp.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -17,10 +17,6 @@
|
|||||||
#include "lv_math.h"
|
#include "lv_math.h"
|
||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -14,10 +14,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -10,10 +10,6 @@
|
|||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ extern "C" {
|
|||||||
#if LV_MEM_CUSTOM != 1
|
#if LV_MEM_CUSTOM != 1
|
||||||
#error "GC requires CUSTOM_MEM"
|
#error "GC requires CUSTOM_MEM"
|
||||||
#endif /* LV_MEM_CUSTOM */
|
#endif /* LV_MEM_CUSTOM */
|
||||||
|
#include LV_GC_INCLUDE
|
||||||
#else /* LV_ENABLE_GC */
|
#else /* LV_ENABLE_GC */
|
||||||
#define LV_GC_ROOT(x) x
|
#define LV_GC_ROOT(x) x
|
||||||
#define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name;
|
#define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name;
|
||||||
|
|||||||
@@ -16,10 +16,6 @@
|
|||||||
#include LV_MEM_CUSTOM_INCLUDE
|
#include LV_MEM_CUSTOM_INCLUDE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
#include "../lv_hal/lv_hal_tick.h"
|
#include "../lv_hal/lv_hal_tick.h"
|
||||||
#include "lv_gc.h"
|
#include "lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
|
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -12,10 +12,6 @@
|
|||||||
|
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -12,10 +12,6 @@
|
|||||||
|
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
|||||||
@@ -12,10 +12,6 @@
|
|||||||
|
|
||||||
#include "../lv_misc/lv_gc.h"
|
#include "../lv_misc/lv_gc.h"
|
||||||
|
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
#include LV_GC_INCLUDE
|
|
||||||
#endif /* LV_ENABLE_GC */
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
@@ -342,13 +338,8 @@ lv_theme_t * lv_theme_template_init(lv_color_t color_primary, lv_color_t color_s
|
|||||||
* styles' data if LVGL is used in a binding (e.g. Micropython)
|
* styles' data if LVGL is used in a binding (e.g. Micropython)
|
||||||
* In a general case styles could be simple `static lv_style_t my style` variables or allocated directly into `styles`*/
|
* In a general case styles could be simple `static lv_style_t my style` variables or allocated directly into `styles`*/
|
||||||
if(!inited) {
|
if(!inited) {
|
||||||
#if defined(LV_GC_INCLUDE)
|
|
||||||
LV_GC_ROOT(_lv_theme_template_styles) = lv_mem_alloc(sizeof(theme_styles_t));
|
LV_GC_ROOT(_lv_theme_template_styles) = lv_mem_alloc(sizeof(theme_styles_t));
|
||||||
styles = (theme_styles_t *)LV_GC_ROOT(_lv_theme_template_styles);
|
styles = (theme_styles_t *)LV_GC_ROOT(_lv_theme_template_styles);
|
||||||
#else
|
|
||||||
styles = lv_mem_alloc(sizeof(theme_styles_t));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
theme.color_primary = color_primary;
|
theme.color_primary = color_primary;
|
||||||
|
|||||||
Reference in New Issue
Block a user