diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-16 11:22:38 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-06-25 07:48:28 -0600 |
commit | 13446e05a363db17f0140b1450fc7df509d2ca37 (patch) | |
tree | 53c7c5c1185dc018da379af4297d812040e60a37 /gdb/tui/tui-command.c | |
parent | 5cf82909a7047cee471ee40cfe623250c258d76e (diff) | |
download | binutils-gdb-13446e05a363db17f0140b1450fc7df509d2ca37.tar.gz |
Introduce methods for scrolling
This changes the TUI to use virtual methods on the various window
types for scrolling. Window-specific functions for this purpose are
renamed to be methods, and the generic tui_scroll function is removed
as it is no longer called.
gdb/ChangeLog
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_horizontal_source_scroll): Don't
declare.
* tui/tui-winsource.c
(tui_source_window_base::do_scroll_horizontal): Rename from
tui_horizontal_source_scroll.
* tui/tui-windata.h (tui_vertical_data_scroll): Don't declare.
* tui/tui-windata.c (tui_data_window::do_scroll_vertical): Rename
from tui_vertical_data_scroll.
* tui/tui-win.h (tui_scroll): Don't declare.
* tui/tui-win.c (tui_win_info::forward_scroll)
(tui_win_info::backward_scroll, tui_win_info::left_scroll)
(tui_win_info::right_scroll): Rename and update.
(tui_scroll_forward_command, tui_scroll_backward_command)
(tui_scroll_left_command, tui_scroll_right_command): Update.
(tui_scroll): Remove.
* tui/tui-source.h: Don't declare tui_vertical_source_scroll.
* tui/tui-source.c (tui_source_window::do_scroll_vertical): Rename
from tui_vertical_source_scroll.
* tui/tui-disasm.h (tui_vertical_disassem_scroll): Don't declare.
* tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Rename
from tui_vertical_disassem_scroll.
* tui/tui-data.h (struct tui_win_info) <do_scroll_vertical,
do_scroll_horizontal>: New methods.
<forward_scroll, backward_scroll, left_scroll, right_scroll>:
Likewise.
(struct tui_source_window_base): Add do_scroll_horizontal.
(struct tui_source_window, struct tui_disasm_window): Add
do_scroll_vertical.
(struct tui_data_window, struct tui_cmd_window): Add
do_scroll_horizontal and do_scroll_vertical.
* tui/tui-command.c (tui_dispatch_ctrl_char): Use method calls.
Diffstat (limited to 'gdb/tui/tui-command.c')
-rw-r--r-- | gdb/tui/tui-command.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c index 76fe9dad814..9603b3cfdca 100644 --- a/gdb/tui/tui-command.c +++ b/gdb/tui/tui-command.c @@ -57,24 +57,24 @@ tui_dispatch_ctrl_char (unsigned int ch) switch (ch) { case KEY_NPAGE: - tui_scroll_forward (win_info, 0); + win_info->forward_scroll (0); break; case KEY_PPAGE: - tui_scroll_backward (win_info, 0); + win_info->backward_scroll (0); break; case KEY_DOWN: case KEY_SF: - tui_scroll_forward (win_info, 1); + win_info->forward_scroll (1); break; case KEY_UP: case KEY_SR: - tui_scroll_backward (win_info, 1); + win_info->backward_scroll (1); break; case KEY_RIGHT: - tui_scroll_left (win_info, 1); + win_info->left_scroll (1); break; case KEY_LEFT: - tui_scroll_right (win_info, 1); + win_info->right_scroll (1); break; case '\f': break; |