+2019-06-25 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-winsource.c (tui_erase_source_content)
+ (tui_show_source_content, tui_show_exec_info_content)
+ (tui_erase_exec_info_content): Use refresh_window method.
+ * tui/tui-wingeneral.h (tui_refresh_win): Don't declare.
+ * tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Rename
+ from tui_refresh_win.
+ (tui_data_window::refresh_window): New method.
+ (tui_win_info::refresh, tui_source_window_base::refresh)
+ (tui_refresh_all): Use refresh_window method.
+ * tui/tui-stack.c (tui_show_locator_content): Call refresh_window
+ method.
+ * tui/tui-regs.c (tui_display_register): Call refresh_window
+ method.
+ * tui/tui-layout.c (show_source_disasm_command)
+ (show_source_or_disasm_and_command): Call refresh_window method.
+ * tui/tui-data.h (struct tui_gen_win_info)
+ (struct tui_data_window, struct tui_cmd_window) <refresh_window>:
+ New method.
+
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_rl_other_window, tui_enable)
{
}
+ /* Call to refresh this window. */
+ virtual void refresh_window ();
+
/* Window handle. */
WINDOW *handle = nullptr;
/* Type of window. */
void set_new_height (int height) override;
+ void refresh_window () override;
+
/* Start of data display content. */
tui_win_content data_content = NULL;
int data_content_count = 0;
int max_height () const override;
+ void refresh_window () override
+ {
+ }
+
int start_line = 0;
protected:
TUI_CMD_WIN->can_highlight = false;
tui_make_visible (TUI_CMD_WIN);
}
- tui_refresh_win (TUI_CMD_WIN);
+ TUI_CMD_WIN->refresh_window ();
tui_set_current_layout_to (SRC_DISASSEM_COMMAND);
}
}
{
tui_win_list[CMD_WIN] = make_command_window (cmd_height,
src_height);
- tui_refresh_win (TUI_CMD_WIN);
+ TUI_CMD_WIN->refresh_window ();
}
else
{
to code that causes the compiler to generate an unused-value
warning. */
(void) wstandend (win_info->handle);
- tui_refresh_win (win_info);
+ win_info->refresh_window ();
}
}
waddstr (locator->handle, string);
wclrtoeol (locator->handle);
(void) wstandend (locator->handle);
- tui_refresh_win (locator);
+ locator->refresh_window ();
wmove (locator->handle, 0, 0);
xfree (string);
locator->content_in_use = TRUE;
** PUBLIC FUNCTIONS
***********************/
-/* Refresh the window. */
+/* See tui-data.h. */
+
void
-tui_refresh_win (struct tui_gen_win_info *win_info)
+tui_gen_win_info::refresh_window ()
{
- if (win_info->type == DATA_WIN && win_info->content_size > 0)
- {
- int i;
+ if (handle != NULL)
+ wrefresh (handle);
+}
- for (i = 0; (i < win_info->content_size); i++)
+/* See tui-data.h. */
+
+void
+tui_data_window::refresh_window ()
+{
+ if (content_size > 0)
+ {
+ for (int i = 0; i < content_size; i++)
{
struct tui_gen_win_info *data_item_win_ptr;
- data_item_win_ptr = win_info->content[i]->which_element.data_window;
+ data_item_win_ptr = content[i]->which_element.data_window;
if (data_item_win_ptr != NULL
&& data_item_win_ptr->handle != NULL)
wrefresh (data_item_win_ptr->handle);
}
}
- else if (win_info->type == CMD_WIN)
- {
- /* Do nothing. */
- }
else
- {
- if (win_info->handle != NULL)
- wrefresh (win_info->handle);
- }
-
- return;
+ tui_gen_win_info::refresh_window ();
}
-
/* Function to delete the curses window, checking for NULL. */
void
tui_delete_win (WINDOW *window)
tui_win_info::refresh ()
{
touchwin (handle);
- tui_refresh_win (this);
+ refresh_window ();
}
/* See tui-data.h. */
tui_source_window_base::refresh ()
{
touchwin (execution_info->handle);
- tui_refresh_win (execution_info);
+ execution_info->refresh_window ();
tui_win_info::refresh ();
}
if (locator->is_visible)
{
touchwin (locator->handle);
- tui_refresh_win (locator);
+ locator->refresh_window ();
}
}
extern void tui_check_and_display_highlight_if_needed (struct tui_win_info *);
extern void tui_refresh_all (struct tui_win_info **);
extern void tui_delete_win (WINDOW *window);
-extern void tui_refresh_win (struct tui_gen_win_info *);
#endif /* TUI_TUI_WINGENERAL_H */
tui_set_source_content_nil (win_info, no_src_str);
}
- tui_refresh_win (win_info);
+ win_info->refresh_window ();
}
}
tui_erase_source_content (win_info, TRUE);
tui_check_and_display_highlight_if_needed (win_info);
- tui_refresh_win (win_info);
+ win_info->refresh_window ();
win_info->content_in_use = TRUE;
}
int cur_line;
werase (exec_info->handle);
- tui_refresh_win (exec_info);
+ exec_info->refresh_window ();
for (cur_line = 1; (cur_line <= exec_info->content_size); cur_line++)
mvwaddstr (exec_info->handle,
cur_line,
0,
(char *) exec_info->content[cur_line - 1]
->which_element.simple_string);
- tui_refresh_win (exec_info);
+ exec_info->refresh_window ();
exec_info->content_in_use = TRUE;
}
struct tui_gen_win_info *exec_info = base->execution_info;
werase (exec_info->handle);
- tui_refresh_win (exec_info);
+ exec_info->refresh_window ();
}
void