-
-
-void
-tui_show_exec_info_content (struct tui_source_window_base *win_info)
-{
- struct tui_exec_info_window *exec_info = win_info->execution_info;
- const tui_exec_info_content *content = exec_info->get_content ();
-
- werase (exec_info->handle);
- exec_info->refresh_window ();
- for (int cur_line = 1; cur_line <= win_info->content.size (); cur_line++)
- mvwaddstr (exec_info->handle,
- cur_line,
- 0,
- content[cur_line - 1]);
- exec_info->refresh_window ();
- exec_info->content_in_use = TRUE;
-}
-
-
-void
-tui_erase_exec_info_content (struct tui_source_window_base *win_info)
-{
- struct tui_gen_win_info *exec_info = win_info->execution_info;
-
- werase (exec_info->handle);
- exec_info->refresh_window ();
-}
-
-void
-tui_clear_exec_info_content (struct tui_source_window_base *win_info)
-{
- win_info->execution_info->content_in_use = FALSE;
- tui_erase_exec_info_content (win_info);
-}
-
-/* Function to update the execution info window. */
-void
-tui_update_exec_info (struct tui_source_window_base *win_info)
-{
- tui_set_exec_info_content (win_info);
- tui_show_exec_info_content (win_info);
-}
-
-void
-tui_alloc_source_buffer (struct tui_source_window_base *win_info)
-{
- int i, line_width, max_lines;
-
- /* The window width/height includes the highlight box. Determine actual
- content dimensions, including string null-terminators. */
- max_lines = win_info->height - 2;
- line_width = win_info->width - 2 + 1;
-
- /* Allocate the buffer for the source lines. */
- win_info->content.resize (max_lines);
- for (i = 0; i < max_lines; i++)
- {
- if (win_info->content[i].line == nullptr)
- win_info->content[i].line = (char *) xmalloc (line_width);
- }
-}
-
-
-/* Answer whether a particular line number or address is displayed
- in the current source window. */
-int
-tui_line_is_displayed (int line,
- struct tui_source_window_base *win_info,
- int check_threshold)
-{
- int is_displayed = FALSE;
- int i, threshold;
-
- if (check_threshold)
- threshold = SCROLL_THRESHOLD;
- else
- threshold = 0;
- i = 0;
- while (i < win_info->content.size () - threshold
- && !is_displayed)
- {
- is_displayed
- = win_info->content[i].line_or_addr.loa == LOA_LINE
- && win_info->content[i].line_or_addr.u.line_no == line;
- i++;
- }
-
- return is_displayed;
-}
-
-
-/* Answer whether a particular line number or address is displayed
- in the current source window. */
-int
-tui_addr_is_displayed (CORE_ADDR addr,
- struct tui_source_window_base *win_info,
- int check_threshold)
-{
- int is_displayed = FALSE;
- int i, threshold;
-
- if (check_threshold)
- threshold = SCROLL_THRESHOLD;
- else
- threshold = 0;
- i = 0;
- while (i < win_info->content.size () - threshold
- && !is_displayed)
- {
- is_displayed
- = win_info->content[i].line_or_addr.loa == LOA_ADDRESS
- && win_info->content[i].line_or_addr.u.addr == addr;
- i++;
- }
-
- return is_displayed;
-}
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS **
-******************************************/