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

107 lines
2.1 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 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);
lv_style_t * lv_theme_get_style(lv_theme_style_t name);
/**********************
* MACROS
**********************/
2019-12-31 07:03:34 +01:00
#define _t(name) lv_theme_get_style(LV_THEME_ ## 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*/