diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-12-20 11:04:20 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-12-26 21:29:15 +0100 |
| commit | 13a95942b6e33033e4bbbe27cc8cafc98c6924a2 (patch) | |
| tree | 04acfeef0b83b4d6e08212948313242b57779f73 /vis.h | |
| parent | 39e2b6f1b7a750af55ceeadab977354919d0ccf5 (diff) | |
| download | vis-13a95942b6e33033e4bbbe27cc8cafc98c6924a2.tar.gz vis-13a95942b6e33033e4bbbe27cc8cafc98c6924a2.tar.xz | |
vis: refactor Lua integration
Lua support can now be disabled at compile time using:
$ make CONFIG_LUA=0
This commit also adds an initial Lua API and provides a few
default hooks.
We now also require Lua >= 5.2 due to the uservalue constructs.
In principle the same functionality could be implemented using
function environments from Lua 5.1.
Diffstat (limited to 'vis.h')
| -rw-r--r-- | vis.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -13,6 +13,16 @@ typedef struct Win Win; #include "view.h" #include "register.h" +typedef struct { + void (*vis_start)(Vis*); + void (*vis_quit)(Vis*); + void (*file_open)(Vis*, File*); + void (*file_save)(Vis*, File*); + void (*file_close)(Vis*, File*); + void (*win_open)(Vis*, Win*); + void (*win_close)(Vis*, Win*); +} VisEvent; + typedef union { /* various types of arguments passed to key action functions */ bool b; int i; @@ -40,7 +50,7 @@ typedef struct { /* a key binding either refers to an action or an ali } KeyBinding; /* creates a new editor instance using the specified user interface */ -Vis *vis_new(Ui*); +Vis *vis_new(Ui*, VisEvent*); /* frees all resources associated with this editor instance, terminates ui */ void vis_free(Vis*); /* instructs the user interface to draw to an internal buffer */ |
