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
|
|
|
|
*********************/
|
2018-07-07 12:21:36 +02:00
|
|
|
#ifdef LV_CONF_INCLUDE_SIMPLE
|
2018-07-07 11:53:22 +02:00
|
|
|
#include "lv_conf.h"
|
|
|
|
#else
|
2019-03-17 08:33:03 +01:00
|
|
|
#include "../../../lv_conf.h"
|
2018-07-07 11:53:22 +02:00
|
|
|
#endif
|
|
|
|
|
2017-11-30 11:35:33 +01:00
|
|
|
#include "../lv_core/lv_style.h"
|
2019-02-12 16:35:17 +01:00
|
|
|
#include "../lv_core/lv_group.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-04-04 07:15:40 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2019-06-26 17:51:14 +02:00
|
|
|
lv_style_t * scr;
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * panel;
|
2017-11-16 15:32:33 +01:00
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_CONT != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * cont;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
2018-09-12 23:34:23 +02:00
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_BTN != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
|
|
|
lv_style_t * tgl_rel;
|
|
|
|
lv_style_t * tgl_pr;
|
|
|
|
lv_style_t * ina;
|
2019-02-11 09:35:06 +01:00
|
|
|
} btn;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_IMGBTN != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
|
|
|
lv_style_t * tgl_rel;
|
|
|
|
lv_style_t * tgl_pr;
|
|
|
|
lv_style_t * ina;
|
2019-02-11 09:35:06 +01:00
|
|
|
} imgbtn;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_LABEL != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * prim;
|
|
|
|
lv_style_t * sec;
|
|
|
|
lv_style_t * hint;
|
2019-02-11 09:35:06 +01:00
|
|
|
} label;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_IMG != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * light;
|
|
|
|
lv_style_t * dark;
|
2019-02-11 09:35:06 +01:00
|
|
|
} img;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_LINE != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * decor;
|
2019-02-11 09:35:06 +01:00
|
|
|
} line;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_LED != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * led;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_BAR != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * indic;
|
2019-02-11 09:35:06 +01:00
|
|
|
} bar;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_SLIDER != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * indic;
|
|
|
|
lv_style_t * knob;
|
2019-02-11 09:35:06 +01:00
|
|
|
} slider;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_LMETER != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * lmeter;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_GAUGE != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * gauge;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_ARC != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * arc;
|
2018-09-20 22:14:33 +02:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_PRELOAD != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * preload;
|
2018-09-20 22:14:33 +02:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_SW != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * indic;
|
|
|
|
lv_style_t * knob_off;
|
|
|
|
lv_style_t * knob_on;
|
2019-02-11 09:35:06 +01:00
|
|
|
} sw;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_CHART != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_style_t * chart;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_CALENDAR != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * header;
|
|
|
|
lv_style_t * header_pr;
|
|
|
|
lv_style_t * day_names;
|
|
|
|
lv_style_t * highlighted_days;
|
|
|
|
lv_style_t * inactive_days;
|
|
|
|
lv_style_t * week_box;
|
|
|
|
lv_style_t * today_box;
|
2019-02-11 09:35:06 +01:00
|
|
|
} calendar;
|
2018-09-10 21:32:08 +02:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_CB != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
|
|
|
lv_style_t * tgl_rel;
|
|
|
|
lv_style_t * tgl_pr;
|
|
|
|
lv_style_t * ina;
|
2019-02-11 09:35:06 +01:00
|
|
|
} box;
|
|
|
|
} cb;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_BTNM != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
|
|
|
lv_style_t * tgl_rel;
|
|
|
|
lv_style_t * tgl_pr;
|
|
|
|
lv_style_t * ina;
|
2019-02-11 09:35:06 +01:00
|
|
|
} btn;
|
|
|
|
} btnm;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_KB != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
|
|
|
lv_style_t * tgl_rel;
|
|
|
|
lv_style_t * tgl_pr;
|
|
|
|
lv_style_t * ina;
|
2019-02-11 09:35:06 +01:00
|
|
|
} btn;
|
|
|
|
} kb;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_MBOX != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
2019-02-11 09:35:06 +01:00
|
|
|
} btn;
|
|
|
|
} mbox;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_PAGE != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * scrl;
|
|
|
|
lv_style_t * sb;
|
2019-02-11 09:35:06 +01:00
|
|
|
} page;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_TA != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * area;
|
|
|
|
lv_style_t * oneline;
|
|
|
|
lv_style_t * cursor;
|
|
|
|
lv_style_t * sb;
|
2019-02-11 09:35:06 +01:00
|
|
|
} ta;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_SPINBOX != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * cursor;
|
|
|
|
lv_style_t * sb;
|
2019-02-11 09:35:06 +01:00
|
|
|
} spinbox;
|
2019-01-01 01:20:10 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_LIST
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * scrl;
|
|
|
|
lv_style_t * sb;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
|
|
|
lv_style_t * tgl_rel;
|
|
|
|
lv_style_t * tgl_pr;
|
|
|
|
lv_style_t * ina;
|
2019-02-11 09:35:06 +01:00
|
|
|
} btn;
|
|
|
|
} list;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_DDLIST != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * sel;
|
|
|
|
lv_style_t * sb;
|
2019-02-11 09:35:06 +01:00
|
|
|
} ddlist;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_ROLLER != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * sel;
|
2019-02-11 09:35:06 +01:00
|
|
|
} roller;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_TABVIEW != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * indic;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
|
|
|
lv_style_t * tgl_rel;
|
|
|
|
lv_style_t * tgl_pr;
|
2019-02-11 09:35:06 +01:00
|
|
|
} btn;
|
|
|
|
} tabview;
|
2017-11-16 15:32:33 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_TILEVIEW != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * scrl;
|
|
|
|
lv_style_t * sb;
|
2019-02-11 09:35:06 +01:00
|
|
|
} tileview;
|
2019-01-01 01:20:10 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_TABLE != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * cell;
|
2019-02-11 09:35:06 +01:00
|
|
|
} table;
|
2019-01-01 01:20:10 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_WIN != 0
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * bg;
|
|
|
|
lv_style_t * sb;
|
|
|
|
lv_style_t * header;
|
2019-06-21 15:26:28 +02:00
|
|
|
lv_style_t * content;
|
2019-04-04 07:15:40 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
lv_style_t * rel;
|
|
|
|
lv_style_t * pr;
|
2019-02-11 09:35:06 +01:00
|
|
|
} btn;
|
|
|
|
} win;
|
|
|
|
#endif
|
|
|
|
} style;
|
2019-02-12 16:35:17 +01:00
|
|
|
|
2019-03-07 00:05:16 +01:00
|
|
|
#if LV_USE_GROUP
|
2019-02-12 16:35:17 +01:00
|
|
|
struct
|
|
|
|
{
|
2019-06-12 23:10:54 +02:00
|
|
|
/* The `x` in the names inidicates that inconsistence becasue
|
|
|
|
* the group related function are stored in the theme.*/
|
|
|
|
lv_group_style_mod_cb_t style_mod_xcb;
|
|
|
|
lv_group_style_mod_cb_t style_mod_edit_xcb;
|
2019-02-12 16:35:17 +01:00
|
|
|
} group;
|
2019-02-18 08:34:41 +01:00
|
|
|
#endif
|
2018-06-19 09:49:58 +02:00
|
|
|
} 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-04-04 07:15:40 +02:00
|
|
|
void lv_theme_set_current(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.
|
|
|
|
*/
|
|
|
|
lv_theme_t * lv_theme_get_current(void);
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
2019-02-12 15:02:43 +01:00
|
|
|
/* Returns number of styles within the `lv_theme_t` structure. */
|
2019-04-04 07:15:40 +02:00
|
|
|
#define LV_THEME_STYLE_COUNT (sizeof(((lv_theme_t *)0)->style) / sizeof(lv_style_t *))
|
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*/
|