diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-06-12 16:29:31 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-06-12 16:29:31 +1000 |
| commit | bd01bf3845fd67dc4e03f56d044b3bc53245eeed (patch) | |
| tree | 782f38292005dd84da267f4f06c7c66f994ca0ad /lib/luavgl/src/luavgl.h | |
| parent | b02d13f5a584c9b0a747b0cefdf92dc867181a50 (diff) | |
| download | tangara-fw-bd01bf3845fd67dc4e03f56d044b3bc53245eeed.tar.gz | |
WIP bump luavgl to latest
Diffstat (limited to 'lib/luavgl/src/luavgl.h')
| -rw-r--r-- | lib/luavgl/src/luavgl.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/luavgl/src/luavgl.h b/lib/luavgl/src/luavgl.h index c76a6493..d485cdc8 100644 --- a/lib/luavgl/src/luavgl.h +++ b/lib/luavgl/src/luavgl.h @@ -14,7 +14,7 @@ extern "C" { typedef const lv_font_t *(*make_font_cb)(const char *name, int size, int weight); -typedef void (*delete_font_cb)(lv_font_t *); +typedef void (*delete_font_cb)(const lv_font_t *); typedef int (*luavgl_pcall_t)(lua_State *L, int nargs, int nresults); typedef struct { @@ -48,13 +48,17 @@ typedef struct { }; } luavgl_value_setter_t; +struct event_callback_s { + lua_State *L; + int ref; /* ref to callback */ + lv_event_code_t code; + lv_event_dsc_t *dsc; +}; + typedef struct luavgl_obj_s { lv_obj_t *obj; /* NULL means obj deleted, but not gc'ed in lua */ bool lua_created; /* this object is created from lua */ - - /* internally used variables */ - int n_events; - struct event_callback_s *events; + lv_array_t events; /* events added from lua, need it to distinguish between lua */ } luavgl_obj_t; #define luavgl_obj_newmetatable(L, clz, name, l) \ @@ -124,6 +128,11 @@ LUALIB_API luavgl_obj_t *luavgl_add_lobj(lua_State *L, lv_obj_t *obj); LUALIB_API luavgl_obj_t *luavgl_to_lobj(lua_State *L, int idx); /** + * @brief Get lvgl style from stack + */ +LUALIB_API lv_style_t *luavgl_to_style(lua_State *L, int idx); + +/** * @brief Create metatable for specified object class * * @param L @@ -158,11 +167,6 @@ LUALIB_API int luavgl_obj_getuserdatauv(lua_State *L, int idx); LUALIB_API lv_obj_t *luavgl_to_obj(lua_State *L, int idx); /** - * @brief Get lvgl style from stack - */ -LUALIB_API lv_style_t *luavgl_to_style(lua_State *L, int idx); - -/** * @brief Convert value to integer * * Supported values are: integer, float, boolean |
