From 7c043ba695a3cee067554b1e871e60f7934512b4 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 22 Feb 2020 11:48:26 -0700 Subject: Add horizontal splitting to TUI layout This changes the TUI layout engine to add horizontal splitting. Now, windows can be side-by-side. A horizontal split is defined using the "-horizontal" parameter to "tui new-layout". This also adds the first "winheight" test to the test suite. One open question is whether we want a new "winwidth" command, now that horizontal layouts are possible. This is easily done using the generic layout code. gdb/ChangeLog 2020-02-22 Tom Tromey PR tui/17850: * tui/tui-win.c (tui_gen_win_info::max_width): New method. * tui/tui-layout.h (class tui_layout_base) : Add "height" argument. (class tui_layout_window) : Likewise. (class tui_layout_split) : Add "vertical" argument. : Add "height" argument. : New field. * tui/tui-layout.c (tui_layout_split::clone): Update. (tui_layout_split::get_sizes): Add "height" argument. (tui_layout_split::adjust_size, tui_layout_split::apply): Update. (tui_new_layout_command): Parse "-horizontal". (_initialize_tui_layout): Update help string. (tui_layout_split::specification): Add "-horizontal" when needed. * tui/tui-layout.c (tui_layout_window::get_sizes): Add "height" argument. * tui/tui-data.h (struct tui_gen_win_info) : New methods. gdb/doc/ChangeLog 2020-02-22 Tom Tromey PR tui/17850: * gdb.texinfo (TUI Commands): Document horizontal layouts. gdb/testsuite/ChangeLog 2020-02-22 Tom Tromey PR tui/17850: * gdb.tui/new-layout.exp: Add horizontal layout and winheight tests. Change-Id: I38b35e504f34698578af86686be03c0fefd954ae --- gdb/tui/tui-data.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/tui/tui-data.h') diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 2badcd4..e15ac58 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -82,6 +82,15 @@ public: /* Compute the minimum height of this window. */ virtual int min_height () const = 0; + /* Compute the maximum width of this window. */ + int max_width () const; + + /* Compute the minimum width of this window. */ + int min_width () const + { + return 3; + } + /* Return true if this window can be boxed. */ virtual bool can_box () const { -- cgit v1.1