From c8ec2f433c54dae7746db144a872da6f808e5d73 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 7 Oct 2019 16:59:02 -0600 Subject: [PATCH] Move max_height method to tui_gen_win_info This moves the max_height method to tui_gen_win_info and implements it in the subclasses. This is used by a subsequent patch, which will normalize window layout across all window types. gdb/ChangeLog 2019-12-11 Tom Tromey * tui/tui-stack.h (struct tui_locator_window) : New method. * tui/tui-regs.h (struct tui_data_item_window) : New method. * tui/tui-data.h (struct tui_gen_win_info) : New method. (struct tui_win_info) : Now override. Change-Id: I4ba3e8899bc4668328d3d78e3c1674c61882450d --- gdb/ChangeLog | 10 ++++++++++ gdb/tui/tui-data.h | 6 ++++-- gdb/tui/tui-regs.h | 5 +++++ gdb/tui/tui-stack.h | 5 +++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ca47b8cad71..20d3321b511 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2019-12-11 Tom Tromey + + * tui/tui-stack.h (struct tui_locator_window) : New + method. + * tui/tui-regs.h (struct tui_data_item_window) : New + method. + * tui/tui-data.h (struct tui_gen_win_info) : New + method. + (struct tui_win_info) : Now override. + 2019-12-11 Joel Brobecker * NEWS: Create a new section for the next release branch. diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 282b49ee6f9..d3b84b164c6 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -82,6 +82,9 @@ public: return ""; } + /* Compute the maximum height of this window. */ + virtual int max_height () const = 0; + /* Resize this window. The parameters are used to set the window's size and position. */ virtual void resize (int height, int width, @@ -173,8 +176,7 @@ public: { } - /* Compute the maximum height of this window. */ - virtual int max_height () const; + int max_height () const override; /* Called after the tab width has been changed. */ virtual void update_tab_width () diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h index e45a68f8f49..d476bcffee1 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -41,6 +41,11 @@ struct tui_data_item_window : public tui_gen_win_info void refresh_window () override; + int max_height () const override + { + return 1; + } + const char *name = nullptr; /* The register number, or data display number. */ int item_no = -1; diff --git a/gdb/tui/tui-stack.h b/gdb/tui/tui-stack.h index 93a79fbd799..dd9851b8ed4 100644 --- a/gdb/tui/tui-stack.h +++ b/gdb/tui/tui-stack.h @@ -37,6 +37,11 @@ struct tui_locator_window : public tui_gen_win_info proc_name[0] = 0; } + int max_height () const override + { + return 1; + } + void rerender () override; /* Update the locator, with the provided arguments. -- 2.30.2