chore: move font/event define to lv_types.h (#5195)

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Benign X
2024-01-05 16:41:33 +08:00
committed by GitHub
parent d8a6ae2e73
commit bc6fd6d40c
7 changed files with 22 additions and 13 deletions
+3 -3
View File
@@ -119,15 +119,15 @@ typedef struct _lv_global_t {
#endif
#if LV_USE_THEME_SIMPLE
my_theme_t * theme_simple;
void * theme_simple;
#endif
#if LV_USE_THEME_DEFAULT
my_theme_t * theme_default;
void * theme_default;
#endif
#if LV_USE_THEME_MONO
my_theme_t * theme_mono;
void * theme_mono;
#endif
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
+3 -2
View File
@@ -20,6 +20,7 @@ extern "C" {
#include "lv_symbol_def.h"
#include "../misc/lv_area.h"
#include "../misc/lv_types.h"
#include "../misc/cache/lv_cache.h"
/*********************
@@ -80,7 +81,7 @@ typedef uint8_t lv_font_kerning_t;
#endif /*DOXYGEN*/
/** Describe the properties of a font*/
typedef struct _lv_font_t {
struct _lv_font_t {
/** Get a glyph's descriptor from a font*/
bool (*get_glyph_dsc)(const lv_font_t *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next);
@@ -102,7 +103,7 @@ typedef struct _lv_font_t {
const void * dsc; /**< Store implementation specific or run_time data or caching here*/
const lv_font_t * fallback; /**< Fallback font for missing glyph. Resolved recursively */
void * user_data; /**< Custom user data for font.*/
} lv_font_t;
};
/**********************
* GLOBAL PROTOTYPES
+2 -2
View File
@@ -119,7 +119,7 @@ typedef struct {
uint32_t cnt;
} lv_event_list_t;
typedef struct _lv_event_t {
struct _lv_event_t {
void * current_target;
void * original_target;
lv_event_code_t code;
@@ -129,7 +129,7 @@ typedef struct _lv_event_t {
uint8_t deleted : 1;
uint8_t stop_processing : 1;
uint8_t stop_bubbling : 1;
} lv_event_t;
};
/**
* @brief Event callback.
-3
View File
@@ -140,9 +140,6 @@ typedef struct _lv_anim_t lv_anim_t;
struct _lv_font_t;
typedef struct _lv_font_t lv_font_t;
struct _my_theme_t;
typedef struct _my_theme_t my_theme_t;
struct _lv_image_decoder_t;
typedef struct _lv_image_decoder_t lv_image_decoder_t;
+5 -1
View File
@@ -17,7 +17,11 @@
/*********************
* DEFINES
*********************/
#define theme_def (LV_GLOBAL_DEFAULT()->theme_default)
struct _my_theme_t;
typedef struct _my_theme_t my_theme_t;
#define theme_def (*(my_theme_t **)(&LV_GLOBAL_DEFAULT()->theme_default))
#define MODE_DARK 1
#define RADIUS_DEFAULT _LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 12 : 8)
+4 -1
View File
@@ -16,7 +16,10 @@
/*********************
* DEFINES
*********************/
#define theme_def (LV_GLOBAL_DEFAULT()->theme_mono)
struct _my_theme_t;
typedef struct _my_theme_t my_theme_t;
#define theme_def (*(my_theme_t **)(&LV_GLOBAL_DEFAULT()->theme_mono))
#define COLOR_FG dark_bg ? lv_color_white() : lv_color_black()
#define COLOR_BG dark_bg ? lv_color_black() : lv_color_white()
+5 -1
View File
@@ -16,7 +16,11 @@
/*********************
* DEFINES
*********************/
#define theme_def (LV_GLOBAL_DEFAULT()->theme_simple)
struct _my_theme_t;
typedef struct _my_theme_t my_theme_t;
#define theme_def (*(my_theme_t **)(&LV_GLOBAL_DEFAULT()->theme_simple))
#define COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 4)
#define COLOR_WHITE lv_color_white()