ui: Add update_fg/update_bg methods

It is necessary to notify the UI when the default background/foreground colors
change in order to render correctly.
This commit is contained in:
Thiago de Arruda
2014-12-12 16:25:11 -03:00
parent 1ccbd94bee
commit fc8f768690
5 changed files with 43 additions and 0 deletions

View File

@@ -67,6 +67,8 @@ Object remote_ui_attach(uint64_t channel_id, uint64_t request_id, Array args,
ui->put = remote_ui_put;
ui->bell = remote_ui_bell;
ui->visual_bell = remote_ui_visual_bell;
ui->update_fg = remote_ui_update_fg;
ui->update_bg = remote_ui_update_bg;
ui->flush = remote_ui_flush;
ui->suspend = remote_ui_suspend;
pmap_put(uint64_t)(connected_uis, channel_id, ui);
@@ -266,6 +268,20 @@ static void remote_ui_visual_bell(UI *ui)
push_call(ui, "visual_bell", args);
}
static void remote_ui_update_fg(UI *ui, int fg)
{
Array args = ARRAY_DICT_INIT;
ADD(args, INTEGER_OBJ(fg));
push_call(ui, "update_fg", args);
}
static void remote_ui_update_bg(UI *ui, int bg)
{
Array args = ARRAY_DICT_INIT;
ADD(args, INTEGER_OBJ(bg));
push_call(ui, "update_bg", args);
}
static void remote_ui_flush(UI *ui)
{
UIData *data = ui->data;