示例#1
0
/*
 * Restore Cursor and Attributes
 */
void
CursorRestore(XtermWidget xw)
{
    TScreen *screen = TScreenOf(xw);
    SavedCursor *sc = &screen->sc[screen->whichBuf];

    /* Restore the character sets, unless we never did a save-cursor op.
     * In that case, we'll reset the character sets.
     */
    if (sc->saved) {
	memmove(screen->gsets, sc->gsets, sizeof(screen->gsets));
	screen->curgl = sc->curgl;
	screen->curgr = sc->curgr;
    } else {
	resetCharsets(screen);
    }

    UIntClr(xw->flags, DECSC_FLAGS);
    UIntSet(xw->flags, sc->flags & DECSC_FLAGS);
    CursorSet(screen,
	      ((xw->flags & ORIGIN)
	       ? sc->row - screen->top_marg
	       : sc->row),
	      sc->col, xw->flags);

#if OPT_ISO_COLORS
    xw->sgr_foreground = sc->sgr_foreground;
    SGR_Foreground(xw, xw->flags & FG_COLOR ? sc->cur_foreground : -1);
    SGR_Background(xw, xw->flags & BG_COLOR ? sc->cur_background : -1);
#endif
    update_autowrap();
}
示例#2
0
文件: cursor.c 项目: idunham/dtextra
/*
 * Restore Cursor and Attributes
 */
void
CursorRestore(register XtermWidget tw)
{
	register TScreen *screen = &tw->screen;
	register SavedCursor *sc = &screen->sc[screen->alternate != False];

	/* Restore the character sets, unless we never did a save-cursor op.
	 * In that case, we'll reset the character sets.
	 */
	if (sc->saved) {
		memmove( screen->gsets, sc->gsets, sizeof(screen->gsets));
		screen->curgl = sc->curgl;
		screen->curgr = sc->curgr;
	} else {
		resetCharsets(screen);
	}

	tw->flags &= ~DECSC_FLAGS;
	tw->flags |= sc->flags & DECSC_FLAGS;
	CursorSet (screen,
		(tw->flags & ORIGIN)
			? sc->row - screen->top_marg
			: sc->row,
		sc->col, tw->flags);

#if OPT_ISO_COLORS
	tw->sgr_foreground = sc->sgr_foreground;
	SGR_Foreground(tw->flags & FG_COLOR ? sc->cur_foreground : -1);
	SGR_Background(tw->flags & BG_COLOR ? sc->cur_background : -1);
#endif
}