1useDynLib("grid", .registration = TRUE, .fixes = "C_")
2
3import(grDevices)
4importFrom(utils, str)
5
6export(
7       "arcCurvature", "arrow",
8       # Conversion of units
9       "convertUnit", "convertX", "convertY",
10       "convertWidth", "convertHeight",
11       "calcStringMetric",
12       # Deprecated conversion functions
13       "convertNative",
14       "grid.convertWidth", "grid.convertX", "grid.convertY",
15       "grid.convert", "grid.convertHeight",
16       "deviceLoc", "deviceDim",
17
18       "current.viewport", "current.vpPath", "current.vpTree",
19       "current.transform", "current.rotation", "current.parent",
20       "depth", "explode",
21       "engine.display.list",
22       "gpar", "get.gpar",
23       "grid.collection",
24       "grid.copy", "grid.display.list", "grid.draw",
25       "grid.record", "recordGrob", "grid.delay", "delayGrob", "grid.DLapply",
26       "grid.grill",
27       "grid.layout", "grid.locator",
28       "grid.newpage",
29       "grid.plot.and.legend",
30       "grid.pretty",
31       "grid.refresh",
32       "grid.show.layout", "grid.show.viewport",
33
34       "unit",
35       "is.unit",
36       "unitType",
37       "unit.c", "unit.length", "unit.pmax", "unit.pmin", "unit.psum", "unit.rep",
38
39       "stringWidth", "stringHeight", "stringAscent", "stringDescent",
40       "grobX", "grobY", "grobWidth", "grobHeight",
41       "grobAscent", "grobDescent",
42       "absolute.size",
43       "unitType",
44
45       "valid.just", "resolveHJust", "resolveVJust",
46       "resolveRasterSize",
47
48       "linearGradient", "radialGradient", "pattern",
49
50       "viewport", "vpList", "vpStack", "vpTree", "vpPath",
51       "pop.viewport", "push.viewport",
52       "popViewport", "pushViewport",
53       "editViewport", "dataViewport", "plotViewport",
54       "downViewport", "upViewport", "seekViewport",
55       "showViewport",
56
57       "makeContext", "makeContent",
58       "drawDetails", "preDrawDetails", "postDrawDetails",
59       "editDetails",
60       "validDetails",
61       "heightDetails", "widthDetails",
62       "xDetails", "yDetails",
63       "ascentDetails", "descentDetails",
64
65#       "height", "heightDetails",
66#       "width", "widthDetails",
67
68       # Creating and modifying grobs (and gTrees)
69       "is.grob",
70       "grid.grob",
71       "grob", "gList", "gTree", "gPath", "grobTree",
72       "grobName",
73       "grid.get", "grid.set", "grid.add", "grid.remove", "grid.edit",
74       "grid.gedit", "grid.gremove", "grid.gget",
75       "getGrob", "setGrob", "addGrob", "removeGrob", "editGrob", "forceGrob",
76       "gEdit", "gEditList", "applyEdit", "applyEdits",
77       "grid.grab", "grid.grabExpr",
78       "grid.force", "grid.revert",
79       "grid.reorder", "reorderGrob",
80       "grid.cap",
81       "setChildren",
82       "showGrob",
83
84       # Listing grobs and viewports
85       "grid.ls",
86       "nestedListing", "pathListing", "grobPathListing",
87       "grid.grep",
88       # Deprecated
89       "getNames", "childNames",
90
91       # Creating and drawing predefined grobs and gTrees
92       "grid.abline",
93       "grid.arrows", "grid.circle", "grid.clip", "grid.curve",
94       "grid.function",
95       "grid.line.to", "grid.lines", "grid.move.to", "grid.null",
96       "grid.points", "grid.path", "grid.polygon", "grid.polyline",
97       "grid.raster", "grid.rect", "grid.roundrect",
98       "grid.segments", "grid.text", "grid.xspline", "grid.bezier",
99       "arrowsGrob", "circleGrob", "clipGrob", "curveGrob",
100       "functionGrob",
101       "linesGrob", "lineToGrob", "moveToGrob", "nullGrob",
102       "pointsGrob", "pathGrob", "polygonGrob", "polylineGrob",
103       "rasterGrob", "rectGrob", "roundrectGrob",
104       "segmentsGrob", "textGrob", "xsplineGrob", "bezierGrob",
105       "xsplinePoints", "bezierPoints",
106
107       "grobCoords", "grobPoints", "emptyCoords", "isEmptyCoords",
108
109       "grid.xaxis", "grid.yaxis",
110       "xaxisGrob", "yaxisGrob",
111
112       # Frames and packing
113       "grid.frame", "grid.pack", "grid.place",
114       "frameGrob", "packGrob", "placeGrob"
115       )
116
117## Documented as internal but in Paul's first attempt at a sensible
118## export list:
119export("draw.details",
120       "grid.legend", "legendGrob",
121       "grid.multipanel",
122       "grid.panel", "grid.strip",
123       "layoutRegion",
124       "layout.widths", "layout.heights",
125       "viewport.layout", "viewport.transform")
126
127## Manipulated via C code ...
128## export("get.gpar", "grid.top.level.vp")
129
130## <FIXME>
131## In the grid.layout.Rd \example ...
132export("layout.torture")
133## </FIXME>
134
135## S3 methods for generics in base
136S3method("[", "arrow")
137S3method("[", "gList")
138S3method("[", "gpar")
139S3method("[", "unit")
140S3method("[", "vpPath")
141S3method("[<-", "unit")
142S3method("[[", "unit")
143S3method("[[<-", "unit")
144S3method("Ops", "unit")
145S3method("Summary", "unit")
146S3method("as.character", "grob")
147S3method("as.character", "gList")
148S3method("as.character", "path")
149S3method("as.character", "unit")
150S3method("as.character", "viewport")
151S3method("as.character", "vpList")
152S3method("as.character", "vpStack")
153S3method("as.character", "vpTree")
154S3method("as.double", "unit")
155S3method("as.vector", "unit")
156S3method("as.double", "simpleUnit")
157S3method("as.vector", "simpleUnit")
158S3method("format", "unit")
159S3method("print", "grob")
160S3method("print", "gList")
161S3method("print", "unit")
162S3method("print", "viewport")
163S3method("print", "path")
164S3method("print", "gpar")
165S3method("print", "flatGridListing")
166
167## S3 methods for exported generics in grid
168S3method("downViewport", "default")
169S3method("downViewport", "vpPath")
170
171S3method("drawDetails", "arrows")
172S3method("drawDetails", "circle")
173S3method("drawDetails", "grob")
174S3method("drawDetails", "line.to")
175S3method("drawDetails", "lines")
176S3method("drawDetails", "move.to")
177S3method("drawDetails", "points")
178S3method("drawDetails", "pathgrob")
179S3method("drawDetails", "polygon")
180S3method("drawDetails", "polyline")
181S3method("drawDetails", "xspline")
182S3method("drawDetails", "rect")
183S3method("drawDetails", "segments")
184S3method("drawDetails", "text")
185
186S3method("editDetails", "default")
187S3method("editDetails", "xaxis")
188S3method("editDetails", "yaxis")
189
190S3method("grid.draw", "grob")
191S3method("grid.draw", "gList")
192S3method("grid.draw", "gTree")
193S3method("grid.draw", "viewport")
194S3method("grid.draw", "vpPath")
195S3method("grid.draw", "pop")
196S3method("grid.draw", "up")
197
198S3method("gridList", "default")
199S3method("gridList", "grob")
200S3method("gridList", "gList")
201S3method("gridList", "gTree")
202S3method("gridList", "viewport")
203S3method("gridList", "vpList")
204S3method("gridList", "vpStack")
205S3method("gridList", "vpTree")
206S3method("gridList", "vpPath")
207S3method("gridList", "pop")
208S3method("gridList", "up")
209
210S3method("grobCoords", "grob")
211S3method("grobCoords", "gList")
212S3method("grobCoords", "gTree")
213S3method("grobPoints", "move.to")
214S3method("grobPoints", "line.to")
215S3method("grobPoints", "circle")
216S3method("grobPoints", "clip")
217S3method("grobPoints", "lines")
218S3method("grobPoints", "null")
219S3method("grobPoints", "pathgrob")
220S3method("grobPoints", "points")
221S3method("grobPoints", "polygon")
222S3method("grobPoints", "polyline")
223S3method("grobPoints", "rastergrob")
224S3method("grobPoints", "rect")
225S3method("grobPoints", "segments")
226S3method("grobPoints", "text")
227S3method("grobPoints", "xspline")
228
229S3method("grobHeight", "grob")
230S3method("grobHeight", "gList")
231S3method("grobHeight", "gPath")
232S3method("grobHeight", "default")
233S3method("grobWidth", "grob")
234S3method("grobWidth", "gList")
235S3method("grobWidth", "gPath")
236S3method("grobWidth", "default")
237
238S3method("grobX", "grob")
239S3method("grobX", "gList")
240S3method("grobX", "gPath")
241S3method("grobX", "default")
242S3method("grobY", "grob")
243S3method("grobY", "gList")
244S3method("grobY", "gPath")
245S3method("grobY", "default")
246
247S3method("grobAscent", "grob")
248S3method("grobAscent", "gList")
249S3method("grobAscent", "gPath")
250S3method("grobAscent", "default")
251S3method("grobDescent", "grob")
252S3method("grobDescent", "gList")
253S3method("grobDescent", "gPath")
254S3method("grobDescent", "default")
255
256S3method("heightDetails", "arrows")
257S3method("heightDetails", "circle")
258S3method("heightDetails", "curve")
259S3method("heightDetails", "functiongrob")
260S3method("heightDetails", "default")
261S3method("heightDetails", "frame")
262S3method("heightDetails", "lines")
263S3method("heightDetails", "points")
264S3method("heightDetails", "polygon")
265S3method("heightDetails", "polyline")
266S3method("heightDetails", "rect")
267S3method("heightDetails", "roundrect")
268S3method("heightDetails", "segments")
269S3method("heightDetails", "text")
270S3method("heightDetails", "xspline")
271S3method("heightDetails", "beziergrob")
272S3method("heightDetails", "rastergrob")
273#S3method("height.details", "viewport")
274
275S3method("postDraw", "grob")
276S3method("preDraw", "grob")
277S3method("preDraw", "gTree")
278
279S3method("preDrawDetails", "grob")
280
281S3method("postDrawDetails", "grob")
282
283S3method("record", "default")
284S3method("record", "grob")
285S3method("record", "viewport")
286S3method("record", "vpPath")
287
288S3method("validDetails", "arrows")
289S3method("validDetails", "circle")
290S3method("validDetails", "clip")
291S3method("validDetails", "curve")
292S3method("validDetails", "functiongrob")
293S3method("validDetails", "grob")
294S3method("validDetails", "lines")
295S3method("validDetails", "line.to")
296S3method("validDetails", "move.to")
297S3method("validDetails", "polygon")
298S3method("validDetails", "polyline")
299S3method("validDetails", "points")
300S3method("validDetails", "rect")
301S3method("validDetails", "roundrect")
302S3method("validDetails", "segments")
303S3method("validDetails", "text")
304S3method("validDetails", "xspline")
305S3method("validDetails", "beziergrob")
306S3method("validDetails", "rastergrob")
307
308S3method("widthDetails", "arrows")
309S3method("widthDetails", "circle")
310S3method("widthDetails", "curve")
311S3method("widthDetails", "functiongrob")
312S3method("widthDetails", "default")
313S3method("widthDetails", "frame")
314S3method("widthDetails", "lines")
315S3method("widthDetails", "points")
316S3method("widthDetails", "polygon")
317S3method("widthDetails", "polyline")
318S3method("widthDetails", "rect")
319S3method("widthDetails", "roundrect")
320S3method("widthDetails", "segments")
321S3method("widthDetails", "text")
322S3method("widthDetails", "xspline")
323S3method("widthDetails", "beziergrob")
324S3method("widthDetails", "rastergrob")
325#S3method("width.details", "viewport")
326
327S3method("xDetails", "circle")
328S3method("xDetails", "curve")
329S3method("xDetails", "functiongrob")
330S3method("xDetails", "lines")
331S3method("xDetails", "points")
332S3method("xDetails", "polygon")
333S3method("xDetails", "polyline")
334S3method("xDetails", "rect")
335S3method("xDetails", "roundrect")
336S3method("xDetails", "segments")
337S3method("xDetails", "text")
338S3method("xDetails", "xspline")
339S3method("xDetails", "beziergrob")
340S3method("xDetails", "rastergrob")
341
342S3method("yDetails", "circle")
343S3method("yDetails", "curve")
344S3method("yDetails", "functiongrob")
345S3method("yDetails", "lines")
346S3method("yDetails", "points")
347S3method("yDetails", "polygon")
348S3method("yDetails", "polyline")
349S3method("yDetails", "rect")
350S3method("yDetails", "roundrect")
351S3method("yDetails", "segments")
352S3method("yDetails", "text")
353S3method("yDetails", "xspline")
354S3method("yDetails", "beziergrob")
355S3method("yDetails", "rastergrob")
356
357S3method("ascentDetails", "default")
358S3method("ascentDetails", "grob")
359S3method("ascentDetails", "text")
360
361S3method("descentDetails", "default")
362S3method("descentDetails", "text")
363
364S3method("forceGrob", "default")
365S3method("forceGrob", "grob")
366S3method("forceGrob", "gTree")
367
368# S3 methods for internal generics that are used in calls to external fns
369S3method("depth", "viewport")
370S3method("depth", "vpList")
371S3method("depth", "vpStack")
372S3method("depth", "vpTree")
373S3method("depth", "path")
374S3method("explode", "character")
375S3method("explode", "path")
376S3method("drawVP", "viewport")
377S3method("drawVP", "vpList")
378S3method("drawVP", "vpStack")
379S3method("drawVP", "vpTree")
380S3method("drawVP", "vpPath")
381S3method("labelGrob", "grob")
382S3method("labelGrob", "gTree")
383S3method("leafPaths", "viewport")
384S3method("leafPaths", "vpList")
385S3method("leafPaths", "vpStack")
386S3method("leafPaths", "vpTree")
387S3method("leafPaths", "vpPath")
388S3method("pushgrobvp", "viewport")
389S3method("pushgrobvp", "vpPath")
390S3method("popgrobvp", "viewport")
391S3method("popgrobvp", "vpPath")
392S3method("setvpgpar", "viewport")
393S3method("setvpgpar", "vpStack")
394S3method("setvpgpar", "vpList")
395S3method("setvpgpar", "vpTree")
396S3method("push.vp", "default")
397S3method("push.vp", "viewport")
398S3method("push.vp", "vpList")
399S3method("push.vp", "vpStack")
400S3method("push.vp", "vpTree")
401S3method("push.vp", "vpPath")
402
403# S3 method for generic dim (in base)
404S3method("dim", "layout")
405
406# S3 method for generic rep (in base)
407S3method("rep", "unit")
408S3method("rep", "arrow")
409
410# S3 method for generic length (in base)
411S3method("length", "arrow")
412
413# S3 method for generic str (in utils)
414S3method("str", "arrow")
415
416S3method("makeContent", "default")
417S3method("makeContent", "beziergrob")
418S3method("makeContent", "roundrect")
419S3method("makeContent", "curve")
420S3method("makeContent", "functiongrob")
421S3method("makeContent", "delayedgrob")
422S3method("makeContent", "xaxis")
423S3method("makeContent", "yaxis")
424S3method("makeContent", "forcedgrob")
425
426S3method("makeContext", "roundrect")
427S3method("makeContext", "frame")
428S3method("makeContext", "cellGrob")
429S3method("makeContext", "forcedgrob")
430
431S3method("grid.force", "default")
432S3method("grid.force", "grob")
433S3method("grid.force", "character")
434S3method("grid.force", "gPath")
435S3method("grid.revert", "default")
436S3method("grid.revert", "grob")
437S3method("grid.revert", "character")
438S3method("grid.revert", "gPath")
439
440S3method("resolveFill", "default")
441S3method("resolveFill", "GridPattern")
442S3method("resolveFill", "GridGrobPattern")
443S3method("resolveFill", "GridResolvedPattern")
444
445S3method("resolvePattern", "GridLinearGradient")
446S3method("resolvePattern", "GridRadialGradient")
447
448S3method("unresolveFill", "default")
449S3method("unresolveFill", "GridPattern")
450
451S3method("unresolvePattern", "GridPattern")
452S3method("unresolvePattern", "GridResolvedPattern")
453
454S3method("upgradeUnit", "unit")
455S3method("upgradeUnit", "unit.arithmetic")
456S3method("upgradeUnit", "unit.list")
457