aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-io.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-16 16:03:54 -0600
committerTom Tromey <tom@tromey.com>2019-06-25 07:48:37 -0600
commitcb2ce89305264543a4014d98bacb26800d92d394 (patch)
treee86e884ade455bdd50ce3039924029caf588ad40 /gdb/tui/tui-io.c
parentab313b35e505ccab9c23acbe82087b6c22a2088d (diff)
downloadgdb-cb2ce89305264543a4014d98bacb26800d92d394.zip
gdb-cb2ce89305264543a4014d98bacb26800d92d394.tar.gz
gdb-cb2ce89305264543a4014d98bacb26800d92d394.tar.bz2
Derive tui_win_info from tui_gen_win_info
This changes tui_win_info to derive from tui_gen_win_info, rather than having a tui_gen_win_info as a member. This removes a layer of member access from the entire TUI, which is why this patch is so large. This change will enable further removal of switches based on window type. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_rl_other_window, tui_enable) (tui_is_window_visible, tui_get_command_dimension): Update. * tui/tui-winsource.c (tui_update_source_window_as_is) (tui_clear_source_content, tui_erase_source_content) (tui_show_source_line, tui_source_window_base::refill) (tui_source_window_base::do_scroll_horizontal) (tui_source_window_base::set_is_exec_point_at) (tui_update_breakpoint_info, tui_set_exec_info_content) (tui_alloc_source_buffer, tui_line_is_displayed) (tui_addr_is_displayed): Update. * tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win) (tui_check_and_display_highlight_if_needed) (tui_win_info::make_visible, tui_win_info::refresh) (tui_refresh_all): Update. * tui/tui-windata.c (tui_first_data_item_displayed) (tui_delete_data_content_windows, tui_erase_data_content) (tui_display_all_data, tui_data_window::refresh_all) (tui_check_data_values): Update. * tui/tui-win.c (window_name_completer, tui_update_gdb_sizes) (tui_set_win_focus_to, tui_win_info::forward_scroll) (tui_win_info::backward_scroll, tui_refresh_all_win) (tui_resize_all, tui_set_focus, tui_all_windows_info) (update_tab_width, tui_set_win_height, tui_adjust_win_heights) (tui_source_window_base::set_new_height) (tui_data_window::set_new_height) (make_invisible_and_set_new_height) (make_visible_with_new_height, new_height_ok) (parse_scrolling_args): Update. * tui/tui-stack.c (tui_show_frame_info): Update. * tui/tui-source.c (tui_set_source_content) (tui_set_source_content_nil, tui_source_is_displayed) (tui_source_window::do_scroll_vertical): Update. * tui/tui-regs.c (tui_show_registers, tui_show_register_group) (tui_display_registers_from, tui_display_reg_element_at_line) (tui_check_register_values, tui_reg_command): Update. * tui/tui-layout.c (tui_default_win_height) (show_source_disasm_command, show_data, init_and_make_win) (show_source_or_disasm_and_command): 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_cont_sig) (tui_getc): Update. * tui/tui-disasm.c (tui_set_disassem_content) (tui_disasm_window::do_scroll_vertical): Update. * tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>: Now virtual. (struct tui_win_info): Derive from tui_gen_win_info. <~tui_win_info>: Mark as override. <generic>: Remove member. * tui/tui-data.c (tui_cmd_window::clear_detail, tui_next_win) (tui_prev_win, tui_partial_win_by_name, tui_win_info) (~tui_data_window, ~tui_win_info) (tui_free_all_source_wins_content): Update. * tui/tui-command.c (tui_refresh_cmd_win): Update.
Diffstat (limited to 'gdb/tui/tui-io.c')
-rw-r--r--gdb/tui/tui-io.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index cdb14bf..56d5974 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -180,7 +180,7 @@ static void
update_cmdwin_start_line ()
{
TUI_CMD_WIN->start_line
- = getcury (TUI_CMD_WIN->generic.handle);
+ = getcury (TUI_CMD_WIN->handle);
}
/* Print a character in the curses command window. The output is
@@ -190,7 +190,7 @@ update_cmdwin_start_line ()
static void
tui_putc (char c)
{
- WINDOW *w = TUI_CMD_WIN->generic.handle;
+ WINDOW *w = TUI_CMD_WIN->handle;
do_tui_putc (w, c);
update_cmdwin_start_line ();
@@ -502,7 +502,7 @@ void
tui_puts (const char *string, WINDOW *w)
{
if (w == nullptr)
- w = TUI_CMD_WIN->generic.handle;
+ w = TUI_CMD_WIN->handle;
tui_puts_internal (w, string, nullptr);
}
@@ -538,13 +538,13 @@ tui_redisplay_readline (void)
c_pos = -1;
c_line = -1;
- w = TUI_CMD_WIN->generic.handle;
+ w = TUI_CMD_WIN->handle;
start_line = TUI_CMD_WIN->start_line;
wmove (w, start_line, 0);
prev_col = 0;
height = 1;
if (prompt != nullptr)
- tui_puts_internal (TUI_CMD_WIN->generic.handle, prompt, &height);
+ tui_puts_internal (TUI_CMD_WIN->handle, prompt, &height);
prev_col = getcurx (w);
for (in = 0; in <= rl_end; in++)
@@ -663,7 +663,7 @@ tui_mld_puts (const struct match_list_displayer *displayer, const char *s)
static void
tui_mld_flush (const struct match_list_displayer *displayer)
{
- wrefresh (TUI_CMD_WIN->generic.handle);
+ wrefresh (TUI_CMD_WIN->handle);
}
/* TUI version of displayer.erase_entire_line. */
@@ -671,7 +671,7 @@ tui_mld_flush (const struct match_list_displayer *displayer)
static void
tui_mld_erase_entire_line (const struct match_list_displayer *displayer)
{
- WINDOW *w = TUI_CMD_WIN->generic.handle;
+ WINDOW *w = TUI_CMD_WIN->handle;
int cur_y = getcury (w);
wmove (w, cur_y, 0);
@@ -709,7 +709,7 @@ gdb_wgetch (WINDOW *win)
static int
tui_mld_getc (FILE *fp)
{
- WINDOW *w = TUI_CMD_WIN->generic.handle;
+ WINDOW *w = TUI_CMD_WIN->handle;
int c = gdb_wgetch (w);
return c;
@@ -845,7 +845,7 @@ tui_cont_sig (int sig)
/* Force a refresh of the screen. */
tui_refresh_all_win ();
- wrefresh (TUI_CMD_WIN->generic.handle);
+ wrefresh (TUI_CMD_WIN->handle);
}
signal (sig, tui_cont_sig);
}
@@ -914,7 +914,7 @@ tui_getc (FILE *fp)
int ch;
WINDOW *w;
- w = TUI_CMD_WIN->generic.handle;
+ w = TUI_CMD_WIN->handle;
#ifdef TUI_USE_PIPE_FOR_READLINE
/* Flush readline output. */
@@ -950,8 +950,8 @@ tui_getc (FILE *fp)
int px, py;
getyx (w, py, px);
px += rl_end - rl_point;
- py += px / TUI_CMD_WIN->generic.width;
- px %= TUI_CMD_WIN->generic.width;
+ py += px / TUI_CMD_WIN->width;
+ px %= TUI_CMD_WIN->width;
wmove (w, py, px);
tui_putc ('\n');
}