From patchwork Wed Nov 6 14:27:38 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: 35678 Received: (qmail 53848 invoked by alias); 6 Nov 2019 14:27:51 -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 53771 invoked by uid 89); 6 Nov 2019 14:27:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:3152 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; Wed, 06 Nov 2019 14:27:49 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 3240920D4C; Wed, 6 Nov 2019 09:27:45 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id B316320C12 for ; Wed, 6 Nov 2019 09:27:40 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 92C482816D for ; Wed, 6 Nov 2019 09:27:40 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Wed, 6 Nov 2019 09:27:38 -0500 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v2] Introduce the tui_gen_win_info::min_height method X-Gerrit-Change-Id: Id33baffdf041fde072e15c1ff89b75f8b8118adb X-Gerrit-Change-Number: 365 X-Gerrit-ChangeURL: X-Gerrit-Commit: ee42cdcdb6b05588763dd10459b6a7f4bb29f58d In-Reply-To: References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Message-Id: <20191106142740.92C482816D@gnutoolchain-gerrit.osci.io> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/365 ...................................................................... Introduce the tui_gen_win_info::min_height method This introduces a new method, tui_gen_win_info::min_height, to fetch the minimum height of a window. This is used in the subsequent unified layout patch. gdb/ChangeLog 2019-11-06 Tom Tromey * tui/tui-stack.h (struct tui_locator_window) : Implement. * tui/tui-regs.h (struct tui_data_item_window) : Implement. * tui/tui-data.h (struct tui_gen_win_info) : New method. (struct tui_win_info) : Implement. Change-Id: Id33baffdf041fde072e15c1ff89b75f8b8118adb --- M gdb/ChangeLog M gdb/tui/tui-data.h M gdb/tui/tui-regs.h M gdb/tui/tui-stack.h 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 02d6364..fbb2885 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,15 @@ 2019-11-06 Tom Tromey + * tui/tui-stack.h (struct tui_locator_window) : + Implement. + * tui/tui-regs.h (struct tui_data_item_window) : + Implement. + * tui/tui-data.h (struct tui_gen_win_info) : New + method. + (struct tui_win_info) : Implement. + +2019-11-06 Tom Tromey + * tui/tui-data.h (struct tui_gen_win_info) : New method. (struct tui_win_info) : Update. diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index b0183a3..7318122 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -85,12 +85,14 @@ /* Compute the maximum height of this window. */ virtual int max_height () const = 0; + /* Compute the minimum height of this window. */ + virtual int min_height () const = 0; + /* Return true if this window can be boxed. */ virtual bool can_box () const { return false; } - /* Resize this window. The parameters are used to set the window's size and position. */ virtual void resize (int height, int width, @@ -184,6 +186,11 @@ int max_height () const override; + int min_height () const override + { + return MIN_WIN_HEIGHT; + } + /* 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 d476bcf..92df618 100644 --- a/gdb/tui/tui-regs.h +++ b/gdb/tui/tui-regs.h @@ -46,6 +46,11 @@ return 1; } + int min_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 dd9851b..27af5d2 100644 --- a/gdb/tui/tui-stack.h +++ b/gdb/tui/tui-stack.h @@ -42,6 +42,11 @@ return 1; } + int min_height () const override + { + return 1; + } + void rerender () override; /* Update the locator, with the provided arguments.