1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00
lvgl/lv_objx/lv_objx_templ.h

106 lines
2.2 KiB
C
Raw Normal View History

2016-06-08 07:25:08 +02:00
/**
2016-06-22 17:24:02 +02:00
* @file lv_templ.h
2016-06-08 07:25:08 +02:00
*
*/
2017-10-05 11:29:21 +02:00
/* TODO Remove these instructions
* Search an replace: template -> object normal name with lower case (e.g. button, label etc.)
* templ -> object short name with lower case(e.g. btn, label etc)
* TEMPL -> object short name with upper case (e.g. BTN, LABEL etc.)
*
*/
2016-06-22 17:24:02 +02:00
#ifndef LV_TEMPL_H
#define LV_TEMPL_H
2016-06-08 07:25:08 +02:00
2017-07-09 15:32:49 +02:00
#ifdef __cplusplus
extern "C" {
#endif
2016-06-08 07:25:08 +02:00
/*********************
* INCLUDES
*********************/
2017-11-26 23:57:39 +01:00
#include "../../lv_conf.h"
2016-06-08 07:25:08 +02:00
#if USE_LV_TEMPL != 0
2017-11-30 11:35:33 +01:00
#include "../lv_core/lv_obj.h"
2016-06-08 07:25:08 +02:00
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/*Data of template*/
2017-08-22 16:41:23 +02:00
typedef struct {
2017-08-21 14:41:50 +02:00
lv_ANCESTOR_ext_t ANCESTOR; /*Ext. of ancestor*/
/*New data for this type */
}lv_templ_ext_t;
2016-06-08 07:25:08 +02:00
2017-12-21 00:19:59 +01:00
/*Styles*/
typedef enum {
LV_TEMPL_STYLE_X,
LV_TEMPL_STYLE_Y,
}lv_templ_style_t;
2016-06-08 07:25:08 +02:00
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Create a template objects
* @param par pointer to an object, it will be the parent of the new template
* @param copy pointer to a template object, if not NULL then the new object will be copied from it
* @return pointer to the created template
*/
2016-10-07 11:15:46 +02:00
lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy);
2017-12-21 00:19:59 +01:00
/*======================
* Add/remove functions
*=====================*/
/*=====================
* Setter functions
*====================*/
/**
2017-12-21 00:19:59 +01:00
* Set a style of a template.
* @param templ pointer to template object
* @param type which style should be set
* @param style pointer to a style
* */
void lv_templ_set_style(lv_obj_t * templ, lv_templ_style_t type, lv_style_t *style);
2017-12-21 00:19:59 +01:00
/*=====================
* Getter functions
*====================*/
/**
* Get style of a template.
* @param templ pointer to template object
* @param type which style should be get
* @return style pointer to the style
* */
lv_style_t * lv_btn_get_style(lv_obj_t * templ, lv_templ_style_t type);
/*=====================
* Other functions
*====================*/
2016-06-08 07:25:08 +02:00
/**********************
* MACROS
**********************/
2017-07-09 15:32:49 +02:00
#endif /*USE_LV_TEMPL*/
2016-06-08 07:25:08 +02:00
2017-07-09 15:32:49 +02:00
#ifdef __cplusplus
} /* extern "C" */
2016-06-08 07:25:08 +02:00
#endif
2017-07-09 15:32:49 +02:00
#endif /*LV_TEMPL_H*/