+set_tui_cmd (const char *args, int from_tty)
+{
+}
+
+static void
+show_tui_cmd (const char *args, int from_tty)
+{
+}
+
+static struct cmd_list_element *tuilist;
+
+static void
+tui_command (const char *args, int from_tty)
+{
+ printf_unfiltered (_("\"tui\" must be followed by the name of a "
+ "tui command.\n"));
+ help_list (tuilist, "tui ", all_commands, gdb_stdout);
+}
+
+struct cmd_list_element **
+tui_get_cmd_list (void)
+{
+ if (tuilist == 0)
+ add_prefix_cmd ("tui", class_tui, tui_command,
+ _("Text User Interface commands."),
+ &tuilist, "tui ", 0, &cmdlist);
+ return &tuilist;
+}
+
+/* The set_func hook of "set tui ..." commands that affect the window
+ borders on the TUI display. */
+void
+tui_set_var_cmd (const char *null_args,
+ int from_tty, struct cmd_list_element *c)
+{
+ if (tui_update_variables () && tui_active)
+ tui_rehighlight_all ();
+}
+
+/* Generic window name completion function. Complete window name pointed
+ to by TEXT and WORD. If INCLUDE_NEXT_PREV_P is true then the special
+ window names 'next' and 'prev' will also be considered as possible
+ completions of the window name. */
+
+static void
+window_name_completer (completion_tracker &tracker,
+ int include_next_prev_p,
+ const char *text, const char *word)
+{
+ VEC (const_char_ptr) *completion_name_vec = NULL;
+ int win_type;
+
+ for (win_type = SRC_WIN; win_type < MAX_MAJOR_WINDOWS; win_type++)
+ {
+ const char *completion_name = NULL;
+
+ /* We can't focus on an invisible window. */
+ if (tui_win_list[win_type] == NULL
+ || !tui_win_list[win_type]->generic.is_visible)
+ continue;
+
+ completion_name = tui_win_name (&tui_win_list [win_type]->generic);
+ gdb_assert (completion_name != NULL);
+ VEC_safe_push (const_char_ptr, completion_name_vec, completion_name);
+ }
+
+ /* If no windows are considered visible then the TUI has not yet been
+ initialized. But still "focus src" and "focus cmd" will work because
+ invoking the focus command will entail initializing the TUI which sets the
+ default layout to SRC_COMMAND. */
+ if (VEC_length (const_char_ptr, completion_name_vec) == 0)
+ {
+ VEC_safe_push (const_char_ptr, completion_name_vec, SRC_NAME);
+ VEC_safe_push (const_char_ptr, completion_name_vec, CMD_NAME);
+ }
+
+ if (include_next_prev_p)
+ {
+ VEC_safe_push (const_char_ptr, completion_name_vec, "next");
+ VEC_safe_push (const_char_ptr, completion_name_vec, "prev");
+ }
+
+ VEC_safe_push (const_char_ptr, completion_name_vec, NULL);
+ complete_on_enum (tracker,
+ VEC_address (const_char_ptr, completion_name_vec),
+ text, word);
+
+ VEC_free (const_char_ptr, completion_name_vec);
+}
+
+/* Complete possible window names to focus on. TEXT is the complete text
+ entered so far, WORD is the word currently being completed. */
+
+static void
+focus_completer (struct cmd_list_element *ignore,
+ completion_tracker &tracker,
+ const char *text, const char *word)