BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
cab8e4e7
Commit
cab8e4e7
authored
Nov 10, 2017
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update lv_objx_templ
parent
f03efd94
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
lv_objx_templ.c
lv_objx/lv_objx_templ.c
+27
-27
No files found.
lv_objx/lv_objx_templ.c
View file @
cab8e4e7
...
...
@@ -30,10 +30,13 @@
* STATIC PROTOTYPES
**********************/
static
bool
lv_templ_design
(
lv_obj_t
*
templ
,
const
area_t
*
mask
,
lv_design_mode_t
mode
);
static
lv_res_t
lv_templ_signal
(
lv_obj_t
*
templ
,
lv_signal_t
sign
,
void
*
param
);
/**********************
* STATIC VARIABLES
**********************/
static
lv_signal_func_t
ancestor_signal
;
static
lv_design_func_t
ancestor_design
;
/**********************
* MACROS
...
...
@@ -63,6 +66,8 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
/*Allocate the template type specific extended data*/
lv_templ_ext_t
*
ext
=
lv_obj_alloc_ext
(
new_templ
,
sizeof
(
lv_templ_ext_t
));
dm_assert
(
ext
);
if
(
ancestor_signal
==
NULL
)
ancestor_signal
=
lv_obj_get_signal_func
(
new_templ
);
if
(
ancestor_design
==
NULL
)
ancestor_design
=
lv_obj_get_design_func
(
new_templ
);
/*Initialize the allocated 'ext' */
ext
->
xyz
=
0
;
...
...
@@ -86,32 +91,6 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
return
new_templ
;
}
/**
* Signal function of the template
* @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
*
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_ANCESTOR_signal
(
templ
,
sign
,
param
);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
if
(
valid
!=
false
)
{
if
(
sign
==
LV_SIGNAL_CLEANUP
)
{
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
}
}
return
valid
;
}
/*======================
* Add/remove functions
*=====================*/
...
...
@@ -150,7 +129,6 @@ bool lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param)
* STATIC FUNCTIONS
**********************/
/**
* Handle the drawing related tasks of the templates
* @param templ pointer to an object
...
...
@@ -179,5 +157,27 @@ static bool lv_templ_design(lv_obj_t * templ, const area_t * mask, lv_design_mod
return
true
;
}
/**
* Signal function of the template
* @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 LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
*/
static
lv_res_t
lv_templ_signal
(
lv_obj_t
*
templ
,
lv_signal_t
sign
,
void
*
param
)
{
lv_res_t
res
;
/* Include the ancient signal function */
res
=
lv_ancestor_signal
(
templ
,
sign
,
param
);
if
(
res
!=
LV_RES_OK
)
return
res
;
if
(
sign
==
LV_SIGNAL_CLEANUP
)
{
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
}
return
res
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment