1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
lvgl/src/lv_themes/lv_theme.h

177 lines
3.5 KiB
C
Raw Normal View History

/**
*@file lv_themes.h
*
*/
#ifndef LV_THEMES_H
#define LV_THEMES_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_conf_internal.h"
2017-11-30 11:35:33 +01:00
#include "../lv_core/lv_style.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
2019-06-27 18:07:26 -04:00
/**
* A theme in LittlevGL consists of many styles bound together.
*
* There is a style for each object type, as well as a generic style for
* backgrounds and panels.
*/
2019-12-31 07:03:34 +01:00
typedef enum {
LV_THEME_SCR,
LV_THEME_SCR_TRANSP,
2019-12-31 07:03:34 +01:00
LV_THEME_PANEL,
LV_THEME_PANEL_TRANSP,
LV_THEME_PANEL_FRAME,
LV_THEME_PANEL_TIGHT,
LV_THEME_PANEL_FIT,
2019-12-31 07:03:34 +01:00
LV_THEME_BTN,
LV_THEME_BTN_DANGER,
LV_THEME_BTN_APPROVE,
LV_THEME_BTN_TRANSP,
LV_THEME_BTN_FRAME,
LV_THEME_BTN_LARGE,
LV_THEME_BTN_SMALL,
2019-12-31 07:03:34 +01:00
LV_THEME_LABEL,
LV_THEME_LABEL_TITLE,
LV_THEME_LABEL_HINT,
2019-12-31 07:03:34 +01:00
LV_THEME_BTNM,
LV_THEME_BTNM_BTN,
2019-12-31 22:13:32 +01:00
LV_THEME_BAR,
LV_THEME_BAR_INDIC,
LV_THEME_SLIDER,
LV_THEME_SLIDER_INDIC,
LV_THEME_SLIDER_KNOB,
LV_THEME_SW,
LV_THEME_SW_INDIC,
LV_THEME_SW_KNOB,
2019-12-31 23:02:25 +01:00
LV_THEME_CB,
LV_THEME_CB_BULLET,
LV_THEME_DDLIST_BG,
LV_THEME_DDLIST_SCRL,
2020-01-01 18:46:22 +01:00
LV_THEME_DDLIST_SCRLBAR,
LV_THEME_DDLIST_SEL,
2020-01-01 18:46:22 +01:00
LV_THEME_ROLLER_BG,
LV_THEME_ROLLER_SCRL,
LV_THEME_ROLLER_SEL,
LV_THEME_TABVIEW_BG,
LV_THEME_TABVIEW_BG_SCRL,
LV_THEME_TABVIEW_BTNS,
LV_THEME_TABVIEW_BTNS_BG,
LV_THEME_TABVIEW_INDIC,
LV_THEME_TABVIEW_TAB_BG,
LV_THEME_TABVIEW_TAB_SCRL,
LV_THEME_TABVIEW_TAB_SCRLBAR,
2020-01-01 21:44:16 +01:00
LV_THEME_LMETER,
LV_THEME_GAUGE,
LV_THEME_GAUGE_STRONG,
2020-01-03 11:06:11 +01:00
LV_THEME_TA,
LV_THEME_TA_CURSOR,
LV_THEME_TA_SCRLBAR,
2020-01-05 01:16:13 +01:00
LV_THEME_LIST_BG,
LV_THEME_LIST_SCRL,
LV_THEME_LIST_SCRLBAR,
LV_THEME_LIST_EDGE_FLASH,
LV_THEME_LIST_BTN,
2020-01-06 22:14:04 +01:00
LV_THEME_CALENDAR_BG,
LV_THEME_CALENDAR_HEADER,
LV_THEME_CALENDAR_DAY_NAMES,
LV_THEME_CALENDAR_DATE_NUMS,
2020-01-10 11:10:07 +01:00
LV_THEME_ARC_BG,
LV_THEME_ARC,
2020-01-10 11:10:07 +01:00
LV_THEME_LED,
2020-01-10 14:19:55 +01:00
LV_THEME_MBOX_BG,
LV_THEME_MBOX_BTN_BG,
LV_THEME_MBOX_BTN,
2020-01-12 22:08:34 +01:00
LV_THEME_TABLE_BG,
LV_THEME_TABLE_CELL1,
LV_THEME_TABLE_CELL2,
LV_THEME_TABLE_CELL3,
LV_THEME_TABLE_CELL4,
2019-12-31 07:03:34 +01:00
}lv_theme_style_t;
2019-12-31 07:03:34 +01:00
typedef struct {
lv_style_t * (*get_style_cb)(lv_theme_style_t);
}lv_theme_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Set a theme for the system.
* From now, all the created objects will use styles from this theme by default
* @param th pointer to theme (return value of: 'lv_theme_init_xxx()')
*/
2019-12-31 07:03:34 +01:00
void lv_theme_set_act(lv_theme_t * th);
/**
* Get the current system theme.
* @return pointer to the current system theme. NULL if not set.
*/
2019-12-31 07:03:34 +01:00
lv_theme_t * lv_theme_get_act(void);
2020-01-06 22:14:04 +01:00
lv_style_t * lv_theme_get_style(lv_theme_style_t name);
2020-01-12 22:08:34 +01:00
void lv_obj_add_style_theme(void * obj, uint8_t part, lv_theme_style_t name);
/**********************
* MACROS
**********************/
2020-01-06 22:14:04 +01:00
#define _t(name) lv_theme_get_style(LV_THEME_ ## name)
2019-12-31 11:13:09 +01:00
#define _ot(obj, part, name) lv_obj_add_style_class(obj, part, _t(name))
2019-02-12 15:02:43 +01:00
/**********************
* POST INCLUDE
*********************/
#include "lv_theme_templ.h"
2017-11-18 00:17:21 +01:00
#include "lv_theme_default.h"
#include "lv_theme_alien.h"
2017-11-21 10:35:57 +01:00
#include "lv_theme_night.h"
2018-04-18 18:11:20 +02:00
#include "lv_theme_zen.h"
#include "lv_theme_mono.h"
2018-09-12 18:02:08 +05:30
#include "lv_theme_nemo.h"
#include "lv_theme_material.h"
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_THEMES_H*/