ui: Add abstract_ui termcap and split UI layer

This is how Nvim behaves when the "abstract_ui" termcap is activated:

- No data is written/read to stdout/stdin by default.
- Instead of sending data to stdout, ui_write will parse the termcap codes
  and invoke dispatch functions in the ui.c module.
- The dispatch functions will forward the calls to all attached UI
  instances(each UI instance is an implementation of the UI layer and is
  registered with ui_attach).
- Like with the "builtin_gui" termcap, "abstract_ui" does not contain any key
  sequences. Instead, vim key strings(<cr>, <esc>, etc) are parsed directly by
  input_enqueue and the translated strings are pushed to the input buffer.

With this new input model, its not possible to send mouse events yet. Thats
because mouse sequence parsing happens in term.c/check_termcodes which must
return early when "abstract_ui" is activated.
This commit is contained in:
Thiago de Arruda
2014-12-06 11:27:36 -03:00
parent 8b6cfff6a1
commit 07e569a25d
11 changed files with 615 additions and 81 deletions

View File

@@ -452,7 +452,7 @@ void setmouse(void)
return;
/* don't switch mouse on when not in raw mode (Ex mode) */
if (cur_tmode != TMODE_RAW) {
if (!abstract_ui && cur_tmode != TMODE_RAW) {
mch_setmouse(false);
return;
}
@@ -470,10 +470,11 @@ void setmouse(void)
else
checkfor = MOUSE_NORMAL; /* assume normal mode */
if (mouse_has(checkfor))
mch_setmouse(true);
else
mch_setmouse(false);
if (mouse_has(checkfor)) {
ui_mouse_on();
} else {
ui_mouse_off();
}
}
/*