From patchwork Thu Nov 14 22:51:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35897 Received: (qmail 98855 invoked by alias); 14 Nov 2019 22:51:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 98787 invoked by uid 89); 14 Nov 2019 22:51:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=UD:tui-stack.h, tui-data.h, UD:tui-regs.h, sk:tui_loc X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Nov 2019 22:51:26 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id E6B5D20393; Thu, 14 Nov 2019 17:51:24 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 3C62720339; Thu, 14 Nov 2019 17:51:21 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 0299220AF6; Thu, 14 Nov 2019 17:51:21 -0500 (EST) X-Gerrit-PatchSet: 3 Date: Thu, 14 Nov 2019 17:51:20 -0500 From: "Tom Tromey (Code Review)" To: Andrew Burgess , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v3] Move max_height method to tui_gen_win_info X-Gerrit-Change-Id: I4ba3e8899bc4668328d3d78e3c1674c61882450d X-Gerrit-Change-Number: 364 X-Gerrit-ChangeURL: X-Gerrit-Commit: ab3739e448cd17fbba7c4791782669eeb51dcad6 In-Reply-To: References: Reply-To: tromey@sourceware.org, andrew.burgess@embecosm.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Message-Id: <20191114225121.0299220AF6@gnutoolchain-gerrit.osci.io> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/364 ...................................................................... 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-11-12 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 --- M gdb/ChangeLog M gdb/tui/tui-data.h M gdb/tui/tui-regs.h M gdb/tui/tui-stack.h 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1a84242..55ee2a8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2019-11-12 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-11-14 Tom Tromey * eval.c (evaluate_subexp_standard) : Do not pass an diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 0e45da5..7464b95 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -82,6 +82,9 @@ 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 @@ { } - /* 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 e45a68f..d476bcf 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -41,6 +41,11 @@ 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 93a79fb..dd9851b 100644 --- a/gdb/tui/tui-stack.h +++ b/gdb/tui/tui-stack.h @@ -37,6 +37,11 @@ proc_name[0] = 0; } + int max_height () const override + { + return 1; + } + void rerender () override; /* Update the locator, with the provided arguments.