The R Project SVN R

Rev

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

Rev 29381 Rev 29428
Line 2852... Line 2852...
2852
SEXP do_box(SEXP call, SEXP op, SEXP args, SEXP env)
2852
SEXP do_box(SEXP call, SEXP op, SEXP args, SEXP env)
2853
{
2853
{
2854
/*     box(which="plot", lty="solid", ...)
2854
/*     box(which="plot", lty="solid", ...)
2855
       --- which is coded, 1 = plot, 2 = figure, 3 = inner, 4 = outer.
2855
       --- which is coded, 1 = plot, 2 = figure, 3 = inner, 4 = outer.
2856
*/
2856
*/
2857
    int which, col, fg;
2857
    int which, col;
2858
    SEXP originalArgs = args;
2858
    SEXP originalArgs = args;
2859
    DevDesc *dd = CurrentDevice();
2859
    DevDesc *dd = CurrentDevice();
2860
 
2860
 
2861
    GCheckState(dd);
2861
    GCheckState(dd);
2862
    GSavePars(dd);
2862
    GSavePars(dd);
2863
    which = asInteger(CAR(args)); args = CDR(args);
2863
    which = asInteger(CAR(args)); args = CDR(args);
2864
    if (which < 1 || which > 4)
2864
    if (which < 1 || which > 4)
2865
	errorcall(call, "invalid \"which\" specification");
2865
	errorcall(call, "invalid \"which\" specification");
2866
    col= Rf_gpptr(dd)->col;	Rf_gpptr(dd)->col= NA_INTEGER;
2866
    col= Rf_gpptr(dd)->col;	Rf_gpptr(dd)->col= NA_INTEGER;
2867
    fg = Rf_gpptr(dd)->col;	Rf_gpptr(dd)->fg = NA_INTEGER;
2867
    Rf_gpptr(dd)->fg = NA_INTEGER;
2868
    ProcessInlinePars(args, dd, call);
2868
    ProcessInlinePars(args, dd, call);
2869
    if (Rf_gpptr(dd)->col == NA_INTEGER) {
2869
    if (Rf_gpptr(dd)->col == NA_INTEGER) {/* col := 'fg' or original 'col' */
2870
	if (Rf_gpptr(dd)->fg == NA_INTEGER)
2870
	if (Rf_gpptr(dd)->fg == NA_INTEGER)
2871
	    Rf_gpptr(dd)->col = col;
2871
	    Rf_gpptr(dd)->col = col;
2872
	else
2872
	else
2873
	    Rf_gpptr(dd)->col = Rf_gpptr(dd)->fg;
2873
	    Rf_gpptr(dd)->col = Rf_gpptr(dd)->fg;
2874
    }
2874
    }