From: Tom Tromey Date: Mon, 7 Oct 2019 23:36:49 +0000 (-0600) Subject: Introduce the tui_gen_win_info::min_height method X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc7ff8a60818f002d7b759210202e0aaabfeebc3;p=binutils-gdb.git Introduce the tui_gen_win_info::min_height method This introduces a new method, tui_gen_win_info::min_height, to fetch the minimum height of a window. This is used in the subsequent unified layout patch. gdb/ChangeLog 2019-12-11 Tom Tromey * tui/tui-stack.h (struct tui_locator_window) : Implement. * tui/tui-regs.h (struct tui_data_item_window) : Implement. * tui/tui-data.h (struct tui_gen_win_info) : New method. (struct tui_win_info) : Implement. Change-Id: Id33baffdf041fde072e15c1ff89b75f8b8118adb --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 88fa1c1d15c..d436bb514b4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2019-12-11 Tom Tromey + + * tui/tui-stack.h (struct tui_locator_window) : + Implement. + * tui/tui-regs.h (struct tui_data_item_window) : + Implement. + * tui/tui-data.h (struct tui_gen_win_info) : New + method. + (struct tui_win_info) : Implement. + 2019-12-11 Tom Tromey * tui/tui-data.h (struct tui_gen_win_info) : New method. diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index d441a381468..a25ab11dc5e 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -85,6 +85,9 @@ public: /* Compute the maximum height of this window. */ virtual int max_height () const = 0; + /* Compute the minimum height of this window. */ + virtual int min_height () const = 0; + /* Return true if this window can be boxed. */ virtual bool can_box () const { @@ -184,6 +187,11 @@ public: int max_height () const override; + int min_height () const override + { + return MIN_WIN_HEIGHT; + } + /* Called after the tab width has been changed. */ virtual void update_tab_width () { diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index d476bcffee1..92df6183677 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -46,6 +46,11 @@ struct tui_data_item_window : public tui_gen_win_info return 1; } + int min_height () const override + { + return 1; + } + const char *name = nullptr; /* The register number, or data display number. */ int item_no = -1; diff --git a/gdb/tui/tui-stack.h b/gdb/tui/tui-stack.h index dd9851b8ed4..27af5d2fe1a 100644 --- a/gdb/tui/tui-stack.h +++ b/gdb/tui/tui-stack.h @@ -42,6 +42,11 @@ struct tui_locator_window : public tui_gen_win_info return 1; } + int min_height () const override + { + return 1; + } + void rerender () override; /* Update the locator, with the provided arguments.