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