Introduce methods for scrolling
authorTom Tromey <tom@tromey.com>
Sun, 16 Jun 2019 17:22:38 +0000 (11:22 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:28 +0000 (07:48 -0600)
commit13446e05a363db17f0140b1450fc7df509d2ca37
tree53c7c5c1185dc018da379af4297d812040e60a37
parent5cf82909a7047cee471ee40cfe623250c258d76e
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.
13 files changed:
gdb/ChangeLog
gdb/tui/tui-command.c
gdb/tui/tui-data.h
gdb/tui/tui-disasm.c
gdb/tui/tui-disasm.h
gdb/tui/tui-source.c
gdb/tui/tui-source.h
gdb/tui/tui-win.c
gdb/tui/tui-win.h
gdb/tui/tui-windata.c
gdb/tui/tui-windata.h
gdb/tui/tui-winsource.c
gdb/tui/tui-winsource.h