+2019-07-17 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-regs.c (tui_data_window::display_reg_element_at_line):
+ Rename from tui_display_reg_element_at_line.
+ (tui_data_window::display_registers_from_line): Update.
+ * tui/tui-data.h (struct tui_data_window)
+ <display_reg_element_at_line>: New method.
+
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (tui_display_registers_from)
/* Return the index of the first element displayed. If none are
displayed, then return -1. */
int first_data_item_displayed ();
+
+ /* Display the registers in the content from 'start_element_no' on
+ 'start_line_no' until the end of the register content or the end
+ 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);
};
struct tui_cmd_window : public tui_win_info
}
}
+/* See tui-data.h. */
-/* Function to display the registers in the content from
- 'start_element_no' on 'start_line_no' until the end of the register
- content or the end of the display height. This function checks
- that we won't display off the end of the register display. */
-static void
-tui_display_reg_element_at_line (int start_element_no,
- int start_line_no)
+void
+tui_data_window::display_reg_element_at_line (int start_element_no,
+ int start_line_no)
{
- if (!TUI_DATA_WIN->regs_content.empty ())
+ if (!regs_content.empty ())
{
int element_no = start_element_no;
{
int last_line_no, first_line_on_last_page;
- last_line_no = TUI_DATA_WIN->last_regs_line_no ();
- first_line_on_last_page
- = last_line_no - (TUI_DATA_WIN->height - 2);
+ last_line_no = last_regs_line_no ();
+ first_line_on_last_page = last_line_no - (height - 2);
if (first_line_on_last_page < 0)
first_line_on_last_page = 0;
registers, adjust what element to really start the
display at. */
if (start_line_no > first_line_on_last_page)
- element_no
- = (TUI_DATA_WIN->first_reg_element_no_inline
- (first_line_on_last_page));
+ element_no = first_reg_element_no_inline (first_line_on_last_page);
}
- TUI_DATA_WIN->display_registers_from (element_no);
+ display_registers_from (element_no);
}
}
element_no = first_reg_element_no_inline (line_no);
if (element_no < regs_content.size ())
- tui_display_reg_element_at_line (element_no, line_no);
+ display_reg_element_at_line (element_no, line_no);
else
line_no = (-1);