diff options
| author | Rudy Dellomas III <dther@dther.xyz> | 2024-04-21 20:25:40 +1000 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2024-04-29 08:36:44 -0600 |
| commit | 596ec20dd81fc4a48a528bfed9e241343ee03eaa (patch) | |
| tree | 9ece9e4212b1d770b33f8fd8317ff13d079f91eb /vis-lua.c | |
| parent | 62ccfe59ae63858dc5c21039e907a9277134d171 (diff) | |
| download | vis-596ec20dd81fc4a48a528bfed9e241343ee03eaa.tar.gz vis-596ec20dd81fc4a48a528bfed9e241343ee03eaa.tar.xz | |
Emit an event (ui_draw) immediately before drawing the screen
This allows better control over styling, as well as potential for
entirely new UI elements implemented entirely using the Lua API.
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -166,7 +166,7 @@ void vis_lua_win_status(Vis *vis, Win *win) { window_status_update(vis, win); } void vis_lua_term_csi(Vis *vis, const long *csi) { } void vis_lua_process_response(Vis *vis, const char *name, char *buffer, size_t len, ResponseType rtype) { } - +void vis_lua_ui_draw(Vis *vis) { } #else @@ -3689,4 +3689,16 @@ void vis_lua_process_response(Vis *vis, const char *name, lua_pop(L, 1); } +/*** + * Emitted immediately before the UI is drawn to the screen. + * Allows last-minute overrides to the styling of UI elements. + * + * *WARNING:* This is emitted every screen draw! + * Use sparingly and check for `nil` values! + * @function ui_draw + */ +void vis_lua_ui_draw(Vis *vis) { + vis_lua_event_call(vis, "ui_draw"); +} + #endif |
