Graphics Attributes

Much of the behavior of the drawing commands described in pxl-prim is determined by the graphics attributes of the destination drawable (or of the gc, if one is supplied as argument). Following is a list of the graphics attributes and their meaning.


function(V)
How source and destination are combined. Possible values are clear, and, and_reverse, copy, and_inverted, noop, xor, or, nor, equiv, invert, or_reverse, copy_inverted, or_inverted, nand, and set. Default is copy.
plane_mask(V)
A bitmask specifying which planes of destination are affected by operations. Default is all planes (i.e., -1).
foreground(V)
Foreground pixel value. Default is the pixel value for black.
background(V)
Background pixel value. Default is the pixel value for white.
line_width(V)
Width of drawn lines, in pixels. A value of 0 means thin lines. These may be drawn somewhat faster than width 1 lines. Default is 0.
line_style(V)
How (and if) lines are to be dashed. Possible values are solid, double_dash, or on_off_dash. Default is solid.
cap_style(V)
How wide lines are to be capped. Possible values are not_last, butt, round, and projecting. Default is butt.
join_style(V)
How wide connecting lines are to be joined. Possible values are miter, round, and bevel. Default is miter.
fill_style(V)
How filling is to be done. Possible values are solid, tiled, opaque_stippled, and stippled. Default is solid.
fill_rule(V)
How to decide which parts of a figure are to be filled when the lines specifying the figure cross. Possible values are odd_even_rule or winding_rule. Default is odd_even_rule.
arc_mode(V)
How arcs are to be filled. Possible values are pie_slice or chord. Default is pie_slice.
tile(V)
The pixmap for tiling operations. This is only used if file_style(tiled) is selected. Default is a pixmap of unspecified size filled with the foreground color.
stipple(V)
A 1 plane pixmap (a bitmap) for stipple operations. This is only used if file_style(opaque_stippled) or file_style(stippled) is selected. The default is a bitmap of unspecified size filled with 0.
ts_x_origin(V)
X offset for tile and stipple operations. Default is 0.
ts_y_origin(V)
Y offset for tile and stipple operations. Default is 0.
ts_origin(X, Y)
Same as ts_x_origin(X), ts_y_origin(Y).
font(V)
The font used for text display. The default is implementation dependent.
subwindow_mode(V)
Should drawing operations affect mapped subwindows of a windows being drawn into? Possible values are clip_by_children and include_inferiors. Default is clip_by_children.
graphics_exposures(V)
Should graphics exposure events be generated when copying from a window? Possible values are true and false. Default is true.
clip_x_origin(V)
X origin for clipping. Default is 0.
clip_y_origin(V)
Y origin for clipping. Default is 0.
clip_origin(X, Y)
Same as clip_x_origin(X), clip_y_origin(Y).
clip(V)
Specifies how to restrict drawing operations to the destination. V may be none, a bitmap, or a list of rectangle(X, Y, Width, Height) terms. If it is a bitmap, only pixels in the destination corresponding to 1 bits in the bitmap will be affected by drawing. If a list of rectangle/4 terms, only pixels in the destination that fall within one of the rectangles will be affected. Default is none.
clip(List, Order)
same as clip(List), except that List must be a list of rectangle(X, Y, Width, Height) terms, and further, Order describes the order of the terms in the list. Possible values are unsorted, y_sorted, y_x_sorted, and y_x_banded. The default is that this attribute doesn't apply, since by default there is no clipping.
dashes(V)
A list of alternating integer on and off lengths for dashed lines. This attribute is only used when line_style(double_dash) or line_style(on_off_dash) are selected. Default value is [4, 4] (which is the same as [4] since the list is used cyclically).
dash_offset(V)
An integer specifying where in the dashes(V) list to begin drawing. Default is 0.

For more detailed information on particular attributes, see any good book on programming the X Window System. There are several good references on Xlib, the C interface to the X Window System.

If you are still confused about graphics attributes, the easiest, and often most effective, way to understand them is to experiment. ProXL makes this very easy. Simply open a window and use the drawing commands to draw into it. Then experiment with changing graphics attributes until you get the effect you want.