public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 54/61] Move TUI command window code
Date: Thu, 04 Jul 2019 17:04:00 -0000	[thread overview]
Message-ID: <20190704170311.15982-55-tom@tromey.com> (raw)
In-Reply-To: <20190704170311.15982-1-tom@tromey.com>

Like the earlier change to the data window, this moves the TUI command
window code to tui-command.[ch], and removes the old "structuring"
comments from tui-command.c.

2019-07-04  Tom Tromey  <tom@tromey.com>

	* tui/tui.c: Update.
	* tui/tui-win.c (tui_cmd_window::do_make_visible_with_new_height)
	(tui_cmd_window::max_height): Move to tui-command.c.
	* tui/tui-layout.c: Update.
	* tui/tui-data.h (struct tui_cmd_window): Move to tui-command.h.
	* tui/tui-data.c (tui_cmd_window::clear_detail): Move to
	tui-command.c.
	* tui/tui-command.h (struct tui_cmd_window): Move from
	tui-data.h.
	* tui/tui-command.c: Remove "structuring" comments.
	(tui_cmd_window::clear_detail)
	(tui_cmd_window::do_make_visible_with_new_height)
	(tui_cmd_window::max_height): Move from elsewhere.
---
 gdb/ChangeLog         | 16 ++++++++++++++
 gdb/tui/tui-command.c | 31 +++++++++++++++++++++------
 gdb/tui/tui-command.h | 50 +++++++++++++++++++++++++++++++++++++++++++
 gdb/tui/tui-data.c    |  8 -------
 gdb/tui/tui-data.h    | 49 ++----------------------------------------
 gdb/tui/tui-layout.c  |  1 +
 gdb/tui/tui-win.c     | 21 +-----------------
 gdb/tui/tui.c         |  1 +
 8 files changed, 96 insertions(+), 81 deletions(-)

diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index 1a269e7fb51..5af3484b9ec 100644
--- a/gdb/tui/tui-command.c
+++ b/gdb/tui/tui-command.c
@@ -27,15 +27,34 @@
 #include "tui/tui-command.h"
 
 #include "gdb_curses.h"
-/*****************************************
-** STATIC LOCAL FUNCTIONS FORWARD DECLS    **
-******************************************/
 
+/* See tui-command.h.  */
+
+void
+tui_cmd_window::clear_detail ()
+{
+  wmove (handle, 0, 0);
+}
+
+/* See tui-command.h.  */
 
+void
+tui_cmd_window::do_make_visible_with_new_height ()
+{
+#ifdef HAVE_WRESIZE
+  wresize (handle, height, width);
+#endif
+  mvwin (handle, origin.y, origin.x);
+  wmove (handle, 0, 0);
+}
 
-/*****************************************
-** PUBLIC FUNCTIONS                        **
-******************************************/
+/* See tui-command.h.  */
+
+int
+tui_cmd_window::max_height () const
+{
+  return tui_term_height () - 4;
+}
 
 /* See tui-command.h.  */
 
diff --git a/gdb/tui/tui-command.h b/gdb/tui/tui-command.h
index 3f84ee22fa8..d2a8ab1903a 100644
--- a/gdb/tui/tui-command.h
+++ b/gdb/tui/tui-command.h
@@ -22,6 +22,56 @@
 #ifndef TUI_TUI_COMMAND_H
 #define TUI_TUI_COMMAND_H
 
+#include "tui/tui-data.h"
+
+/* The TUI command window.  */
+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);
+
+  void clear_detail () override;
+
+  void make_visible (bool visible) override
+  {
+  }
+
+  int max_height () const override;
+
+  void refresh_window () override
+  {
+  }
+
+  const char *name () const override
+  {
+    return CMD_NAME;
+  }
+
+  bool can_scroll () const override
+  {
+    return false;
+  }
+
+  int start_line = 0;
+
+protected:
+
+  void do_scroll_vertical (int num_to_scroll) override
+  {
+  }
+
+  void do_scroll_horizontal (int num_to_scroll) override
+  {
+  }
+
+  void do_make_visible_with_new_height () override;
+};
+
 /* Refresh the command window.  */
 extern void tui_refresh_cmd_win (void);
 
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index e861eb222dd..5e755168827 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -150,14 +150,6 @@ tui_source_window_base::clear_detail ()
   horizontal_offset = 0;
 }
 
-/* See tui-data.h.  */
-
-void
-tui_cmd_window::clear_detail ()
-{
-  wmove (handle, 0, 0);
-}
-
 /* Accessor for the locator win info.  Answers a pointer to the static
    locator win info struct.  */
 struct tui_locator_window *
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 489bae99b22..ed5d291f354 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -26,6 +26,8 @@
 #include "gdb_curses.h"	/* For WINDOW.  */
 #include "observable.h"
 
+struct tui_cmd_window;
+
 /* This is a point definition.  */
 struct tui_point
 {
@@ -452,53 +454,6 @@ protected:
   void do_scroll_vertical (int num_to_scroll) override;
 };
 
-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);
-
-  void clear_detail () override;
-
-  void make_visible (bool visible) override
-  {
-  }
-
-  int max_height () const override;
-
-  void refresh_window () override
-  {
-  }
-
-  const char *name () const override
-  {
-    return CMD_NAME;
-  }
-
-  bool can_scroll () const override
-  {
-    return false;
-  }
-
-  int start_line = 0;
-
-protected:
-
-  void do_scroll_vertical (int num_to_scroll) override
-  {
-  }
-
-  void do_scroll_horizontal (int num_to_scroll) override
-  {
-  }
-
-  void do_make_visible_with_new_height () override;
-};
-
 extern int tui_win_is_auxiliary (enum tui_win_type win_type);
 
 
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index abc3fd60182..2e67ed15238 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -28,6 +28,7 @@
 #include <ctype.h>
 
 #include "tui/tui.h"
+#include "tui/tui-command.h"
 #include "tui/tui-data.h"
 #include "tui/tui-wingeneral.h"
 #include "tui/tui-stack.h"
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 0c7042e9385..124fdb11c7e 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -36,6 +36,7 @@
 
 #include "tui/tui.h"
 #include "tui/tui-io.h"
+#include "tui/tui-command.h"
 #include "tui/tui-data.h"
 #include "tui/tui-wingeneral.h"
 #include "tui/tui-stack.h"
@@ -1319,32 +1320,12 @@ tui_source_window_base::do_make_visible_with_new_height ()
 
 /* See tui-data.h.  */
 
-void
-tui_cmd_window::do_make_visible_with_new_height ()
-{
-#ifdef HAVE_WRESIZE
-  wresize (handle, height, width);
-#endif
-  mvwin (handle, origin.y, origin.x);
-  wmove (handle, 0, 0);
-}
-
-/* See tui-data.h.  */
-
 int
 tui_win_info::max_height () const
 {
   return tui_term_height () - 2;
 }
 
-/* See tui-data.h.  */
-
-int
-tui_cmd_window::max_height () const
-{
-  return tui_term_height () - 4;
-}
-
 static int
 new_height_ok (struct tui_win_info *primary_win_info, 
 	       int new_height)
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 996dbaf6cf7..22de9a70b82 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -23,6 +23,7 @@
 #include "gdbcmd.h"
 #include "tui/tui.h"
 #include "tui/tui-hooks.h"
+#include "tui/tui-command.h"
 #include "tui/tui-data.h"
 #include "tui/tui-layout.h"
 #include "tui/tui-io.h"
-- 
2.17.2

  parent reply	other threads:[~2019-07-04 17:04 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04 17:03 [PATCH 00/61] More TUI refactorings Tom Tromey
2019-07-04 17:03 ` [PATCH 15/61] Introduce two more tui_data_window methods Tom Tromey
2019-07-04 17:03 ` [PATCH 02/61] Check can_highlight in tui_check_and_display_highlight_if_needed Tom Tromey
2019-07-04 17:03 ` [PATCH 24/61] Introduce tui_source_window_base::location_matches_p method Tom Tromey
2019-07-17 12:37   ` Pedro Alves
2019-07-04 17:03 ` [PATCH 12/61] Don't declare unimplemented functions Tom Tromey
2019-07-04 17:03 ` [PATCH 20/61] Introduce TUI window iterator Tom Tromey
2019-07-04 17:03 ` [PATCH 09/61] Remove tui_display_data_from_line Tom Tromey
2019-07-04 17:03 ` [PATCH 01/61] Introduce can_scroll method Tom Tromey
2019-07-04 17:03 ` [PATCH 31/61] Remove tui_source_window::content_in_use Tom Tromey
2019-07-04 17:03 ` [PATCH 04/61] Consolidate "if"s in tui_show_frame_info Tom Tromey
2019-07-04 17:03 ` [PATCH 03/61] Remove some uses of TUI_WIN_SRC Tom Tromey
2019-07-04 17:03 ` [PATCH 23/61] Remove tui_set_win_height Tom Tromey
2019-07-04 17:03 ` [PATCH 40/61] Change tui_set_layout to return void Tom Tromey
2019-07-04 17:03 ` [PATCH 06/61] Introduce tui_data_window::last_regs_line_no method Tom Tromey
2019-07-04 17:03 ` [PATCH 37/61] Introduce reset_locator function in tui-layout.c Tom Tromey
2019-07-04 17:03 ` [PATCH 27/61] Remove unused parameter from two TUI functions Tom Tromey
2019-07-04 17:03 ` [PATCH 22/61] Make source windows be self-updating Tom Tromey
2019-07-04 17:03 ` [PATCH 13/61] Introduce tui_data_window::delete_data_content_windows method Tom Tromey
2019-07-17 12:36   ` Pedro Alves
2019-07-17 18:26     ` Tom Tromey
2019-07-04 17:03 ` [PATCH 28/61] Remove unused TUI defines Tom Tromey
2019-07-04 17:03 ` [PATCH 25/61] Move content_in_use to tui_source_window class Tom Tromey
2019-07-04 17:03 ` [PATCH 14/61] Introduce tui_data_window::erase_data_content method Tom Tromey
2019-07-04 17:03 ` [PATCH 33/61] Remove tui_set_focus Tom Tromey
2019-07-04 17:03 ` [PATCH 07/61] Introduce tui_data_window::line_from_reg_element_no method Tom Tromey
2019-07-04 17:03 ` [PATCH 08/61] Introduce tui_data_window::first_reg_element_no_inline Tom Tromey
2019-07-04 17:03 ` [PATCH 16/61] Introduce tui_data_window::display_reg_element_at_line method Tom Tromey
2019-07-04 17:03 ` [PATCH 18/61] Simplify tui_show_registers Tom Tromey
2019-07-04 17:03 ` [PATCH 36/61] Always create an execution info window for a source window Tom Tromey
2019-07-04 17:03 ` [PATCH 11/61] Introduce tui_data_window::display_all_data method Tom Tromey
2019-07-04 17:03 ` [PATCH 34/61] Remove TUI data window special case Tom Tromey
2019-07-04 17:03 ` [PATCH 29/61] Remove UNDEFINED_ITEM define from TUI Tom Tromey
2019-07-04 17:03 ` [PATCH 17/61] Parameterize tui_show_register_group with window Tom Tromey
2019-07-04 17:03 ` [PATCH 32/61] Merge refresh and refresh_window methods Tom Tromey
2019-07-04 17:03 ` [PATCH 21/61] Fix comment typos Tom Tromey
2019-07-04 17:04 ` [PATCH 59/61] Move source window common to code to tui-winsource.[ch] Tom Tromey
2019-07-04 17:04 ` [PATCH 43/61] Simplify tui_gen_win_info::make_visible Tom Tromey
2019-07-04 17:04 ` [PATCH 44/61] Change tui_get_register to return void Tom Tromey
2019-07-04 17:04 ` [PATCH 48/61] Remove make_data_window Tom Tromey
2019-07-04 17:04 ` [PATCH 51/61] Fix flushing bug in tui_puts_internal Tom Tromey
2019-07-17 12:37   ` Pedro Alves
2019-07-04 17:04 ` [PATCH 19/61] Minor tui_reg_next / tui_reg_prev cleanup Tom Tromey
2019-07-04 17:04 ` [PATCH 30/61] Simplify source window clearing Tom Tromey
2019-07-04 17:04 ` [PATCH 35/61] Remove some dead code from tui_set_layout Tom Tromey
2019-07-04 17:04 ` [PATCH 45/61] Simplify show_source_or_disasm_and_command Tom Tromey
2019-07-04 17:04 ` [PATCH 39/61] Remove reset_locator Tom Tromey
2019-07-04 17:04 ` [PATCH 61/61] Remove unnecessary "return"s Tom Tromey
2019-07-17 12:37   ` Pedro Alves
2019-07-04 17:04 ` [PATCH 46/61] Remove make_command_window Tom Tromey
2019-07-04 17:04 ` [PATCH 49/61] Remove tui_make_visible and tui_make_invisible Tom Tromey
2019-07-04 17:04 ` [PATCH 05/61] Remove deleted breakpoint from TUI display Tom Tromey
2019-07-04 17:04 ` [PATCH 56/61] Move tui_disasm_window to tui-disasm.h Tom Tromey
2019-07-04 17:04 ` [PATCH 52/61] Rearrange TUI data window code Tom Tromey
2019-07-04 17:04 ` [PATCH 53/61] Move tui_dispatch_ctrl_char to tui-io.c Tom Tromey
2019-07-04 17:04 ` [PATCH 58/61] Change make_invisible_and_set_new_height to be a method Tom Tromey
2019-07-22 11:57   ` clang build-regression [Re: [PATCH 58/61] Change make_invisible_and_set_new_height to be a method] Jan Kratochvil
2019-07-04 17:04 ` Tom Tromey [this message]
2019-07-04 17:04 ` [PATCH 57/61] Move tui_source_window to tui-source.h Tom Tromey
2019-07-04 17:04 ` [PATCH 38/61] Remove the win_type parameter from tui_gen_win_info::reset Tom Tromey
2019-07-04 17:04 ` [PATCH 41/61] Clean up tui_layout_command Tom Tromey
2019-07-04 17:04 ` [PATCH 42/61] Simplify show_source_disasm_command Tom Tromey
2019-07-04 17:04 ` [PATCH 26/61] Add win_info parameter to tui_set_disassem_content Tom Tromey
2019-07-04 17:04 ` [PATCH 55/61] Move TUI data item window to tui-regs.h Tom Tromey
2019-07-04 17:04 ` [PATCH 60/61] Fix an error in parse_scrolling_args Tom Tromey
2019-07-04 17:04 ` [PATCH 10/61] Remove tui_display_data_from Tom Tromey
2019-07-04 17:26 ` [PATCH 50/61] Remove has_locator method Tom Tromey
2019-07-04 17:26 ` [PATCH 47/61] Remove make_source_window and make_disasm_window Tom Tromey
2019-07-17 12:41 ` [PATCH 00/61] More TUI refactorings Pedro Alves
2019-07-17 18:35   ` Tom Tromey

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=20190704170311.15982-55-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@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: link
Be 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).