public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Introduce the refresh method Date: Tue, 25 Jun 2019 13:59:00 -0000 [thread overview] Message-ID: <20190625135913.119680.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2042b506c85274b4c652fbc9291be65b2550104d commit 2042b506c85274b4c652fbc9291be65b2550104d Author: Tom Tromey <tom@tromey.com> Date: Sun Jun 16 14:27:28 2019 -0600 Introduce the refresh method This adds tui_win_info::refresh and updates tui_source_window_base to implement it as well. This lets us simplify tui_refresh_all, removing a check of the window type. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_win_info::refresh) (tui_source_window_base::refresh): New methods. (tui_refresh_all): Call the refresh method. * tui/tui-data.h (struct tui_win_info) (struct tui_source_window_base) <refresh>: New method. Diff: --- gdb/ChangeLog | 8 ++++++++ gdb/tui/tui-data.h | 4 ++++ gdb/tui/tui-wingeneral.c | 31 ++++++++++++++++++++----------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b47b6ce..1fea395 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui-wingeneral.c (tui_win_info::refresh) + (tui_source_window_base::refresh): New methods. + (tui_refresh_all): Call the refresh method. + * tui/tui-data.h (struct tui_win_info) + (struct tui_source_window_base) <refresh>: New method. + +2019-06-25 Tom Tromey <tom@tromey.com> + * tui/tui.h (tui_is_window_visible): Return bool. * tui/tui.c (tui_is_window_visible): Return bool. * tui/tui-wingeneral.c (tui_make_window, make_visible) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 3799ab4..e4a9b04 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -258,6 +258,9 @@ public: /* Make this window visible or invisible. */ virtual void make_visible (bool visible); + /* Refresh this window and any associated windows. */ + virtual void refresh (); + /* Methods to scroll the contents of this window. Note that they are named with "_scroll" coming at the end because the more obvious "scroll_forward" is defined as a macro in term.h. */ @@ -299,6 +302,7 @@ public: } void make_visible (bool visible) override; + void refresh () override; /* Does the locator belong to this window? */ bool m_has_locator = false; diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index e802e52..4d168af 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -256,6 +256,25 @@ tui_make_all_invisible (void) make_all_visible (false); } +/* See tui-data.h. */ + +void +tui_win_info::refresh () +{ + touchwin (generic.handle); + tui_refresh_win (&generic); +} + +/* See tui-data.h. */ + +void +tui_source_window_base::refresh () +{ + touchwin (execution_info->handle); + tui_refresh_win (execution_info); + tui_win_info::refresh (); +} + /* Function to refresh all the windows currently displayed. */ void @@ -267,17 +286,7 @@ tui_refresh_all (struct tui_win_info **list) for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++) { if (list[type] && list[type]->generic.is_visible) - { - if (type == SRC_WIN || type == DISASSEM_WIN) - { - tui_source_window_base *base - = (tui_source_window_base *) list[type]; - touchwin (base->execution_info->handle); - tui_refresh_win (base->execution_info); - } - touchwin (list[type]->generic.handle); - tui_refresh_win (&list[type]->generic); - } + list[type]->refresh (); } if (locator->is_visible) {
reply other threads:[~2019-06-25 13:59 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190625135913.119680.qmail@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).