The R Project SVN R

Rev

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

Rev 60714 Rev 61327
Line 277... Line 277...
277
    else
277
    else
278
	return selectDevice(nextDevice(devNum));
278
	return selectDevice(nextDevice(devNum));
279
}
279
}
280
 
280
 
281
/* historically the close was in the [kK]illDevices.
281
/* historically the close was in the [kK]illDevices.
282
   only use findNext= TRUE when shutting R dowm, and .Device[s] are not
282
   only use findNext = FALSE when shutting R dowm, and .Device[s] are not
283
   updated.
283
   updated.
284
*/
284
*/
285
static
285
static
286
void removeDevice(int devNum, Rboolean findNext)
286
void removeDevice(int devNum, Rboolean findNext)
287
{
287
{
Line 446... Line 446...
446
	killDevice(i);
446
	killDevice(i);
447
	error(_("too many open devices"));
447
	error(_("too many open devices"));
448
    }
448
    }
449
}
449
}
450
 
450
 
451
/* conveniende wrapper */
451
/* convenience wrapper */
452
void GEaddDevice2(pGEDevDesc gdd, const char *name)
452
void GEaddDevice2(pGEDevDesc gdd, const char *name)
453
{
453
{
454
    gsetVar(R_DeviceSymbol, mkString(name), R_BaseEnv);
454
    gsetVar(R_DeviceSymbol, mkString(name), R_BaseEnv);
455
    GEaddDevice(gdd);
455
    GEaddDevice(gdd);
456
    GEinitDisplayList(gdd);
456
    GEinitDisplayList(gdd);
Line 485... Line 485...
485
}
485
}
486
 
486
 
487
 
487
 
488
void attribute_hidden InitGraphics(void)
488
void attribute_hidden InitGraphics(void)
489
{
489
{
490
    int i;
-
 
491
    SEXP s, t;
-
 
492
 
-
 
493
    R_Devices[0] = &nullDevice;
490
    R_Devices[0] = &nullDevice;
494
    active[0] = TRUE;
491
    active[0] = TRUE;
-
 
492
    // these are static arrays, not really needed
495
    for (i = 1; i < R_MaxDevices; i++) {
493
    for (int i = 1; i < R_MaxDevices; i++) {
496
	R_Devices[i] = NULL;
494
	R_Devices[i] = NULL;
497
	active[i] = FALSE;
495
	active[i] = FALSE;
498
    }
496
    }
499
 
497
 
500
    /* init .Device and .Devices */
498
    /* init .Device and .Devices */
501
    PROTECT(s = mkString("null device"));
499
    SEXP s = PROTECT(mkString("null device"));
502
    gsetVar(R_DeviceSymbol, s, R_BaseEnv);
500
    gsetVar(R_DeviceSymbol, s, R_BaseEnv);
503
    PROTECT(t = mkString("null device"));
501
    s = PROTECT(mkString("null device"));
504
    gsetVar(R_DevicesSymbol, CONS(t, R_NilValue), R_BaseEnv);
502
    gsetVar(R_DevicesSymbol, CONS(s, R_NilValue), R_BaseEnv);
505
    UNPROTECT(2);
503
    UNPROTECT(2);
506
 
-
 
507
    /* Register the base graphics system with the graphics engine
-
 
508
     */
-
 
509
    // registerBase();
-
 
510
}
504
}
511
 
505
 
512
 
506
 
513
void NewFrameConfirm(pDevDesc dd)
507
void NewFrameConfirm(pDevDesc dd)
514
{
508
{
515
    if(!R_Interactive) return;
509
    if(!R_Interactive) return;
516
    /* dd->newFrameConfirm(dd) will either handle this, or return
510
    /* dd->newFrameConfirm(dd) will either handle this, or return
517
       FALSE to ask for the engine to do so. */
511
       FALSE to ask the engine to do so. */
518
    if(dd->newFrameConfirm && dd->newFrameConfirm(dd)) ;
512
    if(dd->newFrameConfirm && dd->newFrameConfirm(dd)) ;
519
    else {
513
    else {
520
	unsigned char buf[1024];
514
	unsigned char buf[1024];
521
	R_ReadConsole(_("Hit <Return> to see next plot: "), buf, 1024, 0);
515
	R_ReadConsole(_("Hit <Return> to see next plot: "), buf, 1024, 0);
522
    }
516
    }