UI resource file format

I think LVGL should have standard format for the UI resource files which is already discussed on this forum. In brief, may I propose the following:

  1. Specification of the Binary, XML and (optionally?) JSON format for the UI resource file should be created.

  2. Various converters, maybe written in C, Python or JavaScript:

    • from Binary to C source code
    • from Binary to XML
    • from XML to Binary
    • etc.
  3. C API for loading Binary resource file and building LVGL objects from it (screens, widgets, styles, fonts, bitmaps, …)

  4. C API to create Binary resource file from LVGL object(s). For example, given the lv_obj_t* this API will create Binary resource file which can produce exact the same lv_obj_t* with the API from point no. 3. This presumes that all the reflection API calls are already in place or should be added in the future.

With the existence of all of this it would be much easier to share between existing and future UI editors, as long as UI editor supports import from and export to UI resource file. This way user will not be locked-in with particular UI editor.

The feature described in point no. 4 is especially interesting, because even if UI editor doesn’t support this format it would be possible to convert generated code into UI resource file.

Thank you!

Related to this, there is also a need for a precise and standard way of describing what can be done with the LVGL API.

There are already languages ​​for describing APIs, for example IDL, but I think it’s better to come up with some new original format that will take into account all the specifics of LVGL. It can be based on XML.

Since each version of LVGL changes the API, this means that an API description in this language should be released with each released version. There should also be hints on how to migrate from the previous version to the new version. In this way, the UI resource file could be automatically migrated, and if it is not possible, at least what is incompatible should be reported.

In addition to the description of the API for C, the API for MicroPython LVGL binding can also be described in this standard way.

The user can describe his things that he added in the same way, for example some custom widget.

Of course, this API descriptions can be used by the UI editors (and other dev tools), so that UI editors can support up to date LVGL version - just give them API description file.