public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Move TUI command window code
@ 2019-07-17 18:41 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-07-17 18:41 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ce38393b1abc2573d6521d11ab1fbfb5a28e5109
commit ce38393b1abc2573d6521d11ab1fbfb5a28e5109
Author: Tom Tromey <tom@tromey.com>
Date: Tue Jul 2 15:48:59 2019 -0600
Move TUI command window code
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.
Diff:
---
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/ChangeLog b/gdb/ChangeLog
index da9015d..ae15772 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,21 @@
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.
Now static.
* tui/tui-command.h (tui_dispatch_ctrl_char): Don't declare.
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index 1a269e7..5af3484 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 3f84ee2..d2a8ab1 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 e861eb2..5e75516 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 ec60efd..a847f2a 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
{
@@ -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);
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index abc3fd6..2e67ed1 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 0c7042e..124fdb1 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 996dbaf..22de9a7 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"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-17 18:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 18:41 [binutils-gdb] Move TUI command window code Tom Tromey
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).