diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-17 10:43:35 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-17 10:43:35 +0000 |
commit | cf2c0237f49f31763b617e011e4fe73c3e710c9a (patch) | |
tree | 6f35dc3f66fd86e28da407ac457e651d59128918 /input.c | |
parent | 3d9fd1c7f2724b887ec6d2ea07edf3bf70385d75 (diff) | |
download | rtmux-cf2c0237f49f31763b617e011e4fe73c3e710c9a.tar.gz rtmux-cf2c0237f49f31763b617e011e4fe73c3e710c9a.tar.bz2 rtmux-cf2c0237f49f31763b617e011e4fe73c3e710c9a.zip |
Instead of loads of little screen_write_*_on and off functions which just
change mode flags, just have screen_write_mode_set and screen_write_mode_clear.
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -1033,10 +1033,10 @@ input_esc_dispatch(struct input_ctx *ictx) screen_write_reverseindex(sctx); break; case INPUT_ESC_DECKPAM: - screen_write_kkeypadmode(sctx, 1); + screen_write_mode_set(sctx, MODE_KKEYPAD); break; case INPUT_ESC_DECKPNM: - screen_write_kkeypadmode(sctx, 0); + screen_write_mode_clear(sctx, MODE_KKEYPAD); break; case INPUT_ESC_DECSC: memcpy(&ictx->old_cell, &ictx->cell, sizeof ictx->old_cell); @@ -1232,7 +1232,7 @@ input_csi_dispatch(struct input_ctx *ictx) case INPUT_CSI_RM: switch (input_get(ictx, 0, 0, -1)) { case 4: /* IRM */ - screen_write_insertmode(&ictx->ctx, 0); + screen_write_mode_clear(&ictx->ctx, MODE_INSERT); break; default: log_debug("%s: unknown '%c'", __func__, ictx->ch); @@ -1242,23 +1242,23 @@ input_csi_dispatch(struct input_ctx *ictx) case INPUT_CSI_RM_PRIVATE: switch (input_get(ictx, 0, 0, -1)) { case 1: /* GATM */ - screen_write_kcursormode(&ictx->ctx, 0); + screen_write_mode_clear(&ictx->ctx, MODE_KCURSOR); break; case 3: /* DECCOLM */ screen_write_cursormove(&ictx->ctx, 0, 0); screen_write_clearscreen(&ictx->ctx); break; case 25: /* TCEM */ - screen_write_cursormode(&ictx->ctx, 0); + screen_write_mode_clear(&ictx->ctx, MODE_CURSOR); break; case 1000: case 1001: case 1002: case 1003: - screen_write_mousemode_off(&ictx->ctx); + screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); break; case 1005: - screen_write_utf8mousemode(&ictx->ctx, 0); + screen_write_mode_clear(&ictx->ctx, MODE_MOUSE_UTF8); break; case 47: case 1047: @@ -1268,7 +1268,7 @@ input_csi_dispatch(struct input_ctx *ictx) window_pane_alternate_off(wp, &ictx->cell, 1); break; case 2004: - screen_write_bracketpaste(&ictx->ctx, 0); + screen_write_mode_clear(&ictx->ctx, MODE_BRACKETPASTE); break; default: log_debug("%s: unknown '%c'", __func__, ictx->ch); @@ -1286,7 +1286,7 @@ input_csi_dispatch(struct input_ctx *ictx) case INPUT_CSI_SM: switch (input_get(ictx, 0, 0, -1)) { case 4: /* IRM */ - screen_write_insertmode(&ictx->ctx, 1); + screen_write_mode_set(&ictx->ctx, MODE_INSERT); break; default: log_debug("%s: unknown '%c'", __func__, ictx->ch); @@ -1296,28 +1296,29 @@ input_csi_dispatch(struct input_ctx *ictx) case INPUT_CSI_SM_PRIVATE: switch (input_get(ictx, 0, 0, -1)) { case 1: /* GATM */ - screen_write_kcursormode(&ictx->ctx, 1); + screen_write_mode_set(&ictx->ctx, MODE_KCURSOR); break; case 3: /* DECCOLM */ screen_write_cursormove(&ictx->ctx, 0, 0); screen_write_clearscreen(&ictx->ctx); break; case 25: /* TCEM */ - screen_write_cursormode(&ictx->ctx, 1); + screen_write_mode_set(&ictx->ctx, MODE_CURSOR); break; case 1000: - screen_write_mousemode_on( - &ictx->ctx, MODE_MOUSE_STANDARD); + screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); + screen_write_mode_set(&ictx->ctx, MODE_MOUSE_STANDARD); break; case 1002: - screen_write_mousemode_on( - &ictx->ctx, MODE_MOUSE_BUTTON); + screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); + screen_write_mode_set(&ictx->ctx, MODE_MOUSE_BUTTON); break; case 1003: - screen_write_mousemode_on(&ictx->ctx, MODE_MOUSE_ANY); + screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); + screen_write_mode_set(&ictx->ctx, MODE_MOUSE_ANY); break; case 1005: - screen_write_utf8mousemode(&ictx->ctx, 1); + screen_write_mode_set(&ictx->ctx, MODE_MOUSE_UTF8); break; case 47: case 1047: @@ -1327,7 +1328,7 @@ input_csi_dispatch(struct input_ctx *ictx) window_pane_alternate_on(wp, &ictx->cell, 1); break; case 2004: - screen_write_bracketpaste(&ictx->ctx, 1); + screen_write_mode_set(&ictx->ctx, MODE_BRACKETPASTE); break; default: log_debug("%s: unknown '%c'", __func__, ictx->ch); |