+2019-07-17 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-regs.h (tui_last_regs_line_no): Don't declare.
+ * tui/tui-regs.c (tui_data_window::last_regs_line_no): Rename from
+ tui_last_regs_line_no.
+ (tui_display_reg_element_at_line)
+ (tui_display_registers_from_line): Update.
+ * tui/tui-data.h (struct tui_data_window) <last_regs_line_no>: New
+ method.
+
2019-07-17 Tom Tromey <tom@tromey.com>
PR tui/24722:
bool display_regs = false;
struct reggroup *current_group = nullptr;
+ /* 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;
+
protected:
void do_scroll_vertical (int num_to_scroll) override;
** PUBLIC FUNCTIONS **
******************************************/
-/* Answer the number of the last line in the regs display. If there
- are no registers (-1) is returned. */
+/* See tui-data.h. */
+
int
-tui_last_regs_line_no (void)
+tui_data_window::last_regs_line_no () const
{
int num_lines = (-1);
- if (!TUI_DATA_WIN->regs_content.empty ())
+ if (!regs_content.empty ())
{
- num_lines = (TUI_DATA_WIN->regs_content.size ()
- / TUI_DATA_WIN->regs_column_count);
- if (TUI_DATA_WIN->regs_content.size () % TUI_DATA_WIN->regs_column_count)
+ num_lines = regs_content.size () / regs_column_count;
+ if (regs_content.size () % regs_column_count)
num_lines++;
}
return num_lines;
{
int last_line_no, first_line_on_last_page;
- last_line_no = tui_last_regs_line_no ();
+ last_line_no = TUI_DATA_WIN->last_regs_line_no ();
first_line_on_last_page
= last_line_no - (TUI_DATA_WIN->height - 2);
if (first_line_on_last_page < 0)
{ /* If we must display regs (force_display is true), then
make sure that we don't display off the end of the
registers. */
- if (line_no >= tui_last_regs_line_no ())
+ if (line_no >= TUI_DATA_WIN->last_regs_line_no ())
{
if ((line = tui_line_from_reg_element_no (
TUI_DATA_WIN->regs_content.size () - 1)) < 0)
extern void tui_show_registers (struct reggroup *group);
extern void tui_display_registers_from (int);
extern int tui_display_registers_from_line (int, int);
-extern int tui_last_regs_line_no (void);
extern int tui_first_reg_element_inline (int);
extern int tui_line_from_reg_element_no (int);
extern int tui_first_reg_element_no_inline (int lineno);