Make source windows be self-updating
authorTom Tromey <tom@tromey.com>
Fri, 28 Jun 2019 20:48:45 +0000 (14:48 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 17 Jul 2019 18:19:04 +0000 (12:19 -0600)
commitb73dd8779c0530e91c6e5067eab4cb7ca3f794d5
treee717d03900daf50b3c3644b10d40b2927bdce635
parentae2b53806d3ce384e349c722b21a7ad246102d5b
Make source windows be self-updating

This changes the TUI source window to register itself on the
source_styling_changed observable, and removes a bit of code from
tui-hooks.c.  This reduces the number of uses of the TUI_SRC_WIN
global.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

* tui/tui-source.c (tui_source_window): New constructor.  Add
observer.
(~tui_source_window): New destructor.
(tui_source_window::style_changed): New method.
* tui/tui-hooks.c (tui_redisplay_source): Remove.
(tui_attach_detach_observers): Update.
* tui/tui-data.h (struct tui_source_window): Make constructor not
inline.  Add destructor.
(struct tui_source_window) <style_changed>: New method.
<m_observable>: New member.
gdb/ChangeLog
gdb/tui/tui-data.h
gdb/tui/tui-hooks.c
gdb/tui/tui-source.c