diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-11-12 19:14:09 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-11-12 19:14:09 +1100 |
| commit | 8a0a167adbf3d9b6f8b6f16aaf20ca39ad5549de (patch) | |
| tree | 02b6cf23f591915747ec2994381854a79979c4a0 /lib/luavgl/src/private.h | |
| parent | 8471046a95ab9e00f7d42b56dbbc9ce3e5b424b9 (diff) | |
| download | tangara-fw-8a0a167adbf3d9b6f8b6f16aaf20ca39ad5549de.tar.gz | |
Convert the main menu screen to lua lol
Diffstat (limited to 'lib/luavgl/src/private.h')
| -rw-r--r-- | lib/luavgl/src/private.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/luavgl/src/private.h b/lib/luavgl/src/private.h new file mode 100644 index 00000000..20aa802f --- /dev/null +++ b/lib/luavgl/src/private.h @@ -0,0 +1,39 @@ +#pragma once + +#include <lauxlib.h> +#include <lua.h> +#include <lvgl.h> + +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> + +/* clang-format off */ +#define debug(format, ...) +// fprintf(stderr, "[luavgl] %s: " format, __FUNCTION__, ##__VA_ARGS__) +// syslog(LOG_DEBUG, "[luavgl] %s: " format, __FUNCTION__, ##__VA_ARGS__) +/* clang-format on */ + +struct event_callback_s { + lv_event_code_t code; + struct _lv_event_dsc_t *dsc; + int ref; /* ref to callback */ +}; /* variable array if n_callback > 1 */ + +static void dumpstack(lua_State *L); +static void dumptable(lua_State *L, int index); + +/* metatable */ +int luavgl_obj_getmetatable(lua_State *L, const lv_obj_class_t *clz); +int luavgl_obj_setmetatable(lua_State *L, int idx, const lv_obj_class_t *clz); + +static void luavgl_obj_event_init(luavgl_obj_t *lobj); +static void luavgl_obj_remove_event_all(lua_State *L, luavgl_obj_t *obj); + +/* util functions */ +static void luavgl_check_callable(lua_State *L, int index); +static int luavgl_check_continuation(lua_State *L, int index); + +static int luavgl_obj_set_style_kv(lua_State *L, lv_obj_t *obj, int selector); + +static int luavgl_pcall_int(lua_State *L, int nargs, int nresult); |
