diff options
author | Tom Tromey <tom@tromey.com> | 2020-02-22 11:48:26 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-02-22 11:48:33 -0700 |
commit | 6bc5664858d6869513b9b98861c813675231e5b5 (patch) | |
tree | 1239ed8288fde31acffa27c08b1e0f07c9a58324 /gdb/tui/tui-layout.c | |
parent | c22fef7e4cf9d3cb6d7062d248b0cc148dc76137 (diff) | |
download | fsf-binutils-gdb-6bc5664858d6869513b9b98861c813675231e5b5.zip fsf-binutils-gdb-6bc5664858d6869513b9b98861c813675231e5b5.tar.gz fsf-binutils-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.c')
-rw-r--r-- | gdb/tui/tui-layout.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 6077a9c..e1833cd 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -487,7 +487,7 @@ tui_layout_split::set_weights_from_heights () /* See tui-layout.h. */ -bool +tui_adjust_result tui_layout_split::adjust_size (const char *name, int new_height) { /* Look through the children. If one is a layout holding the named @@ -496,10 +496,11 @@ tui_layout_split::adjust_size (const char *name, int new_height) int found_index = -1; for (int i = 0; i < m_splits.size (); ++i) { - if (m_splits[i].layout->adjust_size (name, new_height)) - return true; - const char *win_name = m_splits[i].layout->get_name (); - if (win_name != nullptr && strcmp (name, win_name) == 0) + tui_adjust_result adjusted + = m_splits[i].layout->adjust_size (name, new_height); + if (adjusted == HANDLED) + return HANDLED; + if (adjusted == FOUND) { found_index = i; break; @@ -507,9 +508,9 @@ tui_layout_split::adjust_size (const char *name, int new_height) } if (found_index == -1) - return false; + return NOT_FOUND; if (m_splits[found_index].layout->height == new_height) - return true; + return HANDLED; set_weights_from_heights (); int delta = m_splits[found_index].weight - new_height; @@ -557,7 +558,7 @@ tui_layout_split::adjust_size (const char *name, int new_height) apply (x, y, width, height); } - return true; + return HANDLED; } /* See tui-layout.h. */ |