/* * Nuke the "curses" system */ static void Term_nuke_gcu(term *t) { int x, y; term_data *td = (term_data *)(t->data); /* Delete this window */ delwin(td->win); /* Count nuke's, handle last */ if (--active != 0) return; /* Hack -- make sure the cursor is visible */ Term_xtra(TERM_XTRA_SHAPE, 1); #ifdef A_COLOR /* Reset colors to defaults */ start_color(); #endif /* This moves curses to bottom right corner */ getyx(stdscr, y, x); mvcur(y, x, LINES - 1, 0); /* Flush the curses buffer */ (void)refresh(); /* Exit curses */ endwin(); /* Flush the output */ (void)fflush(stdout); /* Normal keymap */ keymap_norm(); }
/* * Suspend/Resume */ static errr Term_xtra_gcu_alive(int v) { int x, y; /* Suspend */ if (!v) { /* Go to normal keymap mode */ keymap_norm(); /* Restore modes */ nocbreak(); echo(); nl(); /* Hack -- make sure the cursor is visible */ Term_xtra(TERM_XTRA_SHAPE, 1); /* Flush the curses buffer */ (void)refresh(); /* Get current cursor position */ getyx(curscr, y, x); /* Move the cursor to bottom right corner */ mvcur(y, x, LINES - 1, 0); /* Exit curses */ endwin(); /* Flush the output */ (void)fflush(stdout); } /* Resume */ else { /* Refresh */ /* (void)touchwin(curscr); */ /* (void)wrefresh(curscr); */ /* Restore the settings */ cbreak(); noecho(); nonl(); /* Go to angband keymap mode */ keymap_game(); } /* Success */ return (0); }
/* * Suspend/Resume */ static errr Term_xtra_gcu_alive(int v) { /* Suspend */ if (!v) { /* Go to normal keymap mode */ keymap_norm(); /* Restore modes */ nocbreak(); echo(); nl(); /* Hack -- make sure the cursor is visible */ Term_xtra(TERM_XTRA_SHAPE, 1); /* Flush the curses buffer */ (void)refresh(); #ifdef SPECIAL_BSD /* this moves curses to bottom right corner */ mvcur(curscr->cury, curscr->curx, LINES - 1, 0); #else /* this moves curses to bottom right corner */ mvcur(getcury(curscr), getcurx(curscr), LINES - 1, 0); #endif /* Exit curses */ endwin(); /* Flush the output */ (void)fflush(stdout); } /* Resume */ else { /* Refresh */ /* (void)touchwin(curscr); */ /* (void)wrefresh(curscr); */ /* Restore the settings */ cbreak(); noecho(); nonl(); /* Go to angband keymap mode */ keymap_game(); } /* Success */ return (0); }
/* * Nuke a "term" for this file */ static void Term_nuke_cap(term *t) { if (!active) return; /* Hack -- make sure the cursor is visible */ curs_set(1); /* Move to bottom right */ do_move(0, rows - 1, 0, rows - 1); /* Normal keymap */ keymap_norm(); /* No longer active */ active = FALSE; }
/* * Suspend/Resume */ static errr Term_xtra_cap_alive(int v) { /* Suspend */ if (!v) { if (!active) return (1); /* Hack -- make sure the cursor is visible */ curs_set(1); /* Move to bottom right */ do_move(0, rows - 1, 0, rows - 1); /* Go to normal keymap mode */ keymap_norm(); /* No longer active */ active = FALSE; } /* Resume */ else { if (active) return (1); /* Hack -- restore the cursor location */ do_move(curx, cury, curx, cury); /* Hack -- restore the cursor visibility */ curs_set(curv); /* Go to angband keymap mode */ keymap_game(); /* Now we are active */ active = TRUE; } /* Success */ return (0); }