feat(lua): support for using LVGL objects on colorlcd (#4887)

This commit is contained in:
philmoz
2024-06-13 13:16:07 +10:00
committed by GitHub
parent 22128df1cd
commit b4e33fc439
30 changed files with 2257 additions and 123 deletions
+5
View File
@@ -235,6 +235,7 @@ void luaLoadWidgetCallback()
int widgetOptions = 0, createFunction = 0, updateFunction = 0,
refreshFunction = 0, backgroundFunction = 0, translateFunction = 0;
bool lvglLayout = false;
luaL_checktype(lsWidgets, -1, LUA_TTABLE);
@@ -267,6 +268,9 @@ void luaLoadWidgetCallback()
translateFunction = luaL_ref(lsWidgets, LUA_REGISTRYINDEX);
lua_pushnil(lsWidgets);
}
else if (!strcasecmp(key, "uselvgl")) {
lvglLayout = lua_toboolean(lsWidgets, -1);
}
}
if (name && createFunction) {
@@ -276,6 +280,7 @@ void luaLoadWidgetCallback()
factory->updateFunction = updateFunction;
factory->refreshFunction = refreshFunction;
factory->backgroundFunction = backgroundFunction; // NOSONAR
factory->lvglLayout = lvglLayout;
factory->translateFunction = translateFunction;
factory->translateOptions(options);
TRACE("Loaded Lua widget %s", name);