+2019-07-17 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-regs.h (tui_first_reg_element_no_inline): Don't
+ declare.
+ * tui/tui-regs.c (tui_data_window::first_reg_element_no_inline):
+ Rename from tui_first_reg_element_no_inline.
+ (tui_display_reg_element_at_line)
+ (tui_display_registers_from_line): Update.
+ * tui/tui-data.h (struct tui_data_window)
+ <first_reg_element_no_inline>: New method.
+
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.c (tui_display_data_from)
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;
+
protected:
void do_scroll_vertical (int num_to_scroll) override;
return (-1);
}
+/* See tui-data.h. */
-/* Answer the index of the first element in line_no. If line_no is
- past the register area (-1) is returned. */
int
-tui_first_reg_element_no_inline (int line_no)
+tui_data_window::first_reg_element_no_inline (int line_no) const
{
- if ((line_no * TUI_DATA_WIN->regs_column_count)
- <= TUI_DATA_WIN->regs_content.size ())
- return (((line_no + 1) * TUI_DATA_WIN->regs_column_count)
- - TUI_DATA_WIN->regs_column_count);
+ if (line_no * regs_column_count <= regs_content.size ())
+ return ((line_no + 1) * regs_column_count) - regs_column_count;
else
return (-1);
}
display at. */
if (start_line_no > first_line_on_last_page)
element_no
- = tui_first_reg_element_no_inline (first_line_on_last_page);
+ = (TUI_DATA_WIN->first_reg_element_no_inline
+ (first_line_on_last_page));
}
tui_display_registers_from (element_no);
}
else
line = line_no;
- element_no = tui_first_reg_element_no_inline (line);
+ element_no = TUI_DATA_WIN->first_reg_element_no_inline (line);
if (element_no < TUI_DATA_WIN->regs_content.size ())
tui_display_reg_element_at_line (element_no, line);
else
extern void tui_display_registers_from (int);
extern int tui_display_registers_from_line (int, int);
extern int tui_first_reg_element_inline (int);
-extern int tui_first_reg_element_no_inline (int lineno);
#endif /* TUI_TUI_REGS_H */