2.9 KiB
2.9 KiB
Description of the feature or fix
A clear and concise description of what the bug or new feature is.
Checkpoints
- Run
code-format.pyfrom the scripts folder. astyle needs to be installed. - Update the Documentation if needed
- Add Examples if relevant.
- Add Tests if applicable.
- If you added new options to
lv_conf_template.hrun lv_conf_internal_gen.py and update Kconfig.
Be sure the following conventions are followed:
- Follow the Styling guide
- Prefer
enums instead of macros. If inevitable to usedefines export them withLV_EXPORT_CONST_INT(defined_value)right after thedefine. - In function arguments prefer
type name[]declaration for array parameters instead oftype * name - Use typed pointers instead of
void *pointers - Do not
mallocinto a static or global variables. Instead declare the variable inlv_global_tstructure inlv_global.hand mark the variable with(LV_GLOBAL_DEFAULT()->variable)when it's used. See a detailed description here. - Widget constructor must follow the
lv_<widget_name>_create(lv_obj_t * parent)pattern. - Widget members function must start with
lv_<module_name>and should receivelv_obj_t *as first argument which is a pointer to widget object itself. structs should be used via an API and not modified directly via their elements.structAPIs should follow the widgets' conventions. That is to receive a pointer to thestructas the first argument, and the prefix of thestructname should be used as the prefix of the function name too (e.g.lv_disp_set_default(lv_disp_t * disp))- Functions and
structs which are not part of the public API must begin with underscore in order to mark them as "private". - Arguments must be named in H files too.
- To register and use callbacks one of the following needs to be followed (see a detailed description here):
- For both the registration function and the callback pass a pointer to a
structas the first argument. Thestructmust containvoid * user_datafield. - The last argument of the registration function must be
void * user_dataand the sameuser_dataneeds to be passed as the last argument of the callback. - Callback types not following these conventions should end with
xcb_t.
- For both the registration function and the callback pass a pointer to a