diff options
author | Tom Tromey <tom@tromey.com> | 2019-07-09 17:29:13 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-08-15 14:17:11 -0600 |
commit | 3df505f60eacd2c931092c7007f084d27583f9e5 (patch) | |
tree | 46ba8a87a1473d10e92433f803684184ff378948 /gdb/tui/tui-data.h | |
parent | 272560b577894c388a3d0d3fda8294683714f582 (diff) | |
download | fsf-binutils-gdb-3df505f60eacd2c931092c7007f084d27583f9e5.zip fsf-binutils-gdb-3df505f60eacd2c931092c7007f084d27583f9e5.tar.gz fsf-binutils-gdb-3df505f60eacd2c931092c7007f084d27583f9e5.tar.bz2 |
TUI resize unification
The TUI currently has two different ways to resize a window: the
resize method, and the methods make_invisible_and_set_new_height and
make_visible_with_new_height.
There's no deep reason to have two different ways to resize a window,
so this patch unifies them, leaving just the "resize" method.
This also changes the locator to be handled more like an ordinary
window and less like an adjunct of the associated source window.
gdb/ChangeLog
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-io.c (tui_puts_internal): Check TUI_CMD_WIN before
calling update_cmdwin_start_line.
* tui/tui-winsource.h (struct tui_source_window_base)
<do_make_visible_with_new_height, set_new_height>: Don't declare.
<rerender>: Declare.
* tui/tui-winsource.c (tui_source_window_base::update_tab_width):
Call rerender.
(tui_source_window_base::set_new_height): Remove.
(tui_source_window_base::rerender): Rename from
do_make_visible_with_new_height.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use
resize method.
(tui_win_info::make_invisible_and_set_new_height)
(tui_win_info::make_visible_with_new_height): Remove.
* tui/tui-stack.h (struct tui_locator_window) <rerender>:
Declare.
* tui/tui-stack.c (tui_locator_window::rerender): New method.
* tui/tui-regs.h (struct tui_data_window) <set_new_height,
do_make_visible_with_new_height>: Don't declare.
<rerender>: Declare.
* tui/tui-regs.c (tui_data_window::rerender): Rename from
set_new_height.
(tui_data_window::do_make_visible_with_new_height): Remove.
* tui/tui-layout.c (show_source_disasm_command, show_data): Don't
call tui_show_locator_content.
(tui_gen_win_info::resize): Call rerender.
(show_source_or_disasm_and_command): Don't call
tui_show_locator_content.
* tui/tui-data.h (struct tui_gen_win_info) <rerender>: New
method.
(struct tui_win_info) <rerender>: Declare.
<set_new_height, make_invisible_and_set_new_height,
make_visible_with_new_height>: Don't declare.
* tui/tui-data.c (tui_win_list::rerender): New method.
* tui/tui-command.h (struct tui_cmd_window)
<do_make_visible_with_new_height>: Don't declare.
* tui/tui-command.c
(tui_cmd_window::do_make_visible_with_new_height): Remove.
gdb/testsuite/ChangeLog
2019-08-15 Tom Tromey <tom@tromey.com>
* gdb.tui/empty.exp: Enable resizing tests.
Diffstat (limited to 'gdb/tui/tui-data.h')
-rw-r--r-- | gdb/tui/tui-data.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 3388679..6c7ab05 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -46,6 +46,12 @@ protected: { } + /* This is called after the window is resized, and should update the + window's contents. */ + virtual void rerender () + { + } + public: virtual ~tui_gen_win_info (); @@ -164,9 +170,7 @@ protected: left_scroll and right_scroll. */ virtual void do_scroll_horizontal (int num_to_scroll) = 0; - /* Called after make_visible_with_new_height sets the new height. - Should update the window. */ - virtual void do_make_visible_with_new_height () = 0; + void rerender () override; public: @@ -180,12 +184,6 @@ public: { } - /* Called after a TUI window is given a new height; this updates any - related auxiliary windows. */ - virtual void set_new_height (int height) - { - } - /* Compute the maximum height of this window. */ virtual int max_height () const; @@ -194,14 +192,6 @@ public: { } - /* Function make the target window (and auxiliary windows associated - with the target) invisible, and set the new height and - location. */ - void make_invisible_and_set_new_height (int height); - - /* Make the window visible after the height has been changed. */ - void make_visible_with_new_height (); - /* Set whether this window is highglighted. */ void set_highlight (bool highlight) { |