The R Project SVN R

Rev

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

Rev 26109 Rev 27526
Line 48... Line 48...
48
    NewDevDesc *dev;
48
    NewDevDesc *dev;
49
    GEDevDesc* dd;
49
    GEDevDesc* dd;
50
    char *display, *vmax;
50
    char *display, *vmax;
51
    double height, width, ps, xpinch, ypinch, gamma;
51
    double height, width, ps, xpinch, ypinch, gamma;
52
    int recording = 0, resize = 1, canvas, xpos, ypos, buffered;
52
    int recording = 0, resize = 1, canvas, xpos, ypos, buffered;
53
    SEXP sc;
53
    SEXP sc, psenv;
54
 
54
 
55
    checkArity(op, args);
55
    checkArity(op, args);
56
    gcall = call;
56
    gcall = call;
57
    vmax = vmaxget();
57
    vmax = vmaxget();
58
    display = SaveString(CAR(args), 0);
58
    display = SaveString(CAR(args), 0);
Line 89... Line 89...
89
    ypos = asInteger(CAR(args));
89
    ypos = asInteger(CAR(args));
90
    args = CDR(args);
90
    args = CDR(args);
91
    buffered = asLogical(CAR(args));
91
    buffered = asLogical(CAR(args));
92
    if (buffered == NA_LOGICAL)
92
    if (buffered == NA_LOGICAL)
93
	errorcall(call, "invalid value of `buffered'");
93
	errorcall(call, "invalid value of `buffered'");
-
 
94
    args = CDR(args);
-
 
95
    psenv = CAR(args);
94
    
96
    
95
    R_CheckDeviceAvailable();
97
    R_CheckDeviceAvailable();
96
    BEGIN_SUSPEND_INTERRUPTS {
98
    BEGIN_SUSPEND_INTERRUPTS {
97
	/* Allocate and initialize the device driver data */
99
	/* Allocate and initialize the device driver data */
98
	if (!(dev = (NewDevDesc *) calloc(1, sizeof(NewDevDesc))))
100
	if (!(dev = (NewDevDesc *) calloc(1, sizeof(NewDevDesc))))
Line 104... Line 106...
104
	 */
106
	 */
105
	dev->savedSnapshot = R_NilValue;
107
	dev->savedSnapshot = R_NilValue;
106
	GAsetunits(xpinch, ypinch);
108
	GAsetunits(xpinch, ypinch);
107
	if (!GADeviceDriver(dev, display, width, height, ps, 
109
	if (!GADeviceDriver(dev, display, width, height, ps, 
108
			    (Rboolean)recording, resize, canvas, gamma,
110
			    (Rboolean)recording, resize, canvas, gamma,
109
			    xpos, ypos, (Rboolean)buffered)) {
111
			    xpos, ypos, (Rboolean)buffered, psenv)) {
110
	    free(dev);
112
	    free(dev);
111
	    errorcall(call, "unable to start device devga");
113
	    errorcall(call, "unable to start device devga");
112
	}
114
	}
113
	gsetVar(install(".Device"),
115
	gsetVar(install(".Device"),
114
		mkString(display[0] ? display : "windows"), R_NilValue);
116
		mkString(display[0] ? display : "windows"), R_NilValue);