diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-04-29 13:06:14 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2017-05-10 16:14:10 +0200 |
commit | 489d10c57c68183c042fd582e6c8eadbb0efc5a7 (patch) | |
tree | 8428b9de93dc1aa69b81377f6a18d45c795b682a /src/nvim/ui.c | |
parent | d9023b84e63f51611cf55f72ca5e021d64ba7ce9 (diff) | |
download | rneovim-489d10c57c68183c042fd582e6c8eadbb0efc5a7.tar.gz rneovim-489d10c57c68183c042fd582e6c8eadbb0efc5a7.tar.bz2 rneovim-489d10c57c68183c042fd582e6c8eadbb0efc5a7.zip |
api: generate ui events
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r-- | src/nvim/ui.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 924a4192bc..ec59f96d87 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -89,6 +89,10 @@ static int old_mode_idx = -1; #define UI_CALL_MORE(method, ...) if (ui->method) ui->method(ui, __VA_ARGS__) #define UI_CALL_ZERO(method) if (ui->method) ui->method(ui) +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "ui_events_call.generated.h" +#endif + void ui_builtin_start(void) { #ifdef FEAT_TUI @@ -136,13 +140,13 @@ void ui_suspend(void) void ui_set_title(char *title) { - UI_CALL(set_title, title); + ui_call_set_title(cstr_as_string(title)); UI_CALL(flush); } void ui_set_icon(char *icon) { - UI_CALL(set_icon, icon); + ui_call_set_icon(cstr_as_string(icon)); UI_CALL(flush); } @@ -390,7 +394,7 @@ void ui_mode_info_set(void) { Array style = mode_style_array(); bool enabled = (*p_guicursor != NUL); - UI_CALL(mode_info_set, enabled, style); + ui_call_mode_info_set(enabled, style); api_free_array(style); } @@ -420,11 +424,11 @@ static void send_output(uint8_t **ptr) while (*p >= 0x20) { size_t clen = (size_t)mb_ptr2len(p); - UI_CALL(put, p, (size_t)clen); + ui_call_put((String){.data = (char *)p, .size = clen}); col++; if (mb_ptr2cells(p) > 1) { // double cell character, blank the next cell - UI_CALL(put, NULL, 0); + ui_call_put((String)STRING_INIT); col++; } if (utf_ambiguous_width(utf_ptr2char(p))) { @@ -560,7 +564,8 @@ void ui_cursor_shape(void) if (old_mode_idx != mode_idx) { old_mode_idx = mode_idx; - UI_CALL(mode_change, mode_idx); + char *full_name = shape_table[mode_idx].full_name; + ui_call_mode_change(cstr_as_string(full_name), mode_idx); } conceal_check_cursur_line(); } |