From cda37efbffb63e2634ea0600fdad2de6a8f9f3ad Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 16 Jun 2019 14:22:21 -0600 Subject: Introduce make_visible method This introduceds the make_visible to tui_win_info and overrides it in subclasses as appropriate. This allows the removal of the tui_win_is_source_type, as it is no longer used. gdb/ChangeLog 2019-06-25 Tom Tromey * tui/tui-wingeneral.c (tui_win_info::make_visible) (tui_source_window_base::make_visible): New methods. (make_all_visible): Make method call. * tui/tui-data.h (struct tui_win_info) : New method. (struct tui_source_window_base, struct tui_cmd_window): Override make_visible. (tui_win_is_source_type): Don't declare. * tui/tui-data.c (tui_win_is_source_type): Remove. --- gdb/tui/tui-wingeneral.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'gdb/tui/tui-wingeneral.c') diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 5428817..1308437 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -211,6 +211,22 @@ tui_make_invisible (struct tui_gen_win_info *win_info) make_visible (win_info, 0); } +/* See tui-data.h. */ + +void +tui_win_info::make_visible (int visible) +{ + ::make_visible (&generic, visible); +} + +/* See tui-data.h. */ + +void +tui_source_window_base::make_visible (int visible) +{ + ::make_visible (execution_info, visible); + tui_win_info::make_visible (visible); +} /* Makes all windows invisible (except the command and locator windows). */ @@ -221,17 +237,8 @@ make_all_visible (int visible) for (i = 0; i < MAX_MAJOR_WINDOWS; i++) { - if (tui_win_list[i] != NULL - && ((tui_win_list[i])->generic.type) != CMD_WIN) - { - if (tui_win_is_source_type ((tui_win_list[i])->generic.type)) - { - tui_source_window_base *base - = (tui_source_window_base *) tui_win_list[i]; - make_visible (base->execution_info, visible); - } - make_visible (&tui_win_list[i]->generic, visible); - } + if (tui_win_list[i] != NULL) + tui_win_list[i]->make_visible (visible); } return; -- cgit v1.1