Move TUI command window code
authorTom Tromey <tom@tromey.com>
Tue, 2 Jul 2019 21:48:59 +0000 (15:48 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 17 Jul 2019 18:19:22 +0000 (12:19 -0600)
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.

gdb/ChangeLog
2019-07-17  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
gdb/tui/tui-command.c
gdb/tui/tui-command.h
gdb/tui/tui-data.c
gdb/tui/tui-data.h
gdb/tui/tui-layout.c
gdb/tui/tui-win.c
gdb/tui/tui.c

index da9015d5c8c2ad0aebcd6f94df0f25df36a2eddf..ae1577259a09d9ce673d8298afd530a36ca81d3d 100644 (file)
@@ -1,3 +1,19 @@
+2019-07-17  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.
+
 2019-07-17  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-io.c (tui_dispatch_ctrl_char): Move from tui-command.c.
index 1a269e7fb519d77143471d7e8cea180a356692b4..5af3484b9ece44902c1d60e6c154441dd37252a5 100644 (file)
 #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.  */
 
index 3f84ee22fa80cb6d934fcbcbbeb813c147615643..d2a8ab1903a89f34399c2d06fee915e7ba7d39d4 100644 (file)
 #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);
 
index e861eb222ddc04cb552f76df689fd6a4a6675eb2..5e755168827c8b85cf900a04e0c630254fb34cf9 100644 (file)
@@ -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 *
index ec60efda7a5359c457b7c2502219958c572af0d8..a847f2ada936f89c2cef94a58bca2a3bf6d632ee 100644 (file)
@@ -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
 {
@@ -454,53 +456,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);
 
 
index abc3fd6018293d3d76e247fe6eba9482ac505d07..2e67ed15238b6638807d0aa035a995004b37097a 100644 (file)
@@ -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"
index 0c7042e9385b911160b956c4a26443b8440d9701..124fdb11c7e6153af9444e27665f9ae67a62044b 100644 (file)
@@ -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)
index 996dbaf6cf7d3c8a4d1c8a915c5e137329890d04..22de9a70b82af73454a47190edffadf19332d386 100644 (file)
@@ -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"
This page took 0.031885 seconds and 4 git commands to generate.