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

376 lines
7.2 KiB
C
Raw Normal View History

/**
*@file lv_themes.h
*
*/
#ifndef LV_THEMES_H
#define LV_THEMES_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lv_conf.h"
#else
2019-03-17 08:33:03 +01:00
#include "../../../lv_conf.h"
#endif
2017-11-30 11:35:33 +01:00
#include "../lv_core/lv_style.h"
#include "../lv_core/lv_group.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
2019-04-04 07:15:40 +02:00
typedef struct
{
struct
{
lv_style_t * bg;
lv_style_t * panel;
#if LV_USE_CONT != 0
2019-04-04 07:15:40 +02:00
lv_style_t * cont;
#endif
2018-09-12 23:34:23 +02: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;
} btn;
#endif
#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;
} imgbtn;
#endif
#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;
} label;
#endif
#if LV_USE_IMG != 0
2019-04-04 07:15:40 +02:00
struct
{
lv_style_t * light;
lv_style_t * dark;
} img;
#endif
#if LV_USE_LINE != 0
2019-04-04 07:15:40 +02:00
struct
{
lv_style_t * decor;
} line;
#endif
#if LV_USE_LED != 0
2019-04-04 07:15:40 +02:00
lv_style_t * led;
#endif
#if LV_USE_BAR != 0
2019-04-04 07:15:40 +02:00
struct
{
lv_style_t * bg;
lv_style_t * indic;
} bar;
#endif
#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;
} slider;
#endif
#if LV_USE_LMETER != 0
2019-04-04 07:15:40 +02:00
lv_style_t * lmeter;
#endif
#if LV_USE_GAUGE != 0
2019-04-04 07:15:40 +02:00
lv_style_t * gauge;
#endif
#if LV_USE_ARC != 0
2019-04-04 07:15:40 +02:00
lv_style_t * arc;
#endif
#if LV_USE_PRELOAD != 0
2019-04-04 07:15:40 +02:00
lv_style_t * preload;
#endif
#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;
} sw;
#endif
#if LV_USE_CHART != 0
2019-04-04 07:15:40 +02:00
lv_style_t * chart;
#endif
#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;
} calendar;
2018-09-10 21:32:08 +02:00
#endif
#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;
} box;
} cb;
#endif
#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;
} btn;
} btnm;
#endif
#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;
} btn;
} kb;
#endif
#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;
} btn;
} mbox;
#endif
#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;
} page;
#endif
#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;
} ta;
#endif
#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;
} spinbox;
#endif
#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;
} btn;
} list;
#endif
#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;
} ddlist;
#endif
#if LV_USE_ROLLER != 0
2019-04-04 07:15:40 +02:00
struct
{
lv_style_t * bg;
lv_style_t * sel;
} roller;
#endif
#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;
} btn;
} tabview;
#endif
#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;
} tileview;
#endif
#if LV_USE_TABLE != 0
2019-04-04 07:15:40 +02:00
struct
{
lv_style_t * bg;
lv_style_t * cell;
} table;
#endif
#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;
lv_style_t * content;
2019-04-04 07:15:40 +02:00
struct
{
lv_style_t * rel;
lv_style_t * pr;
} btn;
} win;
#endif
} style;
#if LV_USE_GROUP
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;
} group;
#endif
2018-06-19 09:49:58 +02:00
} 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-04-04 07:15:40 +02:00
void lv_theme_set_current(lv_theme_t * th);
/**
* 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
/**********************
* 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*/