The R Project SVN R

Rev

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

Rev 50745 Rev 51272
Line 1485... Line 1485...
1485
    return retval;
1485
    return retval;
1486
}
1486
}
1487
 
1487
 
1488
/*  Call dynamically loaded "internal" graphics functions
1488
/*  Call dynamically loaded "internal" graphics functions
1489
    .External.graphics (unused) and  .Call.graphics (used in grid).
1489
    .External.graphics (unused) and  .Call.graphics (used in grid).
-
 
1490
 
-
 
1491
    If there is an error or user-interrupt in the above
-
 
1492
    evaluation, dd->recordGraphics is set to TRUE
-
 
1493
    on all graphics devices (see GEonExit(); called in errors.c)
-
 
1494
 
-
 
1495
    NOTE: if someone uses try() around this call and there
-
 
1496
    is an error, then dd->recordGraphics stays FALSE, so
-
 
1497
    subsequent pages of graphics output are NOT saved on
-
 
1498
    the display list.  A workaround is to deliberately
-
 
1499
    force an error in a graphics call (e.g., a grid popViewport()
-
 
1500
    while in the ROOT viewport) which will reset dd->recordGraphics
-
 
1501
    to TRUE as per the comment above.
1490
*/
1502
*/
1491
 
1503
 
1492
SEXP attribute_hidden do_Externalgr(SEXP call, SEXP op, SEXP args, SEXP env)
1504
SEXP attribute_hidden do_Externalgr(SEXP call, SEXP op, SEXP args, SEXP env)
1493
{
1505
{
1494
    SEXP retval;
1506
    SEXP retval;
1495
    pGEDevDesc dd = GEcurrentDevice();
1507
    pGEDevDesc dd = GEcurrentDevice();
1496
    Rboolean record = dd->recordGraphics;
1508
    Rboolean record = dd->recordGraphics;
1497
    dd->recordGraphics = FALSE;
1509
    dd->recordGraphics = FALSE;
1498
    PROTECT(retval = do_External(call, op, args, env));
1510
    PROTECT(retval = do_External(call, op, args, env));
1499
    /*
-
 
1500
     * If there is an error or user-interrupt in the above
-
 
1501
     * evaluation, dd->recordGraphics is set to TRUE
-
 
1502
     * on all graphics devices (see GEonExit(); called in errors.c)
-
 
1503
     *
-
 
1504
     * NOTE: if someone uses try() around this call and there
-
 
1505
     * is an error, then dd->recordGraphics stays FALSE, so
-
 
1506
     * subsequent pages of graphics output are NOT saved on
-
 
1507
     * the display list.  A workaround is to deliberately
-
 
1508
     * force an error in a graphics call (e.g., a grid popViewport()
-
 
1509
     * while in the ROOT viewport) which will reset dd->recordGraphics
-
 
1510
     * to TRUE as per the comment above.
-
 
1511
     */
-
 
1512
    dd->recordGraphics = record;
1511
    dd->recordGraphics = record;
1513
    if (GErecording(call, dd)) {
1512
    if (GErecording(call, dd)) {
1514
	if (!GEcheckState(dd))
1513
	if (!GEcheckState(dd))
1515
	    errorcall(call, _("Invalid graphics state"));
1514
	    errorcall(call, _("Invalid graphics state"));
1516
	GErecordGraphicOperation(op, args, dd);
1515
	GErecordGraphicOperation(op, args, dd);
Line 1524... Line 1523...
1524
    SEXP retval;
1523
    SEXP retval;
1525
    pGEDevDesc dd = GEcurrentDevice();
1524
    pGEDevDesc dd = GEcurrentDevice();
1526
    Rboolean record = dd->recordGraphics;
1525
    Rboolean record = dd->recordGraphics;
1527
    dd->recordGraphics = FALSE;
1526
    dd->recordGraphics = FALSE;
1528
    PROTECT(retval = do_dotcall(call, op, args, env));
1527
    PROTECT(retval = do_dotcall(call, op, args, env));
1529
    /*
-
 
1530
     * If there is an error or user-interrupt in the above
-
 
1531
     * evaluation, dd->recordGraphics is set to TRUE
-
 
1532
     * on all graphics devices (see GEonExit(); called in errors.c)
-
 
1533
     *
-
 
1534
     * NOTE: if someone uses try() around this call and there
-
 
1535
     * is an error, then dd->recordGraphics stays FALSE, so
-
 
1536
     * subsequent pages of graphics output are NOT saved on
-
 
1537
     * the display list.  A workaround is to deliberately
-
 
1538
     * force an error in a graphics call (e.g., a grid popViewport()
-
 
1539
     * while in the ROOT viewport) which will reset dd->recordGraphics
-
 
1540
     * to TRUE as per the comment above.
-
 
1541
     */
-
 
1542
    dd->recordGraphics = record;
1528
    dd->recordGraphics = record;
1543
    if (GErecording(call, dd)) {
1529
    if (GErecording(call, dd)) {
1544
	if (!GEcheckState(dd))
1530
	if (!GEcheckState(dd))
1545
	    errorcall(call, _("Invalid graphics state"));
1531
	    errorcall(call, _("Invalid graphics state"));
1546
	GErecordGraphicOperation(op, args, dd);
1532
	GErecordGraphicOperation(op, args, dd);