| 29921 |
ripley |
1 |
/*
|
|
|
2 |
* R : A Computer Language for Statistical Data Analysis
|
| 59039 |
ripley |
3 |
* Copyright (C) 2001-11 The R Core Team.
|
| 29921 |
ripley |
4 |
*
|
| 71657 |
plummer |
5 |
* This header file is free software; you can redistribute it and/or modify
|
| 29921 |
ripley |
6 |
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
7 |
* the Free Software Foundation; either version 2.1 of the License, or
|
|
|
8 |
* (at your option) any later version.
|
|
|
9 |
*
|
| 71657 |
plummer |
10 |
* This file is part of R. R is distributed under the terms of the
|
|
|
11 |
* GNU General Public License, either Version 2, June 1991 or Version 3,
|
|
|
12 |
* June 2007. See doc/COPYRIGHTS for details of the copyright status of R.
|
|
|
13 |
*
|
| 29921 |
ripley |
14 |
* This program is distributed in the hope that it will be useful,
|
|
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
17 |
* GNU Lesser General Public License for more details.
|
|
|
18 |
*
|
|
|
19 |
* You should have received a copy of the GNU Lesser General Public License
|
| 42308 |
ripley |
20 |
* along with this program; if not, a copy is available at
|
| 68949 |
ripley |
21 |
* https://www.R-project.org/Licenses/
|
| 29921 |
ripley |
22 |
*/
|
| 17204 |
hornik |
23 |
|
| 44154 |
ripley |
24 |
/* Used by graphics.c, grid and by third-party graphics devices */
|
| 29921 |
ripley |
25 |
|
| 34747 |
ripley |
26 |
#ifndef R_GRAPHICSENGINE_H_
|
|
|
27 |
#define R_GRAPHICSENGINE_H_
|
|
|
28 |
|
|
|
29 |
#ifdef __cplusplus
|
|
|
30 |
extern "C" {
|
|
|
31 |
#endif
|
|
|
32 |
|
| 32815 |
murrell |
33 |
/*
|
|
|
34 |
* The current graphics engine (including graphics device) API version
|
|
|
35 |
* MUST be integer
|
| 57122 |
maechler |
36 |
*
|
|
|
37 |
* This number should be bumped whenever there are changes to
|
| 32815 |
murrell |
38 |
* GraphicsEngine.h or GraphicsDevice.h so that add-on packages
|
|
|
39 |
* that compile against these headers (graphics systems such as
|
|
|
40 |
* graphics and grid; graphics devices such as gtkDevice, RSvgDevice)
|
|
|
41 |
* can detect any version mismatch.
|
|
|
42 |
*
|
|
|
43 |
* Version 1: Introduction of the version number.
|
| 34785 |
murrell |
44 |
* Version 2: GEDevDesc *dd dropped from GEcontourLines().
|
| 56854 |
ripley |
45 |
* Version 3: R_GE_str2col() added to API. (r41887)
|
| 44308 |
ripley |
46 |
* Version 4: UTF-8 text hooks, useRotatedTextInContour,
|
| 44418 |
ripley |
47 |
* add newFrameConfirm() to NewDevDesc.
|
| 44412 |
ripley |
48 |
* New API: GEaddDevice[2] GEgetDevice, GEkillDevice,
|
| 56854 |
ripley |
49 |
* ndevNumber. (R 2.7.0)
|
| 44404 |
ripley |
50 |
* Version 5: Clean up 1.4.0/2.0.0 changes!
|
| 44308 |
ripley |
51 |
* Remove newDevStruct from GEDevDesc and NewDevDesc.
|
| 44404 |
ripley |
52 |
* Remove asp, dot(), hold(), open() from NewDevDesc.
|
|
|
53 |
* Move displayList, DLlastElt, savedSnapshot from
|
|
|
54 |
* NewDevDesc to GEDevDesc.
|
| 56854 |
ripley |
55 |
* Add 'ask' to GEDevDesc. (R 2.8.0)
|
|
|
56 |
* Version 6: Add dev_Raster() and dev_Cap() (R 2.11.0)
|
| 57122 |
maechler |
57 |
* Version 7: Change graphics event handling, adding eventEnv and eventHelper()
|
| 56854 |
ripley |
58 |
* to DevDesc. (R 2.12.0)
|
|
|
59 |
* Version 8: Add dev_Path() (R 2.12.0)
|
| 57122 |
maechler |
60 |
* Version 9: Add dev_HoldFlush(), haveTrans*, haveRaster,
|
| 56854 |
ripley |
61 |
* haveCapture, haveLocator. (R 2.14.0)
|
| 61351 |
ripley |
62 |
* Version 10: For R 3.0.0. Typedef and use 'rcolor',
|
|
|
63 |
* Remove name2col (R_GE_str2col does the job).
|
| 69314 |
murrell |
64 |
* Version 11: For R 3.3.0.
|
|
|
65 |
* Official support for saving/restoring display lists
|
|
|
66 |
* across R sessions (via recordPlot() and replayPlot())
|
|
|
67 |
* - added grid DL to snapshots (used to be NULL)
|
|
|
68 |
* - added this version number to snapshots (as attribute)
|
|
|
69 |
* - added R version number to snapshots (as attribute)
|
|
|
70 |
* - added pkgName to graphics system state info (as attribute)
|
| 72261 |
murrell |
71 |
* Version 12: For R 3.4.0
|
| 72758 |
ripley |
72 |
* Added canGenIdle, doIdle() and doesIdle() to devices.
|
| 32815 |
murrell |
73 |
*/
|
|
|
74 |
|
| 72261 |
murrell |
75 |
#define R_GE_version 12
|
| 32815 |
murrell |
76 |
|
| 44195 |
ripley |
77 |
int R_GE_getVersion(void);
|
| 32815 |
murrell |
78 |
|
|
|
79 |
void R_GE_checkVersionOrDie(int version);
|
|
|
80 |
|
| 57122 |
maechler |
81 |
/* The graphics engine will only accept locations and dimensions
|
| 17204 |
hornik |
82 |
* in native device coordinates, but it provides the following functions
|
| 57122 |
maechler |
83 |
* for converting between a couple of simple alternative coordinate
|
| 17204 |
hornik |
84 |
* systems and device coordinates:
|
|
|
85 |
* DEVICE = native units of the device
|
| 57122 |
maechler |
86 |
* NDC = Normalised device coordinates
|
| 17204 |
hornik |
87 |
* INCHES = inches (!)
|
|
|
88 |
* CM = centimetres (!!)
|
|
|
89 |
*/
|
|
|
90 |
|
|
|
91 |
typedef enum {
|
|
|
92 |
GE_DEVICE = 0, /* native device coordinates (rasters) */
|
|
|
93 |
GE_NDC = 1, /* normalised device coordinates x=(0,1), y=(0,1) */
|
|
|
94 |
GE_INCHES = 2,
|
|
|
95 |
GE_CM = 3
|
|
|
96 |
} GEUnit;
|
|
|
97 |
|
|
|
98 |
#define MAX_GRAPHICS_SYSTEMS 24
|
|
|
99 |
|
|
|
100 |
typedef enum {
|
|
|
101 |
/* In response to this event, the registered graphics system
|
|
|
102 |
* should allocate and initialise the systemSpecific structure
|
| 57122 |
maechler |
103 |
*
|
| 51056 |
murrell |
104 |
* Should return R_NilValue on failure so that engine
|
|
|
105 |
* can tidy up memory allocation
|
| 17204 |
hornik |
106 |
*/
|
|
|
107 |
GE_InitState = 0,
|
|
|
108 |
/* This event gives the registered system a chance to undo
|
|
|
109 |
* anything done in the initialisation.
|
|
|
110 |
*/
|
|
|
111 |
GE_FinaliseState = 1,
|
|
|
112 |
/* This is sent by the graphics engine prior to initialising
|
|
|
113 |
* the display list. It give the graphics system the chance
|
|
|
114 |
* to squirrel away information it will need for redrawing the
|
|
|
115 |
* the display list
|
|
|
116 |
*/
|
|
|
117 |
GE_SaveState = 2,
|
|
|
118 |
/* This is sent by the graphics engine prior to replaying the
|
|
|
119 |
* display list. It gives the graphics system the chance to
|
|
|
120 |
* restore any information it saved on the GE_SaveState event
|
|
|
121 |
*/
|
|
|
122 |
GE_RestoreState = 6,
|
|
|
123 |
/* Copy system state information to the current device.
|
|
|
124 |
* This is used when copying graphics from one device to another
|
|
|
125 |
* so all the graphics system needs to do is to copy across
|
|
|
126 |
* the bits required for the display list to draw faithfully
|
|
|
127 |
* on the new device.
|
|
|
128 |
*/
|
|
|
129 |
GE_CopyState = 3,
|
|
|
130 |
/* Create a snapshot of the system state that is sufficient
|
|
|
131 |
* for the current "image" to be reproduced
|
|
|
132 |
*/
|
|
|
133 |
GE_SaveSnapshotState = 4,
|
|
|
134 |
/* Restore the system state that is saved by GE_SaveSnapshotState
|
|
|
135 |
*/
|
|
|
136 |
GE_RestoreSnapshotState = 5,
|
| 57122 |
maechler |
137 |
/* When replaying the display list, the graphics engine
|
|
|
138 |
* checks, after each replayed action, that the action
|
| 17204 |
hornik |
139 |
* produced valid output. This is the graphics system's
|
|
|
140 |
* chance to say that the output is crap (in which case the
|
|
|
141 |
* graphics engine will abort the display list replay).
|
|
|
142 |
*/
|
| 17270 |
murrell |
143 |
GE_CheckPlot = 7,
|
|
|
144 |
/* The device wants to scale the current pointsize
|
|
|
145 |
* (for scaling an image)
|
| 57122 |
maechler |
146 |
* This is not a nice general solution, but a quick fix for
|
| 17270 |
murrell |
147 |
* the Windows device.
|
|
|
148 |
*/
|
|
|
149 |
GE_ScalePS = 8
|
| 17204 |
hornik |
150 |
} GEevent;
|
|
|
151 |
|
| 44271 |
ripley |
152 |
/*
|
|
|
153 |
* Some line end/join constants
|
|
|
154 |
*/
|
|
|
155 |
typedef enum {
|
|
|
156 |
GE_ROUND_CAP = 1,
|
|
|
157 |
GE_BUTT_CAP = 2,
|
|
|
158 |
GE_SQUARE_CAP = 3
|
|
|
159 |
} R_GE_lineend;
|
|
|
160 |
|
|
|
161 |
typedef enum {
|
|
|
162 |
GE_ROUND_JOIN = 1,
|
|
|
163 |
GE_MITRE_JOIN = 2,
|
|
|
164 |
GE_BEVEL_JOIN = 3
|
|
|
165 |
} R_GE_linejoin;
|
|
|
166 |
|
| 57122 |
maechler |
167 |
/*
|
|
|
168 |
* A structure containing graphical parameters
|
| 44271 |
ripley |
169 |
*
|
|
|
170 |
* This is how graphical parameters are passed from graphics systems
|
|
|
171 |
* to the graphics engine AND from the graphics engine to graphics
|
|
|
172 |
* devices.
|
|
|
173 |
*
|
|
|
174 |
* Devices are not *required* to honour graphical parameters
|
|
|
175 |
* (e.g., alpha transparency is going to be tough for some)
|
|
|
176 |
*/
|
|
|
177 |
typedef struct {
|
|
|
178 |
/*
|
|
|
179 |
* Colours
|
|
|
180 |
*
|
|
|
181 |
* NOTE: Alpha transparency included in col & fill
|
|
|
182 |
*/
|
|
|
183 |
int col; /* pen colour (lines, text, borders, ...) */
|
|
|
184 |
int fill; /* fill colour (for polygons, circles, rects, ...) */
|
|
|
185 |
double gamma; /* Gamma correction */
|
| 57122 |
maechler |
186 |
/*
|
| 44271 |
ripley |
187 |
* Line characteristics
|
|
|
188 |
*/
|
|
|
189 |
double lwd; /* Line width (roughly number of pixels) */
|
|
|
190 |
int lty; /* Line type (solid, dashed, dotted, ...) */
|
|
|
191 |
R_GE_lineend lend; /* Line end */
|
|
|
192 |
R_GE_linejoin ljoin; /* line join */
|
|
|
193 |
double lmitre; /* line mitre */
|
|
|
194 |
/*
|
|
|
195 |
* Text characteristics
|
|
|
196 |
*/
|
|
|
197 |
double cex; /* Character expansion (font size = fontsize*cex) */
|
|
|
198 |
double ps; /* Font size in points */
|
|
|
199 |
double lineheight; /* Line height (multiply by font size) */
|
|
|
200 |
int fontface; /* Font face (plain, italic, bold, ...) */
|
|
|
201 |
char fontfamily[201]; /* Font family */
|
|
|
202 |
} R_GE_gcontext;
|
|
|
203 |
|
| 44301 |
ripley |
204 |
typedef R_GE_gcontext* pGEcontext;
|
|
|
205 |
|
| 57122 |
maechler |
206 |
|
| 46180 |
ripley |
207 |
#include <R_ext/GraphicsDevice.h> /* needed for DevDesc */
|
| 44271 |
ripley |
208 |
|
| 19966 |
duncan |
209 |
typedef struct _GEDevDesc GEDevDesc;
|
| 17204 |
hornik |
210 |
|
| 19966 |
duncan |
211 |
typedef SEXP (* GEcallback)(GEevent, GEDevDesc *, SEXP);
|
|
|
212 |
|
| 57122 |
maechler |
213 |
typedef struct {
|
| 17204 |
hornik |
214 |
/* An array of information about each graphics system that
|
|
|
215 |
* has registered with the graphics engine.
|
|
|
216 |
* This is used to store graphics state for each graphics
|
|
|
217 |
* system on each device.
|
|
|
218 |
*/
|
|
|
219 |
void *systemSpecific;
|
| 57122 |
maechler |
220 |
/*
|
| 17204 |
hornik |
221 |
* An array of function pointers, one per graphics system that
|
|
|
222 |
* has registered with the graphics engine.
|
|
|
223 |
*
|
|
|
224 |
* system_Callback is called when the graphics engine wants
|
|
|
225 |
* to give a graphics system the chance to play with its
|
|
|
226 |
* device-specific information (stored in systemSpecific)
|
|
|
227 |
* There are two parameters: an "event" to tell the graphics
|
|
|
228 |
* system why the graphics engine has called this function,
|
|
|
229 |
* and the systemSpecific pointer. The graphics engine
|
|
|
230 |
* has to pass the systemSpecific pointer because only
|
|
|
231 |
* the graphics engine will know what array index to use.
|
|
|
232 |
*/
|
|
|
233 |
GEcallback callback;
|
|
|
234 |
} GESystemDesc;
|
|
|
235 |
|
| 19966 |
duncan |
236 |
struct _GEDevDesc {
|
| 57122 |
maechler |
237 |
/*
|
| 30832 |
murrell |
238 |
* Stuff that the devices can see (and modify).
|
|
|
239 |
* All detailed in GraphicsDevice.h
|
|
|
240 |
*/
|
| 44364 |
ripley |
241 |
pDevDesc dev;
|
| 30832 |
murrell |
242 |
/*
|
|
|
243 |
* Stuff about the device that only the graphics engine sees
|
|
|
244 |
* (the devices don't see it).
|
| 17204 |
hornik |
245 |
*/
|
| 44352 |
ripley |
246 |
Rboolean displayListOn; /* toggle for display list status */
|
|
|
247 |
SEXP displayList; /* display list */
|
|
|
248 |
SEXP DLlastElt; /* A pointer to the end of the display list
|
|
|
249 |
to avoid tranversing pairlists */
|
|
|
250 |
SEXP savedSnapshot; /* The last element of the display list
|
|
|
251 |
* just prior to when the display list
|
|
|
252 |
* was last initialised
|
|
|
253 |
*/
|
|
|
254 |
Rboolean dirty; /* Has the device received any output? */
|
| 31938 |
murrell |
255 |
Rboolean recordGraphics; /* Should a graphics call be stored
|
|
|
256 |
* on the display list?
|
|
|
257 |
* Set to FALSE by do_recordGraphics,
|
| 57122 |
maechler |
258 |
* do_dotcallgr, and do_Externalgr
|
| 31938 |
murrell |
259 |
* so that nested calls are not
|
|
|
260 |
* recorded on the display list
|
|
|
261 |
*/
|
| 57122 |
maechler |
262 |
/*
|
| 30832 |
murrell |
263 |
* Stuff about the device that only graphics systems see.
|
|
|
264 |
* The graphics engine has no idea what is in here.
|
|
|
265 |
* Used by graphics systems to store system state per device.
|
|
|
266 |
*/
|
| 17204 |
hornik |
267 |
GESystemDesc *gesd[MAX_GRAPHICS_SYSTEMS];
|
| 44458 |
ripley |
268 |
|
|
|
269 |
/* per-device setting for 'ask' (use NewFrameConfirm) */
|
|
|
270 |
Rboolean ask;
|
| 19966 |
duncan |
271 |
};
|
| 17204 |
hornik |
272 |
|
| 44285 |
ripley |
273 |
typedef GEDevDesc* pGEDevDesc;
|
|
|
274 |
|
| 44259 |
ripley |
275 |
/* functions from devices.c for use by graphics devices */
|
|
|
276 |
|
|
|
277 |
#define desc2GEDesc Rf_desc2GEDesc
|
| 46180 |
ripley |
278 |
/* map DevDesc to enclosing GEDevDesc */
|
| 44364 |
ripley |
279 |
pGEDevDesc desc2GEDesc(pDevDesc dd);
|
| 44285 |
ripley |
280 |
int GEdeviceNumber(pGEDevDesc);
|
| 44412 |
ripley |
281 |
pGEDevDesc GEgetDevice(int);
|
| 44372 |
ripley |
282 |
void GEaddDevice(pGEDevDesc);
|
| 44376 |
ripley |
283 |
void GEaddDevice2(pGEDevDesc, const char *);
|
| 66109 |
ripley |
284 |
void GEaddDevice2f(pGEDevDesc, const char *, const char *);
|
| 44285 |
ripley |
285 |
void GEkillDevice(pGEDevDesc);
|
| 44364 |
ripley |
286 |
pGEDevDesc GEcreateDevDesc(pDevDesc dev);
|
| 44257 |
ripley |
287 |
|
| 44285 |
ripley |
288 |
void GEdestroyDevDesc(pGEDevDesc dd);
|
| 44299 |
ripley |
289 |
void *GEsystemState(pGEDevDesc dd, int index);
|
| 44285 |
ripley |
290 |
void GEregisterWithDevice(pGEDevDesc dd);
|
| 17360 |
murrell |
291 |
void GEregisterSystem(GEcallback callback, int *systemRegisterIndex);
|
| 17204 |
hornik |
292 |
void GEunregisterSystem(int registerIndex);
|
| 44364 |
ripley |
293 |
SEXP GEhandleEvent(GEevent event, pDevDesc dev, SEXP data);
|
| 17204 |
hornik |
294 |
|
| 38705 |
ripley |
295 |
#define fromDeviceX GEfromDeviceX
|
|
|
296 |
#define toDeviceX GEtoDeviceX
|
|
|
297 |
#define fromDeviceY GEfromDeviceY
|
|
|
298 |
#define toDeviceY GEtoDeviceY
|
|
|
299 |
#define fromDeviceWidth GEfromDeviceWidth
|
|
|
300 |
#define toDeviceWidth GEtoDeviceWidth
|
|
|
301 |
#define fromDeviceHeight GEfromDeviceHeight
|
|
|
302 |
#define toDeviceHeight GEtoDeviceHeight
|
|
|
303 |
|
| 57122 |
maechler |
304 |
double fromDeviceX(double value, GEUnit to, pGEDevDesc dd);
|
| 44285 |
ripley |
305 |
double toDeviceX(double value, GEUnit from, pGEDevDesc dd);
|
| 57122 |
maechler |
306 |
double fromDeviceY(double value, GEUnit to, pGEDevDesc dd);
|
| 44285 |
ripley |
307 |
double toDeviceY(double value, GEUnit from, pGEDevDesc dd);
|
| 57122 |
maechler |
308 |
double fromDeviceWidth(double value, GEUnit to, pGEDevDesc dd);
|
| 44285 |
ripley |
309 |
double toDeviceWidth(double value, GEUnit from, pGEDevDesc dd);
|
| 57122 |
maechler |
310 |
double fromDeviceHeight(double value, GEUnit to, pGEDevDesc dd);
|
| 44285 |
ripley |
311 |
double toDeviceHeight(double value, GEUnit from, pGEDevDesc dd);
|
| 17204 |
hornik |
312 |
|
| 44264 |
ripley |
313 |
/*-------------------------------------------------------------------
|
|
|
314 |
*
|
|
|
315 |
* COLOUR CODE is concerned with the internals of R colour representation
|
|
|
316 |
*
|
|
|
317 |
* From colors.c, used in par.c, grid/src/gpar.c
|
|
|
318 |
*/
|
|
|
319 |
|
| 61351 |
ripley |
320 |
typedef unsigned int rcolor;
|
|
|
321 |
|
| 44264 |
ripley |
322 |
#define RGBpar Rf_RGBpar
|
| 44369 |
ripley |
323 |
#define RGBpar3 Rf_RGBpar3
|
| 44264 |
ripley |
324 |
#define col2name Rf_col2name
|
|
|
325 |
|
| 44312 |
ripley |
326 |
/* Convert an element of a R colour specification (which might be a
|
|
|
327 |
number or a string) into an internal colour specification. */
|
| 61351 |
ripley |
328 |
rcolor RGBpar(SEXP, int);
|
|
|
329 |
rcolor RGBpar3(SEXP, int, rcolor);
|
| 44357 |
ripley |
330 |
|
| 44312 |
ripley |
331 |
/* Convert an internal colour specification to/from a colour name */
|
| 61351 |
ripley |
332 |
const char *col2name(rcolor col); /* used in par.c, grid */
|
| 44357 |
ripley |
333 |
|
| 44369 |
ripley |
334 |
/* Convert either a name or a #RRGGBB[AA] string to internal.
|
|
|
335 |
Because people were using it, it also converts "1", "2" ...
|
|
|
336 |
to a colour in the palette, and "0" to transparent white.
|
|
|
337 |
*/
|
| 61351 |
ripley |
338 |
rcolor R_GE_str2col(const char *s);
|
| 44264 |
ripley |
339 |
|
|
|
340 |
|
| 44312 |
ripley |
341 |
|
| 17204 |
hornik |
342 |
/*
|
|
|
343 |
* Some Notes on Line Textures
|
|
|
344 |
*
|
|
|
345 |
* Line textures are stored as an array of 4-bit integers within
|
|
|
346 |
* a single 32-bit word. These integers contain the lengths of
|
|
|
347 |
* lines to be drawn with the pen alternately down and then up.
|
|
|
348 |
* The device should try to arrange that these values are measured
|
|
|
349 |
* in points if possible, although pixels is ok on most displays.
|
|
|
350 |
*
|
|
|
351 |
* If newlty contains a line texture description it is decoded
|
|
|
352 |
* as follows:
|
|
|
353 |
*
|
|
|
354 |
* ndash = 0;
|
|
|
355 |
* for(i=0 ; i<8 && newlty & 15 ; i++) {
|
|
|
356 |
* dashlist[ndash++] = newlty & 15;
|
|
|
357 |
* newlty = newlty>>4;
|
|
|
358 |
* }
|
|
|
359 |
* dashlist[0] = length of pen-down segment
|
|
|
360 |
* dashlist[1] = length of pen-up segment
|
|
|
361 |
* etc
|
|
|
362 |
*
|
|
|
363 |
* An integer containing a zero terminates the pattern. Hence
|
|
|
364 |
* ndash in this code fragment gives the length of the texture
|
|
|
365 |
* description. If a description contains an odd number of
|
|
|
366 |
* elements it is replicated to create a pattern with an
|
|
|
367 |
* even number of elements. (If this is a pain, do something
|
|
|
368 |
* different its not crucial).
|
|
|
369 |
*
|
|
|
370 |
*/
|
|
|
371 |
|
|
|
372 |
/*--- The basic numbered & names line types; Here device-independent:
|
|
|
373 |
e.g. "dashed" == "44", "dotdash" == "1343"
|
|
|
374 |
*/
|
|
|
375 |
|
| 44154 |
ripley |
376 |
/* NB: was also in Rgraphics.h in R < 2.7.0 */
|
| 17204 |
hornik |
377 |
#define LTY_BLANK -1
|
|
|
378 |
#define LTY_SOLID 0
|
|
|
379 |
#define LTY_DASHED 4 + (4<<4)
|
|
|
380 |
#define LTY_DOTTED 1 + (3<<4)
|
|
|
381 |
#define LTY_DOTDASH 1 + (3<<4) + (4<<8) + (3<<12)
|
|
|
382 |
#define LTY_LONGDASH 7 + (3<<4)
|
|
|
383 |
#define LTY_TWODASH 2 + (2<<4) + (6<<8) + (2<<12)
|
|
|
384 |
|
| 44142 |
ripley |
385 |
R_GE_lineend GE_LENDpar(SEXP value, int ind);
|
|
|
386 |
SEXP GE_LENDget(R_GE_lineend lend);
|
|
|
387 |
R_GE_linejoin GE_LJOINpar(SEXP value, int ind);
|
|
|
388 |
SEXP GE_LJOINget(R_GE_linejoin ljoin);
|
| 30925 |
murrell |
389 |
|
| 44285 |
ripley |
390 |
void GESetClip(double x1, double y1, double x2, double y2, pGEDevDesc dd);
|
| 44500 |
ripley |
391 |
void GENewPage(const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
392 |
void GELine(double x1, double y1, double x2, double y2,
|
| 44500 |
ripley |
393 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
394 |
void GEPolyline(int n, double *x, double *y,
|
| 44500 |
ripley |
395 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
396 |
void GEPolygon(int n, double *x, double *y,
|
| 44500 |
ripley |
397 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
398 |
SEXP GEXspline(int n, double *x, double *y, double *s, Rboolean open,
|
| 36748 |
murrell |
399 |
Rboolean repEnds, Rboolean draw,
|
| 44500 |
ripley |
400 |
const pGEcontext gc, pGEDevDesc dd);
|
| 17204 |
hornik |
401 |
void GECircle(double x, double y, double radius,
|
| 44500 |
ripley |
402 |
const pGEcontext gc, pGEDevDesc dd);
|
| 17204 |
hornik |
403 |
void GERect(double x0, double y0, double x1, double y1,
|
| 44500 |
ripley |
404 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
405 |
void GEPath(double *x, double *y,
|
| 52406 |
murrell |
406 |
int npoly, int *nper,
|
|
|
407 |
Rboolean winding,
|
|
|
408 |
const pGEcontext gc, pGEDevDesc dd);
|
| 50283 |
murrell |
409 |
void GERaster(unsigned int *raster, int w, int h,
|
|
|
410 |
double x, double y, double width, double height,
|
|
|
411 |
double angle, Rboolean interpolate,
|
|
|
412 |
const pGEcontext gc, pGEDevDesc dd);
|
|
|
413 |
SEXP GECap(pGEDevDesc dd);
|
| 44986 |
ripley |
414 |
void GEText(double x, double y, const char * const str, cetype_t enc,
|
| 21060 |
murrell |
415 |
double xc, double yc, double rot,
|
| 44500 |
ripley |
416 |
const pGEcontext gc, pGEDevDesc dd);
|
| 44285 |
ripley |
417 |
void GEMode(int mode, pGEDevDesc dd);
|
| 17204 |
hornik |
418 |
void GESymbol(double x, double y, int pch, double size,
|
| 44500 |
ripley |
419 |
const pGEcontext gc, pGEDevDesc dd);
|
| 17204 |
hornik |
420 |
void GEPretty(double *lo, double *up, int *ndiv);
|
| 57122 |
maechler |
421 |
void GEMetricInfo(int c, const pGEcontext gc,
|
| 17204 |
hornik |
422 |
double *ascent, double *descent, double *width,
|
| 44285 |
ripley |
423 |
pGEDevDesc dd);
|
| 57122 |
maechler |
424 |
double GEStrWidth(const char *str, cetype_t enc,
|
| 44500 |
ripley |
425 |
const pGEcontext gc, pGEDevDesc dd);
|
| 44986 |
ripley |
426 |
double GEStrHeight(const char *str, cetype_t enc,
|
| 44500 |
ripley |
427 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57567 |
murrell |
428 |
void GEStrMetric(const char *str, cetype_t enc, const pGEcontext gc,
|
|
|
429 |
double *ascent, double *descent, double *width,
|
|
|
430 |
pGEDevDesc dd);
|
| 44142 |
ripley |
431 |
int GEstring_to_pch(SEXP pch);
|
| 17204 |
hornik |
432 |
|
| 44142 |
ripley |
433 |
/*-------------------------------------------------------------------
|
|
|
434 |
*
|
|
|
435 |
* LINE TEXTURE CODE is concerned with the internals of R
|
|
|
436 |
* line texture representation.
|
|
|
437 |
*/
|
|
|
438 |
unsigned int GE_LTYpar(SEXP, int);
|
|
|
439 |
SEXP GE_LTYget(unsigned int);
|
|
|
440 |
|
| 50488 |
murrell |
441 |
/*
|
|
|
442 |
* Raster operations
|
|
|
443 |
*/
|
| 50554 |
murrell |
444 |
void R_GE_rasterScale(unsigned int *sraster, int sw, int sh,
|
|
|
445 |
unsigned int *draster, int dw, int dh);
|
| 50488 |
murrell |
446 |
void R_GE_rasterInterpolate(unsigned int *sraster, int sw, int sh,
|
|
|
447 |
unsigned int *draster, int dw, int dh);
|
| 50554 |
murrell |
448 |
void R_GE_rasterRotatedSize(int w, int h, double angle,
|
|
|
449 |
int *wnew, int *hnew);
|
|
|
450 |
void R_GE_rasterRotatedOffset(int w, int h, double angle, int botleft,
|
|
|
451 |
double *xoff, double *yoff);
|
| 57122 |
maechler |
452 |
void R_GE_rasterResizeForRotation(unsigned int *sraster,
|
|
|
453 |
int w, int h,
|
| 50554 |
murrell |
454 |
unsigned int *newRaster,
|
|
|
455 |
int wnew, int hnew,
|
|
|
456 |
const pGEcontext gc);
|
|
|
457 |
void R_GE_rasterRotate(unsigned int *sraster, int w, int h, double angle,
|
| 50608 |
murrell |
458 |
unsigned int *draster, const pGEcontext gc,
|
|
|
459 |
Rboolean perPixelAlpha);
|
| 50488 |
murrell |
460 |
|
| 50554 |
murrell |
461 |
|
| 57122 |
maechler |
462 |
/*
|
|
|
463 |
* From plotmath.c
|
| 19875 |
murrell |
464 |
*/
|
| 57122 |
maechler |
465 |
double GEExpressionWidth(SEXP expr,
|
| 44500 |
ripley |
466 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
467 |
double GEExpressionHeight(SEXP expr,
|
| 44500 |
ripley |
468 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57567 |
murrell |
469 |
void GEExpressionMetric(SEXP expr, const pGEcontext gc,
|
|
|
470 |
double *ascent, double *descent, double *width,
|
|
|
471 |
pGEDevDesc dd);
|
| 19875 |
murrell |
472 |
void GEMathText(double x, double y, SEXP expr,
|
| 57122 |
maechler |
473 |
double xc, double yc, double rot,
|
| 44500 |
ripley |
474 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
475 |
/*
|
| 21060 |
murrell |
476 |
* (End from plotmath.c)
|
| 19875 |
murrell |
477 |
*/
|
|
|
478 |
|
| 57122 |
maechler |
479 |
/*
|
| 44158 |
ripley |
480 |
* From plot3d.c : used in package clines
|
| 21060 |
murrell |
481 |
*/
|
|
|
482 |
SEXP GEcontourLines(double *x, int nx, double *y, int ny,
|
| 34785 |
murrell |
483 |
double *z, double *levels, int nl);
|
| 57122 |
maechler |
484 |
/*
|
| 21060 |
murrell |
485 |
* (End from plot3d.c)
|
|
|
486 |
*/
|
|
|
487 |
|
| 57122 |
maechler |
488 |
/*
|
| 21060 |
murrell |
489 |
* From vfonts.c
|
|
|
490 |
*/
|
| 44986 |
ripley |
491 |
double R_GE_VStrWidth(const char *s, cetype_t enc, const pGEcontext gc, pGEDevDesc dd);
|
| 21060 |
murrell |
492 |
|
| 44986 |
ripley |
493 |
double R_GE_VStrHeight(const char *s, cetype_t enc, const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
494 |
void R_GE_VText(double x, double y, const char * const s, cetype_t enc,
|
| 21060 |
murrell |
495 |
double x_justify, double y_justify, double rotation,
|
| 44500 |
ripley |
496 |
const pGEcontext gc, pGEDevDesc dd);
|
| 57122 |
maechler |
497 |
/*
|
| 21060 |
murrell |
498 |
* (End from vfonts.c)
|
|
|
499 |
*/
|
|
|
500 |
|
| 44154 |
ripley |
501 |
/* Also in Graphics.h */
|
| 17204 |
hornik |
502 |
#define DEG2RAD 0.01745329251994329576
|
|
|
503 |
|
| 44285 |
ripley |
504 |
pGEDevDesc GEcurrentDevice(void);
|
|
|
505 |
Rboolean GEdeviceDirty(pGEDevDesc dd);
|
|
|
506 |
void GEdirtyDevice(pGEDevDesc dd);
|
|
|
507 |
Rboolean GEcheckState(pGEDevDesc dd);
|
|
|
508 |
Rboolean GErecording(SEXP call, pGEDevDesc dd);
|
|
|
509 |
void GErecordGraphicOperation(SEXP op, SEXP args, pGEDevDesc dd);
|
|
|
510 |
void GEinitDisplayList(pGEDevDesc dd);
|
|
|
511 |
void GEplayDisplayList(pGEDevDesc dd);
|
| 17204 |
hornik |
512 |
void GEcopyDisplayList(int fromDevice);
|
| 44285 |
ripley |
513 |
SEXP GEcreateSnapshot(pGEDevDesc dd);
|
|
|
514 |
void GEplaySnapshot(SEXP snapshot, pGEDevDesc dd);
|
| 44195 |
ripley |
515 |
void GEonExit(void);
|
|
|
516 |
void GEnullDevice(void);
|
| 34747 |
ripley |
517 |
|
|
|
518 |
|
| 59105 |
maechler |
519 |
/* From ../../main/plot.c, used by ../../library/grid/src/grid.c : */
|
| 45051 |
ripley |
520 |
#define CreateAtVector Rf_CreateAtVector
|
|
|
521 |
SEXP CreateAtVector(double*, double*, int, Rboolean);
|
| 59105 |
maechler |
522 |
/* From ../../main/graphics.c, used by ../../library/grDevices/src/axis_scales.c : */
|
| 57122 |
maechler |
523 |
#define GAxisPars Rf_GAxisPars
|
|
|
524 |
void GAxisPars(double *min, double *max, int *n, Rboolean log, int axis);
|
| 45051 |
ripley |
525 |
|
| 34747 |
ripley |
526 |
#ifdef __cplusplus
|
|
|
527 |
}
|
|
|
528 |
#endif
|
|
|
529 |
|
|
|
530 |
#endif /* R_GRAPHICSENGINE_ */
|