This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/gdb-7.9-branch] Make setting TUI border attributes take effect immediately


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=84fc067cb2054ed935f5d6fc94a3edf5518447bf

commit 84fc067cb2054ed935f5d6fc94a3edf5518447bf
Author: Eli Zaretskii <eliz@gnu.org>
Date:   Fri Jan 16 18:24:16 2015 +0200

    Make setting TUI border attributes take effect immediately
    
    gdb/
    2015-01-16  Eli Zaretskii  <eliz@gnu.org>
    
         * tui/tui-win.c (tui_rehighlight_all, tui_set_var_cmd): New
         functions.
         (_initialize_tui_win) <border-kind, border-mode>:
         <active-border-mode>: Use tui_set_var_cmd as the "set" function.
         * tui/tui-win.h: Add prototype for tui_rehighlight_all.
    
    (cherry picked from commit 6cdb25f4df143e8d98bd71bf943bbe61c702e239)

Diff:
---
 gdb/ChangeLog     |  8 ++++++++
 gdb/tui/tui-win.c | 23 ++++++++++++++++++++---
 gdb/tui/tui-win.h |  3 +++
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 82f844a..721076c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
 2015-01-16  Eli Zaretskii  <eliz@gnu.org>
 
+	* tui/tui-win.c (tui_rehighlight_all, tui_set_var_cmd): New
+	functions.
+	(_initialize_tui_win) <border-kind, border-mode>:
+	<active-border-mode>: Use tui_set_var_cmd as the "set" function.
+	* tui/tui-win.h: Add prototype for tui_rehighlight_all.
+
+2015-01-16  Eli Zaretskii  <eliz@gnu.org>
+
 	* tui/tui-win.c (tui_scroll_left_command, tui_scroll_right_command):
 	Doc fix.
 	(tui_set_tab_width_command): Delete and recreate the source and
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 96fa801..7e9bd1e 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -344,6 +344,15 @@ tui_get_cmd_list (void)
   return &tuilist;
 }
 
+/* The set_func hook of "set tui ..." commands that affect the window
+   borders on the TUI display.  */
+void
+tui_set_var_cmd (char *null_args, int from_tty, struct cmd_list_element *c)
+{
+  if (tui_update_variables () && tui_active)
+    tui_rehighlight_all ();
+}
+
 /* Function to initialize gdb commands, for tui window
    manipulation.  */
 
@@ -420,7 +429,7 @@ This variable controls the border of TUI windows:\n\
 space           use a white space\n\
 ascii           use ascii characters + - | for the border\n\
 acs             use the Alternate Character Set"),
-			NULL,
+			tui_set_var_cmd,
 			show_tui_border_kind,
 			&tui_setlist, &tui_showlist);
 
@@ -436,7 +445,7 @@ half            use half bright\n\
 half-standout   use half bright and standout mode\n\
 bold            use extra bright or bold\n\
 bold-standout   use extra bright or bold with standout mode"),
-			NULL,
+			tui_set_var_cmd,
 			show_tui_border_mode,
 			&tui_setlist, &tui_showlist);
 
@@ -452,7 +461,7 @@ half            use half bright\n\
 half-standout   use half bright and standout mode\n\
 bold            use extra bright or bold\n\
 bold-standout   use extra bright or bold with standout mode"),
-			NULL,
+			tui_set_var_cmd,
 			show_tui_active_border_mode,
 			&tui_setlist, &tui_showlist);
 }
@@ -646,6 +655,14 @@ tui_refresh_all_win (void)
   tui_show_locator_content ();
 }
 
+void
+tui_rehighlight_all (void)
+{
+  enum tui_win_type type;
+
+  for (type = SRC_WIN; type < MAX_MAJOR_WINDOWS; type++)
+    tui_check_and_display_highlight_if_needed (tui_win_list[type]);
+}
 
 /* Resize all the windows based on the terminal size.  This function
    gets called from within the readline sinwinch handler.  */
diff --git a/gdb/tui/tui-win.h b/gdb/tui/tui-win.h
index 6601d4b..7d77a00 100644
--- a/gdb/tui/tui-win.h
+++ b/gdb/tui/tui-win.h
@@ -55,4 +55,7 @@ extern void tui_update_gdb_sizes (void);
 /* Create or get the TUI command list.  */
 struct cmd_list_element **tui_get_cmd_list (void);
 
+/* Set a TUI variable.  */
+void tui_set_var_cmd (char *, int, struct cmd_list_element *);
+
 #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]