- /* Can this window ever be highlighted? */
- bool can_highlight = true;
-
- /* Is this window highlighted? */
- bool is_highlighted = false;
-};
-
-/* The base class for all source-like windows, namely the source and
- disassembly windows. */
-
-struct tui_source_window_base : public tui_win_info
-{
-protected:
- explicit tui_source_window_base (enum tui_win_type type);
- ~tui_source_window_base () override;
- DISABLE_COPY_AND_ASSIGN (tui_source_window_base);
-
- void do_scroll_horizontal (int num_to_scroll) override;
- void do_make_visible_with_new_height () override;
-
-public:
-
- void clear_detail () override;
-
- /* Return true if this window has the locator. */
- bool has_locator () const override
- {
- return m_has_locator;
- }
-
- void make_visible (bool visible) override;
- void refresh () override;
- void refresh_all () override;
-
- /* Refill the source window's source cache and update it. If this
- is a disassembly window, then just update it. */
- void refill ();
-
- /* Set the location of the execution point. */
- void set_is_exec_point_at (struct tui_line_or_address l);
-
- void set_new_height (int height) override;
-
- void update_tab_width () override;
-
- /* Return true if the location LOC corresponds to the line number
- LINE_NO in this source window; false otherwise. */
- virtual bool location_matches_p (struct bp_location *loc, int line_no) = 0;
-
- /* Can it be used, or is it already used? */
- bool content_in_use = false;
- /* Does the locator belong to this window? */
- bool m_has_locator = false;
- /* Execution information window. */
- struct tui_exec_info_window *execution_info = nullptr;
- /* Used for horizontal scroll. */
- int horizontal_offset = 0;
- struct tui_line_or_address start_line_or_addr;
-
- /* It is the resolved form as returned by symtab_to_fullname. */
- char *fullname = nullptr;
-
- /* Architecture associated with code at this location. */
- struct gdbarch *gdbarch = nullptr;
-
- std::vector<tui_source_element> content;
-};
-
-/* A TUI source window. */
-
-struct tui_source_window : public tui_source_window_base
-{
- tui_source_window ();
- ~tui_source_window ();
-
- DISABLE_COPY_AND_ASSIGN (tui_source_window);
-
- const char *name () const override
- {
- return SRC_NAME;
- }
-
- bool location_matches_p (struct bp_location *loc, int line_no) override;
-
- bool showing_source_p (const char *filename) const;
-
-protected:
-
- void do_scroll_vertical (int num_to_scroll) override;
-
-private:
-
- void style_changed ();
-
- /* A token used to register and unregister an observer. */
- gdb::observers::token m_observable;
-};
-
-/* A TUI disassembly window. */
-
-struct tui_disasm_window : public tui_source_window_base
-{
- tui_disasm_window ()
- : tui_source_window_base (DISASSEM_WIN)
- {
- }
-
- DISABLE_COPY_AND_ASSIGN (tui_disasm_window);
-
- const char *name () const override
- {
- return DISASSEM_NAME;
- }
-
- bool location_matches_p (struct bp_location *loc, int line_no) override;
-
-protected:
-
- void do_scroll_vertical (int num_to_scroll) override;
-};
-
-struct tui_data_window : public tui_win_info
-{
- tui_data_window ()
- : tui_win_info (DATA_WIN)
- {
- }
-
- 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
- {
- 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;
-
- /* 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;
-
- /* Displays the data that is in the data window's content. It does
- not set the content. */
- void display_all_data ();
-
- /* 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);
-
- /* Display the registers in the content from 'start_element_no'
- until the end of the register content or the end of the display
- height. No checking for displaying past the end of the registers
- is done here. */
- void display_registers_from (int start_element_no);
-
- /* Display the registers starting at line line_no in the data
- window. Answers the line number that the display actually
- 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 ();
-
- /* 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
-{
- tui_cmd_window ()
- : tui_win_info (CMD_WIN)
- {
- can_highlight = false;
- }
-
- DISABLE_COPY_AND_ASSIGN (tui_cmd_window);
-
- void clear_detail () override;
-
- void make_visible (bool visible) override