Introduce new layout code
This introduces a new approach to window layout for the TUI. The idea
behind this code is that a layout should be specified in a declarative
way, and then be applied by generic code that does not need to know
the specifics of every possible layout.
This patch itself does not change any behavior, because the new layout
engine isn't yet connected to anything. That is, this merely
introduces the implementation.
This generic approach makes the code more maintainable. It also
enables some future changes:
* New window types are simpler to add;
* User-specified layouts are possible; and
* Horizontal layouts are more attainable
gdb/ChangeLog
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-layout.h (class tui_layout_base)
(class tui_layout_window, class tui_layout_split): New.
* tui/tui-layout.c (tui_get_window_by_name)
(tui_layout_window::clone, tui_layout_window::apply)
(tui_layout_window::get_sizes, tui_layout_window::add_split)
(tui_layout_split::add_window, tui_layout_split::clone)
(tui_layout_split::get_sizes)
(tui_layout_split::set_weights_from_heights)
(tui_layout_split::adjust_size, tui_layout_split::apply): New
functions.
(tui_layout_split::add_split, tui_layout_split::add_split)
(tui_layout_split::set_weights_from_heights)
(tui_layout_split::set_weights_from_heights): New functions.
Change-Id: I3a4cae666327b617d862aaa356f8179f945c6a4e