diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-17 13:19:15 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-06-25 07:48:41 -0600 |
commit | 48a3bd16c2189174f601600dc6cceedd68e908b6 (patch) | |
tree | b75e64905292ef3215df8ca8d59b11b0efedb453 /gdb | |
parent | c3bd716ffc20cada32e8a18a209638b578d47f5e (diff) | |
download | gdb-48a3bd16c2189174f601600dc6cceedd68e908b6.zip gdb-48a3bd16c2189174f601600dc6cceedd68e908b6.tar.gz gdb-48a3bd16c2189174f601600dc6cceedd68e908b6.tar.bz2 |
Move make_visible method to tui_gen_win_info
This moves the make_visible method from tui_win_info to its base
class, tui_gen_win_info. This allows the removal of another window
type check.
gdb/ChangeLog
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_gen_win_info::make_visible): Rename
from make_visible.
(tui_make_visible, tui_make_invisible): Rewrite.
(tui_win_info::make_visible): Remove.
(tui_source_window_base::make_visible): Update.
* tui/tui-data.h (struct tui_gen_win_info) <make_visible>: New
method. Moved from...
(struct tui_win_info) <make_visible>: ...here.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/tui/tui-data.h | 6 | ||||
-rw-r--r-- | gdb/tui/tui-wingeneral.c | 41 |
3 files changed, 28 insertions, 30 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2e6b47e..3780b96 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,16 @@ 2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui-wingeneral.c (tui_gen_win_info::make_visible): Rename + from make_visible. + (tui_make_visible, tui_make_invisible): Rewrite. + (tui_win_info::make_visible): Remove. + (tui_source_window_base::make_visible): Update. + * tui/tui-data.h (struct tui_gen_win_info) <make_visible>: New + method. Moved from... + (struct tui_win_info) <make_visible>: ...here. + +2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui-winsource.c (tui_source_window_base::do_scroll_horizontal): Remove direction parameter. diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 59d1900..74efdde 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -51,6 +51,9 @@ struct tui_gen_win_info /* Call to refresh this window. */ virtual void refresh_window (); + /* Make this window visible or invisible. */ + virtual void make_visible (bool visible); + /* Return the name of this type of window. */ virtual const char *name () const { @@ -273,9 +276,6 @@ public: return false; } - /* Make this window visible or invisible. */ - virtual void make_visible (bool visible); - /* Refresh this window and any associated windows. */ virtual void refresh (); diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index f1089a9..acb8a26 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -168,51 +168,37 @@ tui_make_window (struct tui_gen_win_info *win_info, int box_it) /* We can't really make windows visible, or invisible. So we have to delete the entire window when making it visible, and create it again when making it visible. */ -static void -make_visible (struct tui_gen_win_info *win_info, bool visible) +void +tui_gen_win_info::make_visible (bool visible) { - /* Don't tear down/recreate command window. */ - if (win_info->type == CMD_WIN) - return; - if (visible) { - if (!win_info->is_visible) + if (!is_visible) { - tui_make_window (win_info, !tui_win_is_auxillary (win_info->type)); - win_info->is_visible = true; + tui_make_window (this, !tui_win_is_auxillary (type)); + is_visible = true; } } else if (!visible - && win_info->is_visible - && win_info->handle != NULL) + && is_visible + && handle != NULL) { - win_info->is_visible = false; - tui_delete_win (win_info->handle); - win_info->handle = NULL; + is_visible = false; + tui_delete_win (handle); + handle = NULL; } - - return; } void tui_make_visible (struct tui_gen_win_info *win_info) { - make_visible (win_info, true); + win_info->make_visible (true); } void tui_make_invisible (struct tui_gen_win_info *win_info) { - make_visible (win_info, false); -} - -/* See tui-data.h. */ - -void -tui_win_info::make_visible (bool visible) -{ - ::make_visible (this, visible); + win_info->make_visible (false); } /* See tui-data.h. */ @@ -220,7 +206,8 @@ tui_win_info::make_visible (bool visible) void tui_source_window_base::make_visible (bool visible) { - ::make_visible (execution_info, visible); + if (execution_info != nullptr) + execution_info->make_visible (visible); tui_win_info::make_visible (visible); } |