BigW Consortium Gitlab

Commit c295a04d by Gabor

prototype argument renameing

parent dc17c3d4
......@@ -59,12 +59,12 @@ void anim_init(void)
*/
void anim_create(anim_t * anim_p)
{
anim_t * new_anim_dp = ll_ins_head(&anim_ll);
dm_assert(new_anim_dp);
anim_t * new_anim = ll_ins_head(&anim_ll);
dm_assert(new_anim);
memcpy(new_anim_dp, anim_p, sizeof(anim_t));
memcpy(new_anim, anim_p, sizeof(anim_t));
new_anim_dp->fp(new_anim_dp->p, new_anim_dp->start);
new_anim->fp(new_anim->p, new_anim->start);
}
......
......@@ -25,8 +25,8 @@ typedef struct
point_t last_point;
point_t vect;
point_t vect_sum;
lv_obj_t* act_obj_dp;
lv_obj_t* last_obj_dp;
lv_obj_t * act_obj;
lv_obj_t * last_obj;
uint32_t press_time_stamp;
/*Flags*/
......
......@@ -59,7 +59,7 @@ typedef enum
LV_DESIGN_COVER_CHK,
}lv_design_mode_t;
typedef bool (* lv_design_f_t) (struct __LV_OBJ_T* obj_dp, const area_t * mask_p, lv_design_mode_t mode);
typedef bool (* lv_design_f_t) (struct __lv_obj_t * obj, const area_t * mask_p, lv_design_mode_t mode);
typedef enum
{
......@@ -75,11 +75,11 @@ typedef enum
LV_SIGNAL_STYLE_CHG,
}lv_signal_t;
typedef bool (* lv_signal_f_t) (struct __LV_OBJ_T* obj_dp, lv_signal_t sign, void * param);
typedef bool (* lv_signal_f_t) (struct __lv_obj_t * obj, lv_signal_t sign, void * param);
typedef struct __LV_OBJ_T
{
struct __LV_OBJ_T* par_dp;
struct __lv_obj_t * par;
ll_dsc_t child_ll;
area_t cords;
......@@ -87,7 +87,7 @@ typedef struct __LV_OBJ_T
lv_signal_f_t signal_f;
lv_design_f_t design_f;
void * ext_dp; /*The object attributes can be extended here*/
void * ext; /*The object attributes can be extended here*/
void * style_p; /*Object specific style*/
#if LV_OBJ_FREE_P != 0
......@@ -165,86 +165,86 @@ typedef enum
* GLOBAL PROTOTYPES
**********************/
void lv_init(void);
void lv_obj_inv(lv_obj_t* obj_dp);
void lv_obj_refr_style(lv_obj_t* obj_dp);
void lv_obj_inv(lv_obj_t * obj);
void lv_obj_refr_style(lv_obj_t * obj);
void lv_style_refr_all(void * style_p);
/*Create and delete*/
lv_obj_t* lv_obj_create(lv_obj_t* parent_dp, lv_obj_t * copy_dp);
void lv_obj_del(lv_obj_t* obj_dp);
lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy);
void lv_obj_del(lv_obj_t * obj);
/*Virtual functions*/
bool lv_obj_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
bool lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
/*SETTER FUNCTIONS*/
/*Parent/children set*/
void lv_obj_set_parent(lv_obj_t* obj_dp, lv_obj_t* parent_dp);
void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent);
/*Coordinate set (set_cord_f will be called)*/
void lv_obj_set_pos(lv_obj_t* obj_dp, cord_t x, cord_t y);
void lv_obj_set_pos_us(lv_obj_t* obj_dp, cord_t x, cord_t y);
void lv_obj_set_x(lv_obj_t* obj_dp, cord_t x);
void lv_obj_set_x_us(lv_obj_t* obj_dp, cord_t x);
void lv_obj_set_y(lv_obj_t* obj_dp, cord_t y);
void lv_obj_set_y_us(lv_obj_t* obj_dp, cord_t y);
void lv_obj_set_size(lv_obj_t* obj_dp, cord_t w, cord_t h);
void lv_obj_set_size_us(lv_obj_t* obj_dp, cord_t w, cord_t h);
void lv_obj_set_width(lv_obj_t* obj_dp, cord_t w);
void lv_obj_set_width_us(lv_obj_t* obj_dp, cord_t w);
void lv_obj_set_height(lv_obj_t* obj_dp, cord_t h);
void lv_obj_set_height_us(lv_obj_t* obj_dp, cord_t h);
void lv_obj_align(lv_obj_t* obj_dp,lv_obj_t* base_dp, lv_align_t align, cord_t x_mod, cord_t y_mod);
void lv_obj_align_us(lv_obj_t* obj_dp,lv_obj_t* base_dp, lv_align_t align, cord_t x_mod, cord_t y_mod);
void lv_obj_set_pos(lv_obj_t * obj, cord_t x, cord_t y);
void lv_obj_set_pos_us(lv_obj_t * obj, cord_t x, cord_t y);
void lv_obj_set_x(lv_obj_t * obj, cord_t x);
void lv_obj_set_x_us(lv_obj_t * obj, cord_t x);
void lv_obj_set_y(lv_obj_t * obj, cord_t y);
void lv_obj_set_y_us(lv_obj_t * obj, cord_t y);
void lv_obj_set_size(lv_obj_t * obj, cord_t w, cord_t h);
void lv_obj_set_size_us(lv_obj_t * obj, cord_t w, cord_t h);
void lv_obj_set_width(lv_obj_t * obj, cord_t w);
void lv_obj_set_width_us(lv_obj_t * obj, cord_t w);
void lv_obj_set_height(lv_obj_t * obj, cord_t h);
void lv_obj_set_height_us(lv_obj_t * obj, cord_t h);
void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, cord_t x_mod, cord_t y_mod);
void lv_obj_align_us(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, cord_t x_mod, cord_t y_mod);
/*Appearance set*/
void lv_obj_set_hidden(lv_obj_t* obj_dp, bool hidden_en);
void lv_obj_set_opa(lv_obj_t* obj_dp, opa_t opa);
void lv_obj_set_opar(lv_obj_t* obj_dp, opa_t opa);
void lv_obj_set_hidden(lv_obj_t * obj, bool hidden_en);
void lv_obj_set_opa(lv_obj_t * obj, opa_t opa);
void lv_obj_set_opar(lv_obj_t * obj, opa_t opa);
/*Attribute set*/
void lv_obj_set_click(lv_obj_t* obj_dp, bool click_en);
void lv_obj_set_top(lv_obj_t* obj_dp, bool click_en);
void lv_obj_set_drag(lv_obj_t* obj_dp, bool drag_en);
void lv_obj_set_drag_throw(lv_obj_t* obj_dp, bool dragthr_en);
void lv_obj_set_drag_parent(lv_obj_t* obj_dp, bool dragpar_en);
void lv_obj_set_signal_f(lv_obj_t* obj_dp, lv_signal_f_t fp);
void lv_obj_set_design_f(lv_obj_t* obj_dp, lv_design_f_t fp);
void lv_obj_set_click(lv_obj_t * obj, bool click_en);
void lv_obj_set_top(lv_obj_t * obj, bool click_en);
void lv_obj_set_drag(lv_obj_t * obj, bool drag_en);
void lv_obj_set_drag_throw(lv_obj_t * obj, bool dragthr_en);
void lv_obj_set_drag_parent(lv_obj_t * obj, bool dragpar_en);
void lv_obj_set_signal_f(lv_obj_t * obj, lv_signal_f_t fp);
void lv_obj_set_design_f(lv_obj_t * obj, lv_design_f_t fp);
/*Other set*/
void * lv_obj_alloc_ext(lv_obj_t* obj_dp, uint16_t ext_size);
void lv_obj_set_style(lv_obj_t* obj_dp, void * style_p);
void * lv_obj_iso_style(lv_obj_t * obj_dp, uint32_t style_size);
void lv_obj_set_free_num(lv_obj_t* obj_dp, uint8_t free_num);
void lv_obj_set_free_p(lv_obj_t* obj_dp, void * free_p);
void lv_obj_anim(lv_obj_t * obj_dp, lv_anim_builtin_t anim, uint16_t time, uint16_t delay, void (*cb) (lv_obj_t *));
void * lv_obj_alloc_ext(lv_obj_t * obj, uint16_t ext_size);
void lv_obj_set_style(lv_obj_t * obj, void * style_p);
void * lv_obj_iso_style(lv_obj_t * obj, uint32_t style_size);
void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num);
void lv_obj_set_free_p(lv_obj_t * obj, void * free_p);
void lv_obj_anim(lv_obj_t * obj, lv_anim_builtin_t anim, uint16_t time, uint16_t delay, void (*cb) (lv_obj_t *));
/*GETTER FUNCTIONS*/
/*Screen get*/
lv_obj_t* lv_scr_act(void);
void lv_scr_load(lv_obj_t* scr_dp);
lv_obj_t * lv_scr_act(void);
void lv_scr_load(lv_obj_t * scr);
/*Parent/children get*/
lv_obj_t* lv_obj_get_scr(lv_obj_t* obj_dp);
lv_obj_t* lv_obj_get_parent(lv_obj_t* obj_dp);
lv_obj_t * lv_obj_get_child(lv_obj_t * obj_dp, lv_obj_t * child_dp);
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
lv_obj_t * lv_obj_get_parent(lv_obj_t * obj);
lv_obj_t * lv_obj_get_child(lv_obj_t * obj, lv_obj_t * child);
/*Coordinate get*/
void lv_obj_get_cords(lv_obj_t* obj_dp, area_t * cords_p);
cord_t lv_obj_get_x(lv_obj_t* obj_dp);
cord_t lv_obj_get_y(lv_obj_t* obj_dp);
cord_t lv_obj_get_width(lv_obj_t* obj_dp);
cord_t lv_obj_get_height(lv_obj_t* obj_dp);
void lv_obj_get_cords(lv_obj_t * obj, area_t * cords_p);
cord_t lv_obj_get_x(lv_obj_t * obj);
cord_t lv_obj_get_y(lv_obj_t * obj);
cord_t lv_obj_get_width(lv_obj_t * obj);
cord_t lv_obj_get_height(lv_obj_t * obj);
/*Appearance get*/
bool lv_obj_get_hidden(lv_obj_t* obj_dp);
opa_t lv_obj_get_opa(lv_obj_t* obj_dp);
bool lv_obj_get_hidden(lv_obj_t * obj);
opa_t lv_obj_get_opa(lv_obj_t * obj);
/*Attribute get*/
bool lv_obj_get_click(lv_obj_t* obj_dp);
bool lv_obj_get_top(lv_obj_t* obj_dp);
bool lv_obj_get_drag(lv_obj_t* obj_dp);
bool lv_obj_get_drag_throw(lv_obj_t* obj_dp);
bool lv_obj_get_drag_parent(lv_obj_t* obj_dp);
bool lv_obj_get_click(lv_obj_t * obj);
bool lv_obj_get_top(lv_obj_t * obj);
bool lv_obj_get_drag(lv_obj_t * obj);
bool lv_obj_get_drag_throw(lv_obj_t * obj);
bool lv_obj_get_drag_parent(lv_obj_t * obj);
/*Virtual functions get*/
lv_design_f_t lv_obj_get_design_f(lv_obj_t* obj_dp);
lv_signal_f_t lv_obj_get_signal_f(lv_obj_t* obj_dp);
lv_design_f_t lv_obj_get_design_f(lv_obj_t * obj);
lv_signal_f_t lv_obj_get_signal_f(lv_obj_t * obj);
/*Other get*/
void * lv_obj_get_ext(lv_obj_t* obj_dp);
void * lv_obj_get_style(lv_obj_t* obj_dp);
uint8_t lv_obj_get_free_num(lv_obj_t* obj_dp);
void * lv_obj_get_ext(lv_obj_t * obj);
void * lv_obj_get_style(lv_obj_t * obj);
uint8_t lv_obj_get_free_num(lv_obj_t * obj);
lv_objs_t * lv_objs_get(lv_objs_builtin_t style, lv_objs_t * copy_p);
......@@ -252,7 +252,7 @@ lv_objs_t * lv_objs_get(lv_objs_builtin_t style, lv_objs_t * copy_p);
* MACROS
**********************/
#define LV_SA(obj_dp, style_type) ((style_type *) obj_dp->style_p)
#define LV_EA(obj_dp, ext_type) ((ext_type *) obj_dp->ext_dp)
#define LV_SA(obj, style_type) ((style_type *) obj->style_p)
#define LV_EA(obj, ext_type) ((ext_type *) obj->ext)
#endif
......@@ -38,9 +38,9 @@ static void lv_refr_area_no_vdb(const area_t * area_p);
static void lv_refr_area_with_vdb(const area_t * area_p);
static void lv_refr_area_part_vdb(const area_t * area_p);
#endif
static lv_obj_t* lv_refr_get_top_obj(const area_t * area_p, lv_obj_t* obj_dp);
static void lv_refr_make(lv_obj_t* top_p, const area_t * mask_p);
static void lv_refr_obj(lv_obj_t* obj_dp, const area_t * mask_ori_p);
static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj);
static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p);
static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p);
/**********************
* STATIC VARIABLES
......@@ -219,7 +219,7 @@ static void lv_refr_areas(lv_join_t * area_a, uint32_t area_num)
*/
static void lv_refr_area_no_vdb(const area_t * area_p)
{
lv_obj_t* top_p;
lv_obj_t * top_p;
/*Get top object which is not covered by others*/
top_p = lv_refr_get_top_obj(area_p, lv_scr_act());
......@@ -283,7 +283,7 @@ static void lv_refr_area_with_vdb(const area_t * area_p)
static void lv_refr_area_part_vdb(const area_t * area_p)
{
lv_vdb_t * vdb_p = lv_vdb_get();
lv_obj_t* top_p;
lv_obj_t * top_p;
/*Get the new mask from the original area and the act. VDB
It will be a part of 'area_p'*/
......@@ -305,21 +305,21 @@ static void lv_refr_area_part_vdb(const area_t * area_p)
/**
* Search the most top object which fully covers an area
* @param area_p pointer to an area
* @param obj_dp the first object to start the searching (typically a screen)
* @param obj the first object to start the searching (typically a screen)
* @return
*/
static lv_obj_t* lv_refr_get_top_obj(const area_t * area_p, lv_obj_t* obj_dp)
static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
{
lv_obj_t* i;
lv_obj_t* found_p = NULL;
lv_obj_t * i;
lv_obj_t * found_p = NULL;
/*If this object is fully cover the draw area check the children too */
if(obj_dp->opa == OPA_COVER &&
obj_dp->hidden == 0 &&
LV_SA(obj_dp, lv_objs_t)->transp == 0 &&
obj_dp->design_f(obj_dp, area_p, LV_DESIGN_COVER_CHK) != false)
if(obj->opa == OPA_COVER &&
obj->hidden == 0 &&
LV_SA(obj, lv_objs_t)->transp == 0 &&
obj->design_f(obj, area_p, LV_DESIGN_COVER_CHK) != false)
{
LL_READ(obj_dp->child_ll, i) {
LL_READ(obj->child_ll, i) {
found_p = lv_refr_get_top_obj(area_p, i);
/*If a children is ok then break*/
......@@ -330,7 +330,7 @@ static lv_obj_t* lv_refr_get_top_obj(const area_t * area_p, lv_obj_t* obj_dp)
/*If there is no better children use this object*/
if(found_p == NULL) {
found_p = obj_dp;
found_p = obj;
}
}
......@@ -342,7 +342,7 @@ static lv_obj_t* lv_refr_get_top_obj(const area_t * area_p, lv_obj_t* obj_dp)
* @param top_p pointer to an objects. Start the drawing from it.
* @param mask_p pointer to an area, the objects will be drawn only here
*/
static void lv_refr_make(lv_obj_t* top_p, const area_t * mask_p)
static void lv_refr_make(lv_obj_t * top_p, const area_t * mask_p)
{
/* Normally always will be a top_obj (at least the screen)
* but in special cases (e.g. if the screen has alpha) it won't.
......@@ -353,60 +353,60 @@ static void lv_refr_make(lv_obj_t* top_p, const area_t * mask_p)
lv_refr_obj(top_p, mask_p);
/*Draw the 'younger' objects because they can be on top_obj */
lv_obj_t* par_dp;
lv_obj_t* i;
lv_obj_t* border_p = top_p;
lv_obj_t * par;
lv_obj_t * i;
lv_obj_t * border_p = top_p;
par_dp = lv_obj_get_parent(top_p);
par = lv_obj_get_parent(top_p);
/*Do until not reach the screen*/
while(par_dp != NULL) {
while(par != NULL) {
/*object before border_p has to be redrawn*/
i = ll_get_prev(&(par_dp->child_ll), border_p);
i = ll_get_prev(&(par->child_ll), border_p);
while(i != NULL) {
/*Refresh the objects*/
lv_refr_obj(i, mask_p);
i = ll_get_prev(&(par_dp->child_ll), i);
i = ll_get_prev(&(par->child_ll), i);
}
/*The new border will be there last parents,
*so the 'younger' brothers of parent will be refreshed*/
border_p = par_dp;
border_p = par;
/*Go a level deeper*/
par_dp = lv_obj_get_parent(par_dp);
par = lv_obj_get_parent(par);
}
}
/**
* Refresh an object an all of its children. (Called recursively)
* @param obj_dp pointer to an object to refresh
* @param obj pointer to an object to refresh
* @param mask_ori_p pointer to an area, the objects will be drawn only here
*/
static void lv_refr_obj(lv_obj_t* obj_dp, const area_t * mask_ori_p)
static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
{
/*Do not refresh hidden objects*/
if(obj_dp->hidden != 0) return;
if(obj->hidden != 0) return;
bool union_ok; /* Store the return value of area_union */
/* Truncate the original mask to the coordinates of the parent
* because the parent and its children are visible only here */
area_t mask_parent;
union_ok = area_union(&mask_parent, mask_ori_p, &obj_dp->cords);
union_ok = area_union(&mask_parent, mask_ori_p, &obj->cords);
/*Draw the parent and its children only if they ore on 'mask_parent'*/
if(union_ok != false) {
/* Redraw the object */
if(obj_dp->opa != OPA_TRANSP && LV_SA(obj_dp, lv_objs_t)->transp == 0) {
obj_dp->design_f(obj_dp, &mask_parent, LV_DESIGN_DRAW_MAIN);
if(obj->opa != OPA_TRANSP && LV_SA(obj, lv_objs_t)->transp == 0) {
obj->design_f(obj, &mask_parent, LV_DESIGN_DRAW_MAIN);
}
area_t mask_child; /*Mask from obj_dp and its child*/
lv_obj_t* child_p;
LL_READ_BACK(obj_dp->child_ll, child_p)
area_t mask_child; /*Mask from obj and its child*/
lv_obj_t * child_p;
LL_READ_BACK(obj->child_ll, child_p)
{
/* Get the union (common parts) of original mask (from obj_dp)
/* Get the union (common parts) of original mask (from obj)
* and its child */
union_ok = area_union(&mask_child, &mask_parent, &child_p->cords);
......@@ -418,8 +418,8 @@ static void lv_refr_obj(lv_obj_t* obj_dp, const area_t * mask_ori_p)
}
/* If all the children are redrawn call make 'post draw' design */
if(obj_dp->opa != OPA_TRANSP && LV_SA(obj_dp, lv_objs_t)->transp == 0) {
obj_dp->design_f(obj_dp, &mask_parent, LV_DESIGN_DRAW_POST);
if(obj->opa != OPA_TRANSP && LV_SA(obj, lv_objs_t)->transp == 0) {
obj->design_f(obj, &mask_parent, LV_DESIGN_DRAW_POST);
}
}
}
......@@ -33,14 +33,17 @@ typedef enum
LV_BTN_STATE_NUM,
}lv_btn_state_t;
/*Style of button*/
typedef struct
{
lv_rects_t rects; /*To be compatible with the ancestor*/
lv_rects_t rects; /*Style of ancestor*/
/*New style element for this type */
color_t mcolor[LV_BTN_STATE_NUM];
color_t gcolor[LV_BTN_STATE_NUM];
color_t bcolor[LV_BTN_STATE_NUM];
}lv_btns_t;
/*Built-in styles of button*/
typedef enum
{
LV_BTNS_DEF,
......@@ -48,12 +51,14 @@ typedef enum
LV_BTNS_BORDER,
}lv_btns_builtin_t;
/*Data of button*/
typedef struct
{
lv_rect_ext_t rect_ext;
bool (*pr_action)(lv_obj_t*, lv_dispi_t *);
bool (*rel_action)(lv_obj_t*, lv_dispi_t *);
bool (*lpr_action)(lv_obj_t*, lv_dispi_t *);
lv_rect_ext_t rect_ext; /*Ext. of ancestor*/
/*New data for this type */
bool (*pr_action)(lv_obj_t *, lv_dispi_t *);
bool (*rel_action)(lv_obj_t *, lv_dispi_t *);
bool (*lpr_action)(lv_obj_t *, lv_dispi_t *);
lv_btn_state_t state;
uint8_t tgl :1; /*1: Toggle enabled*/
......@@ -64,19 +69,19 @@ typedef struct
* GLOBAL PROTOTYPES
**********************/
/*Create function*/
lv_obj_t* lv_btn_create(lv_obj_t* par_dp, lv_obj_t * c_dp);
lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_btn_signal(lv_obj_t * obj_dp, lv_signal_t sign, void * param);
lv_btns_t * lv_btns_get(lv_btns_builtin_t style, lv_btns_t * copy_p);
bool lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param);
lv_btns_t * lv_btns_get(lv_btns_builtin_t style, lv_btns_t * copy);
void lv_btn_set_tgl(lv_obj_t* obj_dp, bool tgl);
void lv_btn_set_state(lv_obj_t* obj_dp, lv_btn_state_t state);
void lv_btn_set_pr_action(lv_obj_t* obi_p, bool (*pr_action)(lv_obj_t*, lv_dispi_t *));
void lv_btn_set_rel_action(lv_obj_t* obj_dp, bool (*rel_action)(lv_obj_t*, lv_dispi_t *));
void lv_btn_set_lpr_action(lv_obj_t* obj_dp, bool (*lpr_action)(lv_obj_t*, lv_dispi_t *));
void lv_btn_set_tgl(lv_obj_t * btn, bool tgl);
void lv_btn_set_state(lv_obj_t * btn, lv_btn_state_t state);
void lv_btn_set_pr_action(lv_obj_t * btn, bool (*pr_action)(lv_obj_t *, lv_dispi_t *));
void lv_btn_set_rel_action(lv_obj_t * btn, bool (*rel_action)(lv_obj_t *, lv_dispi_t *));
void lv_btn_set_lpr_action(lv_obj_t * btn, bool (*lpr_action)(lv_obj_t *, lv_dispi_t *));
bool lv_btn_get_tgl(lv_obj_t* obj_dp);
lv_btn_state_t lv_btn_get_state(lv_obj_t* obj_dp);
bool lv_btn_get_tgl(lv_obj_t * btn);
lv_btn_state_t lv_btn_get_state(lv_obj_t * btn);
/**********************
* MACROS
......
......@@ -35,10 +35,10 @@
/*Style of button matrix*/
typedef struct
{
lv_rects_t rects; /*Style of ancestor*/
lv_rects_t bg; /*Style of ancestor*/
/*New style element for this type */
lv_btns_t btns;
lv_labels_t labels;
lv_btns_t btn;
lv_labels_t btn_label;
}lv_btnms_t;
/*Built-in styles of button matrix*/
......@@ -54,7 +54,7 @@ typedef bool (*lv_btnm_callback_t) (lv_obj_t *, lv_obj_t *, uint16_t);
/*Data of button matrix*/
typedef struct
{
lv_rect_ext_t rect; /*Ext. of ancestor*/
lv_rect_ext_t bg; /*Ext. of ancestor*/
/*New data for this type */
const char ** map_p; /*Pointer to the current map*/
lv_btnm_callback_t cb;
......@@ -63,15 +63,15 @@ typedef struct
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_btnm_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_btnm_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
lv_btnms_t * lv_btnms_get(lv_btnms_builtin_t style, lv_btnms_t * copy_p);
lv_obj_t * lv_btnm_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param);
lv_btnms_t * lv_btnms_get(lv_btnms_builtin_t style, lv_btnms_t * copy);
void lv_btnm_set_map(lv_obj_t * obj_dp, const char ** map_p);
void lv_btnm_set_cb(lv_obj_t * obj_dp, lv_btnm_callback_t cb);
void lv_btnm_set_map(lv_obj_t * btnm, const char ** map);
void lv_btnm_set_cb(lv_obj_t * btnm, lv_btnm_callback_t cb);
const char ** lv_btnm_get_map(lv_obj_t * obj_dp);
lv_btnm_callback_t lv_btnm_get_cb(lv_obj_t * obj_dp);
const char ** lv_btnm_get_map(lv_obj_t * btnm);
lv_btnm_callback_t lv_btnm_get_cb(lv_obj_t * btnm);
/**********************
* MACROS
**********************/
......
......@@ -23,7 +23,7 @@
* STATIC PROTOTYPES
**********************/
#if 0 /*The ancestor design function is used */
static bool lv_cb_design(lv_obj_t* obj_dp, const area_t * mask_p, lv_design_mode_t mode);
static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mode);
#endif
static void lv_cbs_init(void);
......@@ -48,61 +48,61 @@ static lv_cbs_t lv_cbs_def =
/**
* Create a check box objects
* @param par_dp pointer to an object, it will be the parent of the new check box
* @param copy_dp pointer to a check box object, if not NULL then the new object will be copied from it
* @param par pointer to an object, it will be the parent of the new check box
* @param copy pointer to a check box object, if not NULL then the new object will be copied from it
* @return pointer to the created check box
*/
lv_obj_t * lv_cb_create(lv_obj_t* par_dp, lv_obj_t * copy_dp)
lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
{
/*Create the ancestor basic object*/
lv_obj_t* new_obj_dp = lv_btn_create(par_dp, copy_dp);
dm_assert(new_obj_dp);
lv_obj_t * new_cb = lv_btn_create(par, copy);
dm_assert(new_cb);
lv_cb_ext_t * ext = lv_obj_alloc_ext(new_obj_dp, sizeof(lv_cb_ext_t));
lv_cb_ext_t * ext = lv_obj_alloc_ext(new_cb, sizeof(lv_cb_ext_t));
dm_assert(ext);
lv_obj_set_signal_f(new_obj_dp, lv_cb_signal);
lv_obj_set_signal_f(new_cb, lv_cb_signal);
/*Init the new checkbox object*/
if(copy_dp == NULL) {
lv_rect_set_layout(new_obj_dp, LV_RECT_LAYOUT_ROW_M);
lv_rect_set_fit(new_obj_dp, true, true);
lv_btn_set_tgl(new_obj_dp, true);
if(copy == NULL) {
lv_rect_set_layout(new_cb, LV_RECT_LAYOUT_ROW_M);
lv_rect_set_fit(new_cb, true, true);
lv_btn_set_tgl(new_cb, true);
ext->bullet = lv_btn_create(new_obj_dp, NULL);
ext->bullet = lv_btn_create(new_cb, NULL);
lv_obj_set_click(ext->bullet, false);
ext->label = lv_label_create(new_obj_dp, NULL);
ext->label = lv_label_create(new_cb, NULL);
lv_label_set_text(ext->label, "Check box");
lv_obj_set_style(new_obj_dp, lv_cbs_get(LV_CBS_DEF, NULL));
lv_obj_set_style(new_cb, lv_cbs_get(LV_CBS_DEF, NULL));
} else {
lv_cb_ext_t * copy_ext = lv_obj_get_ext(copy_dp);
ext->bullet = lv_btn_create(new_obj_dp, copy_ext->bullet);
ext->label = lv_label_create(new_obj_dp, copy_ext->label);
lv_cb_ext_t * copy_ext = lv_obj_get_ext(copy);
ext->bullet = lv_btn_create(new_cb, copy_ext->bullet);
ext->label = lv_label_create(new_cb, copy_ext->label);
}
lv_obj_align_us(new_obj_dp, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_align_us(new_cb, NULL, LV_ALIGN_CENTER, 0, 0);
return new_obj_dp;
return new_cb;
}
/**
* Signal function of the check box
* @param obj_dp pointer to a check box object
* @param cb pointer to a check box object
* @param sign a signal type from lv_signal_t enum
* @param param pointer to a signal specific variable
*/
bool lv_cb_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param)
bool lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param)
{
bool valid;
/* Include the ancient signal function */
valid = lv_btn_signal(obj_dp, sign, param);
valid = lv_btn_signal(cb, sign, param);
lv_cb_ext_t * ext_dp = lv_obj_get_ext(obj_dp);
lv_cbs_t * style_p = lv_obj_get_style(obj_dp);
lv_cb_ext_t * ext = lv_obj_get_ext(cb);
lv_cbs_t * cbs = lv_obj_get_style(cb);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
......@@ -112,12 +112,12 @@ bool lv_cb_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param)
case LV_SIGNAL_RELEASED:
case LV_SIGNAL_LONG_PRESS:
case LV_SIGNAL_PRESS_LOST:
lv_btn_set_state(ext_dp->bullet, lv_btn_get_state(obj_dp));
lv_btn_set_state(ext->bullet, lv_btn_get_state(cb));
break;
case LV_SIGNAL_STYLE_CHG:
lv_obj_set_size(ext_dp->bullet, style_p->bullet_size, style_p->bullet_size);
lv_obj_set_style(ext_dp->bullet, &style_p->bullet);
lv_obj_set_style(ext_dp->label, &style_p->label);
lv_obj_set_size(ext->bullet, cbs->bullet_size, cbs->bullet_size);
lv_obj_set_style(ext->bullet, &cbs->bullet);
lv_obj_set_style(ext->label, &cbs->label);
break;
case LV_SIGNAL_CLEANUP:
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
......@@ -137,13 +137,13 @@ bool lv_cb_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param)
/**
* Set the text of a check box
* @param obj_dp pointer to a check box
* @param cb pointer to a check box
* @param txt the text of the check box
*/
void lv_cb_set_text(lv_obj_t * obj_dp, const char * txt)
void lv_cb_set_text(lv_obj_t * cb, const char * txt)
{
lv_cb_ext_t * ext_dp = lv_obj_get_ext(obj_dp);
lv_label_set_text(ext_dp->label, txt);
lv_cb_ext_t * ext = lv_obj_get_ext(cb);
lv_label_set_text(ext->label, txt);
}
......@@ -153,22 +153,22 @@ void lv_cb_set_text(lv_obj_t * obj_dp, const char * txt)
/**
* Get the text of a check box
* @param obj_dp pointer to check box object
* @param cb pointer to check box object
* @return pointer to the text of the check box
*/
const char * lv_cb_get_text(lv_obj_t * obj_dp)
const char * lv_cb_get_text(lv_obj_t * cb)
{
lv_cb_ext_t * ext_dp = lv_obj_get_ext(obj_dp);
return lv_label_get_text(ext_dp->label);
lv_cb_ext_t * ext = lv_obj_get_ext(cb);
return lv_label_get_text(ext->label);
}
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_cbs_builtin_t enum
* @param copy_p copy the style to this variable. (NULL if unused)
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_cbs_t style
*/
lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy_p)
lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy)
{
static bool style_inited = false;
......@@ -188,9 +188,9 @@ lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy_p)
style_p = &lv_cbs_def;
}
if(copy_p != NULL) {
if(style_p != NULL) memcpy(copy_p, style_p, sizeof(lv_cbs_t));
else memcpy(copy_p, &lv_cbs_def, sizeof(lv_cbs_t));
if(copy != NULL) {
if(style_p != NULL) memcpy(copy, style_p, sizeof(lv_cbs_t));
else memcpy(copy, &lv_cbs_def, sizeof(lv_cbs_t));
}
return style_p;
......@@ -202,7 +202,7 @@ lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy_p)
#if 0 /*The ancestor design function is used */
/**
* Handle the drawing related tasks of the check boxes
* @param obj_dp pointer to an object
* @param cb pointer to an object
* @param mask the object will be drawn only in this area
* @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area
* (return 'true' if yes)
......@@ -210,14 +210,13 @@ lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy_p)
* LV_DESIGN_DRAW_POST: drawing after every children are drawn
* @param return true/false, depends on 'mode'
*/
static bool lv_cb_design(lv_obj_t* obj_dp, const area_t * mask_p, lv_design_mode_t mode)
static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mode)
{
if(mode == LV_DESIGN_COVER_CHK) {
/*Return false if the object is not covers the mask_p area*/
return false;
}
/*Draw the object*/
return true;
......@@ -231,7 +230,7 @@ static void lv_cbs_init(void)
/*Default style*/
/*Bg style*/
lv_rects_get(LV_RECTS_TRANSP, &lv_cbs_def.bg);
lv_btns_get(LV_RECTS_TRANSP, &lv_cbs_def.bg);
lv_cbs_def.bg.rects.hpad = 0 * LV_STYLE_MULT;
lv_cbs_def.bg.rects.vpad = 0 * LV_STYLE_MULT;
lv_cbs_def.bg.rects.opad = 5 * LV_STYLE_MULT;
......
......@@ -27,7 +27,8 @@
/*Style of check box*/
typedef struct
{
lv_btns_t bg;
lv_btns_t bg; /*Style of ancestor*/
/*New style element for this type */
lv_btns_t bullet;
lv_labels_t label;
cord_t bullet_size;
......@@ -42,7 +43,8 @@ typedef enum
/*Data of check box*/
typedef struct
{
lv_btn_ext_t btn_ext;
lv_btn_ext_t bg_btn; /*Ext. of ancestor*/
/*New data for this type */
lv_obj_t * bullet;
lv_obj_t * label;
}lv_cb_ext_t;
......@@ -50,11 +52,11 @@ typedef struct
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_cb_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_cb_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
void lv_cb_set_text(lv_obj_t * obj_dp, const char * txt);
const char * lv_cb_get_text(lv_obj_t * obj_dp);
lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy_p);
lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param);
void lv_cb_set_text(lv_obj_t * cb, const char * txt);
const char * lv_cb_get_text(lv_obj_t * cb);
lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy);
/**********************
* MACROS
......
......@@ -35,11 +35,12 @@ typedef enum
/*Style of chart background*/
typedef struct
{
lv_rects_t bg_rects;
lv_lines_t div_lines;
lv_rects_t bg; /*Style of ancestor*/
/*New style element for this type */
lv_lines_t div_line;
uint8_t div_line_opa; /*Percentage of obj. opacity*/
color_t color[LV_CHART_DL_NUM]; /*Line/Point/Col color */
uint16_t width; /*Line width or point radius*/
uint16_t width; /*Line width or point radius*/
opa_t data_opa; /*Line/Point/Col opacity in the percentage of obj. opacity*/
uint8_t dark_eff; /*Dark effect on the bottom of ó points and columns*/
}lv_charts_t;
......@@ -53,12 +54,12 @@ typedef enum
/*Data of chart background*/
typedef struct
{
lv_rect_ext_t rect_ext;
lv_rect_ext_t bg; /*Ext. of ancestor*/
/*New data for this type */
cord_t ymin;
cord_t ymax;
uint8_t hdiv_num;
uint8_t vdiv_num;
ll_dsc_t dl_ll; /*Linked list for the data line pointers (stores cord_t * )*/
uint16_t pnum; /*Point number in a data line*/
uint8_t type :2; /*Line, column or point chart*/
......@@ -68,22 +69,22 @@ typedef struct
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_chart_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_chart_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
lv_charts_t * lv_charts_get(lv_charts_builtin_t style, lv_charts_t * copy_p);
lv_obj_t * lv_chart_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_chart_signal(lv_obj_t * chart, lv_signal_t sign, void * param);
lv_charts_t * lv_charts_get(lv_charts_builtin_t style, lv_charts_t * copy);
cord_t * lv_chart_add_dataline(lv_obj_t* obj_dp);
cord_t * lv_chart_add_dataline(lv_obj_t * chart);
void lv_chart_refr(lv_obj_t * obj_dp);
void lv_chart_refr(lv_obj_t * chart);
void lv_chart_set_type(lv_obj_t * obj_dp, lv_chart_type_t type);
void lv_chart_set_hvdiv(lv_obj_t * obj_dp, uint8_t hdiv, uint8_t vdiv);
void lv_chart_set_range(lv_obj_t * obj_dp, cord_t ymin, cord_t ymax);
void lv_chart_set_pnum(lv_obj_t * obj_dp, uint16_t pnum);
void lv_chart_set_next(lv_obj_t * obj_dp, cord_t * dl_p, cord_t y);
void lv_chart_set_type(lv_obj_t * chart, lv_chart_type_t type);
void lv_chart_set_hvdiv(lv_obj_t * chart, uint8_t hdiv, uint8_t vdiv);
void lv_chart_set_range(lv_obj_t * chart, cord_t ymin, cord_t ymax);
void lv_chart_set_pnum(lv_obj_t * chart, uint16_t pnum);
void lv_chart_set_next(lv_obj_t * chart, cord_t * dl, cord_t y);
lv_chart_type_t lv_chart_get_type(lv_obj_t * obj_dp);
uint16_t lv_chart_get_pnum(lv_obj_t * obj_dp);
lv_chart_type_t lv_chart_get_type(lv_obj_t * chart);
uint16_t lv_chart_get_pnum(lv_obj_t * chart);
/**********************
* MACROS
......
......@@ -18,33 +18,40 @@
/*********************
* DEFINES
*********************/
#define LV_IMG_DECLARE(var_name) extern const color_int_t var_name[];
/**********************
* TYPEDEFS
**********************/
/*Style of template*/
typedef struct
{
lv_objs_t objs;
lv_objs_t objs; /*Style of ancestor*/
/*New style element for this type */
opa_t recolor_opa;
}lv_imgs_t;
/*Built-in styles of template*/
typedef enum
{
LV_IMGS_DEF,
LV_IMGS_LIGHT,
LV_IMGS_DARK,
}lv_imgs_builtin_t;
/*Data of template*/
typedef struct
{
char* fn_dp;
/*No ext. because inherited from the base object*/ /*Ext. of ancestor*/
/*New data for this type */
char* fn;
cord_t w;
cord_t h;
uint8_t auto_size :1;
uint8_t transp :1; /*Transp. bit in the images header (library handles this)*/
}lv_img_ext_t;
typedef enum
{
LV_IMGS_DEF,
LV_IMGS_LIGHT,
LV_IMGS_DARK,
}lv_imgs_builtin_t;
/*Image header*/
typedef struct
{
uint16_t w;
......@@ -58,20 +65,21 @@ typedef struct
* GLOBAL PROTOTYPES
**********************/
/*Create function*/
lv_obj_t* lv_img_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
lv_obj_t * lv_img_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_img_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
void lv_img_set_file(lv_obj_t* obj_p, const char * fn);
bool lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param);
void lv_img_set_file(lv_obj_t * img, const char * fn);
fs_res_t lv_img_create_file(const char * fn, const color_int_t * data_p);
void lv_img_set_auto_size(lv_obj_t* obj_dp, bool en);
void lv_img_set_auto_size(lv_obj_t * img, bool autotosize);
bool lv_img_get_auto_size(lv_obj_t* obj_dp);
bool lv_img_get_auto_size(lv_obj_t * img);
lv_imgs_t * lv_imgs_get(lv_imgs_builtin_t style, lv_imgs_t * copy_p);
lv_imgs_t * lv_imgs_get(lv_imgs_builtin_t style, lv_imgs_t * copy);
/**********************
* MACROS
**********************/
#define LV_IMG_DECLARE(var_name) extern const color_int_t var_name[];
#endif
......
......@@ -23,21 +23,18 @@
* TYPEDEFS
**********************/
/*Style of label*/
typedef struct
{
lv_objs_t objs;
lv_objs_t objs; /*Style of ancestor*/
/*New style element for this type */
font_types_t font;
uint16_t letter_space;
uint16_t line_space;
uint8_t mid :1;
}lv_labels_t;
typedef struct
{
char * txt_dp;
uint8_t fixw :1;
}lv_label_ext_t;
/*Built-in styles of label*/
typedef enum
{
LV_LABELS_DEF,
......@@ -45,24 +42,30 @@ typedef enum
LV_LABELS_TXT,
LV_LABELS_TITLE,
}lv_labels_builtin_t;
/*Data of label*/
typedef struct
{
/*Inherited from 'base_obj' so no inherited ext.*/ /*Ext. of ancestor*/
/*New data for this type */
char * txt;
uint8_t fixw :1;
}lv_label_ext_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/*Create function*/
lv_obj_t* lv_label_create(lv_obj_t* par_dp, lv_obj_t * ori_dp);
bool lv_label_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
void lv_label_set_text(lv_obj_t* obj_dp, const char * text);
void lv_label_set_fixw(lv_obj_t * obj_dp, bool fixw);
const char * lv_label_get_text(lv_obj_t* obj_dp);
bool lv_label_get_fixw(lv_obj_t * obj_dp);
void lv_label_get_letter_pos(lv_obj_t * obj_dp, uint16_t index, point_t * pos_p);
uint16_t lv_label_get_letter_on(lv_obj_t * obj_dp, point_t * pos_p);
lv_obj_t * lv_label_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param);
lv_labels_t * lv_labels_get(lv_labels_builtin_t style, lv_labels_t * copy);
lv_labels_t * lv_labels_get(lv_labels_builtin_t style, lv_labels_t * copy_p);
void lv_label_set_text(lv_obj_t * label, const char * text);
void lv_label_set_fixw(lv_obj_t * label, bool fixw);
const char * lv_label_get_text(lv_obj_t * label);
bool lv_label_get_fixw(lv_obj_t * label);
void lv_label_get_letter_pos(lv_obj_t * label, uint16_t index, point_t * pos);
uint16_t lv_label_get_letter_on(lv_obj_t * label, point_t * pos);
/**********************
* MACROS
......
......@@ -3,12 +3,6 @@
*
*/
/*Search an replace: led -> object normal name with lower case (e.g. button, label etc.)
* led -> object short name with lower case(e.g. btn, label etc)
* LED -> object short name with upper case (e.g. BTN, LABEL etc.)
*
*/
/*********************
* INCLUDES
*********************/
......@@ -33,7 +27,7 @@
/**********************
* STATIC PROTOTYPES
**********************/
static bool lv_led_design(lv_obj_t* obj_dp, const area_t * mask_p, lv_design_mode_t mode);
static bool lv_led_design(lv_obj_t * led, const area_t * mask, lv_design_mode_t mode);
static void lv_leds_init(void);
/**********************
......@@ -57,51 +51,51 @@ static lv_leds_t lv_leds_green;
/**
* Create a led objects
* @param par_dp pointer to an object, it will be the parent of the new led
* @param copy_dp pointer to a led object, if not NULL then the new object will be copied from it
* @param par pointer to an object, it will be the parent of the new led
* @param copy pointer to a led object, if not NULL then the new object will be copied from it
* @return pointer to the created led
*/
lv_obj_t* lv_led_create(lv_obj_t* par_dp, lv_obj_t * copy_dp)
lv_obj_t * lv_led_create(lv_obj_t * par, lv_obj_t * copy)
{
/*Create the ancestor basic object*/
lv_obj_t* new_obj_dp = lv_rect_create(par_dp, copy_dp);
dm_assert(new_obj_dp);
lv_obj_t * new_led = lv_rect_create(par, copy);
dm_assert(new_led);
/*Allocate the object type specific extended data*/
lv_led_ext_t * ext_dp = lv_obj_alloc_ext(new_obj_dp, sizeof(lv_led_ext_t));
dm_assert(ext_dp);
lv_led_ext_t * ext = lv_obj_alloc_ext(new_led, sizeof(lv_led_ext_t));
dm_assert(ext);
lv_obj_set_signal_f(new_obj_dp, lv_led_signal);
lv_obj_set_design_f(new_obj_dp, lv_led_design);
lv_obj_set_signal_f(new_led, lv_led_signal);
lv_obj_set_design_f(new_led, lv_led_design);
/*Init the new led object*/
if(copy_dp == NULL) {
ext_dp->bright = LV_LED_BRIGHTNESS_DEF;
lv_obj_set_style(new_obj_dp, lv_leds_get(LV_LEDS_DEF, NULL));
lv_obj_set_size_us(new_obj_dp, 40, 40);
if(copy == NULL) {
ext->bright = LV_LED_BRIGHTNESS_DEF;
lv_obj_set_style(new_led, lv_leds_get(LV_LEDS_DEF, NULL));
lv_obj_set_size_us(new_led, 40, 40);
}
/*Copy an existing object*/
else {
lv_led_ext_t * copy_ext_p = lv_obj_get_ext(copy_dp);
ext_dp->bright = copy_ext_p->bright;
lv_led_ext_t * copy_ext = lv_obj_get_ext(copy);
ext->bright = copy_ext->bright;
}
return new_obj_dp;
return new_led;
}
/**
* Signal function of the led
* @param obj_dp pointer to a led object
* @param led pointer to a led object
* @param sign a signal type from lv_signal_t enum
* @param param pointer to a signal specific variable
* @return true: the object is still valid (not deleted), false: the object become invalid
*/
bool lv_led_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param)
bool lv_led_signal(lv_obj_t * led, lv_signal_t sign, void * param)
{
bool valid;
/* Include the ancient signal function */
valid = lv_rect_signal(obj_dp, sign, param);
valid = lv_rect_signal(led, sign, param);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
......@@ -124,47 +118,47 @@ bool lv_led_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param)
/**
* Set the brightness of a LED object
* @param obj_dp pointer to a LED object
* @param led pointer to a LED object
* @param bright 0 (max. dark) ... 255 (max. light)
*/
void lv_led_set_bright(lv_obj_t * obj_dp, uint8_t bright)
void lv_led_set_bright(lv_obj_t * led, uint8_t bright)
{
/*Set the brightness*/
lv_led_ext_t * ext_dp = lv_obj_get_ext(obj_dp);
ext_dp->bright = bright;
lv_led_ext_t * ext = lv_obj_get_ext(led);
ext->bright = bright;
/*Invalidate the object there fore it will be redrawn*/
lv_obj_inv(obj_dp);
lv_obj_inv(led);
}
/**
* Light on a LED
* @param obj_dp pointer to a LED object
* @param led pointer to a LED object
*/
void lv_led_on(lv_obj_t * obj_dp)
void lv_led_on(lv_obj_t * led)
{
lv_led_set_bright(obj_dp, LV_LED_BRIGHTNESS_ON);
lv_led_set_bright(led, LV_LED_BRIGHTNESS_ON);
}
/**
* Light off a LED
* @param obj_dp pointer to a LED object
* @param led pointer to a LED object
*/
void lv_led_off(lv_obj_t * obj_dp)
void lv_led_off(lv_obj_t * led)
{
lv_led_set_bright(obj_dp, LV_LED_BRIGHTNESS_OFF);
lv_led_set_bright(led, LV_LED_BRIGHTNESS_OFF);
}
/**
* Toggle the state of a LED
* @param obj_dp pointer to a LED object
* @param led pointer to a LED object
*/
void lv_led_tgl(lv_obj_t * obj_dp)
void lv_led_tgl(lv_obj_t * led)
{
uint8_t bright = lv_led_get_bright(obj_dp);
if(bright > 60) lv_led_off(obj_dp);
else lv_led_on(obj_dp);
uint8_t bright = lv_led_get_bright(led);
if(bright > 60) lv_led_off(led);
else lv_led_on(led);
}
/*=====================
......@@ -173,22 +167,22 @@ void lv_led_tgl(lv_obj_t * obj_dp)
/**
* Get the brightness of a LEd object
* @param obj_dp pointer to LED object
* @param led pointer to LED object
* @return bright 0 (max. dark) ... 255 (max. light)
*/
uint8_t lv_led_get_bright(lv_obj_t * obj_dp)
uint8_t lv_led_get_bright(lv_obj_t * led)
{
lv_led_ext_t * ext_dp = lv_obj_get_ext(obj_dp);
return ext_dp->bright;
lv_led_ext_t * ext = lv_obj_get_ext(led);
return ext->bright;
}
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_leds_builtin_t enum
* @param copy_p copy the style to this variable. (NULL if unused)
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_leds_t style
*/
lv_leds_t * lv_leds_get(lv_leds_builtin_t style, lv_leds_t * copy_p)
lv_leds_t * lv_leds_get(lv_leds_builtin_t style, lv_leds_t * copy)
{
static bool style_inited = false;
......@@ -212,9 +206,9 @@ lv_leds_t * lv_leds_get(lv_leds_builtin_t style, lv_leds_t * copy_p)
style_p = &lv_leds_def;
}
if(copy_p != NULL) {
if(style_p != NULL) memcpy(copy_p, style_p, sizeof(lv_leds_t));
else memcpy(copy_p, &lv_leds_def, sizeof(lv_leds_t));
if(copy != NULL) {
if(style_p != NULL) memcpy(copy, style_p, sizeof(lv_leds_t));
else memcpy(copy, &lv_leds_def, sizeof(lv_leds_t));
}
return style_p;
......@@ -226,7 +220,7 @@ lv_leds_t * lv_leds_get(lv_leds_builtin_t style, lv_leds_t * copy_p)
/**
* Handle the drawing related tasks of the leds
* @param obj_dp pointer to an object
* @param led pointer to an object
* @param mask the object will be drawn only in this area
* @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area
* (return 'true' if yes)
......@@ -234,27 +228,27 @@ lv_leds_t * lv_leds_get(lv_leds_builtin_t style, lv_leds_t * copy_p)
* LV_DESIGN_DRAW_POST: drawing after every children are drawn
* @param return true/false, depends on 'mode'
*/
static bool lv_led_design(lv_obj_t* obj_dp, const area_t * mask_p, lv_design_mode_t mode)
static bool lv_led_design(lv_obj_t * led, const area_t * mask, lv_design_mode_t mode)
{
if(mode == LV_DESIGN_COVER_CHK) {
/*Return false if the object is not covers the mask_p area*/
return false;
} else if(mode == LV_DESIGN_DRAW_MAIN) {
/*Make darker colors in a temporary style according to the brightness*/
lv_led_ext_t * led_ext_p = lv_obj_get_ext(obj_dp);
lv_leds_t * leds_p = lv_obj_get_style(obj_dp);
lv_led_ext_t * ext = lv_obj_get_ext(led);
lv_leds_t * style = lv_obj_get_style(led);
lv_leds_t leds_tmp;
memcpy(&leds_tmp, leds_p, sizeof(leds_tmp));
memcpy(&leds_tmp, style, sizeof(leds_tmp));
leds_tmp.rects.objs.color = color_mix(leds_tmp.rects.objs.color, COLOR_BLACK, led_ext_p->bright);
leds_tmp.rects.gcolor = color_mix(leds_tmp.rects.gcolor, COLOR_BLACK, led_ext_p->bright);
leds_tmp.bg_rect.objs.color = color_mix(leds_tmp.bg_rect.objs.color, COLOR_BLACK, ext->bright);
leds_tmp.bg_rect.gcolor = color_mix(leds_tmp.bg_rect.gcolor, COLOR_BLACK, ext->bright);
opa_t opa = lv_obj_get_opa(obj_dp);
opa_t opa = lv_obj_get_opa(led);
area_t area;
lv_obj_get_cords(obj_dp, &area);
lv_obj_get_cords(led, &area);
lv_draw_rect(&area, mask_p, &leds_tmp.rects, opa);
lv_draw_rect(&area, mask, &leds_tmp.bg_rect, opa);
}
return true;
}
......@@ -265,22 +259,22 @@ static bool lv_led_design(lv_obj_t* obj_dp, const area_t * mask_p, lv_design_mod
static void lv_leds_init(void)
{
/*Default style*/
lv_rects_get(LV_RECTS_DEF, &lv_leds_def.rects);
lv_leds_def.rects.objs.color = COLOR_RED;
lv_leds_def.rects.gcolor = COLOR_MARRON,
lv_leds_def.rects.bcolor = COLOR_WHITE;
lv_leds_def.rects.bwidth = 4 * LV_STYLE_MULT;
lv_leds_def.rects.bopa = 50;
lv_leds_def.rects.round = LV_RECT_CIRCLE;
lv_leds_def.rects.hpad = 0;
lv_leds_def.rects.vpad = 0;
lv_leds_def.rects.opad = 0;
lv_rects_get(LV_RECTS_DEF, &lv_leds_def.bg_rect);
lv_leds_def.bg_rect.objs.color = COLOR_RED;
lv_leds_def.bg_rect.gcolor = COLOR_MARRON,
lv_leds_def.bg_rect.bcolor = COLOR_WHITE;
lv_leds_def.bg_rect.bwidth = 4 * LV_STYLE_MULT;
lv_leds_def.bg_rect.bopa = 50;
lv_leds_def.bg_rect.round = LV_RECT_CIRCLE;
lv_leds_def.bg_rect.hpad = 0;
lv_leds_def.bg_rect.vpad = 0;
lv_leds_def.bg_rect.opad = 0;
/* Green style */
memcpy(&lv_leds_green, &lv_leds_def, sizeof(lv_leds_t));
lv_leds_green.rects.objs.color = COLOR_LIME;
lv_leds_green.rects.gcolor = COLOR_GREEN;
lv_leds_green.rects.bcolor = COLOR_WHITE;
lv_leds_green.bg_rect.objs.color = COLOR_LIME;
lv_leds_green.bg_rect.gcolor = COLOR_GREEN;
lv_leds_green.bg_rect.bcolor = COLOR_WHITE;
}
#endif
......@@ -3,13 +3,6 @@
*
*/
/*Search an replace: led -> object normal name with lower case (e.g. button, label etc.)
* led -> object short name with lower case(e.g. btn, label etc)
* LED -> object short name with upper case (e.g. BTN, LABEL etc.)
*
*/
#ifndef LV_LED_H
#define LV_LED_H
......@@ -32,7 +25,7 @@
/*Style of led*/
typedef struct
{
lv_rects_t rects;/*Style of ancestor*/
lv_rects_t bg_rect;/*Style of ancestor*/
/*New style element for this type */
}lv_leds_t;
......@@ -55,16 +48,16 @@ typedef struct
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_led_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_led_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
lv_leds_t * lv_leds_get(lv_leds_builtin_t style, lv_leds_t * copy_p);
lv_obj_t * lv_led_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_led_signal(lv_obj_t * led, lv_signal_t sign, void * param);
lv_leds_t * lv_leds_get(lv_leds_builtin_t style, lv_leds_t * copy);
void lv_led_set_bright(lv_obj_t * obj_dp, uint8_t bright);
uint8_t lv_led_get_bright(lv_obj_t * obj_dp);
void lv_led_set_bright(lv_obj_t * led, uint8_t bright);
uint8_t lv_led_get_bright(lv_obj_t * led);
void lv_led_on(lv_obj_t * obj_dp);
void lv_led_off(lv_obj_t * obj_dp);
void lv_led_tgl(lv_obj_t * obj_dp);
void lv_led_on(lv_obj_t * led);
void lv_led_off(lv_obj_t * led);
void lv_led_tgl(lv_obj_t * led);
/**********************
......
......@@ -21,21 +21,15 @@
/**********************
* TYPEDEFS
**********************/
/*Style of line*/
typedef struct
{
const point_t * point_p;
uint16_t point_num;
uint8_t auto_size :1;
uint8_t y_inv :1;
uint8_t upscale :1;
}lv_line_ext_t;
typedef struct
{
lv_objs_t objs;
lv_objs_t objs; /*Style of ancestor*/
/*New style element for this type */
uint16_t width;
}lv_lines_t;
/*Built-in styles of line*/
typedef enum
{
LV_LINES_DEF,
......@@ -43,19 +37,30 @@ typedef enum
LV_LINES_CHART,
}lv_lines_builtin_t;
/*Data of line*/
typedef struct
{
/*Inherited from 'base_obj' so inherited ext.*/ /*Ext. of ancestor*/
const point_t * point_array;
uint16_t point_num;
uint8_t auto_size :1;
uint8_t y_inv :1;
uint8_t upscale :1;
}lv_line_ext_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_line_create(lv_obj_t * par_dp, lv_obj_t * copy_dp);
bool lv_line_signal(lv_obj_t * obj_dp, lv_signal_t sign, void * param);
lv_lines_t * lv_lines_get(lv_lines_builtin_t style, lv_lines_t * copy_p);
void lv_line_set_points(lv_obj_t * obj_dp, const point_t * point_a, uint16_t point_num);
void lv_line_set_auto_size(lv_obj_t * obj_dp, bool en);
void lv_line_set_y_inv(lv_obj_t * obj_dp, bool en);
void lv_line_set_upscale(lv_obj_t * obj_dp, bool en);
bool lv_line_get_auto_size(lv_obj_t * obj_dp);
bool lv_line_get_y_inv(lv_obj_t * obj_dp);
bool lv_line_get_upscale(lv_obj_t * obj_dp);
lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_line_signal(lv_obj_t * line, lv_signal_t sign, void * param);
lv_lines_t * lv_lines_get(lv_lines_builtin_t style, lv_lines_t * copy);
void lv_line_set_points(lv_obj_t * line, const point_t * point_a, uint16_t point_num);
void lv_line_set_auto_size(lv_obj_t * line, bool autosize);
void lv_line_set_y_inv(lv_obj_t * line, bool yinv);
void lv_line_set_upscale(lv_obj_t * line, bool unscale);
bool lv_line_get_auto_size(lv_obj_t * line);
bool lv_line_get_y_inv(lv_obj_t * line);
bool lv_line_get_upscale(lv_obj_t * line);
/**********************
* MACROS
......
......@@ -26,17 +26,18 @@
* TYPEDEFS
**********************/
/*Style of LIST*/
/*Style of list*/
typedef struct
{
lv_pages_t pages; /*Ancestor page style*/
lv_btns_t liste_btns;
lv_labels_t liste_labels;
lv_imgs_t liste_imgs;
lv_pages_t bg_page; /*Style of ancestor*/
/*New style element for this type */
lv_btns_t liste_btn;
lv_labels_t liste_label;
lv_imgs_t liste_img;
lv_rect_layout_t liste_layout;
}lv_lists_t;
/*Built-in styles of LISTATE*/
/*Built-in styles of list*/
typedef enum
{
LV_LISTS_DEF,
......@@ -51,27 +52,26 @@ typedef enum
LV_LIST_FIT_LONGEST,
}lv_list_fit_t;
/*Data of LIST*/
/*Data of list*/
typedef struct
{
lv_page_ext_t page_ext;
lv_page_ext_t page_ext; /*Ext. of ancestor*/
/*New data for this type */
uint8_t fit; /*Width adjustment of list elements (from lv_list_adjsut_t)*/
}lv_list_ext_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_list_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_list_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
lv_obj_t * lv_list_add(lv_obj_t * obj_dp, const char * img_fn, const char * txt, bool (*rel_action)(lv_obj_t*, lv_dispi_t *));
lv_lists_t * lv_lists_get(lv_lists_builtin_t style, lv_lists_t * copy_p);
void lv_list_down(lv_obj_t * obj_dp);
void lv_list_up(lv_obj_t * obj_dp);
void lv_list_set_fit(lv_obj_t * obj_dp, lv_list_fit_t fit);
lv_list_fit_t lv_list_get_fit(lv_obj_t * obj_dp);
lv_obj_t * lv_list_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_list_signal(lv_obj_t * list, lv_signal_t sign, void * param);
lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, bool (*rel_action)(lv_obj_t *, lv_dispi_t *));
lv_lists_t * lv_lists_get(lv_lists_builtin_t style, lv_lists_t * copy);
void lv_list_down(lv_obj_t * list);
void lv_list_up(lv_obj_t * list);
void lv_list_set_fit(lv_obj_t * list, lv_list_fit_t fit);
lv_list_fit_t lv_list_get_fit(lv_obj_t * list);
/**********************
* MACROS
......
......@@ -28,14 +28,13 @@
/**********************
* STATIC PROTOTYPES
**********************/
static bool lv_templ_design(lv_obj_t* obj_dp, const area_t * mask_p, lv_design_mode_t mode);
static bool lv_templ_design(lv_obj_t * templ, const area_t * mask, lv_design_mode_t mode);
static void lv_temps_init(void);
/**********************
* STATIC VARIABLES
**********************/
static lv_templs_t lv_templs_def =
{ /*Create a default style*/ };
static lv_templs_t lv_templs_def; /*Default template style*/
/**********************
* MACROS
......@@ -51,50 +50,50 @@ static lv_templs_t lv_templs_def =
/**
* Create a template objects
* @param par_dp pointer to an object, it will be the parent of the new template
* @param copy_dp pointer to a template object, if not NULL then the new object will be copied from it
* @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
*/
lv_obj_t * lv_templ_create(lv_obj_t* par_dp, lv_obj_t * copy_dp)
lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
{
/*Create the ancestor object*/
lv_obj_t* new_obj_dp = lv_obj_create(par_dp, copy_dp);
dm_assert(new_obj_dp);
/*Create the ancestor templect*/
lv_templ_t * new_templ = lv_templ_create(par, copy);
dm_assert(new_templ);
/*Allocate the object type specific extended data*/
lv_templ_ext_t * ext_dp = lv_obj_alloc_ext(new_obj_dp, sizeof(lv_templ_ext_t));
dm_assert(ext_dp);
/*Allocate the templect type specific extended data*/
lv_templ_ext_t * ext = lv_templ_alloc_ext(new_templ, sizeof(lv_templ_ext_t));
dm_assert(ext);
/*The signal and design functions are not copied so set them here*/
lv_obj_set_signal_f(new_obj_dp, lv_templ_signal);
lv_obj_set_design_f(new_obj_dp, lv_templ_design);
lv_templ_set_signal_f(new_templ, lv_templ_signal);
lv_templ_set_design_f(new_templ, lv_templ_design);
/*Init the new template object*/
if(copy_dp == NULL) {
/*Init the new template templect*/
if(copy == NULL) {
}
/*Copy an existing object*/
/*Copy an existing templect*/
else {
lv_templ_ext_t * copy_ext_dp = lv_obj_get_ext(copy_dp);
lv_templ_ext_t * copy_ext = lv_templ_get_ext(copy);
}
return new_obj_dp;
return new_templ;
}
/**
* Signal function of the template
* @param obj_dp pointer to a template object
* @param templ pointer to a template object
* @param sign a signal type from lv_signal_t enum
* @param param pointer to a signal specific variable
* @return true: the object is still valid (not deleted), false: the object become invalid
*/
bool lv_templ_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param)
bool lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param)
{
bool valid;
/* Include the ancient signal function */
/* TODO update it to the ancestor's signal function*/
valid = lv_obj_signal(obj_dp, sign, param);
valid = lv_obj_signal(templ, sign, param);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
......@@ -123,10 +122,10 @@ bool lv_templ_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param)
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_templs_builtin_t enum
* @param copy_p copy the style to this variable. (NULL if unused)
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_templs_t style
*/
lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy_p)
lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy)
{
static bool style_inited = false;
......@@ -146,9 +145,9 @@ lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy_p)
style_p = &lv_templs_def;
}
if(copy_p != NULL) {
if(style_p != NULL) memcpy(copy_p, style_p, sizeof(lv_templs_t));
else memcpy(copy_p, &lv_templs_def, sizeof(lv_templs_t));
if(copy != NULL) {
if(style_p != NULL) memcpy(copy, style_p, sizeof(lv_templs_t));
else memcpy(copy, &lv_templs_def, sizeof(lv_templs_t));
}
return style_p;
......@@ -161,7 +160,7 @@ lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy_p)
/**
* Handle the drawing related tasks of the templates
* @param obj_dp pointer to an object
* @param templ pointer to an object
* @param mask the object will be drawn only in this area
* @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area
* (return 'true' if yes)
......@@ -169,7 +168,7 @@ lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy_p)
* LV_DESIGN_DRAW_POST: drawing after every children are drawn
* @param return true/false, depends on 'mode'
*/
static bool lv_templ_design(lv_obj_t* obj_dp, const area_t * mask_p, lv_design_mode_t mode)
static bool lv_templ_design(lv_obj_t * templ, const area_t * mask, lv_design_mode_t mode)
{
if(mode == LV_DESIGN_COVER_CHK) {
/*Return false if the object is not covers the mask_p area*/
......
......@@ -52,9 +52,9 @@ typedef struct
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t * lv_templ_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_templ_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy_p);
lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param);
lv_templs_t * lv_templs_get(lv_templs_builtin_t style, lv_templs_t * copy);
/**********************
* MACROS
......
......@@ -29,6 +29,7 @@ typedef enum
LV_PAGE_SB_MODE_AUTO,
}lv_page_sb_mode_t;
/*Style of page*/
typedef struct
{
lv_rects_t bg_rects; /*Style of ancestor*/
......@@ -40,32 +41,35 @@ typedef struct
uint8_t sb_opa;
}lv_pages_t;
/*Built-in styles of page*/
typedef enum
{
LV_PAGES_DEF,
LV_PAGES_TRANSP,
}lv_pages_builtin_t;
/*Data of page*/
typedef struct
{
lv_rect_ext_t rect_ext; /*Ext. of ancestor*/
/*New data for this type */
lv_obj_t * scrolling_dp; /*The scrollable object on the background*/
lv_obj_t * scrolling; /*The scrollable object on the background*/
area_t sbh; /*Horizontal scrollbar*/
area_t sbv; /*Vertical scrollbar*/
uint8_t sbh_draw :1; /*1: horizontal scrollbar is visible now*/
uint8_t sbv_draw :1; /*1: vertical scrollbar is visible now*/
}lv_page_ext_t;
typedef enum
{
LV_PAGES_DEF,
LV_PAGES_TRANSP,
}lv_pages_builtin_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/*Create function*/
lv_obj_t* lv_page_create(lv_obj_t* par_dp, lv_obj_t * ori_dp);
void lv_page_glue_obj(lv_obj_t* page_p, bool en);
lv_pages_t * lv_pages_get(lv_pages_builtin_t style, lv_pages_t * to_copy);
bool lv_page_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy);
void lv_page_glue_obj(lv_obj_t * page, bool glue);
lv_pages_t * lv_pages_get(lv_pages_builtin_t style, lv_pages_t * copy);
bool lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param);
/**********************
* MACROS
......
......@@ -41,22 +41,23 @@ typedef enum
/*Data of progress bar*/
typedef struct
{
lv_rect_ext_t rect_ext;
lv_rect_ext_t rect_ext; /*Ext. of ancestor*/
/*New data for this type */
uint16_t act_value;
uint16_t min_value;
uint16_t max_value;
char * format_dp; /*Format string of the label*/
char * format; /*Format string of the label*/
}lv_pb_ext_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_pb_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_pb_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
void lv_pb_set_value(lv_obj_t * obj_dp, uint16_t value);
void lv_pb_set_min_max_value(lv_obj_t * obj_dp, uint16_t min, uint16_t max);
void lv_pb_set_format(lv_obj_t * obj_dp, const char * format);
uint16_t lv_pb_get_value(lv_obj_t * obj_dp);
lv_obj_t * lv_pb_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_pb_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
void lv_pb_set_value(lv_obj_t * obj, uint16_t value);
void lv_pb_set_min_max_value(lv_obj_t * obj, uint16_t min, uint16_t max);
void lv_pb_set_format(lv_obj_t * obj, const char * format);
uint16_t lv_pb_get_value(lv_obj_t * obj);
lv_pbs_t * lv_pbs_get(lv_pbs_builtin_t style, lv_pbs_t * copy_p);
/**********************
......
......@@ -37,9 +37,11 @@ typedef enum
LV_RECT_LAYOUT_GRID,
}lv_rect_layout_t;
/*Style of template*/
typedef struct
{
lv_objs_t objs;
lv_objs_t objs; /*Style of ancestor*/
/*New style element for this type */
color_t gcolor;
color_t bcolor;
uint16_t bwidth;
......@@ -51,36 +53,38 @@ typedef struct
uint8_t empty :1;
}lv_rects_t;
/*Built-in styles of template*/
typedef enum
{
LV_RECTS_DEF,
LV_RECTS_TRANSP,
LV_RECTS_BORDER,
}lv_rects_builtin_t;
typedef struct
{
/*Inherited from 'base_obj' so no inherited ext. */ /*Ext. of ancestor*/
/*New data for this type */
uint8_t layout :5;
uint8_t hfit_en :1;
uint8_t vfit_en :1;
}lv_rect_ext_t;
typedef enum
{
LV_RECTS_DEF,
LV_RECTS_TRANSP,
LV_RECTS_BORDER,
}lv_rects_builtin_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/*Create function*/
lv_obj_t* lv_rect_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_rect_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
void lv_rect_set_fit(lv_obj_t * obj_dp, bool hor_en, bool ver_en);
void lv_rect_set_layout(lv_obj_t * obj_dp, lv_rect_layout_t layout);
lv_obj_t * lv_rect_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_rect_signal(lv_obj_t * rect, lv_signal_t sign, void * param);
lv_rect_layout_t lv_rect_get_layout(lv_obj_t * obj_dp);
bool lv_rect_get_hfit(lv_obj_t * obj_dp);
bool lv_rect_get_vfit(lv_obj_t * obj_dp);
void lv_rect_set_fit(lv_obj_t * rect, bool hor_en, bool ver_en);
void lv_rect_set_layout(lv_obj_t * rect, lv_rect_layout_t layout);
lv_rects_t * lv_rects_get(lv_rects_builtin_t style, lv_rects_t * copy_p);
lv_rect_layout_t lv_rect_get_layout(lv_obj_t * rect);
bool lv_rect_get_hfit(lv_obj_t * rect);
bool lv_rect_get_vfit(lv_obj_t * rect);
lv_rects_t * lv_rects_get(lv_rects_builtin_t style, lv_rects_t * copy);
/**********************
* MACROS
......
......@@ -29,7 +29,7 @@ typedef struct
{
lv_pages_t pages; /*Style of ancestor*/
/*New style element for this type */
lv_labels_t labels;
lv_labels_t label;
color_t cursor_color;
cord_t cursor_width;
uint8_t cursor_show :1;
......@@ -46,7 +46,7 @@ typedef struct
{
lv_page_ext_t page; /*Ext. of ancestor*/
/*New data for this type */
lv_obj_t * label_dp;
lv_obj_t * label;
cord_t cursor_valid_x;
uint16_t cursor_pos;
}lv_ta_ext_t;
......@@ -54,22 +54,21 @@ typedef struct
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t* lv_ta_create(lv_obj_t* par_dp, lv_obj_t * copy_dp);
bool lv_ta_signal(lv_obj_t* obj_dp, lv_signal_t sign, void * param);
lv_tas_t * lv_tas_get(lv_tas_builtin_t style, lv_tas_t * copy_p);
void lv_ta_add_char(lv_obj_t * obj_dp, char c);
void lv_ta_add_text(lv_obj_t * obj_dp, const char * txt);
void lv_ta_del(lv_obj_t * obj_dp);
void lv_ta_set_cursor_pos(lv_obj_t * obj_dp, uint16_t pos);
void lv_ta_cursor_right (lv_obj_t * obj_dp);
void lv_ta_cursor_left(lv_obj_t * obj_dp);
void lv_ta_cursor_down(lv_obj_t * obj_dp);
void lv_ta_cursor_up(lv_obj_t * obj_dp);
const char * lv_ta_get_txt(lv_obj_t obj_dp);
uint16_t lv_ta_get_cursor_pos(lv_obj_t * obj_dp);
lv_obj_t * lv_ta_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param);
lv_tas_t * lv_tas_get(lv_tas_builtin_t style, lv_tas_t * copy);
void lv_ta_add_char(lv_obj_t * ta, char c);
void lv_ta_add_text(lv_obj_t * ta, const char * txt);
void lv_ta_del(lv_obj_t * ta);
void lv_ta_set_cursor_pos(lv_obj_t * ta, uint16_t pos);
void lv_ta_cursor_right (lv_obj_t * ta);
void lv_ta_cursor_left(lv_obj_t * taj);
void lv_ta_cursor_down(lv_obj_t * ta);
void lv_ta_cursor_up(lv_obj_t * ta);
const char * lv_ta_get_txt(lv_obj_t * ta);
uint16_t lv_ta_get_cursor_pos(lv_obj_t * ta);
/**********************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment