Hello! Again getting acquainted with version 7
I’d like to establish a theme of my own, just like the existing theme “material”. In the config file there’s a hint that this kind of custom theme has been thought by the authors, as there is “LV_USE_THEME_TEMPLATE”.
Now, as the docs are not finished yet, I decided to try my luck. I extracted the “material” theme sources and put those to my application tree, not tainting lvgl core.
Good … but then, there is define LV_THEME_DEFAULT_INIT declaring the init function.
Well, some C linkers are happy with the fact that this function is defined somewhere, as long as it is accessible by it.
But then, for instance ESP-IDF toolchain, the C compiler HAS to have a prototype of it, otherwise it issues an error. Now, there is no way to officially get the correct include file to be included in “lv_obj.c”, where the style init is being called.
I circumvented this by defining “LV_GC_INCLUDE” containing my include, where my theme_init() is declared --> compiles OK.
But, that is a dirty hack. Should we have a separate config item for this? Or … how a custom theme is supposed to be implemented?
More on custom themes:
I also read a discussion (Questions about Version 7.0 styles and theme) in which @kisvegabor states that we are not supposed to overwrite themes directly, instead cascading the required stuff on existing themes. However, by replacing the unwanted theme definitions to be like “ready to use” we might gain some memory estate, both ROM (initializers) and RAM (no need for so many “style extensions”).
Or … is it only my IQ too low to understand this?
Thanks - once again!