From patchwork Sun Nov 10 17:34:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 35777 Received: (qmail 10704 invoked by alias); 10 Nov 2019 17:34:16 -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 10672 invoked by uid 89); 10 Nov 2019 17:34:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 10 Nov 2019 17:34:14 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 0F2E97BEC for ; Sun, 10 Nov 2019 11:34:13 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id Tr6KiD6BIHunhTr6LidC5G; Sun, 10 Nov 2019 11:34:13 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VuRa1JjPnMOrFVVTaORjILO4MKYy2DQra59a6huK90M=; b=SVERTYM9ivdnzOu5rbLcsSJnFV FuYZaeLdL7di0STfDaKKSnMFxGOLOhyP9sMH3zP5AhN3wcfXzLQV8+Pr0KtYy1uslPExj9eBRq9r9 mhif3pTMn2Uk2Sx/fXtd/I7MF; Received: from 75-166-69-206.hlrn.qwest.net ([75.166.69.206]:52926 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iTr6K-003Ric-Q2; Sun, 10 Nov 2019 10:34:12 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Remove can_highlight from TUI windows Date: Sun, 10 Nov 2019 10:34:10 -0700 Message-Id: <20191110173410.15702-1-tom@tromey.com> Each TUI window has a "can_highlight" member. However, this has the same meaning as "can_box" -- a window can be highlighted if and only if it can be boxed. So, this patch removes can_highlight in favor of simply using can_box. gdb/ChangeLog 2019-11-10 Tom Tromey * tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box. (tui_highlight_win): Likewise. (tui_win_info::check_and_display_highlight_if_needed): Likewise. * tui/tui-data.h (struct tui_win_info) : Remove. * tui/tui-command.h (struct tui_cmd_window) : Don't set can_highlight. Change-Id: I35916859070efcdfcc6e692c71cc6070956dcfce --- gdb/ChangeLog | 9 +++++++++ gdb/tui/tui-command.h | 1 - gdb/tui/tui-data.h | 3 --- gdb/tui/tui-wingeneral.c | 6 +++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gdb/tui/tui-command.h b/gdb/tui/tui-command.h index 79516941c98..6a276df72e7 100644 --- a/gdb/tui/tui-command.h +++ b/gdb/tui/tui-command.h @@ -30,7 +30,6 @@ 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); diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 8af15735aa1..0e45da5934f 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -211,9 +211,6 @@ public: /* Window title to display. */ std::string title; - /* Can this window ever be highlighted? */ - bool can_highlight = true; - /* Is this window highlighted? */ bool is_highlighted = false; }; diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index b6dd3f9b26a..f6a69033065 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -84,7 +84,7 @@ void tui_unhighlight_win (struct tui_win_info *win_info) { if (win_info != NULL - && win_info->can_highlight + && win_info->can_box () && win_info->handle != NULL) { box_win (win_info, false); @@ -98,7 +98,7 @@ void tui_highlight_win (struct tui_win_info *win_info) { if (win_info != NULL - && win_info->can_highlight + && win_info->can_box () && win_info->handle != NULL) { box_win (win_info, true); @@ -110,7 +110,7 @@ tui_highlight_win (struct tui_win_info *win_info) void tui_win_info::check_and_display_highlight_if_needed () { - if (can_highlight) + if (can_box ()) { if (is_highlighted) tui_highlight_win (this);