Remove can_highlight from TUI windows
authorTom Tromey <tom@tromey.com>
Sun, 10 Nov 2019 17:33:07 +0000 (10:33 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 10 Nov 2019 17:33:07 +0000 (10:33 -0700)
Each TUI window has a "can_highlight" member.  However, this has the
same meaning as "can_box" -- a window can be highlighted if and only
if it can be boxed.  So, this patch removes can_highlight in favor of
simply using can_box.

gdb/ChangeLog
2019-11-10  Tom Tromey  <tom@tromey.com>

* tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box.
(tui_highlight_win): Likewise.
(tui_win_info::check_and_display_highlight_if_needed): Likewise.
* tui/tui-data.h (struct tui_win_info) <can_highlight>: Remove.
* tui/tui-command.h (struct tui_cmd_window) <tui_cmd_window>:
Don't set can_highlight.

Change-Id: I35916859070efcdfcc6e692c71cc6070956dcfce

gdb/ChangeLog
gdb/tui/tui-command.h
gdb/tui/tui-data.h
gdb/tui/tui-wingeneral.c

index bac7f4419e06d6c541596cfcb8d523bc2d78ca03..6f377f33473d12b3f53525f866993bd182e47282 100644 (file)
@@ -1,3 +1,12 @@
+2019-11-10  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box.
+       (tui_highlight_win): Likewise.
+       (tui_win_info::check_and_display_highlight_if_needed): Likewise.
+       * tui/tui-data.h (struct tui_win_info) <can_highlight>: Remove.
+       * tui/tui-command.h (struct tui_cmd_window) <tui_cmd_window>:
+       Don't set can_highlight.
+
 2019-11-10  Tom Tromey  <tom@tromey.com>
 
        * cli/cli-style.h (class cli_style_option) <cli_style_option>:
index 79516941c9885a1ac4b92f8186e377d945baf382..6a276df72e73d38544d77b8958d7dbb6ba3d6ed3 100644 (file)
@@ -30,7 +30,6 @@ struct tui_cmd_window : public tui_win_info
   tui_cmd_window ()
     : tui_win_info (CMD_WIN)
   {
-    can_highlight = false;
   }
 
   DISABLE_COPY_AND_ASSIGN (tui_cmd_window);
index 8af15735aa1009c1c24de1e7e9b980a087babc88..0e45da5934ffd149ab0efbb79744598f3df4937a 100644 (file)
@@ -211,9 +211,6 @@ public:
   /* Window title to display.  */
   std::string title;
 
-  /* Can this window ever be highlighted?  */
-  bool can_highlight = true;
-
   /* Is this window highlighted?  */
   bool is_highlighted = false;
 };
index b6dd3f9b26a47899cabc61bfc978b2755bef7f9d..f6a690330657bb2bcb74cbbbf25893d606f34ac2 100644 (file)
@@ -84,7 +84,7 @@ void
 tui_unhighlight_win (struct tui_win_info *win_info)
 {
   if (win_info != NULL 
-      && win_info->can_highlight
+      && win_info->can_box ()
       && win_info->handle != NULL)
     {
       box_win (win_info, false);
@@ -98,7 +98,7 @@ void
 tui_highlight_win (struct tui_win_info *win_info)
 {
   if (win_info != NULL
-      && win_info->can_highlight
+      && win_info->can_box ()
       && win_info->handle != NULL)
     {
       box_win (win_info, true);
@@ -110,7 +110,7 @@ tui_highlight_win (struct tui_win_info *win_info)
 void
 tui_win_info::check_and_display_highlight_if_needed ()
 {
-  if (can_highlight)
+  if (can_box ())
     {
       if (is_highlighted)
        tui_highlight_win (this);