+2019-06-25 Tom Tromey <tom@tromey.com>
+
+ * tui/tui.c (tui_rl_other_window): Call the refresh_all method.
+ * tui/tui-windata.c (tui_data_window::refresh_all): Rename from
+ tui_refresh_data_win.
+ * tui/tui-win.c (tui_source_window_base::refresh_all): New
+ method.
+ (tui_refresh_all_win): Call the refresh_all method.
+ (tui_set_focus): Likewise.
+ * tui/tui-data.h (struct tui_win_info) <refresh_all>: New method.
+ (struct tui_source_window_base, struct tui_data_window) <refresh>:
+ Likewise.
+
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_refill_source_window)
/* Refresh this window and any associated windows. */
virtual void refresh ();
+ /* Called after all the TUI windows are refreshed, to let this
+ window have a chance to update itself further. */
+ virtual void refresh_all ()
+ {
+ }
+
/* Methods to scroll the contents of this window. Note that they
are named with "_scroll" coming at the end because the more
obvious "scroll_forward" is defined as a macro in term.h. */
void make_visible (bool visible) override;
void refresh () override;
+ void refresh_all () override;
/* Refill the source window's source cache and update it. If this
is a disassembly window, then just update it. */
DISABLE_COPY_AND_ASSIGN (tui_data_window);
void clear_detail () override;
+ void refresh_all () override;
/* Start of data display content. */
tui_win_content data_content = NULL;
}
+/* See tui-data.h. */
+
+void
+tui_source_window_base::refresh_all ()
+{
+ tui_show_source_content (this);
+ tui_check_and_display_highlight_if_needed (this);
+ tui_erase_exec_info_content (this);
+ tui_update_exec_info (this);
+}
+
void
tui_refresh_all_win (void)
{
tui_refresh_all (tui_win_list);
for (type = SRC_WIN; type < MAX_MAJOR_WINDOWS; type++)
{
- if (tui_win_list[type]
- && tui_win_list[type]->generic.is_visible)
- {
- switch (type)
- {
- case SRC_WIN:
- case DISASSEM_WIN:
- tui_show_source_content (tui_win_list[type]);
- tui_check_and_display_highlight_if_needed (tui_win_list[type]);
- tui_erase_exec_info_content (tui_win_list[type]);
- tui_update_exec_info (tui_win_list[type]);
- break;
- case DATA_WIN:
- tui_refresh_data_win ();
- break;
- default:
- break;
- }
- }
+ if (tui_win_list[type] && tui_win_list[type]->generic.is_visible)
+ tui_win_list[type]->refresh_all ();
}
tui_show_locator_content ();
}
}
if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible)
- tui_refresh_data_win ();
+ TUI_DATA_WIN->refresh_all ();
xfree (buf_ptr);
printf_filtered (_("Focus set to %s window.\n"),
tui_win_name (&tui_win_with_focus ()->generic));
/* Function to redisplay the contents of the data window. */
void
-tui_refresh_data_win (void)
+tui_data_window::refresh_all ()
{
tui_erase_data_content (NULL);
- if (TUI_DATA_WIN->generic.content_size > 0)
+ if (generic.content_size > 0)
{
int first_element = tui_first_data_item_displayed ();
{
tui_set_win_focus_to (win_info);
if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible)
- tui_refresh_data_win ();
+ TUI_DATA_WIN->refresh_all ();
keypad (TUI_CMD_WIN->generic.handle, (win_info != TUI_CMD_WIN));
}
return 0;