diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-06-14 13:34:41 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-06-14 13:34:41 +1000 |
| commit | 5086ab96ea648cd842addb02b188f29bff7bbadd (patch) | |
| tree | 7a3579d655c906ace9e76c394c33eb164d7ce7aa /lib/luavgl/src/luavgl.h | |
| parent | 194f0e6b59259986b36448c376788c227d490f06 (diff) | |
| parent | 37ed3996017e43b343e4880981d70c4a6d4a5636 (diff) | |
| download | tangara-fw-5086ab96ea648cd842addb02b188f29bff7bbadd.tar.gz | |
Merge branch 'jqln/lvgl-bump'
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 |
