+2019-07-17 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-winsource.h (tui_erase_source_content)
+ (tui_clear_source_content): Remove "display_prompt" parameter.
+ * tui/tui-winsource.c (tui_update_source_window_as_is)
+ (tui_update_source_windows_with_addr): Update.
+ (tui_clear_source_content): Remove "display_prompt" parameter.
+ (tui_erase_source_content): Likewise. Simplify.
+ (tui_show_source_content): Update.
+ * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update.
+ * tui/tui-stack.c (tui_show_frame_info): Update.
+ * tui/tui-data.h (EMPTY_SOURCE_PROMPT, NO_EMPTY_SOURCE_PROMPT):
+ Remove defines.
+
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
#define NO_HILITE FALSE
#define WITH_LOCATOR TRUE
#define NO_LOCATOR FALSE
-#define EMPTY_SOURCE_PROMPT TRUE
-#define NO_EMPTY_SOURCE_PROMPT FALSE
#define UNDEFINED_ITEM -1
#define MIN_WIN_HEIGHT 3
#define MIN_CMD_WIN_HEIGHT 3
tui_show_locator_content ();
for (struct tui_source_window_base *win_info : tui_source_windows ())
{
- tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
+ tui_clear_source_content (win_info);
tui_update_exec_info (win_info);
}
first_win->make_visible_with_new_height ();
TUI_CMD_WIN->make_visible_with_new_height ();
if (src_win->content.empty ())
- tui_erase_source_content (src_win, EMPTY_SOURCE_PROMPT);
+ tui_erase_source_content (src_win);
break;
default:
if (cur_layout == SRC_DISASSEM_COMMAND)
second_win->make_visible_with_new_height ();
TUI_CMD_WIN->make_visible_with_new_height ();
if (src_win->content.empty ())
- tui_erase_source_content (src_win, EMPTY_SOURCE_PROMPT);
+ tui_erase_source_content (src_win);
break;
}
/* Now remove all invisible windows, and their content so that
tui_source_window_base *src_base
= (tui_source_window_base *) src_win_info;
if (src_base->content.empty ())
- tui_erase_source_content (src_base,
- EMPTY_SOURCE_PROMPT);
+ tui_erase_source_content (src_base);
}
}
else
second_win->make_visible_with_new_height ();
first_win->make_visible_with_new_height ();
if (src1 != nullptr && src1->content.empty ())
- tui_erase_source_content (src1, EMPTY_SOURCE_PROMPT);
+ tui_erase_source_content (src1);
if (second_win->content.empty ())
- tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
+ tui_erase_source_content (second_win);
}
}
}
if (ret == TUI_FAILURE)
{
- tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
+ tui_clear_source_content (win_info);
tui_clear_exec_info_content (win_info);
}
else
{
for (struct tui_source_window_base *win_info : tui_source_windows ())
{
- tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
+ tui_clear_source_content (win_info);
tui_clear_exec_info_content (win_info);
}
}
}
void
-tui_clear_source_content (struct tui_source_window_base *win_info,
- int display_prompt)
+tui_clear_source_content (struct tui_source_window_base *win_info)
{
if (win_info != NULL)
{
int i;
win_info->content_in_use = false;
- tui_erase_source_content (win_info, display_prompt);
+ tui_erase_source_content (win_info);
for (i = 0; i < win_info->content.size (); i++)
{
struct tui_source_element *element = &win_info->content[i];
void
-tui_erase_source_content (struct tui_source_window_base *win_info,
- int display_prompt)
+tui_erase_source_content (struct tui_source_window_base *win_info)
{
int x_pos;
int half_width = (win_info->width - 2) / 2;
{
werase (win_info->handle);
tui_check_and_display_highlight_if_needed (win_info);
- if (display_prompt == EMPTY_SOURCE_PROMPT)
- {
- const char *no_src_str;
-
- if (win_info->type == SRC_WIN)
- no_src_str = NO_SRC_STRING;
- else
- no_src_str = NO_DISASSEM_STRING;
- if (strlen (no_src_str) >= half_width)
- x_pos = 1;
- else
- x_pos = half_width - strlen (no_src_str);
- mvwaddstr (win_info->handle,
- (win_info->height / 2),
- x_pos,
- (char *) no_src_str);
-
- /* elz: Added this function call to set the real contents of
- the window to what is on the screen, so that later calls
- to refresh, do display the correct stuff, and not the old
- image. */
-
- tui_set_source_content_nil (win_info, no_src_str);
- }
+
+ const char *no_src_str;
+
+ if (win_info->type == SRC_WIN)
+ no_src_str = NO_SRC_STRING;
+ else
+ no_src_str = NO_DISASSEM_STRING;
+ if (strlen (no_src_str) >= half_width)
+ x_pos = 1;
+ else
+ x_pos = half_width - strlen (no_src_str);
+ mvwaddstr (win_info->handle,
+ (win_info->height / 2),
+ x_pos,
+ (char *) no_src_str);
+
+ /* elz: Added this function call to set the real contents of
+ the window to what is on the screen, so that later calls
+ to refresh, do display the correct stuff, and not the old
+ image. */
+
+ tui_set_source_content_nil (win_info, no_src_str);
+
win_info->refresh_window ();
}
}
tui_show_source_line (win_info, lineno);
}
else
- tui_erase_source_content (win_info, TRUE);
+ tui_erase_source_content (win_info);
tui_check_and_display_highlight_if_needed (win_info);
win_info->refresh_window ();
extern void tui_update_source_windows_with_addr (struct gdbarch *, CORE_ADDR);
extern void tui_update_source_windows_with_line (struct symtab *,
int);
-extern void tui_clear_source_content (struct tui_source_window_base *, int);
-extern void tui_erase_source_content (struct tui_source_window_base *, int);
+extern void tui_clear_source_content (struct tui_source_window_base *);
+extern void tui_erase_source_content (struct tui_source_window_base *);
extern void tui_show_source_content (struct tui_source_window_base *);
extern void tui_set_exec_info_content (struct tui_source_window_base *);
extern void tui_show_exec_info_content (struct tui_source_window_base *);