Move max_height method to tui_gen_win_info
[deliverable/binutils-gdb.git] / gdb / tui / tui-regs.h
index acefa41f99ee602efc9a126b0df6fb1af057e69d..d476bcffee19561cceab2d2e7d6dab659da6a7c7 100644 (file)
 
 #include "tui/tui-data.h"
 
+/* A data item window.  */
+
+struct tui_data_item_window : public tui_gen_win_info
+{
+  tui_data_item_window ()
+    : tui_gen_win_info (DATA_ITEM_WIN)
+  {
+  }
+
+  DISABLE_COPY_AND_ASSIGN (tui_data_item_window);
+
+  tui_data_item_window (tui_data_item_window &&) = default;
+
+  void rerender () override;
+
+  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;
+  bool highlight = false;
+  gdb::unique_xmalloc_ptr<char> content;
+};
+
 /* The TUI registers window.  */
 struct tui_data_window : public tui_win_info
 {
@@ -34,11 +63,6 @@ struct tui_data_window : public tui_win_info
 
   DISABLE_COPY_AND_ASSIGN (tui_data_window);
 
-  void clear_detail () override;
-  void refresh_all () override;
-
-  void set_new_height (int height) override;
-
   void refresh_window () override;
 
   const char *name () const override
@@ -46,35 +70,25 @@ struct tui_data_window : public tui_win_info
     return DATA_NAME;
   }
 
-  /* Windows that are used to display registers.  */
-  std::vector<std::unique_ptr<tui_data_item_window>> regs_content;
-  int regs_column_count = 0;
-  /* Should regs be displayed at all?  */
-  bool display_regs = false;
-  struct reggroup *current_group = nullptr;
+  void check_register_values (struct frame_info *frame);
 
-  /* Answer the number of the last line in the regs display.  If there
-     are no registers (-1) is returned.  */
-  int last_regs_line_no () const;
+  void show_registers (struct reggroup *group);
 
-  /* Answer the line number that the register element at element_no is
-     on.  If element_no is greater than the number of register
-     elements there are, -1 is returned.  */
-  int line_from_reg_element_no (int element_no) const;
+  struct reggroup *get_current_group () const
+  {
+    return m_current_group;
+  }
 
-  /* Answer the index of the first element in line_no.  If line_no is
-     past the register area (-1) is returned.  */
-  int first_reg_element_no_inline (int line_no) const;
+protected:
 
-  /* Displays the data that is in the data window's content.  It does
-     not set the content.  */
-  void display_all_data ();
+  void do_scroll_vertical (int num_to_scroll) override;
+  void do_scroll_horizontal (int num_to_scroll) override
+  {
+  }
 
-  /* Delete all the item windows in the data window.  This is usually
-     done when the data window is scrolled.  */
-  void delete_data_content_windows ();
+  void rerender () override;
 
-  void erase_data_content (const char *prompt);
+private:
 
   /* Display the registers in the content from 'start_element_no'
      until the end of the register content or the end of the display
@@ -87,14 +101,6 @@ struct tui_data_window : public tui_win_info
      started from.  If nothing is displayed (-1) is returned.  */
   int display_registers_from_line (int line_no);
 
-protected:
-
-  void do_scroll_vertical (int num_to_scroll) override;
-  void do_scroll_horizontal (int num_to_scroll) override
-  {
-  }
-  void do_make_visible_with_new_height () override;
-
   /* Return the index of the first element displayed.  If none are
      displayed, then return -1.  */
   int first_data_item_displayed ();
@@ -104,9 +110,34 @@ protected:
      of the display height.  This function checks that we won't
      display off the end of the register display.  */
   void display_reg_element_at_line (int start_element_no, int start_line_no);
-};
 
-extern void tui_check_register_values (struct frame_info *);
-extern void tui_show_registers (struct reggroup *group);
+  void show_register_group (struct reggroup *group,
+                           struct frame_info *frame,
+                           bool refresh_values_only);
+
+  /* Answer the number of the last line in the regs display.  If there
+     are no registers (-1) is returned.  */
+  int last_regs_line_no () const;
+
+  /* Answer the line number that the register element at element_no is
+     on.  If element_no is greater than the number of register
+     elements there are, -1 is returned.  */
+  int line_from_reg_element_no (int element_no) const;
+
+  /* Answer the index of the first element in line_no.  If line_no is
+     past the register area (-1) is returned.  */
+  int first_reg_element_no_inline (int line_no) const;
+
+  /* Delete all the item windows in the data window.  This is usually
+     done when the data window is scrolled.  */
+  void delete_data_content_windows ();
+
+  void erase_data_content (const char *prompt);
+
+  /* Windows that are used to display registers.  */
+  std::vector<tui_data_item_window> m_regs_content;
+  int m_regs_column_count = 0;
+  struct reggroup *m_current_group = nullptr;
+};
 
 #endif /* TUI_TUI_REGS_H */
This page took 0.025808 seconds and 4 git commands to generate.