aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-style.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-11-09 14:13:13 -0700
committerTom Tromey <tom@tromey.com>2019-12-01 11:59:23 -0700
commita2a7af0c33869f08a999d5d1b301017138cbeb7a (patch)
treeabf38fc4ea8f60ce1ac2d72fc368cb2801322721 /gdb/cli/cli-style.h
parentd1da6b01608841c846aa75209248e276f49e1587 (diff)
downloadgdb-a2a7af0c33869f08a999d5d1b301017138cbeb7a.zip
gdb-a2a7af0c33869f08a999d5d1b301017138cbeb7a.tar.gz
gdb-a2a7af0c33869f08a999d5d1b301017138cbeb7a.tar.bz2
Add TUI border colors
This adds the ability to change the color of the TUI borders, both ordinary and active. Unlike other styling options, this doesn't allow setting the intensity, because that is already done by the TUI in a different way. gdb/ChangeLog 2019-12-01 Tom Tromey <tom@tromey.com> * NEWS: Document new settings. * tui/tui-wingeneral.c (box_win): Apply appropriate border style. * tui/tui-win.c (_initialize_tui_win): Add border style observers. * tui/tui-io.h (tui_apply_style): Declare. * tui/tui-io.c (tui_apply_style): Rename from apply_style. No longer static. (apply_ansi_escape, tui_set_reverse_mode): Update. * cli/cli-style.h (class cli_style_option) <add_setshow_commands>: Add "skip_intensity" parameter. <changed>: New member. <do_set_value>: Declare. (tui_border_style, tui_active_border_style): Declare. * cli/cli-style.c (tui_border_style, tui_active_border_style): New globals. (cli_style_option): Initialize "changed". (cli_style_option::do_set_value): New function. (cli_style_option::add_setshow_commands): Add "skip_intensity" parameter. Update. (STYLE_ADD_SETSHOW_COMMANDS): Add "SKIP" parameter. (_initialize_cli_style): Update. Create TUI border style commands. gdb/doc/ChangeLog 2019-12-01 Tom Tromey <tom@tromey.com> * gdb.texinfo (TUI Configuration): Mention TUI border styles. (Output Styling): Document new settings. Change-Id: Id13e2af0af2a0bde61282752f2c379db3220c9fc
Diffstat (limited to 'gdb/cli/cli-style.h')
-rw-r--r--gdb/cli/cli-style.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/gdb/cli/cli-style.h b/gdb/cli/cli-style.h
index 44eb6cb..12140bc 100644
--- a/gdb/cli/cli-style.h
+++ b/gdb/cli/cli-style.h
@@ -22,6 +22,7 @@
#include "ui-file.h"
#include "command.h"
+#include "gdbsupport/observable.h"
/* A single CLI style option. */
class cli_style_option
@@ -47,7 +48,8 @@ public:
struct cmd_list_element **set_list,
void (*do_set) (const char *args, int from_tty),
struct cmd_list_element **show_list,
- void (*do_show) (const char *args, int from_tty));
+ void (*do_show) (const char *args, int from_tty),
+ bool skip_intensity);
/* Return the 'set style NAME' command list, that can be used
to build a lambda DO_SET to call add_setshow_commands. */
@@ -56,6 +58,9 @@ public:
/* Same as SET_LIST but for the show command list. */
struct cmd_list_element *show_list () { return m_show_list; };
+ /* This style can be observed for any changes. */
+ gdb::observers::observable<> changed;
+
private:
/* The style name. */
@@ -76,6 +81,10 @@ private:
struct cmd_list_element *m_set_list = nullptr;
struct cmd_list_element *m_show_list = nullptr;
+ /* Callback to notify the observable. */
+ static void do_set_value (const char *ignore, int from_tty,
+ struct cmd_list_element *cmd);
+
/* Callback to show the foreground. */
static void do_show_foreground (struct ui_file *file, int from_tty,
struct cmd_list_element *cmd,
@@ -111,6 +120,12 @@ extern cli_style_option title_style;
/* The metadata style. */
extern cli_style_option metadata_style;
+/* The border style of a TUI window that does not have the focus. */
+extern cli_style_option tui_border_style;
+
+/* The border style of a TUI window that does have the focus. */
+extern cli_style_option tui_active_border_style;
+
/* True if source styling is enabled. */
extern bool source_styling;