aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-data.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-13 16:47:31 -0600
committerTom Tromey <tom@tromey.com>2019-08-20 16:45:50 -0600
commitab0e1f1a4507f91536b583c57a492cb9d3aaf6f2 (patch)
treecea4886a288944d3af598bb3fc9d26af76dbd3ec /gdb/tui/tui-data.h
parent100c2bf31fa9bde80d997a5b39d1a07e0505a1cb (diff)
downloadbinutils-ab0e1f1a4507f91536b583c57a492cb9d3aaf6f2.zip
binutils-ab0e1f1a4507f91536b583c57a492cb9d3aaf6f2.tar.gz
binutils-ab0e1f1a4507f91536b583c57a492cb9d3aaf6f2.tar.bz2
Change tui_make_window to be a method
I combined several small changes into one patch here. I believe I started by noticing that the "title" is not needed by tui_gen_win_info and could be self-managing (i.e. std::string). Moving this revealed that "can_box" is also a property of tui_win_info and not tui_gen_win_info; and this in turn caused the changes to tui_make_window and box_win. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.h (tui_make_window): Don't declare. * tui/tui-wingeneral.c (box_win): Change type of win_info. (box_win): Update. (tui_gen_win_info::make_window): Rename from tui_make_window. (tui_win_info::make_window): New method. (tui_gen_win_info::make_visible): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * tui/tui-regs.c (tui_data_window::show_register_group): Update. (tui_data_window::display_registers_from): Update. * tui/tui-layout.c (tui_gen_win_info::resize): Update. * tui/tui-data.h (struct tui_gen_win_info) <make_window>: Declare. <can_box>: Remove. <title>: Remove. (struct tui_win_info) <make_window>: Declare. <can_box>: Now virtual. <title>: New member. * tui/tui-data.c (~tui_gen_win_info): Don't free title. * tui/tui-command.c (tui_cmd_window::resize): Update.
Diffstat (limited to 'gdb/tui/tui-data.h')
-rw-r--r--gdb/tui/tui-data.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 0432a53..a5ff5e2 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -52,6 +52,8 @@ protected:
{
}
+ virtual void make_window ();
+
public:
virtual ~tui_gen_win_info ();
@@ -73,12 +75,6 @@ public:
virtual void resize (int height, int width,
int origin_x, int origin_y);
- /* Return true if this can be boxed. */
- virtual bool can_box () const
- {
- return false;
- }
-
/* Return true if this window is visible. */
bool is_visible () const
{
@@ -97,8 +93,6 @@ public:
struct tui_point origin = {0, 0};
/* Viewport height. */
int viewport_height = 0;
- /* Window title to display. */
- char *title = nullptr;
};
/* Constant definitions. */
@@ -173,6 +167,8 @@ protected:
void rerender () override;
+ void make_window () override;
+
public:
~tui_win_info () override
@@ -213,13 +209,16 @@ public:
return true;
}
- bool can_box () const override
+ virtual bool can_box () const
{
return true;
}
void check_and_display_highlight_if_needed ();
+ /* Window title to display. */
+ std::string title;
+
/* Can this window ever be highlighted? */
bool can_highlight = true;