Make tui_win_info::name pure virtual

It seemed cleaner to me for tui_win_info::name to be pure virtual.
This meant adding a name method to the locator window; but this too
seems like an improvement.

gdb/ChangeLog
2020-07-01  Tom Tromey  <tom@tromey.com>

	* tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.
	* tui/tui-stack.h (struct tui_locator_window) <name>: New method.
This commit is contained in:
Tom Tromey
2020-07-01 21:21:12 -06:00
parent 32c1e21009
commit 1cdf9e33ea
3 changed files with 11 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
2020-07-01 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.
* tui/tui-stack.h (struct tui_locator_window) <name>: New method.
2020-07-01 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_win_info::refresh_window): Move from

View File

@@ -62,10 +62,7 @@ public:
virtual void make_visible (bool visible);
/* Return the name of this type of window. */
virtual const char *name () const
{
return "";
}
virtual const char *name () const = 0;
/* Compute the maximum height of this window. */
virtual int max_height () const;

View File

@@ -32,6 +32,11 @@ struct tui_locator_window : public tui_win_info
{
tui_locator_window () = default;
const char *name () const override
{
return STATUS_NAME;
}
int max_height () const override
{
return 1;