| 1 |
/*
|
1 |
/*
|
| 2 |
* R : A Computer Language for Statistical Data Analysis
|
2 |
* R : A Computer Language for Statistical Data Analysis
|
| 3 |
* Copyright (C) 1998--2021 R Core Team
|
3 |
* Copyright (C) 1998--2021 R Core Team
|
| 4 |
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
|
4 |
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
|
| 5 |
*
|
5 |
*
|
| 6 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* This program is free software; you can redistribute it and/or modify
|
| 7 |
* it under the terms of the GNU General Public License as published by
|
7 |
* it under the terms of the GNU General Public License as published by
|
| 8 |
* the Free Software Foundation; either version 2 of the License, or
|
8 |
* the Free Software Foundation; either version 2 of the License, or
|
| 9 |
* (at your option) any later version.
|
9 |
* (at your option) any later version.
|
| 10 |
*
|
10 |
*
|
| 11 |
* This program is distributed in the hope that it will be useful,
|
11 |
* This program is distributed in the hope that it will be useful,
|
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
* GNU General Public License for more details.
|
14 |
* GNU General Public License for more details.
|
| 15 |
*
|
15 |
*
|
| 16 |
* You should have received a copy of the GNU General Public License
|
16 |
* You should have received a copy of the GNU General Public License
|
| 17 |
* along with this program; if not, a copy is available at
|
17 |
* along with this program; if not, a copy is available at
|
| 18 |
* https://www.R-project.org/Licenses/
|
18 |
* https://www.R-project.org/Licenses/
|
| 19 |
*/
|
19 |
*/
|
| 20 |
|
20 |
|
| 21 |
/* Internal header, not installed */
|
21 |
/* Internal header, not installed */
|
| 22 |
|
22 |
|
| 23 |
#ifndef GRAPHICS_H_
|
23 |
#ifndef GRAPHICS_H_
|
| 24 |
#define GRAPHICS_H_
|
24 |
#define GRAPHICS_H_
|
| 25 |
|
25 |
|
| 26 |
#include <R_ext/Boolean.h>
|
26 |
#include <R_ext/Boolean.h>
|
| 27 |
|
27 |
|
| 28 |
#include <R_ext/GraphicsEngine.h>
|
28 |
#include <R_ext/GraphicsEngine.h>
|
| 29 |
/* needed for R_GE_lineend/join, R_GE_gcontext */
|
29 |
/* needed for R_GE_lineend/join, R_GE_gcontext */
|
| 30 |
|
30 |
|
| 31 |
#define R_GRAPHICS 1
|
31 |
#define R_GRAPHICS 1
|
| 32 |
#include <Rgraphics.h> /* RUnit, G<par> functions */
|
32 |
#include <Rgraphics.h> /* RUnit, G<par> functions */
|
| 33 |
|
33 |
|
| 34 |
/* base.c, graphics.c, par.c */
|
34 |
/* base.c, graphics.c, par.c */
|
| 35 |
#define MAX_LAYOUT_ROWS 200
|
35 |
#define MAX_LAYOUT_ROWS 200
|
| 36 |
#define MAX_LAYOUT_COLS 200
|
36 |
#define MAX_LAYOUT_COLS 200
|
| 37 |
#define MAX_LAYOUT_CELLS 10007 /* must be less than 65535,
|
37 |
#define MAX_LAYOUT_CELLS 10007 /* must be less than 65535,
|
| 38 |
3 copies, 3bytes each */
|
38 |
3 copies, 3bytes each */
|
| 39 |
|
39 |
|
| 40 |
typedef struct {
|
40 |
typedef struct {
|
| 41 |
double ax;
|
41 |
double ax;
|
| 42 |
double bx;
|
42 |
double bx;
|
| 43 |
double ay;
|
43 |
double ay;
|
| 44 |
double by;
|
44 |
double by;
|
| 45 |
} GTrans;
|
45 |
} GTrans;
|
| 46 |
|
46 |
|
| 47 |
typedef struct {
|
47 |
typedef struct {
|
| 48 |
/* Plot State */
|
48 |
/* Plot State */
|
| 49 |
/*
|
49 |
/*
|
| 50 |
When the device driver is started this is 0
|
50 |
When the device driver is started this is 0
|
| 51 |
After the first call to plot.new/perps it is 1
|
51 |
After the first call to plot.new/perps it is 1
|
| 52 |
Every graphics operation except plot.new/persp
|
52 |
Every graphics operation except plot.new/persp
|
| 53 |
should fail if state = 0
|
53 |
should fail if state = 0
|
| 54 |
This is checked at the highest internal function
|
54 |
This is checked at the highest internal function
|
| 55 |
level (e.g., do_lines, do_axis, do_plot_xy, ...)
|
55 |
level (e.g., do_lines, do_axis, do_plot_xy, ...)
|
| 56 |
*/
|
56 |
*/
|
| 57 |
|
57 |
|
| 58 |
int state; /* plot state: 1 if GNewPlot has been called
|
58 |
int state; /* plot state: 1 if GNewPlot has been called
|
| 59 |
(by plot.new or persp) */
|
59 |
(by plot.new or persp) */
|
| 60 |
Rboolean valid; /* valid layout ? Used in GCheckState & do_playDL */
|
60 |
Rboolean valid; /* valid layout ? Used in GCheckState & do_playDL */
|
| 61 |
|
61 |
|
| 62 |
/* GRZ-like Graphics Parameters */
|
62 |
/* GRZ-like Graphics Parameters */
|
| 63 |
/* ``The horror, the horror ... '' */
|
63 |
/* ``The horror, the horror ... '' */
|
| 64 |
/* Marlon Brando - Appocalypse Now */
|
64 |
/* Marlon Brando - Apocalypse Now */
|
| 65 |
|
65 |
|
| 66 |
/* General Parameters -- set and interrogated directly */
|
66 |
/* General Parameters -- set and interrogated directly */
|
| 67 |
|
67 |
|
| 68 |
double adj; /* String adjustment */
|
68 |
double adj; /* String adjustment */
|
| 69 |
Rboolean ann; /* Should annotation take place */
|
69 |
Rboolean ann; /* Should annotation take place */
|
| 70 |
rcolor bg; /* **R ONLY** Background color */
|
70 |
rcolor bg; /* **R ONLY** Background color */
|
| 71 |
char bty; /* Box type */
|
71 |
char bty; /* Box type */
|
| 72 |
double cex; /* Character expansion */
|
72 |
double cex; /* Character expansion */
|
| 73 |
double lheight; /* Line height
|
73 |
double lheight; /* Line height
|
| 74 |
The height of a line of text is:
|
74 |
The height of a line of text is:
|
| 75 |
ps * cex * lheight */
|
75 |
ps * cex * lheight */
|
| 76 |
rcolor col; /* Plotting Color */
|
76 |
rcolor col; /* Plotting Color */
|
| 77 |
double crt; /* Character/string rotation */
|
77 |
double crt; /* Character/string rotation */
|
| 78 |
double din[2]; /* device size in inches */
|
78 |
double din[2]; /* device size in inches */
|
| 79 |
int err; /* Error repporting level */
|
79 |
int err; /* Error reporting level */
|
| 80 |
rcolor fg; /* **R ONLY** Foreground Color */
|
80 |
rcolor fg; /* **R ONLY** Foreground Color */
|
| 81 |
char family[201]; /* **R ONLY** Font family
|
81 |
char family[201]; /* **R ONLY** Font family
|
| 82 |
Simple name which is mapped by device-specific
|
82 |
Simple name which is mapped by device-specific
|
| 83 |
font database to device-specific name.
|
83 |
font database to device-specific name.
|
| 84 |
Only used if not "".
|
84 |
Only used if not "".
|
| 85 |
Default is "".
|
85 |
Default is "".
|
| 86 |
Ignored by some devices. */
|
86 |
Ignored by some devices. */
|
| 87 |
int font; /* Text font */
|
87 |
int font; /* Text font */
|
| 88 |
double gamma; /* Device Gamma Correction */
|
88 |
double gamma; /* Device Gamma Correction */
|
| 89 |
int lab[3]; /* Axis labelling */
|
89 |
int lab[3]; /* Axis labelling */
|
| 90 |
/* [0] = # ticks on x-axis */
|
90 |
/* [0] = # ticks on x-axis */
|
| 91 |
/* [1] = # ticks on y-axis */
|
91 |
/* [1] = # ticks on y-axis */
|
| 92 |
/* [2] = length of axis labels */
|
92 |
/* [2] = length of axis labels */
|
| 93 |
int las; /* Label style (rotation) */
|
93 |
int las; /* Label style (rotation) */
|
| 94 |
int lty; /* Line texture */
|
94 |
int lty; /* Line texture */
|
| 95 |
double lwd; /* Line width */
|
95 |
double lwd; /* Line width */
|
| 96 |
R_GE_lineend lend; /* **R ONLY** Line end style */
|
96 |
R_GE_lineend lend; /* **R ONLY** Line end style */
|
| 97 |
R_GE_linejoin ljoin;/* **R ONLY** Line join style */
|
97 |
R_GE_linejoin ljoin;/* **R ONLY** Line join style */
|
| 98 |
double lmitre; /* **R ONLY** Line mitre limit */
|
98 |
double lmitre; /* **R ONLY** Line mitre limit */
|
| 99 |
double mgp[3]; /* Annotation location */
|
99 |
double mgp[3]; /* Annotation location */
|
| 100 |
/* [0] = location of axis title */
|
100 |
/* [0] = location of axis title */
|
| 101 |
/* [1] = location of axis label */
|
101 |
/* [1] = location of axis label */
|
| 102 |
/* [2] = location of axis line */
|
102 |
/* [2] = location of axis line */
|
| 103 |
double mkh; /* Mark size in inches */
|
103 |
double mkh; /* Mark size in inches */
|
| 104 |
int pch; /* Plotting character */
|
104 |
int pch; /* Plotting character */
|
| 105 |
/* Note that ps is never changed, so always the same as dev->startps.
|
105 |
/* Note that ps is never changed, so always the same as dev->startps.
|
| 106 |
However, the ps in the graphics context is changed */
|
106 |
However, the ps in the graphics context is changed */
|
| 107 |
double ps; /* Text & symbol pointsize */
|
107 |
double ps; /* Text & symbol pointsize */
|
| 108 |
int smo; /* Curve smoothness */
|
108 |
int smo; /* Curve smoothness */
|
| 109 |
double srt; /* String Rotation */
|
109 |
double srt; /* String Rotation */
|
| 110 |
double tck; /* Tick size as in S */
|
110 |
double tck; /* Tick size as in S */
|
| 111 |
double tcl; /* Tick size in "lines" */
|
111 |
double tcl; /* Tick size in "lines" */
|
| 112 |
double xaxp[3]; /* X Axis annotation */
|
112 |
double xaxp[3]; /* X Axis annotation */
|
| 113 |
/* [0] = coordinate of lower tick */
|
113 |
/* [0] = coordinate of lower tick */
|
| 114 |
/* [1] = coordinate of upper tick */
|
114 |
/* [1] = coordinate of upper tick */
|
| 115 |
/* [2] = num tick intervals */
|
115 |
/* [2] = num tick intervals */
|
| 116 |
/* almost always used internally */
|
116 |
/* almost always used internally */
|
| 117 |
char xaxs; /* X Axis style */
|
117 |
char xaxs; /* X Axis style */
|
| 118 |
char xaxt; /* X Axis type */
|
118 |
char xaxt; /* X Axis type */
|
| 119 |
Rboolean xlog; /* Log Axis for X */
|
119 |
Rboolean xlog; /* Log Axis for X */
|
| 120 |
int xpd; /* Clip to plot region indicator */
|
120 |
int xpd; /* Clip to plot region indicator */
|
| 121 |
int oldxpd;
|
121 |
int oldxpd;
|
| 122 |
double yaxp[3]; /* Y Axis annotation */
|
122 |
double yaxp[3]; /* Y Axis annotation */
|
| 123 |
char yaxs; /* Y Axis style */
|
123 |
char yaxs; /* Y Axis style */
|
| 124 |
char yaxt; /* Y Axis type */
|
124 |
char yaxt; /* Y Axis type */
|
| 125 |
Rboolean ylog; /* Log Axis for Y */
|
125 |
Rboolean ylog; /* Log Axis for Y */
|
| 126 |
|
126 |
|
| 127 |
/* Annotation Parameters */
|
127 |
/* Annotation Parameters */
|
| 128 |
|
128 |
|
| 129 |
double cexbase; /* Base character size */
|
129 |
double cexbase; /* Base character size */
|
| 130 |
double cexmain; /* Main title size */
|
130 |
double cexmain; /* Main title size */
|
| 131 |
double cexlab; /* xlab and ylab size */
|
131 |
double cexlab; /* xlab and ylab size */
|
| 132 |
double cexsub; /* Sub title size */
|
132 |
double cexsub; /* Sub title size */
|
| 133 |
double cexaxis; /* Axis label size */
|
133 |
double cexaxis; /* Axis label size */
|
| 134 |
|
134 |
|
| 135 |
int fontmain; /* Main title font */
|
135 |
int fontmain; /* Main title font */
|
| 136 |
int fontlab; /* Xlab and ylab font */
|
136 |
int fontlab; /* Xlab and ylab font */
|
| 137 |
int fontsub; /* Subtitle font */
|
137 |
int fontsub; /* Subtitle font */
|
| 138 |
int fontaxis; /* Axis label fonts */
|
138 |
int fontaxis; /* Axis label fonts */
|
| 139 |
|
139 |
|
| 140 |
rcolor colmain; /* Main title color */
|
140 |
rcolor colmain; /* Main title color */
|
| 141 |
rcolor collab; /* Xlab and ylab color */
|
141 |
rcolor collab; /* Xlab and ylab color */
|
| 142 |
rcolor colsub; /* Subtitle color */
|
142 |
rcolor colsub; /* Subtitle color */
|
| 143 |
rcolor colaxis; /* Axis label color */
|
143 |
rcolor colaxis; /* Axis label color */
|
| 144 |
|
144 |
|
| 145 |
/* Layout Parameters */
|
145 |
/* Layout Parameters */
|
| 146 |
|
146 |
|
| 147 |
Rboolean layout; /* has a layout been specified */
|
147 |
Rboolean layout; /* has a layout been specified */
|
| 148 |
|
148 |
|
| 149 |
int numrows;
|
149 |
int numrows;
|
| 150 |
int numcols;
|
150 |
int numcols;
|
| 151 |
int currentFigure;
|
151 |
int currentFigure;
|
| 152 |
int lastFigure;
|
152 |
int lastFigure;
|
| 153 |
double heights[MAX_LAYOUT_ROWS];
|
153 |
double heights[MAX_LAYOUT_ROWS];
|
| 154 |
double widths[MAX_LAYOUT_COLS];
|
154 |
double widths[MAX_LAYOUT_COLS];
|
| 155 |
int cmHeights[MAX_LAYOUT_ROWS];
|
155 |
int cmHeights[MAX_LAYOUT_ROWS];
|
| 156 |
int cmWidths[MAX_LAYOUT_COLS];
|
156 |
int cmWidths[MAX_LAYOUT_COLS];
|
| 157 |
unsigned short order[MAX_LAYOUT_CELLS];
|
157 |
unsigned short order[MAX_LAYOUT_CELLS];
|
| 158 |
int rspct; /* 0 = none, 1 = full, 2 = see respect */
|
158 |
int rspct; /* 0 = none, 1 = full, 2 = see respect */
|
| 159 |
unsigned char respect[MAX_LAYOUT_CELLS];
|
159 |
unsigned char respect[MAX_LAYOUT_CELLS];
|
| 160 |
|
160 |
|
| 161 |
int mfind; /* By row/col indicator */
|
161 |
int mfind; /* By row/col indicator */
|
| 162 |
|
162 |
|
| 163 |
/* Layout parameters which can be set directly by the */
|
163 |
/* Layout parameters which can be set directly by the */
|
| 164 |
/* user (e.g., par(fig=c(.5,1,0,1))) or otherwise are */
|
164 |
/* user (e.g., par(fig=c(.5,1,0,1))) or otherwise are */
|
| 165 |
/* calculated automatically */
|
165 |
/* calculated automatically */
|
| 166 |
/* NOTE that *Units parameters are for internal use only */
|
166 |
/* NOTE that *Units parameters are for internal use only */
|
| 167 |
|
167 |
|
| 168 |
double fig[4]; /* (current) Figure size (proportion) */
|
168 |
double fig[4]; /* (current) Figure size (proportion) */
|
| 169 |
/* [0] = left, [1] = right */
|
169 |
/* [0] = left, [1] = right */
|
| 170 |
/* [2] = bottom, [3] = top */
|
170 |
/* [2] = bottom, [3] = top */
|
| 171 |
double fin[2]; /* (current) Figure size (inches) */
|
171 |
double fin[2]; /* (current) Figure size (inches) */
|
| 172 |
/* [0] = width, [1] = height */
|
172 |
/* [0] = width, [1] = height */
|
| 173 |
GUnit fUnits; /* (current) figure size units */
|
173 |
GUnit fUnits; /* (current) figure size units */
|
| 174 |
double plt[4]; /* (current) Plot size (proportions) */
|
174 |
double plt[4]; /* (current) Plot size (proportions) */
|
| 175 |
/* [0] = left, [1] = right */
|
175 |
/* [0] = left, [1] = right */
|
| 176 |
/* [2] = bottom, [3] = top */
|
176 |
/* [2] = bottom, [3] = top */
|
| 177 |
double pin[2]; /* (current) plot size (inches) */
|
177 |
double pin[2]; /* (current) plot size (inches) */
|
| 178 |
/* [0] = width, [1] = height */
|
178 |
/* [0] = width, [1] = height */
|
| 179 |
GUnit pUnits; /* (current) plot size units */
|
179 |
GUnit pUnits; /* (current) plot size units */
|
| 180 |
Rboolean defaultFigure; /* calculate figure from layout ? */
|
180 |
Rboolean defaultFigure; /* calculate figure from layout ? */
|
| 181 |
Rboolean defaultPlot; /* calculate plot from figure - margins ? */
|
181 |
Rboolean defaultPlot; /* calculate plot from figure - margins ? */
|
| 182 |
|
182 |
|
| 183 |
/* Layout parameters which are set directly by the user */
|
183 |
/* Layout parameters which are set directly by the user */
|
| 184 |
|
184 |
|
| 185 |
double mar[4]; /* Plot margins in lines */
|
185 |
double mar[4]; /* Plot margins in lines */
|
| 186 |
double mai[4]; /* Plot margins in inches */
|
186 |
double mai[4]; /* Plot margins in inches */
|
| 187 |
/* [0] = bottom, [1] = left */
|
187 |
/* [0] = bottom, [1] = left */
|
| 188 |
/* [2] = top, [3] = right */
|
188 |
/* [2] = top, [3] = right */
|
| 189 |
GUnit mUnits; /* plot margin units */
|
189 |
GUnit mUnits; /* plot margin units */
|
| 190 |
double mex; /* Margin expansion factor */
|
190 |
double mex; /* Margin expansion factor */
|
| 191 |
double oma[4]; /* Outer margins in lines */
|
191 |
double oma[4]; /* Outer margins in lines */
|
| 192 |
double omi[4]; /* outer margins in inches */
|
192 |
double omi[4]; /* outer margins in inches */
|
| 193 |
double omd[4]; /* outer margins in NDC */
|
193 |
double omd[4]; /* outer margins in NDC */
|
| 194 |
/* [0] = bottom, [1] = left */
|
194 |
/* [0] = bottom, [1] = left */
|
| 195 |
/* [2] = top, [3] = right */
|
195 |
/* [2] = top, [3] = right */
|
| 196 |
GUnit oUnits; /* outer margin units */
|
196 |
GUnit oUnits; /* outer margin units */
|
| 197 |
char pty; /* Plot type */
|
197 |
char pty; /* Plot type */
|
| 198 |
|
198 |
|
| 199 |
/* Layout parameters which can be set by the user, but */
|
199 |
/* Layout parameters which can be set by the user, but */
|
| 200 |
/* almost always get automatically calculated anyway */
|
200 |
/* almost always get automatically calculated anyway */
|
| 201 |
|
201 |
|
| 202 |
double usr[4]; /* Graphics window */
|
202 |
double usr[4]; /* Graphics window */
|
| 203 |
/* [0] = xmin, [1] = xmax */
|
203 |
/* [0] = xmin, [1] = xmax */
|
| 204 |
/* [2] = ymin, [3] = ymax */
|
204 |
/* [2] = ymin, [3] = ymax */
|
| 205 |
|
205 |
|
| 206 |
/* The logged usr parameter; if xlog, use logusr[0:1] */
|
206 |
/* The logged usr parameter; if xlog, use logusr[0:1] */
|
| 207 |
/* if ylog, use logusr[2:3] */
|
207 |
/* if ylog, use logusr[2:3] */
|
| 208 |
|
208 |
|
| 209 |
double logusr[4];
|
209 |
double logusr[4];
|
| 210 |
|
210 |
|
| 211 |
/* Layout parameter: Internal flags */
|
211 |
/* Layout parameter: Internal flags */
|
| 212 |
|
212 |
|
| 213 |
Rboolean new; /* Clean plot ? */
|
213 |
Rboolean new; /* Clean plot ? */
|
| 214 |
int devmode; /* creating new image or adding to existing one */
|
214 |
int devmode; /* creating new image or adding to existing one */
|
| 215 |
|
215 |
|
| 216 |
/* Coordinate System Mappings */
|
216 |
/* Coordinate System Mappings */
|
| 217 |
/* These are only used internally (i.e., cannot be */
|
217 |
/* These are only used internally (i.e., cannot be */
|
| 218 |
/* set directly by the user) */
|
218 |
/* set directly by the user) */
|
| 219 |
|
219 |
|
| 220 |
/* The reliability of these parameters relies on */
|
220 |
/* The reliability of these parameters relies on */
|
| 221 |
/* the fact that plot.new is the */
|
221 |
/* the fact that plot.new is the */
|
| 222 |
/* first graphics operation called in the creation */
|
222 |
/* first graphics operation called in the creation */
|
| 223 |
/* of a graph (unless it is a call to persp) */
|
223 |
/* of a graph (unless it is a call to persp) */
|
| 224 |
|
224 |
|
| 225 |
/* udpated per plot.new */
|
225 |
/* udpated per plot.new */
|
| 226 |
|
226 |
|
| 227 |
double xNDCPerChar; /* Nominal character width (NDC) */
|
227 |
double xNDCPerChar; /* Nominal character width (NDC) */
|
| 228 |
double yNDCPerChar; /* Nominal character height (NDC) */
|
228 |
double yNDCPerChar; /* Nominal character height (NDC) */
|
| 229 |
double xNDCPerLine; /* Nominal line width (NDC) */
|
229 |
double xNDCPerLine; /* Nominal line width (NDC) */
|
| 230 |
double yNDCPerLine; /* Nominal line height (NDC) */
|
230 |
double yNDCPerLine; /* Nominal line height (NDC) */
|
| 231 |
double xNDCPerInch; /* xNDC -> Inches */
|
231 |
double xNDCPerInch; /* xNDC -> Inches */
|
| 232 |
double yNDCPerInch; /* yNDC -> Inches */
|
232 |
double yNDCPerInch; /* yNDC -> Inches */
|
| 233 |
|
233 |
|
| 234 |
/* updated per plot.new and if inner2dev changes */
|
234 |
/* updated per plot.new and if inner2dev changes */
|
| 235 |
|
235 |
|
| 236 |
GTrans fig2dev; /* Figure to device */
|
236 |
GTrans fig2dev; /* Figure to device */
|
| 237 |
|
237 |
|
| 238 |
/* udpated per DevNewPlot and if ndc2dev changes */
|
238 |
/* udpated per DevNewPlot and if ndc2dev changes */
|
| 239 |
|
239 |
|
| 240 |
GTrans inner2dev; /* Inner region to device */
|
240 |
GTrans inner2dev; /* Inner region to device */
|
| 241 |
|
241 |
|
| 242 |
/* udpated per device resize */
|
242 |
/* udpated per device resize */
|
| 243 |
|
243 |
|
| 244 |
GTrans ndc2dev; /* NDC to raw device */
|
244 |
GTrans ndc2dev; /* NDC to raw device */
|
| 245 |
|
245 |
|
| 246 |
/* updated per plot.new and per plot.window */
|
246 |
/* updated per plot.new and per plot.window */
|
| 247 |
|
247 |
|
| 248 |
GTrans win2fig; /* Window to figure mapping */
|
248 |
GTrans win2fig; /* Window to figure mapping */
|
| 249 |
|
249 |
|
| 250 |
/* NOTE: if user has not set fig and/or plt then */
|
250 |
/* NOTE: if user has not set fig and/or plt then */
|
| 251 |
/* they need to be updated per plot.new too */
|
251 |
/* they need to be updated per plot.new too */
|
| 252 |
|
252 |
|
| 253 |
double scale; /* An internal "zoom" factor to apply to ps and lwd */
|
253 |
double scale; /* An internal "zoom" factor to apply to ps and lwd */
|
| 254 |
/* (for fit-to-window resizing in Windows) */
|
254 |
/* (for fit-to-window resizing in Windows) */
|
| 255 |
} GPar;
|
255 |
} GPar;
|
| 256 |
|
256 |
|
| 257 |
/* always remap private functions */
|
257 |
/* always remap private functions */
|
| 258 |
#define copyGPar Rf_copyGPar
|
258 |
#define copyGPar Rf_copyGPar
|
| 259 |
#define FixupCol Rf_FixupCol
|
259 |
#define FixupCol Rf_FixupCol
|
| 260 |
#define FixupLty Rf_FixupLty
|
260 |
#define FixupLty Rf_FixupLty
|
| 261 |
#define FixupLwd Rf_FixupLwd
|
261 |
#define FixupLwd Rf_FixupLwd
|
| 262 |
#define FixupVFont Rf_FixupVFont
|
262 |
#define FixupVFont Rf_FixupVFont
|
| 263 |
#define GInit Rf_GInit
|
263 |
#define GInit Rf_GInit
|
| 264 |
#define labelformat Rf_labelformat
|
264 |
#define labelformat Rf_labelformat
|
| 265 |
#define ProcessInlinePars Rf_ProcessInlinePars
|
265 |
#define ProcessInlinePars Rf_ProcessInlinePars
|
| 266 |
#define recordGraphicOperation Rf_recordGraphicOperation
|
266 |
#define recordGraphicOperation Rf_recordGraphicOperation
|
| 267 |
|
267 |
|
| 268 |
/* NOTE: during replays, call == R_NilValue;
|
268 |
/* NOTE: during replays, call == R_NilValue;
|
| 269 |
---- the following adds readability: */
|
269 |
---- the following adds readability: */
|
| 270 |
Rboolean GRecording(SEXP, pGEDevDesc);
|
270 |
Rboolean GRecording(SEXP, pGEDevDesc);
|
| 271 |
|
271 |
|
| 272 |
/* Default the settings for general graphical parameters
|
272 |
/* Default the settings for general graphical parameters
|
| 273 |
* (i.e., defaults that do not depend on the device type: */
|
273 |
* (i.e., defaults that do not depend on the device type: */
|
| 274 |
void GInit(GPar*);
|
274 |
void GInit(GPar*);
|
| 275 |
|
275 |
|
| 276 |
void copyGPar(GPar *, GPar *);
|
276 |
void copyGPar(GPar *, GPar *);
|
| 277 |
|
277 |
|
| 278 |
/* from graphics.c, used in par.c */
|
278 |
/* from graphics.c, used in par.c */
|
| 279 |
double R_Log10(double);
|
279 |
double R_Log10(double);
|
| 280 |
|
280 |
|
| 281 |
/* from par.c, called in plot.c, plot3d.c */
|
281 |
/* from par.c, called in plot.c, plot3d.c */
|
| 282 |
void ProcessInlinePars(SEXP, pGEDevDesc);
|
282 |
void ProcessInlinePars(SEXP, pGEDevDesc);
|
| 283 |
|
283 |
|
| 284 |
/* from device.c */
|
284 |
/* from device.c */
|
| 285 |
void recordGraphicOperation(SEXP, SEXP, pGEDevDesc);
|
285 |
void recordGraphicOperation(SEXP, SEXP, pGEDevDesc);
|
| 286 |
|
286 |
|
| 287 |
/* some functions that plot.c needs to share with plot3d.c */
|
287 |
/* some functions that plot.c needs to share with plot3d.c */
|
| 288 |
SEXP FixupCol(SEXP, unsigned int);
|
288 |
SEXP FixupCol(SEXP, unsigned int);
|
| 289 |
SEXP FixupLty(SEXP, int);
|
289 |
SEXP FixupLty(SEXP, int);
|
| 290 |
SEXP FixupLwd(SEXP, double);
|
290 |
SEXP FixupLwd(SEXP, double);
|
| 291 |
SEXP FixupVFont(SEXP);
|
291 |
SEXP FixupVFont(SEXP);
|
| 292 |
SEXP labelformat(SEXP);
|
292 |
SEXP labelformat(SEXP);
|
| 293 |
|
293 |
|
| 294 |
/*
|
294 |
/*
|
| 295 |
* Function to generate an R_GE_gcontext from Rf_gpptr info
|
295 |
* Function to generate an R_GE_gcontext from Rf_gpptr info
|
| 296 |
*
|
296 |
*
|
| 297 |
* from graphics.c, used in plot.c, plotmath.c
|
297 |
* from graphics.c, used in plot.c, plotmath.c
|
| 298 |
*/
|
298 |
*/
|
| 299 |
void gcontextFromGP(pGEcontext gc, pGEDevDesc dd);
|
299 |
void gcontextFromGP(pGEcontext gc, pGEDevDesc dd);
|
| 300 |
|
300 |
|
| 301 |
/* From base.c */
|
301 |
/* From base.c */
|
| 302 |
#define gpptr Rf_gpptr
|
302 |
#define gpptr Rf_gpptr
|
| 303 |
#define dpptr Rf_dpptr
|
303 |
#define dpptr Rf_dpptr
|
| 304 |
GPar* Rf_gpptr(pGEDevDesc dd);
|
304 |
GPar* Rf_gpptr(pGEDevDesc dd);
|
| 305 |
GPar* Rf_dpptr(pGEDevDesc dd);
|
305 |
GPar* Rf_dpptr(pGEDevDesc dd);
|
| 306 |
|
306 |
|
| 307 |
#endif /* GRAPHICS_H_ */
|
307 |
#endif /* GRAPHICS_H_ */
|