aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-wingeneral.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-16 16:28:12 -0600
committerTom Tromey <tom@tromey.com>2019-06-25 07:48:38 -0600
commit5b81daba91b035ce98fb7be4970fc2be0183f6ea (patch)
tree95b05f93cccf3058b358619c00276272ecf23097 /gdb/tui/tui-wingeneral.c
parentcb2ce89305264543a4014d98bacb26800d92d394 (diff)
downloadgdb-5b81daba91b035ce98fb7be4970fc2be0183f6ea.zip
gdb-5b81daba91b035ce98fb7be4970fc2be0183f6ea.tar.gz
gdb-5b81daba91b035ce98fb7be4970fc2be0183f6ea.tar.bz2
Introduce refresh_window method
This replaces tui_refresh_win with a new refresh_window method. This removes another spot that was checking the window's type. gdb/ChangeLog 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.
Diffstat (limited to 'gdb/tui/tui-wingeneral.c')
-rw-r--r--gdb/tui/tui-wingeneral.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 06d7ad5..f1089a9 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -31,38 +31,36 @@
** 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)
@@ -260,7 +258,7 @@ void
tui_win_info::refresh ()
{
touchwin (handle);
- tui_refresh_win (this);
+ refresh_window ();
}
/* See tui-data.h. */
@@ -269,7 +267,7 @@ void
tui_source_window_base::refresh ()
{
touchwin (execution_info->handle);
- tui_refresh_win (execution_info);
+ execution_info->refresh_window ();
tui_win_info::refresh ();
}
@@ -289,7 +287,7 @@ tui_refresh_all (struct tui_win_info **list)
if (locator->is_visible)
{
touchwin (locator->handle);
- tui_refresh_win (locator);
+ locator->refresh_window ();
}
}