Introduce tui_gen_win_info::reset method
This introduces the tui_gen_win_info::reset method and changes various
places to use it. This led to the realization that the can_highlight
member only needs to be set during construction, so this patch makes
that change as well. Finally, init_and_make_win is drastically
simplified.
gdb/ChangeLog
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_command_window): Don't set
can_highlight.
(show_source_disasm_command): Call the reset method.
(show_data): Don't set can_highlight. Call the reset method.
(tui_gen_win_info::reset): Rename from init_gen_win_info
(init_and_make_win): Simplify. Return tui_gen_win_info.
(show_source_or_disasm_and_command): Call the reset method.
* tui/tui-data.h (struct tui_gen_win_info) <reset>: New method.
(struct tui_cmd_window): Set can_highlight.