-
Notifications
You must be signed in to change notification settings - Fork 644
docs: add project.mdx, and databinding updates #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kisvegabor
wants to merge
5
commits into
master
Choose a base branch
from
feat/more-details
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4645fd1
docs: add project.mdx, and databinding updates
kisvegabor 86e6932
clarify path of fonts and images
kisvegabor 48bb8b6
Apply suggestion from @kisvegabor
kisvegabor 3615234
Apply suggestion from @kisvegabor
kisvegabor a776f32
Apply suggestion from @kisvegabor
kisvegabor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| title: Project File | ||
| description: Configure your LVGL Pro project with project.xml — set the LVGL version, exported code name, and the display targets used to preview screens. | ||
| --- | ||
|
|
||
| `project.xml` is the top-level configuration file of an LVGL Pro project. It is read by the Editor, by the CLI, and by the runtime XML loader to learn the target LVGL version, the exported code's name, and the display configurations used to render screens in the preview. | ||
|
|
||
| `project.xml` lives next to `globals.xml` at the root of the project folder. | ||
|
|
||
| ## Recommended Project Layout | ||
|
|
||
| LVGL Pro doesn't enforce a folder structure, but the Editor, the tutorials, and the example projects all follow the same convention. Sticking to it keeps `src_path` references short and makes generated code predictable. | ||
|
|
||
| ``` | ||
| my_project/ | ||
| ├── project.xml ← target/display configuration (this file) | ||
| ├── globals.xml ← shared fonts, images, subjects, consts, styles | ||
| ├── translations.xml ← optional, multi-language strings | ||
| ├── fonts/ ← .ttf / .bin source files referenced by globals.xml | ||
| ├── images/ ← .png assets referenced by globals.xml | ||
| ├── widgets/ ← custom <widget> XMLs (one file per widget) | ||
| ├── components/ ← reusable <component> XMLs (one file per component) | ||
| └── screens/ ← <screen> XMLs (one file per screen) | ||
| ``` | ||
|
|
||
| The three XML files (`project.xml`, `globals.xml`, `translations.xml`) sit at the project root; the five sub-folders hold everything else. Any of the sub-folders can be omitted if the project doesn't use that category. | ||
|
|
||
| ## Minimal Example | ||
|
|
||
| The simplest valid project file just declares the LVGL version: | ||
|
|
||
| ```xml | ||
| <project lvgl_version="9.5.0"> | ||
| </project> | ||
| ``` | ||
|
|
||
| This is enough for the Editor to load the project, but no preview targets are defined — screens fall back to a default preview size. | ||
|
|
||
| ## Defining Display Targets | ||
|
|
||
| To preview Screens at the resolution(s) of the real hardware, declare one or more `<target>` elements inside `<targets>`. Each target contains a `<display>` describing the screen size. | ||
|
|
||
| ```xml | ||
| <project lvgl_version="9.5.0"> | ||
| <targets> | ||
| <target name="dashboard_large"> | ||
| <display width="800" height="480"/> | ||
| </target> | ||
| <target name="controller_small"> | ||
| <display width="480" height="320"/> | ||
| </target> | ||
| </targets> | ||
| </project> | ||
| ``` | ||
|
|
||
| When a Screen is open in the Editor, the Preview panel shows one entry per `<target>`. This is also how the Editor knows how to size a Screen's `<view>` when `width="100%"` or `height="100%"` is used at the screen root. | ||
|
|
||
| All Screens see all targets — there is no per-screen targeting. | ||
|
|
||
| ## Relation to Other Files | ||
|
|
||
| - **`globals.xml`** — Defines project-wide fonts, images, subjects, constants, and shared styles. See [Introduction](./introduction#shared-resources-with-globalsxml). | ||
| - **Screens** — Use the targets declared here to choose a preview resolution. See [Screens](./screens#preview). | ||
| - **Code export** — The `name` attribute controls the exported project name and init function. See [Using Exported C Code](../integration/using-exported-c-code). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.