The R Project SVN R

Rev

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

Rev 44342 Rev 44343
Line 48... Line 48...
48
	double ay;
48
	double ay;
49
	double by;
49
	double by;
50
} GTrans;
50
} GTrans;
51
 
51
 
52
typedef struct {
52
typedef struct {
53
#if 0
-
 
54
    /* FIXME: why not talk to the device rather than having
-
 
55
       multiple copies of these? */
-
 
56
    /* Basic Device Driver Properties */
-
 
57
    /* These MUST be set by device drivers on open */
-
 
58
 
-
 
59
    /* These parameters cannot be set by the user */
-
 
60
    /* although left, right, bottom, and top can be */
-
 
61
    /* interrogated indirectly (i.e., par("din")) */
-
 
62
    /* and cra can be interrogated directly (i.e., par("cra")) */
-
 
63
 
-
 
64
    double left;	/* left raster coordinate */
-
 
65
    double right;	/* right raster coordinate */
-
 
66
    double bottom;	/* bottom raster coordinate */
-
 
67
    double top;		/* top raster coordinate */
-
 
68
    double xCharOffset;	/* x character addressing offset: unused */
-
 
69
    double yCharOffset;	/* y character addressing offset */
-
 
70
    double yLineBias;	/* 1/2 interline space as fraction of line height */
-
 
71
    Rboolean canResizePlot;	/* can the graphics surface be resized */
-
 
72
    Rboolean canChangeFont;	/* device has multiple fonts */
-
 
73
    Rboolean canRotateText;	/* text can be rotated */
-
 
74
    Rboolean canResizeText;	/* text can be resized */
-
 
75
    Rboolean canClip;		/* Hardware clipping */
-
 
76
    int canHAdj;	/* Can do at least some horizontal adjustment of text
-
 
77
			   0 = none, 1 = {0,0.5, 1}, 2 = [0,1] */
-
 
78
 
-
 
79
    /* a couple of the GRZ-like parameters that have to be */
-
 
80
    /* set by the device */
-
 
81
 
-
 
82
    double ipr[2];	/* Inches per raster; [0]=x, [1]=y */
-
 
83
    double asp;		/* Pixel aspect ratio = ipr[1]/ipr[0] */
-
 
84
#endif
-
 
85
    /* This may get changed if the device is resized, in the 
-
 
86
       GE_ScalePS action */ 
-
 
87
    double cra[2];	/* Character size in rasters; [0]=x, [1]=y */
-
 
88
 
-
 
89
 
-
 
90
    /* Plot State */
53
    /* Plot State */
91
    /* 
54
    /* 
92
       When the device driver is started this is 0
55
       When the device driver is started this is 0
93
       After the first call to plot.new/perps it is 1
56
       After the first call to plot.new/perps it is 1
94
       Every graphics operation except plot.new/persp
57
       Every graphics operation except plot.new/persp
95
       should fail if state = 0 
58
       should fail if state = 0 
96
       This is checked at the highest internal function
59
       This is checked at the highest internal function
97
       level (e.g., do_lines, do_axis, do_plot_xy, ...) 
60
       level (e.g., do_lines, do_axis, do_plot_xy, ...) 
98
    */
61
    */
99
 
62
 
100
    int	state;		/* Plot State */
63
    int	state;		/* plot state: 1 if GNewPlot has been called 
-
 
64
			   (by plot.new or persp) */
101
    Rboolean valid;	/* valid layout ? */
65
    Rboolean valid;	/* valid layout ?  Used in GCheckState & do_playDL */
102
 
66
 
103
    /* GRZ-like Graphics Parameters */
67
    /* GRZ-like Graphics Parameters */
104
    /* ``The horror, the horror ... '' */
68
    /* ``The horror, the horror ... '' */
105
    /* Marlon Brando - Appocalypse Now */
69
    /* Marlon Brando - Appocalypse Now */
106
 
70
 
Line 142... Line 106...
142
			/* [0] = location of axis title */
106
			/* [0] = location of axis title */
143
			/* [1] = location of axis label */
107
			/* [1] = location of axis label */
144
			/* [2] = location of axis line */
108
			/* [2] = location of axis line */
145
    double mkh;		/* Mark size in inches */
109
    double mkh;		/* Mark size in inches */
146
    int	pch;		/* Plotting character */
110
    int	pch;		/* Plotting character */
-
 
111
    /* Note that ps is never changed, so always the same as dev->startps.
-
 
112
       However, the ps in the graphics context is changed */
147
    int ps;		/* Text & symbol pointsize */
113
    int ps;		/* Text & symbol pointsize */
148
    int	smo;		/* Curve smoothness */
114
    int	smo;		/* Curve smoothness */
149
    double srt;		/* String Rotation */
115
    double srt;		/* String Rotation */
150
    double tck;		/* Tick size as in S */
116
    double tck;		/* Tick size as in S */
151
    double tcl;		/* Tick size in "lines" */
117
    double tcl;		/* Tick size in "lines" */
152
    /* kept to avoid changing the structure */
-
 
153
    double tmag;	/* **DEFUNCT** Title Magnification */
-
 
154
    /* int	type;	    type of plot desired -- removed in 2.3.0 */
-
 
155
    double xaxp[3];	/* X Axis annotation */
118
    double xaxp[3];	/* X Axis annotation */
156
			/* [0] = coordinate of lower tick */
119
			/* [0] = coordinate of lower tick */
157
			/* [1] = coordinate of upper tick */
120
			/* [1] = coordinate of upper tick */
158
			/* [2] = num tick intervals */
121
			/* [2] = num tick intervals */
159
			/* almost always used internally */
122
			/* almost always used internally */
160
    int	xaxs;		/* X Axis style */
123
    int	xaxs;		/* X Axis style */
161
    int	xaxt;		/* X Axis type */
124
    int	xaxt;		/* X Axis type */
-
 
125
    Rboolean xlog;	/* Log Axis for X */
162
    int	xpd;		/* Clip to plot region indicator */
126
    int	xpd;		/* Clip to plot region indicator */
163
    int	oldxpd;
127
    int	oldxpd;
164
    double yaxp[3];	/* Y Axis annotation */
128
    double yaxp[3];	/* Y Axis annotation */
165
    int	yaxs;		/* Y Axis style */
129
    int	yaxs;		/* Y Axis style */
166
    int	yaxt;		/* Y Axis type */
130
    int	yaxt;		/* Y Axis type */
167
    Rboolean xlog;	/* Log Axis for X */
-
 
168
    Rboolean ylog;	/* Log Axis for Y */
131
    Rboolean ylog;	/* Log Axis for Y */
169
 
132
 
170
    /* Annotation Parameters */
133
    /* Annotation Parameters */
171
 
134
 
172
    float cexbase;	/* Base character size */
135
    float cexbase;	/* Base character size */
Line 261... Line 224...
261
    /* set directly by the user) */
224
    /* set directly by the user) */
262
 
225
 
263
    /* The reliability of these parameters relies on */
226
    /* The reliability of these parameters relies on */
264
    /* the fact that plot.new is the */
227
    /* the fact that plot.new is the */
265
    /* first graphics operation called in the creation */
228
    /* first graphics operation called in the creation */
266
    /* of a graph */
229
    /* of a graph  (unless it is a call to persp) */
267
 
230
 
268
    /* udpated per plot.new */
231
    /* udpated per plot.new */
269
 
232
 
270
    double xNDCPerChar;	/* Nominal character width (NDC) */
233
    double xNDCPerChar;	/* Nominal character width (NDC) */
271
    double yNDCPerChar;	/* Nominal character height (NDC) */
234
    double yNDCPerChar;	/* Nominal character height (NDC) */
Line 340... Line 303...
340
 * from graphics.c, used in plot.c, plotmath.c
303
 * from graphics.c, used in plot.c, plotmath.c
341
 */
304
 */
342
void gcontextFromGP(R_GE_gcontext *gc, DevDesc *dd);
305
void gcontextFromGP(R_GE_gcontext *gc, DevDesc *dd);
343
 
306
 
344
/* From base.c */
307
/* From base.c */
-
 
308
#define gpptr Rf_gpptr
-
 
309
#define dpptr Rf_dpptr
345
GPar* Rf_gpptr(DevDesc *dd);
310
GPar* Rf_gpptr(DevDesc *dd);
346
GPar* Rf_dpptr(DevDesc *dd);
311
GPar* Rf_dpptr(DevDesc *dd);
347
GPar* Rf_dpSavedptr(DevDesc *dd);
-
 
348
 
312
 
349
#endif /* GRAPHICS_H_ */
313
#endif /* GRAPHICS_H_ */