Remove tui_win_info::refresh_all

The TUI has two duplicate "re-render this window" methods, "rerender"
and "refresh_all".  They differ only slightly in semantics, so I
wanted to see if they could be unified.

After looking into this, I decided that refresh_all was not needed.
There are 4 calls to tui_refresh_all_win (the only caller of this
method):

1. tui_enable.  This sets the layout, which renders the windows.

2. tui_cont_sig.  Here, I think it's sufficient to simply redraw the
   current window contents from the curses backing store, because gdb
   state didn't change while it was suspended

3. tui_dispatch_ctrl_char.  This is the C-l handler, and here it's
   explicitly enough to just refresh the screen (as above).

4. tui_refresh_all_command.  This is the command equivalent of C-l.

So, this patch removes this method entirely and simplifies
tui_refresh_all_win.

gdb/ChangeLog
2019-08-30  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.h (struct tui_source_window_base)
	<refresh_all>: Don't declare.
	* tui/tui-winsource.c (tui_source_window_base::refresh_all):
	Remove.
	* tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or
	tui_show_locator_content.
	* tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't
	declare.
	* tui/tui-regs.c (tui_data_window::refresh_all): Remove.
	* tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't
	declare.
This commit is contained in:
Tom Tromey 2019-07-18 14:38:39 -06:00
parent 55b2657bdc
commit d6a00eba2a
7 changed files with 14 additions and 49 deletions

View File

@ -1,3 +1,17 @@
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<refresh_all>: Don't declare.
* tui/tui-winsource.c (tui_source_window_base::refresh_all):
Remove.
* tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or
tui_show_locator_content.
* tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't
declare.
* tui/tui-regs.c (tui_data_window::refresh_all): Remove.
* tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't
declare.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-io.c (tui_cont_sig): Don't call wrefresh.

View File

@ -162,12 +162,6 @@ public:
{
}
/* Called after all the TUI windows are refreshed, to let this
window have a chance to update itself further. */
virtual void refresh_all ()
{
}
/* Compute the maximum height of this window. */
virtual int max_height () const;

View File

@ -403,29 +403,6 @@ tui_data_window::rerender ()
}
/* Function to redisplay the contents of the data window. */
void
tui_data_window::refresh_all ()
{
erase_data_content (NULL);
if (!regs_content.empty ())
{
int first_element = first_data_item_displayed ();
if (first_element >= 0) /* Re-use existing windows. */
{
int first_line = (-1);
if (first_element < regs_content.size ())
first_line = line_from_reg_element_no (first_element);
if (first_line >= 0)
display_registers_from_line (first_line);
}
}
}
/* Scroll the data window vertically forward or backward. */
void
tui_data_window::do_scroll_vertical (int num_to_scroll)

View File

@ -58,8 +58,6 @@ struct tui_data_window : public tui_win_info
DISABLE_COPY_AND_ASSIGN (tui_data_window);
void refresh_all () override;
void refresh_window () override;
const char *name () const override

View File

@ -504,12 +504,6 @@ tui_refresh_all_win (void)
{
clearok (curscr, TRUE);
tui_refresh_all ();
for (tui_win_info *win_info : all_tui_windows ())
{
if (win_info->is_visible ())
win_info->refresh_all ();
}
tui_show_locator_content ();
}
void

View File

@ -280,16 +280,6 @@ tui_source_window_base::~tui_source_window_base ()
/* See tui-data.h. */
void
tui_source_window_base::refresh_all ()
{
show_source_content ();
check_and_display_highlight_if_needed ();
update_exec_info ();
}
/* See tui-data.h. */
void
tui_source_window_base::update_tab_width ()
{

View File

@ -103,8 +103,6 @@ public:
void clear_detail ();
void refresh_all () override;
/* Refill the source window's source cache and update it. If this
is a disassembly window, then just update it. */
void refill ();