The R Project SVN R

Rev

Rev 31630 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31630 Rev 31853
Line 1050... Line 1050...
1050
{
1050
{
1051
    int   where;
1051
    int   where;
1052
    SEXP  class;
1052
    SEXP  class;
1053
 
1053
 
1054
    GETDL;
1054
    GETDL;
-
 
1055
    PROTECT(snapshot);
1055
/*    if (dl == R_NilValue) {
1056
/*    if (dl == R_NilValue) {
1056
	R_ShowMessage("Display list is void!");
1057
	R_ShowMessage("Display list is void!");
1057
	return;
1058
	return;
1058
	} */
1059
	} */
1059
    if (!pEXIST)
1060
    if (!pEXIST)
Line 1064... Line 1065...
1064
    pCHECK;
1065
    pCHECK;
1065
    if (replace)
1066
    if (replace)
1066
	where = pCURRENTPOS;
1067
	where = pCURRENTPOS;
1067
    else
1068
    else
1068
	where = pNUMPLOTS;
1069
	where = pNUMPLOTS;
1069
    PROTECT(snapshot);
-
 
-
 
1070
 
1070
    PROTECT(class = allocVector(STRSXP, 1));
1071
    PROTECT(class = allocVector(STRSXP, 1));
1071
    SET_STRING_ELT(class, 0, mkChar("recordedplot"));
1072
    SET_STRING_ELT(class, 0, mkChar("recordedplot"));
1072
    classgets(snapshot, class);
1073
    classgets(snapshot, class);
1073
    SET_VECTOR_ELT(pHISTORY, where, snapshot);
1074
    SET_VECTOR_ELT(pHISTORY, where, snapshot);
1074
    pCURRENTPOS = where;
1075
    pCURRENTPOS = where;
Line 1987... Line 1988...
1987
 
1988
 
1988
static void GA_Close(NewDevDesc *dd)
1989
static void GA_Close(NewDevDesc *dd)
1989
{
1990
{
1990
    gadesc *xd = (gadesc *) dd->deviceSpecific;
1991
    gadesc *xd = (gadesc *) dd->deviceSpecific;
1991
    GEDevDesc *gdd = (GEDevDesc *) GetDevice(devNumber((DevDesc*) dd));
1992
    GEDevDesc *gdd = (GEDevDesc *) GetDevice(devNumber((DevDesc*) dd));
1992
    GETDL;
1993
    SEXP vDL;
1993
 
1994
 
1994
    if (xd->kind == SCREEN) {
1995
    if (xd->kind == SCREEN) {
1995
	if(xd->recording) {
1996
	if(xd->recording) {
1996
	    AddtoPlotHistory(GEcreateSnapshot(gdd), 0);
1997
	    AddtoPlotHistory(GEcreateSnapshot(gdd), 0);
-
 
1998
	    /* May have changed vDL, so can't use GETDL above */	
-
 
1999
	    vDL = findVar(install(".SavedPlots"), R_GlobalEnv);
1997
	    pCURRENTPOS++; /* so PgUp goes to the last saved plot
2000
	    pCURRENTPOS++; /* so PgUp goes to the last saved plot
1998
			      when a windows() device is opened */
2001
			      when a windows() device is opened */
1999
	}
2002
	}
2000
	hide(xd->gawin);
2003
	hide(xd->gawin);
2001
	del(xd->bm);
2004
	del(xd->bm);