2017-11-16 15:32:33 +01:00
|
|
|
/**
|
|
|
|
*@file lv_themes.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_THEMES_H
|
|
|
|
#define LV_THEMES_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
2019-12-26 02:49:30 +01:00
|
|
|
#include "../lv_conf_internal.h"
|
2018-07-07 11:53:22 +02:00
|
|
|
|
2017-11-30 11:35:33 +01:00
|
|
|
#include "../lv_core/lv_style.h"
|
2017-11-16 15:32:33 +01:00
|
|
|
|
|
|
|
/*********************
|
|
|
|
* 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,
|
2017-11-16 15:32:33 +01:00
|
|
|
|
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,
|
2017-11-16 15:32:33 +01:00
|
|
|
|
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,
|
2017-11-16 15:32:33 +01:00
|
|
|
|
2019-12-31 07:03:34 +01:00
|
|
|
LV_THEME_LABEL,
|
|
|
|
LV_THEME_LABEL_TITLE,
|
|
|
|
LV_THEME_LABEL_HINT,
|
2017-11-16 15:32:33 +01:00
|
|
|
|
2019-12-31 07:03:34 +01:00
|
|
|
LV_THEME_BTNM,
|
|
|
|
LV_THEME_BTNM_BTN,
|
2017-11-16 15:32:33 +01:00
|
|
|
|
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,
|
|
|
|
|
2020-01-01 15:25:16 +01:00
|
|
|
LV_THEME_DDLIST_BG,
|
|
|
|
LV_THEME_DDLIST_SCRL,
|
2020-01-01 18:46:22 +01:00
|
|
|
LV_THEME_DDLIST_SCRLBAR,
|
2020-01-01 15:25:16 +01:00
|
|
|
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,
|
|
|
|
LV_THEME_CALENDAR_TODAY_BOX,
|
|
|
|
LV_THEME_CALENDAR_WEEK_BOX,
|
2019-12-31 07:03:34 +01:00
|
|
|
}lv_theme_style_t;
|
2017-11-16 15:32:33 +01:00
|
|
|
|
2019-12-31 07:03:34 +01:00
|
|
|
typedef struct {
|
|
|
|
lv_style_t * (*get_style_cb)(lv_theme_style_t);
|
|
|
|
}lv_theme_t;
|
2017-11-16 15:32:33 +01:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* 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);
|
2017-11-16 15:32:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
2017-11-16 15:32:33 +01:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* 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
|
|
|
|
2017-11-16 15:32:33 +01:00
|
|
|
/**********************
|
|
|
|
* POST INCLUDE
|
|
|
|
*********************/
|
2017-11-17 15:43:08 +01:00
|
|
|
#include "lv_theme_templ.h"
|
2017-11-18 00:17:21 +01:00
|
|
|
#include "lv_theme_default.h"
|
2017-11-16 15:32:33 +01:00
|
|
|
#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"
|
2017-12-03 00:36:31 +01:00
|
|
|
#include "lv_theme_mono.h"
|
2018-09-12 18:02:08 +05:30
|
|
|
#include "lv_theme_nemo.h"
|
2018-05-30 13:25:56 +02:00
|
|
|
#include "lv_theme_material.h"
|
2017-11-16 15:32:33 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /*LV_THEMES_H*/
|