aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.h
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-11 10:38:28 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-21 20:21:46 -0600
commit07b8e9d8a293d63fd9c1059968b53ad396e9f013 (patch)
tree8da02e24e203efbb8772fde0f0689aac87e31574 /vis-lua.h
parentb7074021b7bfb0932b889b9560dd22df31cef818 (diff)
downloadvis-07b8e9d8a293d63fd9c1059968b53ad396e9f013.tar.gz
vis-07b8e9d8a293d63fd9c1059968b53ad396e9f013.tar.xz
cleanup vis event interface
This removes the function pointer interface which was adding needless complexity and making it difficult to add new events. Now if new events are only meant for lua they only need to be added to the lua interface. This will also have a minor reduction in runtime memory usage and produce a smaller binary. The only runtime difference is that QUIT happens after all windows have been closed and their files freed.
Diffstat (limited to 'vis-lua.h')
-rw-r--r--vis-lua.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/vis-lua.h b/vis-lua.h
index b4f3f51..76e7029 100644
--- a/vis-lua.h
+++ b/vis-lua.h
@@ -22,26 +22,13 @@ bool vis_lua_path_add(Vis*, const char *path);
bool vis_lua_paths_get(Vis*, char **lpath, char **cpath);
/* various event handlers, triggered by the vis core */
-void vis_lua_init(Vis*);
-void vis_lua_start(Vis*);
-void vis_lua_quit(Vis*);
#if !CONFIG_LUA
-#define vis_lua_mode_insert_input vis_insert_key
-#define vis_lua_mode_replace_input vis_replace_key
+#define vis_event_mode_insert_input vis_insert_key
+#define vis_event_mode_replace_input vis_replace_key
#else
-void vis_lua_mode_insert_input(Vis*, const char *key, size_t len);
-void vis_lua_mode_replace_input(Vis*, const char *key, size_t len);
+void vis_event_mode_insert_input(Vis*, const char *key, size_t len);
+void vis_event_mode_replace_input(Vis*, const char *key, size_t len);
#endif
-void vis_lua_file_open(Vis*, File*);
-bool vis_lua_file_save_pre(Vis*, File*, const char *path);
-void vis_lua_file_save_post(Vis*, File*, const char *path);
-void vis_lua_file_close(Vis*, File*);
-void vis_lua_win_open(Vis*, Win*);
-void vis_lua_win_close(Vis*, Win*);
-void vis_lua_win_highlight(Vis*, Win*);
-void vis_lua_win_status(Vis*, Win*);
-void vis_lua_term_csi(Vis*, const long *);
void vis_lua_process_response(Vis *, const char *, char *, size_t, ResponseType);
-void vis_lua_ui_draw(Vis*);
#endif