aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-layout.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-22 11:48:26 -0700
committerTom Tromey <tom@tromey.com>2020-02-22 11:48:33 -0700
commit6bc5664858d6869513b9b98861c813675231e5b5 (patch)
tree1239ed8288fde31acffa27c08b1e0f07c9a58324 /gdb/tui/tui-layout.h
parentc22fef7e4cf9d3cb6d7062d248b0cc148dc76137 (diff)
downloadgdb-6bc5664858d6869513b9b98861c813675231e5b5.zip
gdb-6bc5664858d6869513b9b98861c813675231e5b5.tar.gz
gdb-6bc5664858d6869513b9b98861c813675231e5b5.tar.bz2
Change return type of tui_layout_base::adjust_size
This changes tui_layout_base::adjust_size to return a new enum type. I broke this out into a separate patch because it simplifies a subsequent patch. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui-layout.h (enum tui_adjust_result): New. (class tui_layout_base) <adjust_size>: Return tui_adjust_result. (class tui_layout_window) <adjust_size>: Return tui_adjust_result. Rewrite. (class tui_layout_split) <adjust_size>: Return tui_adjust_result. * tui/tui-layout.c (tui_layout_split::adjust_size): Update. Change-Id: I821b48ab06a9b9485875e147bd08a3bc46b900a0
Diffstat (limited to 'gdb/tui/tui-layout.h')
-rw-r--r--gdb/tui/tui-layout.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h
index 4351e26..969e4df 100644
--- a/gdb/tui/tui-layout.h
+++ b/gdb/tui/tui-layout.h
@@ -27,6 +27,18 @@
#include "tui/tui.h"
#include "tui/tui-data.h"
+/* Values that can be returned when handling a request to adjust a
+ window's size. */
+enum tui_adjust_result
+{
+ /* Requested window was not found here. */
+ NOT_FOUND,
+ /* Window was found but not handled. */
+ FOUND,
+ /* Window was found and handled. */
+ HANDLED
+};
+
/* The basic object in a TUI layout. This represents a single piece
of screen real estate. Subclasses determine the exact
behavior. */
@@ -64,7 +76,7 @@ public:
/* Adjust the size of the window named NAME to NEW_HEIGHT, updating
the sizes of the other windows around it. */
- virtual bool adjust_size (const char *name, int new_height) = 0;
+ virtual tui_adjust_result adjust_size (const char *name, int new_height) = 0;
/* Remove some windows from the layout, leaving the command window
and the window being passed in here. */
@@ -111,9 +123,9 @@ public:
return m_contents.c_str ();
}
- bool adjust_size (const char *name, int new_height) override
+ tui_adjust_result adjust_size (const char *name, int new_height) override
{
- return false;
+ return m_contents == name ? FOUND : NOT_FOUND;
}
bool top_boxed_p () const override;
@@ -165,7 +177,7 @@ public:
void apply (int x, int y, int width, int height) override;
- bool adjust_size (const char *name, int new_height) override;
+ tui_adjust_result adjust_size (const char *name, int new_height) override;
bool top_boxed_p () const override;