Next: , Previous: , Up: Graphics Contexts   [Contents][Index]


6.1 Creating Graphics Contexts

To create a graphics context, use create-gcontext.

Function: create-gcontext &key :arc-mode :background (:cache-p t) :cap-style :clip-mask :clip-ordering :clip-x :clip-y :dash-offset :dashes :drawable :exposures :fill-rule :fill-style :font :foreground :function :join-style :line-style :line-width :plane-mask :stipple :subwindow-mode :tile :ts-x :ts-y
:cache-p

Specifies if this graphics context should be cached locally by CLX. If nil then the state is not cached, otherwise a local cache is kept.

:drawable

The drawable whose root and depth are to be associated with this graphics context. This is a required keyword argument.

:arc-mode
:background
:cap-style
:clip-mask
:clip-ordering
:clip-x
:clip-y
:dash-offset
:dashes
:exposures
:fill-rule
:fill-style
:font
:foreground
:function
:join-style
:line-style
:line-width
:plane-mask
:stipple
:subwindow-mode
:tile
:ts-x
:ts-y

Initial attribute values for the graphics context.

Creates, initializes, and returns a graphics context (gcontext). The graphics context can only be used with destination drawables having the same root and depth as the specified :drawable. If :cache-p is non-nil, the graphics context state is cached locally, and changing a component has no effect unless the new value differs from the cached value. Changes to a graphics context (setf and with-gcontext) are always deferred regardless of the cache mode and sent to the server only when required by a local operation or by an explicit call to force-gcontext-changes.

All of the graphics context components are set to the values that are specified by the keyword arguments, except that a value of nil causes the default value to be used. These default values are as follows:

arc-mode:pie-slice
background1
cap-style:butt
clip-mask:none
clip-ordering:unsorted
clip-x0
clip-y0
dash-offset0
dashes4 (that is, the list ’(4, 4))
exposures:on
fill-rule:even-odd
fill-style:solid
fontserver dependent
foreground0
functionboole-1
join-style:miter
line-style:solid
line-width0
plane-maskA bit mask of all ones
stipplePixmap of unspecified size filled with ones
subwindow-mode:clip-by-children
tilePixmap of an unspecified size filled with the foreground pixel (that is, the client-specified pixel if any, or else 0)
ts-x0
ts-y0

Note that foreground and background do not default to any values that are likely to be useful on a color display. Since specifying a nil value means use the default, this implies for clip-mask that an empty rectangle sequence cannot be specified as an empty list; :none must be used instead. Specifying a stringable for font causes an implicit open-font call to occur.

gcontext

Type gcontext.


Next: , Previous: , Up: Graphics Contexts   [Contents][Index]