Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/libs/lvgl/lv_objx/lv_objx_templ.h
1476 views
1
/**
2
* @file lv_templ.h
3
*
4
*/
5
6
7
/* TODO Remove these instructions
8
* Search an replace: template -> object normal name with lower case (e.g. button, label etc.)
9
* templ -> object short name with lower case(e.g. btn, label etc)
10
* TEMPL -> object short name with upper case (e.g. BTN, LABEL etc.)
11
*
12
*/
13
14
#ifndef LV_TEMPL_H
15
#define LV_TEMPL_H
16
17
#ifdef __cplusplus
18
extern "C" {
19
#endif
20
21
/*********************
22
* INCLUDES
23
*********************/
24
#ifdef LV_CONF_INCLUDE_SIMPLE
25
#include "lv_conf.h"
26
#else
27
#include "../../lv_conf.h"
28
#endif
29
30
#if USE_LV_TEMPL != 0
31
32
#include "../lv_core/lv_obj.h"
33
34
/*********************
35
* DEFINES
36
*********************/
37
38
/**********************
39
* TYPEDEFS
40
**********************/
41
/*Data of template*/
42
typedef struct {
43
lv_ANCESTOR_ext_t ANCESTOR; /*Ext. of ancestor*/
44
/*New data for this type */
45
} lv_templ_ext_t;
46
47
48
/*Styles*/
49
enum {
50
LV_TEMPL_STYLE_X,
51
LV_TEMPL_STYLE_Y,
52
};
53
typedef uint8_t lv_templ_style_t;
54
55
56
/**********************
57
* GLOBAL PROTOTYPES
58
**********************/
59
60
/**
61
* Create a template objects
62
* @param par pointer to an object, it will be the parent of the new template
63
* @param copy pointer to a template object, if not NULL then the new object will be copied from it
64
* @return pointer to the created template
65
*/
66
lv_obj_t * lv_templ_create(lv_obj_t * par, const lv_obj_t * copy);
67
68
/*======================
69
* Add/remove functions
70
*=====================*/
71
72
73
/*=====================
74
* Setter functions
75
*====================*/
76
77
/**
78
* Set a style of a template.
79
* @param templ pointer to template object
80
* @param type which style should be set
81
* @param style pointer to a style
82
*/
83
void lv_templ_set_style(lv_obj_t * templ, lv_templ_style_t type, lv_style_t *style);
84
85
/*=====================
86
* Getter functions
87
*====================*/
88
89
/**
90
* Get style of a template.
91
* @param templ pointer to template object
92
* @param type which style should be get
93
* @return style pointer to the style
94
*/
95
lv_style_t * lv_templ_get_style(const lv_obj_t * templ, lv_templ_style_t type);
96
97
/*=====================
98
* Other functions
99
*====================*/
100
101
/**********************
102
* MACROS
103
**********************/
104
105
#endif /*USE_LV_TEMPL*/
106
107
#ifdef __cplusplus
108
} /* extern "C" */
109
#endif
110
111
#endif /*LV_TEMPL_H*/
112
113