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

2.7 KiB

Description of the feature or fix

A clear and concise description of what the bug or new feature is.

Checkpoints

Be sure the following conventions are followed:

  • Follow the Styling guide
  • Prefer enums instead of macros. If inevitable to use defines export them with LV_EXPORT_CONST_INT(defined_value) right after the define.
  • In function arguments prefer type name[] declaration for array parameters instead of type * name
  • Use typed pointers instead of void * pointers
  • Do not malloc into a static or global variables. Instead declare the variable in LV_ITERATE_ROOTS list in lv_gc.h and mark the variable with GC_ROOT(variable) when it's used.
  • Widget constructor must follow the lv_<widget_name>_create(lv_obj_t * parent) pattern.
  • Widget members function must start with lv_<modul_name> and should receive lv_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.
  • struct APIs should follow the widgets' conventions. That is to receive a pointer to the struct as the first argument, and the prefix of the struct name 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 followings needs to be followed:
    • For both the registration function and the callback pass a pointer to a struct as the first argument. The struct must contain void * user_data field.
    • The last argument of the registration function must be void * user_data and the same user_data needs to be passed as the last argument of the callback.
    • Callback types not following these conventions should end with xcb_t.