/* if_draw: Draws the interface on the screen. * -------- */ void if_draw(void) { /* Only redisplay the filedlg if it is up */ if (focus == FILE_DLG) { filedlg_display(fd); return; } update_status_win(); if (get_src_height() != 0 && get_gdb_height() != 0) wrefresh(status_win); if (tty_win_on) wrefresh(tty_status_win); if (get_src_height() > 0) source_display(src_win, focus == CGDB); if (tty_win_on && get_tty_height() > 0) scr_refresh(tty_win, focus == TTY); if (get_gdb_height() > 0) scr_refresh(gdb_win, focus == GDB); /* This check is here so that the cursor goes to the * cgdb window. The cursor would stay in the gdb window * on cygwin */ if (get_src_height() > 0 && focus == CGDB) wrefresh(src_win->win); }
/* if_draw: Draws the interface on the screen. * -------- */ void if_draw(void) { if (!curses_initialized) return; /* Only redisplay the filedlg if it is up */ if (focus == FILE_DLG) { filedlg_display(fd); return; } update_status_win(WIN_NO_REFRESH); if (get_src_height() != 0 && get_gdb_height() != 0) swin_wnoutrefresh(status_win); if (get_src_height() > 0) source_display(src_viewer, focus == CGDB, WIN_NO_REFRESH); separator_display(cur_split_orientation == WSO_VERTICAL); if (get_gdb_height() > 0) scr_refresh(gdb_scroller, focus == GDB, WIN_NO_REFRESH); /* This check is here so that the cursor goes to the * cgdb window. The cursor would stay in the gdb window * on cygwin */ if (get_src_height() > 0 && focus == CGDB) swin_wnoutrefresh(src_viewer->win); swin_doupdate(); }
void source_list(IMAGEHLP_LINE* src1, IMAGEHLP_LINE* src2, int delta) { int end; int start; const char* sourcefile; /* * We need to see what source file we need. Hopefully we only have * one specified, otherwise we might as well punt. */ if (src1 && src2 && src1->FileName && src2->FileName && strcmp(src1->FileName, src2->FileName) != 0) { dbg_printf("Ambiguous source file specification.\n"); return; } sourcefile = NULL; if (src1 && src1->FileName) sourcefile = src1->FileName; if (!sourcefile && src2 && src2->FileName) sourcefile = src2->FileName; if (!sourcefile) sourcefile = source_current_file; /* * Now figure out the line number range to be listed. */ start = end = -1; if (src1) start = src1->LineNumber; if (src2) end = src2->LineNumber; if (start == -1 && end == -1) { if (delta < 0) { end = source_start_line; start = end + delta; } else { start = source_end_line; end = start + delta; } } else if (start == -1) start = end + delta; else if (end == -1) end = start + delta; /* * Now call this function to do the dirty work. */ source_display(sourcefile, start, end); if (sourcefile != source_current_file) strcpy(source_current_file, sourcefile); source_start_line = start; source_end_line = end; }