[review] Introduce the tui_gen_win_info::min_height method

Message ID gerrit.1572212661000.Id33baffdf041fde072e15c1ff89b75f8b8118adb@gnutoolchain-gerrit.osci.io
State Superseded
Headers show
Series
  • [review] Introduce the tui_gen_win_info::min_height method
Related show

Commit Message

Simon Marchi (Code Review) Oct. 27, 2019, 9:44 p.m.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/365
......................................................................

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-10-27  Tom Tromey  <tom@tromey.com>

	* tui/tui-stack.h (struct tui_locator_window) <min_height>:
	Implement.
	* tui/tui-regs.h (struct tui_data_item_window) <min_height>:
	Implement.
	* tui/tui-data.h (struct tui_gen_win_info) <min_height>: New
	method.
	(struct tui_win_info) <min_height>: Implement.

Change-Id: Id33baffdf041fde072e15c1ff89b75f8b8118adb
---
M gdb/ChangeLog
M gdb/tui/tui-data.h
M gdb/tui/tui-regs.h
M gdb/tui/tui-stack.h
4 files changed, 28 insertions(+), 0 deletions(-)




-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id33baffdf041fde072e15c1ff89b75f8b8118adb
Gerrit-Change-Number: 365
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newchange

Comments

Simon Marchi (Code Review) Nov. 13, 2019, 10:19 a.m. | #1
Andrew Burgess has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/365
......................................................................


Patch Set 2: Code-Review+2

LGTM


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id33baffdf041fde072e15c1ff89b75f8b8118adb
Gerrit-Change-Number: 365
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Comment-Date: Wed, 13 Nov 2019 10:19:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Simon Marchi (Code Review) Nov. 23, 2019, 12:22 a.m. | #2
Andrew Burgess has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/365
......................................................................


Patch Set 4: Code-Review+2

Still LGTM :)


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id33baffdf041fde072e15c1ff89b75f8b8118adb
Gerrit-Change-Number: 365
Gerrit-PatchSet: 4
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Comment-Date: Sat, 23 Nov 2019 00:22:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c1f106c..94ba3c0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@ 
 2019-10-27  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-stack.h (struct tui_locator_window) <min_height>:
+	Implement.
+	* tui/tui-regs.h (struct tui_data_item_window) <min_height>:
+	Implement.
+	* tui/tui-data.h (struct tui_gen_win_info) <min_height>: New
+	method.
+	(struct tui_win_info) <min_height>: Implement.
+
+2019-10-27  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-stack.h (struct tui_locator_window) <max_height>: New
 	method.
 	* tui/tui-regs.h (struct tui_data_item_window) <max_height>: New
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 0131aa4..d342ca0 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -85,6 +85,9 @@ 
   /* 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;
+
   /* Resize this window.  The parameters are used to set the window's
      size and position.  */
   virtual void resize (int height, int width,
@@ -178,6 +181,11 @@ 
 
   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 d476bcf..92df618 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -46,6 +46,11 @@ 
     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 dd9851b..27af5d2 100644
--- a/gdb/tui/tui-stack.h
+++ b/gdb/tui/tui-stack.h
@@ -42,6 +42,11 @@ 
     return 1;
   }
 
+  int min_height () const override
+  {
+    return 1;
+  }
+
   void rerender () override;
 
   /* Update the locator, with the provided arguments.