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:30 -0700
commit416eb92d84ac0bc4b8aba137789f52d1f987cd54 (patch)
treed340076992433388780995dd406fbcc065346151 /gdb/tui/tui-layout.h
parent0dbc2fc759fc8b5eaa69d7b3b7d0c4cf4afb19be (diff)
downloadbinutils-416eb92d84ac0bc4b8aba137789f52d1f987cd54.zip
binutils-416eb92d84ac0bc4b8aba137789f52d1f987cd54.tar.gz
binutils-416eb92d84ac0bc4b8aba137789f52d1f987cd54.tar.bz2
Remove hard-coded TUI layouts
This changes the TUI so that the available layouts are no longer completely hard-coded. "enum tui_layout_type" is removed, and then all the fallout from this is fixed up. This patch also reimplements the "layout" command to be a prefix command. The concrete layouts are simply sub-commands now. This provides completion and correct abbreviation behavior for free. Finally, this also changes the name of the locator window to "status". This matches the documentation and will be exposed to the user in a subsequent patch. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_enable): Call tui_set_initial_layout. * tui/tui-win.c (window_name_completer): Update comment. * tui/tui-layout.h (class tui_layout_base) <replace_window>: Declare method. (class tui_layout_window) <replace_window>: Likewise. (class tui_layout_split) <replace_window>: Likewise. (tui_set_layout): Don't declare. (tui_set_initial_layout): Declare function. * tui/tui-layout.c (layouts, applied_skeleton, src_regs_layout) (asm_regs_layout): New globals. (tui_current_layout, show_layout): Remove. (tui_set_layout, tui_add_win_to_layout): Rewrite. (find_layout, tui_apply_layout): New function. (layout_completer): Remove. (tui_next_layout): Reimplement. (tui_next_layout_command): New function. (tui_set_initial_layout, tui_prev_layout_command): New functions. (tui_regs_layout): Reimplement. (tui_regs_layout_command): New function. (extract_display_start_addr): Rewrite. (next_layout, prev_layout): Remove. (tui_layout_window::replace_window): New method. (tui_layout_split::replace_window): New method. (destroy_layout): New function. (layout_list): New global. (add_layout_command): New function. (initialize_layouts): Update. (tui_layout_command): New function. (_initialize_tui_layout): Install "layout" commands. * tui/tui-data.h (enum tui_layout_type): Remove. (tui_current_layout): Don't declare. Change-Id: I9b5f7ab3ce838d6b340b8c373ef649a8e0a74b73
Diffstat (limited to 'gdb/tui/tui-layout.h')
-rw-r--r--gdb/tui/tui-layout.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h
index 05089ab..98bd548 100644
--- a/gdb/tui/tui-layout.h
+++ b/gdb/tui/tui-layout.h
@@ -68,6 +68,10 @@ public:
and the window being passed in here. */
virtual void remove_windows (const char *name) = 0;
+ /* Replace the window named NAME in the layout with the window named
+ NEW_WINDOW. */
+ virtual void replace_window (const char *name, const char *new_window) = 0;
+
/* The most recent space allocation. */
int x = 0;
int y = 0;
@@ -114,6 +118,8 @@ public:
{
}
+ void replace_window (const char *name, const char *new_window) override;
+
protected:
void get_sizes (int *min_height, int *max_height) override;
@@ -159,6 +165,8 @@ public:
void remove_windows (const char *name) override;
+ void replace_window (const char *name, const char *new_window) override;
+
protected:
void get_sizes (int *min_height, int *max_height) override;
@@ -189,7 +197,8 @@ private:
way. */
extern void tui_add_win_to_layout (enum tui_win_type);
-extern void tui_set_layout (enum tui_layout_type);
+/* Set the initial layout. */
+extern void tui_set_initial_layout ();
/* Switch to the next layout. */
extern void tui_next_layout ();