<\body> > both implements a low-level part of the graphics in C++ and the high-level user interface in . This API describes how both parts interact. The low-level C++ mainly takes care of transforming the graphical markup in a typesetted box. It also provides routines for translating between physical coordinates (relative to the window) into logical coordinates (the local coordinate system of the graphics) and routines for interacting with the typesetted boxes (finding the closest objects to a given point or region or projecting a point on a grid). <\description> The coordinates of the outermost typesetted box. Mouse events are typically passed in these coordinates. The corresponding data type is . The coordinates of the innermost graphics corresponding to the current cursor position. The current grid relative to the graphics for editing objects (this grid may theoretically be different from the grid which is displayed). The current grid consists both of a mathematical type of grid (no grid, cartesian grid, polar grid, etc.), together with special points which correspond either to control points, intersections of curves with the grid, intersections of curves, or self-intersections of curves. A point on the grid is a triple )>, where is a point in graphics coordinates, its distance to the point which was projected on the grid (see below) and the type of grid point with a potential origin. For instance, can be or someting like for a control point corresponding to the tree in the document. <\explain> graphics )> <|explain> Transform a point of the form )> from the editor coordinates into the graphics coordinates. <\explain> editor p)> <|explain> Transform a point of the form )> from the graphics coordinates into the editor coordinates. <\explain> )> <|explain> Given a point (in graphics coordinates), find its projection on \ the current grid, the part of the projection being the distance between and its projection. Note: the routine grid-project can also be used in order to find editable shapes and groups close to the current pointer position. Indeed, the corresponding control points are understood to lie on the grid in our sense. <\explain> ? )> =? )> <|explain> Grid points are ordered by pertinence as a function of type and distance. For instance, control points have higher pertinence than plain grid points and closer grid points are considered better than farther ones. <\explain> )> <|explain> Return the list of all trees in the graphics which intersect a disk with center and radius (in graphics coordinates). <\explain> )> <|explain> Return the list of all trees in the graphics which intersect a rectangle with corners and (in graphics coordinates). <\explain> <|explain> \ Get a bounding box (and other information) about a shape . can be a tree or a scheme tree. <\remark> This section might be extended, since a lot of the graphical intelligence is implemented in the C++ code. For instance, we might want to compute the intersections of two curves inside the Scheme code. Also, when we will allow for user macros, we might want routines which return the graphical expansion of the macro (the constituent elementary shapes, i.e. polylines, splines, etc.).