Every medium must implement methods for the various graphical drawing generic functions. Furthermore, every sheet that supports the standard output protocol must implement these methods as well; often, the sheet methods will trampoline to the methods on the sheet's medium. All of these generic functions take the same arguments as the non-generic spread function equivalents, except the arguments that are keyword arguments in the non-generic functions are positional arguments in the generic functions. [annotate]
Every medium must implement methods for the various graphical drawing generic functions. All of these generic functions take as (specialized) arguments the medium, followed by the drawing function-specific arguments, followed by the ink, line style (or text style), and clipping region. [annotate]
The drawing function-specific arguments will either be x and y positions, or a sequence of x and y positions. These positions will be in medium coordinates, and must be transformed by applying the medium's device transformation in order to produce device coordinates. Note that the user transformation will have already been applied to the positions when the medium-specific drawing function is called. However, the medium-specific drawing function will still need to apply the device transformation to the positions in order to draw the graphics in the appopriate place on the host window. [annotate]
The ink, line style, text style, and clipping regions arguments are not part of the medium-specific drawing functions. They must be extracted from the medium object. Each medium-specific method will decode the ink, line (or text) style, and clipping region in a port-specific way and communicate it to the underlying port. [annotate]
Using draw-line* as an example, calling any of the drawing functions specified above results in the following series of function calls on a non-output recording sheet: [annotate]
All mediums and all sheets that support the standard output protocol must implement methods for the following generic functions. [annotate]
The method for each of these drawing functions on the most specific, implementation-dependent medium class will transform the coordinates by the device transformation of the medium's sheet, extract the medium's port-specific "drawable", and then invoke a port-specific drawing function (such as xlib:draw-line) to do the actual drawing. [annotate]
An :around on basic-medium for each of the drawing functions will have already transformed the user coordinates to medium coordinates before the most specific, implementation-dependent method is called. [annotate]
Implementation note: CLIM implementations should provide "trampoline" methods on sheets that support the standard output protocol that simply call the same generic function on the medium. Sheets that support output recording will require extra mechanism before delegating to the medium in order to implement such functionality as creating output records and handling scrolling. [annotate]
Draws a point on the medium medium. [annotate] |
Draws a set of points on the medium medium. coord-seq is a sequence of coordinate pairs, which are real numbers. It is an error if coord-seq does not contain an even number of elements. [annotate] |
Draws a line on the medium medium. The line is drawn from (x1,y1) to (x2,y2). [annotate] |
Draws a set of disconnected lines on the medium medium. coord-seq is a sequence of coordinate pairs, which are real numbers. Each successive pair of coordinate pairs is taken as the start and end position of each line. It is an error if coord-seq does not contain an even number of elements. [annotate] |
Draws a polygon or polyline on the medium medium. coord-seq is a sequence of coordinate pairs, which are real numbers. It is an error if coord-seq does not contain an even number of elements. Each successive coordinate pair is taken as the position of one vertex of the polygon. [annotate] |
Draws a rectangle on the medium medium. The corners of the rectangle are at (x1,y1) and (x2,y2). [annotate] |
Draws a set of rectangles on the medium medium. coord-seq is a sequence of coordinate pairs, which are real numbers. It is an error if coord-seq does not contain an even number of elements. Each successive pair of coordinate pairs is taken as the upper-left and lower-right corner of the rectangle. [annotate] |
medium-draw-ellipse* | medium center-x center-y radius-1-dx radius-1-dy radius-2-dx radius-2-dy start-angle end-angle | [Generic Function] |
Draws an ellipse or elliptical arc on the medium medium. The center of the ellipse is at (x,y), and the radii are specified by the two vectors (radius-1-dx,radius-1-dy) and (radius-2-dx,radius-2-dy). [annotate] start-angle and end-angle are real numbers that specify an arc rather than a complete ellipse. Note that the medium and device transformations must be applied to the angles as well. [annotate] |
medium-draw-text* | medium text x y (start 0) end (align-x :left) (align-y :baseline) toward-x toward-y transform-glyphs | [Generic Function] |
Draws a character or a string on the medium medium. The text is drawn starting at (x,y), and towards (toward-x,toward-y). In Some implementations of CLIM, medium-draw-text* may call either medium-draw-string* or medium-draw-character* in order to draw the text. [annotate] Note: There is no medium-draw-string* and no medium-draw-character* in this spec.
Are these supposed to be lower level primitives? [edit]-- Gilbert Baumann 2003-06-02 05:50Z Note: medium-draw-string* and medium-draw-character* appear in Franz's implementation and also appear in the form of port-draw-string* and port-draw-character* in the October 1993 version of CLIM 2.0 specification with a function signature of: port-draw-string* port medium text x y (start 0) end (align-x :left) (align-y :baseline) toward-x toward-y transform-glyphs &optional ink text-style clipping-region [Generic Function ] Maybe these became strictly optional. [edit]-- Charlie McMackin 2024-07-04 16:45Z |
Ensures that all the output sent to medium has reached its destination, and only then return false. This is used by finish-output. [annotate] |
Like medium-finish-output, except that it may return false without waiting for the output to complete. This is used by force-output. [annotate] |
Clears an area on the medium medium by filling the rectangle whose edges are at left, top, right, and bottom with the medium's background ink. left, top, right, and bottom are in thed medium's coordinate system. [annotate] The default method on basic-medium simply uses draw-rectangle* to clear the area. Some host window systems has special functions that are faster than draw-rectangle*. [annotate] Note: It is worth noting, that unlike medium-draw-rectangle*, medium-clear-area is expected to do a "source" operation not "over" from the composition point of view. Otherwise, if the background ink is translucent, we get garbage result. [edit]-- Daniel Kochmanski 2024-06-05 12:21Z |
Causes an audible sound to be played on the medium. The default method does nothing. [annotate] |