Move max_height method to tui_gen_win_info
authorTom Tromey <tom@tromey.com>
Mon, 7 Oct 2019 22:59:02 +0000 (16:59 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 11 Dec 2019 22:48:59 +0000 (15:48 -0700)
This moves the max_height method to tui_gen_win_info and implements it
in the subclasses.  This is used by a subsequent patch, which will
normalize window layout across all window types.

gdb/ChangeLog
2019-12-11  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
method.
* tui/tui-data.h (struct tui_gen_win_info) <max_height>: New
method.
(struct tui_win_info) <max_height>: Now override.

Change-Id: I4ba3e8899bc4668328d3d78e3c1674c61882450d

gdb/ChangeLog
gdb/tui/tui-data.h
gdb/tui/tui-regs.h
gdb/tui/tui-stack.h

index ca47b8cad71703229f37750eb631c6994c9e6cdb..20d3321b51103fbd53b1c6306f4c54f527853816 100644 (file)
@@ -1,3 +1,13 @@
+2019-12-11  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
+       method.
+       * tui/tui-data.h (struct tui_gen_win_info) <max_height>: New
+       method.
+       (struct tui_win_info) <max_height>: Now override.
+
 2019-12-11  Joel Brobecker  <brobecker@adacore.com>
 
        * NEWS: Create a new section for the next release branch.
index 282b49ee6f9f3b093cda2aec63a426720ab2c8ae..d3b84b164c62d466857f53939ec1acd64abec06d 100644 (file)
@@ -82,6 +82,9 @@ public:
     return "";
   }
 
+  /* Compute the maximum height of this window.  */
+  virtual int max_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,
@@ -173,8 +176,7 @@ public:
   {
   }
 
-  /* Compute the maximum height of this window.  */
-  virtual int max_height () const;
+  int max_height () const override;
 
   /* Called after the tab width has been changed.  */
   virtual void update_tab_width ()
index e45a68f8f49fb57d1c14b5a0fb42abfb92fa1d79..d476bcffee19561cceab2d2e7d6dab659da6a7c7 100644 (file)
@@ -41,6 +41,11 @@ struct tui_data_item_window : public tui_gen_win_info
 
   void refresh_window () override;
 
+  int max_height () const override
+  {
+    return 1;
+  }
+
   const char *name = nullptr;
   /* The register number, or data display number.  */
   int item_no = -1;
index 93a79fbd799c72d0a6986ab8dc9369e2d3c64fec..dd9851b8ed4b30f0532d7aa6b148719d2421961f 100644 (file)
@@ -37,6 +37,11 @@ struct tui_locator_window : public tui_gen_win_info
     proc_name[0] = 0;
   }
 
+  int max_height () const override
+  {
+    return 1;
+  }
+
   void rerender () override;
 
   /* Update the locator, with the provided arguments.
This page took 0.031743 seconds and 4 git commands to generate.