8.  Graphics Context Functions  

(gcontext? x)

Returns #t iff x is an object of type gcontext.

(gcontext-display gcontext)

Returns the display associated with the given GC.

(create-gcontext . args)

See XCreateGC. This function is used to create a new GC.

The number of arguments must be even. The 1st, 3rd, etc. argument is the name (a symbol) of an attribute to be set when the graphics context is created, the 2nd, 4th, etc. argument is the corresponding value. The attributes can be specified in any order.

Attributes are window (a drawable; mandatory) and all the attributes that can be set by the set-gcontext-attribute! functions below.

(copy-gcontext gcontext drawable)

See XCopyGC. Returns a copy of gcontext (associated with the specified drawable).

(free-gcontext gcontext)

See XFreeGC.

(query-best-size display width height shape)

See XQueryBestSize. shape is a symbol (cursor, tile, or stipple). Returns a pair of integers (result width and result height).

(query-best-cursor display width height)
(query-best-tile display width height)
(query-best-stipple display width height)

See XQueryBestSize. Invokes query-best-size with the given arguments and a shape of cursor, tile, or stipple, respectively.

(gcontext-function gcontext)
(gcontext-plane-mask gcontext)
(gcontext-foreground gcontext)
(gcontext-background gcontext)
(gcontext-line-width gcontext)
(gcontext-line-style gcontext)
(gcontext-cap-style gcontext)
(gcontext-join-style gcontext)
(gcontext-fill-style gcontext)
(gcontext-fill-rule gcontext)
(gcontext-arc-mode gcontext)
(gcontext-tile gcontext)
(gcontext-stipple gcontext)
(gcontext-ts-x gcontext)
(gcontext-ts-y gcontext)
(gcontext-subwindow-mode gcontext)
(gcontext-exposures gcontext)
(gcontext-clip-x gcontext)
(gcontext-clip-y gcontext)
(gcontext-dash-offset gcontext)

See XGetGCValues. Returns the logical operation, plane mask, foreground and background pixel value, line width and style, cap and join style, fill style and rule, arc mode, tiling and stippling pixmap, tiling x- and y-origin, subwindow mode, clipping x- and y-origin, and dashed line information of the specified graphics context.

gcontext-function returns a symbol (clear, and, and-reverse, copy, and-inverted, no-op, xor, or, nor, equiv, invert, or-reverse, copy-inverted, nand, or set). gcontext-plane-mask, gcontext-foreground, and gcontext-background return a pixel. gcontext-tile and gcontext-stipple return a pixmap. The line style is a symbol (solid, dash, double-dash); the cap style is a symbol (not-last, butt, round, projecting); the join style is a symbol (miter, round, bevel); the fill style is a symbol (solid, tiled, stippled, opaque-stippled); the fill rule is a symbol (even-odd, winding); the arc mode is a symbol (chord, pie-slice); the subwindow-mode is a symbol (clip-by-children, include-inferiors). gcontext-exposures returns a boolean. All other functions return an integer.

(set-gcontext-function! gcontext value)
(set-gcontext-plane-mask! gcontext value)
(set-gcontext-foreground! gcontext value)
(set-gcontext-background! gcontext value)
(set-gcontext-line-width! gcontext value)
(set-gcontext-line-style! gcontext value)
(set-gcontext-cap-style! gcontext value)
(set-gcontext-join-style! gcontext value)
(set-gcontext-fill-style! gcontext value)
(set-gcontext-fill-rule! gcontext value)
(set-gcontext-arc-mode! gcontext value)
(set-gcontext-tile! gcontext value)
(set-gcontext-stipple! gcontext value)
(set-gcontext-ts-x! gcontext value)
(set-gcontext-ts-y! gcontext value)
(set-gcontext-font! gcontext value)
(set-gcontext-subwindow-mode! gcontext value)
(set-gcontext-exposures! gcontext value)
(set-gcontext-clip-x! gcontext value)
(set-gcontext-clip-y! gcontext value)
(set-gcontext-clip-mask! gcontext value)
(set-gcontext-dash-offset! gcontext value)

See XChangeGC. Sets the logical operation, plane mask, foreground and background pixel value, line width and style, cap and join style, fill style and rule, arc mode, tiling and stippling pixmap, tiling x- and y-origin, font, subwindow mode, clipping x- and y-origin, clipping bitmap, and dashed line information for the specified graphics context.

The value argument to set-gcontext-font! is a font, and the value argument to set-gcontext-clip-mask! is a pixmap. For the types of the value argument of the other functions see the return values of the gcontext- functions above.

(set-gcontext-clip-rectangles! gcontext x y rectangles ordering)

See XSetClipRectangles. x and y are integers (the coordinates of the clip-mask origin). rectangles is a vector of lists of four integers (x, y, width, and height of each rectangle). ordering is a symbol (unsorted, y-sorted, yx-sorted, or yx-banded).

(set-gcontext-dashlist! gcontext dash-offset dash-list)

See XSetDashes. dash-offset is an integer. dash-list is a vector of integers between 0 and 255.


Markup created by unroff 1.0,    September 24, 1996,    net@informatik.uni-bremen.de