summaryrefslogtreecommitdiff
path: root/src/libs/lvgl/docs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/lvgl/docs')
-rw-r--r--src/libs/lvgl/docs/CODE_OF_CONDUCT.md46
-rw-r--r--src/libs/lvgl/docs/CODING_STYLE.md94
-rw-r--r--src/libs/lvgl/docs/CONTRIBUTING.md111
3 files changed, 251 insertions, 0 deletions
diff --git a/src/libs/lvgl/docs/CODE_OF_CONDUCT.md b/src/libs/lvgl/docs/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..c7d7eeb1
--- /dev/null
+++ b/src/libs/lvgl/docs/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [atom@github.com](mailto:atom@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/src/libs/lvgl/docs/CODING_STYLE.md b/src/libs/lvgl/docs/CODING_STYLE.md
new file mode 100644
index 00000000..31071e94
--- /dev/null
+++ b/src/libs/lvgl/docs/CODING_STYLE.md
@@ -0,0 +1,94 @@
+
+## File format
+Use [lv_misc/lv_templ.c](https://github.com/littlevgl/lvgl/blob/master/src/lv_misc/lv_templ.c) and [lv_misc/lv_templ.h](https://github.com/littlevgl/lvgl/blob/master/src/lv_misc/lv_templ.h)
+
+## Naming conventions
+* Words are separated by '_'
+* In variable and function names use only lower case letters (e.g. *height_tmp*)
+* In enums and defines use only upper case letters (e.g. *e.g. MAX_LINE_NUM*)
+* Global names (API):
+ * starts with *lv*
+ * followed by module name: *btn*, *label*, *style* etc.
+ * followed by the action (for functions): *set*, *get*, *refr* etc.
+ * closed with the subject: *name*, *size*, *state* etc.
+* Typedefs
+ * prefer `typedef struct` and `typedef enum` instead of `struct name` and `enum name`
+ * always end `typedef struct` and `typedef enum` type names with `_t`
+* Abbreviations:
+ * Use abbreviations on public names only if they become longer than 32 characters
+ * Use only very straightforward (e.g. pos: position) or well-established (e.g. pr: press) abbreviations
+
+## Coding guide
+* Functions:
+ * Try to write function shorter than is 50 lines
+ * Always shorter than 100 lines (except very straightforwards)
+* Variables:
+ * One line, one declaration (BAD: char x, y;)
+ * Use `<stdint.h>` (*uint8_t*, *int32_t* etc)
+ * Declare variables when needed (not all at function start)
+ * Use the smallest required scope
+ * Variables in a file (outside functions) are always *static*
+ * Do not use global variables (use functions to set/get static variables)
+
+## Comments
+Before every function have a comment like this:
+
+```c
+/**
+ * Return with the screen of an object
+ * @param obj pointer to an object
+ * @return pointer to a screen
+ */
+lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
+```
+
+Always use `/* Something */` format and NOT `//Something`
+
+Write readable code to avoid descriptive comments like:
+`x++; /* Add 1 to x */`.
+The code should show clearly what you are doing.
+
+You should write **why** have you done this:
+`x++; /*Because of closing '\0' of the string */`
+
+Short "code summaries" of a few lines are accepted. E.g. `/*Calculate the new coordinates*/`
+
+In comments use \` \` when referring to a variable. E.g. ``/*Update the value of `x_act`*/``
+
+### Formatting
+Here is example to show bracket placing and using of white spaces:
+```c
+/**
+ * Set a new text for a label. Memory will be allocated to store the text by the label.
+ * @param label pointer to a label object
+ * @param text '\0' terminated character string. NULL to refresh with the current text.
+ */
+void lv_label_set_text(lv_obj_t * label, const char * text)
+{ /* Main brackets of functions in new line*/
+
+ if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/
+
+ lv_obj_inv(label);
+
+ lv_label_ext_t * ext = lv_obj_get_ext(label);
+
+ /*Comment before a section */
+ if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/
+ lv_label_refr_text(label);
+ return;
+ }
+
+ ...
+}
+```
+
+Use 4 spaces indentation instead of tab.
+
+You can use **astyle** to format the code. The required config flies are: `docs/astyle_c` and `docs/astyle_h`.
+To format the source files:
+ `$ find . -type f -name "*.c" | xargs astyle --options=docs/astyle_c`
+
+To format the header files:
+ `$ find . -type f -name "*.h" | xargs astyle --options=docs/astyle_h`
+
+Append `-n` to the end to skip creation of backup file OR use `$ find . -type f -name "*.bak" -delete` (for source file's backups) and `find . -type f -name "*.orig" -delete` (for header file's backups)
diff --git a/src/libs/lvgl/docs/CONTRIBUTING.md b/src/libs/lvgl/docs/CONTRIBUTING.md
new file mode 100644
index 00000000..aa31870e
--- /dev/null
+++ b/src/libs/lvgl/docs/CONTRIBUTING.md
@@ -0,0 +1,111 @@
+# Contributing to Littlev Graphics Library
+
+**Do you have some free time to spend with programming?
+Are you working on an Embedded GUI project with LittlevGL?
+See how can you help to improve the graphics library!**
+
+There are many ways to join the community. If you have some time to work with us I'm sure you will find something that fits you! You can:
+- help others in the [Forum](https://forum.littlevgl.com/)
+- improve and/or translate the documentation
+- write a blog post about your experiences
+- report and/or fix bugs
+- suggest and/or implement new features
+
+But first, start with the most Frequently Asked Questions.
+
+# FAQ about contributing
+
+## Where can I write my question and remarks?
+
+We use the [Forum](https://forum.littlevgl.com/) to ask and answer questions and [GitHub's issue tracker](https://github.com/littlevgl/lvgl/issues) for development-related discussion.
+
+But there are some simple rules:
+- Be kind and friendly.
+- Speak about one thing in one issue/topic.
+- Give feedback and close the issue or mark the topic as solved if your question is answered.
+- Tell what you experience or expect. _"The button is not working"_ is not enough info to get help.
+- If possible send an absolute minimal code example in order to reproduce the issue
+- Use [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to format your post.
+
+## How can I send fixes and improvements?
+
+Merging new code happens via Pull Requests. If you are still not familiar with the Pull Requests (PR for short) here is a quick guide:
+1. **Fork** the [lvgl repository](https://github.com/littlevgl/lvgl). To do this click the "Fork" button in the top right corner. It will "copy" the `lvgl` repository to your GitHub account (`https://github.com/your_name?tab=repositories`)
+2. **Clone** the forked repository and add your changes
+3. **Create a PR** on GitHub from the page of your `lvgl` repository (`https://github.com/your_name/lvgl`) by hitting the "New pull request" button
+4. **Set the base branch**. It means where you want to merge your update. Fixes go to `master`, new features to the actual `dev-x.y` branch.
+5. **Describe** what is in the update. An example code is welcome if applicable.
+
+Some advice:
+- If you are not sure about your fix or feature it's better to open an issue first and discuss the details there.
+- Maybe your fix or update won't be perfect at first. Don't be afraid, just improve it and push the new commits. The PR will be updated accordingly.
+- If your update needs some extra work it's okay to say: _"I'm busy now and I will improve it soon"_ or _"Sorry, I don't have time to improve it, I hope it helps in this form too"_.
+So it's better to say don't have time to continue than saying nothing.
+- Please read and follow this [guide about the coding style](https://github.com/littlevgl/lvgl/blob/master/docs/CODING_STYLE.md)
+
+
+## Where is the documentation?
+
+You can read the documentation here: <https://docs.littlevgl.com/>
+You can edit the documentation here: <https://github.com/littlevgl/doc>
+
+## Where is the blog?
+
+You can read the blog here: <https://blog.littlevgl.com/>
+You can edit the blog here: <https://github.com/littlevgl/blog>
+
+# So how and where can you contribute?
+
+## Help others in the Forum
+
+It's a great way to contribute to the library if you already use it.
+Just go to [https://forum.littlevgl.com/](https://forum.littlevgl.com/) a register (Google and GitHub login also works).
+Log in, read the titles and if you are already familiar with a topic, don't be shy, and write your suggestion.
+
+## Improving and/or translating the documentation
+
+If you would like to contribute to LittlevGL the documentation is the best place to start.
+
+### Fix typos, add missing parts
+
+If you find a typo, an obscure sentence or something which is not explained well enough in the [English documentation](https://docs.littlevgl.com/en/html/index.html)
+click the *"Edit on GitHub"* button in the top right corner and fix the issue by sending a Pull Request.
+
+### Translate the documentation
+
+If you have time and interest you can translate the documentation to your native language or any language you speak.
+You can join others to work on an already existing language or you can start a new one.
+
+To translate the documentation we use [Zanata](https://zanata.org) which is an online translation platform.
+You will find the LittlevGL project here: [LittlevGL on Zanata](https://translate.zanata.org/iteration/view/littlevgl-docs/v6.0-doc1?dswid=3430)
+
+To get started you need to:
+- register at [Zanata](https://zanata.org) which is an online translation platform.
+- comment to [this post](https://forum.littlevgl.com/t/translate-the-documentation/238?u=kisvegabor)
+- tell your username at *Zanata* and your selected language(s) to get permission the edit the translations
+
+Note that a translation will be added to the documentation only if at least the [Porting section](https://docs.littlevgl.com/en/html/porting/index.html) is translated.
+
+
+## Writing a blog post about your experiences
+
+Have you ported LittlevGL to a new platform? Have you created a fancy GUI? Do you know a great trick?
+You can share your knowledge on LittlevGL's blog! It's super easy to add your own post:
+- Fork and clone the [blog repository](https://github.com/littlevgl/blog)
+- Add your post in Markdown to the `_posts` folder.
+- Store the images and other resources in a dedicated folder in `assets`
+- Create a Pull Request
+
+The blog uses [Jekyll](https://jekyllrb.com/) to convert the `.md` files to a webpage. You can easily [run Jekyll offline](https://jekyllrb.com/docs/) to check your post before creating the Pull request
+
+## Reporting and/or fixing bugs
+For simple bugfixes (typos, missing error handling, fixing a warning) is fine to send a Pull request directly. However, for more complex bugs it's better to open an issue first. In the issue, you should describe how to reproduce the bug and even add the minimal code snippet.
+
+## Suggesting and/or implementing new features
+If you have a good idea don't hesitate to share with us. It's even better if you have time to deal with its implementation. Don't be afraid if you still don't know LittlevGL well enough. We will help you to get started.
+
+During the implementation don't forget the [Code style guide](https://github.com/littlevgl/lvgl/blob/master/docs/CODING_STYLE.md).
+
+# Summary
+
+I hope you have taken a liking to contribute to LittlevGL. A helpful and friendly community is waiting for you! :)