aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-layout.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-22 11:48:26 -0700
committerTom Tromey <tom@tromey.com>2020-02-22 11:48:31 -0700
commitee325b61cd4389506d2dd63294c1ce1c64cb9d9f (patch)
tree1040c49dcd59346665afe89f07cfc62d2d0317ad /gdb/tui/tui-layout.h
parent416eb92d84ac0bc4b8aba137789f52d1f987cd54 (diff)
downloadgdb-ee325b61cd4389506d2dd63294c1ce1c64cb9d9f.zip
gdb-ee325b61cd4389506d2dd63294c1ce1c64cb9d9f.tar.gz
gdb-ee325b61cd4389506d2dd63294c1ce1c64cb9d9f.tar.bz2
Add the "tui new-layout" command
This adds a new command, "tui new-layout". This command can be used to define a new TUI window layout. The command is used like: (gdb) tui new-layout name src 1 regs 1 status 0 cmd 1 The first argument is the name of the layout. In this example, it is "name", so the new layout could be seen by "layout name". Subsequent arguments come in pairs, where the first item in a pair is the name of a window, and the second item in a pair is the window's weight. A weight is just an integer -- a window's allocated size is proportional to the total of the weights given. So, in the above example, all windows will have the same size (the status windows's weight does not matter, because it has fixed height). gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * NEWS: Add "tui new-layout" item. * tui/tui-layout.c (add_layout_command): Return cmd_list_element. Add new-layout command to help text. (validate_window_name): New function. (tui_new_layout_command): New function. (_initialize_tui_layout): Register "new-layout". (tui_layout_window::specification): New method. (tui_layout_window::specification): New method. * tui/tui-layout.h (class tui_layout_base) <specification>: New method. (class tui_layout_window) <specification>: New method. (class tui_layout_split) <specification>: New method. gdb/doc/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * gdb.texinfo (TUI Overview): Mention user layouts. (TUI Commands): Document "tui new-layout". gdb/testsuite/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * gdb.tui/new-layout.exp: New file. Change-Id: Id7c3ace20ab1e8924f8f4ad788f40210f58a5c05
Diffstat (limited to 'gdb/tui/tui-layout.h')
-rw-r--r--gdb/tui/tui-layout.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h
index 98bd548..c2249a7 100644
--- a/gdb/tui/tui-layout.h
+++ b/gdb/tui/tui-layout.h
@@ -22,6 +22,8 @@
#ifndef TUI_TUI_LAYOUT_H
#define TUI_TUI_LAYOUT_H
+#include "ui-file.h"
+
#include "tui/tui.h"
#include "tui/tui-data.h"
@@ -72,6 +74,9 @@ public:
NEW_WINDOW. */
virtual void replace_window (const char *name, const char *new_window) = 0;
+ /* Append the specification to this window to OUTPUT. */
+ virtual void specification (ui_file *output) = 0;
+
/* The most recent space allocation. */
int x = 0;
int y = 0;
@@ -120,6 +125,8 @@ public:
void replace_window (const char *name, const char *new_window) override;
+ void specification (ui_file *output) override;
+
protected:
void get_sizes (int *min_height, int *max_height) override;
@@ -167,6 +174,8 @@ public:
void replace_window (const char *name, const char *new_window) override;
+ void specification (ui_file *output) override;
+
protected:
void get_sizes (int *min_height, int *max_height) override;