Make TUI window handle a unique_ptr
authorTom Tromey <tom@tromey.com>
Tue, 1 Oct 2019 23:29:49 +0000 (17:29 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 9 Oct 2019 22:50:35 +0000 (16:50 -0600)
commit7523da63ca33a37b54c2cde18b7752d0f0f11c26
tree9c89a33c5d2848fa4613e5b558136a6cd000fb24
parenta7798e7f7dd1c4226376d455af957e369aa2a192
Make TUI window handle a unique_ptr

This changes tui_gen_win_info::handle to be a specialization of
unique_ptr.  This is perhaps mildly uglier in some spots, due to the
proliferation of "get"; but on the other hand it cleans up some manual
management and it allows for the removal of tui_delete_win.

gdb/ChangeLog
2019-10-09  Tom Tromey  <tom@tromey.com>

* tui/tui-wingeneral.h (tui_delete_win): Don't declare.
* tui/tui-stack.c (tui_locator_window::rerender): Update.
* tui/tui-command.c (tui_cmd_window::resize)
(tui_refresh_cmd_win): Update.
* tui/tui-win.c (tui_resize_all, tui_set_focus_command): Update.
* tui/tui.c (tui_rl_other_window, tui_enable): Update.
* tui/tui-data.c (~tui_gen_win_info): Remove.
* tui/tui-layout.c (tui_gen_win_info::resize): Update.
* tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts)
(tui_redisplay_readline, tui_mld_flush)
(tui_mld_erase_entire_line, tui_mld_getc, tui_getc): Update.
* tui/tui-regs.c (tui_data_window::delete_data_content_windows)
(tui_data_window::erase_data_content)
(tui_data_item_window::rerender)
(tui_data_item_window::refresh_window): Update.
* tui/tui-wingeneral.c (tui_gen_win_info::refresh_window)
(box_win, tui_gen_win_info::make_window)
(tui_gen_win_info::make_visible): Update.
(tui_delete_win): Remove.
* tui/tui-winsource.c
(tui_source_window_base::do_erase_source_content): Update.
(tui_show_source_line, tui_source_window_base::update_tab_width)
(tui_source_window_base::update_exec_info): Update.
* tui/tui-data.h (struct curses_deleter): New.
(struct tui_gen_win_info) <handle>: Now a unique_ptr.
(struct tui_gen_win_info) <~tui_gen_win_info>: Define.
13 files changed:
gdb/ChangeLog
gdb/tui/tui-command.c
gdb/tui/tui-data.c
gdb/tui/tui-data.h
gdb/tui/tui-io.c
gdb/tui/tui-layout.c
gdb/tui/tui-regs.c
gdb/tui/tui-stack.c
gdb/tui/tui-win.c
gdb/tui/tui-wingeneral.c
gdb/tui/tui-wingeneral.h
gdb/tui/tui-winsource.c
gdb/tui/tui.c
This page took 0.04105 seconds and 4 git commands to generate.