The R Project SVN R

Rev

Rev 27236 | Rev 29016 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27236 Rev 27354
Line 1746... Line 1746...
1746
/*  GNewPlot -- Begin a new plot (advance to new frame if needed)  */
1746
/*  GNewPlot -- Begin a new plot (advance to new frame if needed)  */
1747
DevDesc *GNewPlot(Rboolean recording)
1747
DevDesc *GNewPlot(Rboolean recording)
1748
{
1748
{
1749
    DevDesc *dd;
1749
    DevDesc *dd;
1750
 
1750
 
1751
    /* If there are no active devices
-
 
1752
     * check the options for a "default device".
-
 
1753
     * If there is one, start it up. */
-
 
1754
 
-
 
1755
    if (NoDevices()) {
-
 
1756
	SEXP defdev = GetOption(install("device"), R_NilValue);
-
 
1757
	if (isString(defdev) && length(defdev) > 0) {
-
 
1758
	    PROTECT(defdev = lang1(install(CHAR(STRING_ELT(defdev, 0)))));
-
 
1759
	}
-
 
1760
	else error("No active or default device");
-
 
1761
	eval(defdev, R_GlobalEnv);
-
 
1762
	UNPROTECT(1);
-
 
1763
    }
-
 
1764
 
-
 
1765
    /* Restore Default Parameters */
1751
    /* Restore Default Parameters */
1766
 
1752
 
1767
    dd = CurrentDevice();
1753
    dd = CurrentDevice();
1768
    GRestore(dd);
1754
    GRestore(dd);
1769
 
1755
 
Line 4345... Line 4331...
4345
}
4331
}
4346
 
4332
 
4347
 
4333
 
4348
DevDesc* CurrentDevice(void)
4334
DevDesc* CurrentDevice(void)
4349
{
4335
{
-
 
4336
    /* If there are no active devices
-
 
4337
     * check the options for a "default device".
-
 
4338
     * If there is one, start it up. */
-
 
4339
    if (NoDevices()) {
-
 
4340
	SEXP defdev = GetOption(install("device"), R_NilValue);
-
 
4341
	if (isString(defdev) && length(defdev) > 0) 
-
 
4342
	    PROTECT(defdev = lang1(install(CHAR(STRING_ELT(defdev, 0)))));
-
 
4343
	else 
-
 
4344
	    error("No active or default device");
-
 
4345
	eval(defdev, R_GlobalEnv);
-
 
4346
	UNPROTECT(1);
-
 
4347
    }
4350
    return R_Devices[R_CurrentDevice];
4348
    return R_Devices[R_CurrentDevice];
4351
}
4349
}
4352
 
4350
 
4353
 
4351
 
4354
DevDesc* GetDevice(int i)
4352
DevDesc* GetDevice(int i)