Next: , Previous: , Up: Low-level X Interface   [Contents][Index]


25.6 X Drawing

Function: x-clear-window window

Clear the window associated with window to its background color.

Function: x-copy-area window gc (x . y) (width . height) (dest-x . dest-y)

Copy a region of window with top-left corner (x, y) and dimensions (width, height) to the position (dest-x, dest-y) using gc.

Function: x-create-gc window attrs

Create a new GC for the specified window window. Attrs is an alist mapping attributes to values. Allowed attribute names are foreground, background, line-width, line-style, cap-style, join-style, fill-style, fill-rule, arc-mode, tile, stipple, ts-x-origin, ts-y-origin, clip-mask, clip-x-origin, clip-y-origin and function.

Function: x-change-gc gc attrs

Sets attributes of the X Graphical Context. Attrs is an association list of attribute names and values. Allowed attribute names are foreground, background, line-width, line-style, cap-style, join-style, fill-style, fill-rule, arc-mode, tile, stipple, ts-x-origin, ts-y-origin, clip-mask, clip-x-origin, clip-y-origin and function.

Function: x-create-root-xor-gc

Create a graphics context specialized for XOR-ing onto the root window. This is used for drawing outlines for window movement.

Function: x-destroy-gc gc

Destroy the X graphics context gc.

Function: x-draw-arc window gc (x . y) (width . height) (angle1 . angle2)

Draw a single circular or elliptical arc in window using the graphics context gc. The center of the circle or ellipse is the center of an imaginary rectangle at (x, y). The major and minor axes are the (width, height) of that rectangle. The arc sweeps from angle1 to angle2; positive angles are rotated counter-clockwise from zero, and negative angles are rotated clockwise from zero.

Function: x-draw-image image window (x . y) #!optional (width . height)

Render the image object image in window at position (x, y). If width and height are defined the image is first scaled to these dimensions; otherwise it is drawn using its natural dimensions.

Function: x-draw-line window gc (x1 . y1) (x2 . y2)

Draw a line from (x1, y1) to (x2, y2) in window using the graphics context gc.

Function: x-draw-rectangle window gc (x . y) (width . height)

Draw a rectangle with its top-left corner at (x, y) and dimensions (width, height) in window using the graphics context gc.

Function: x-fill-arc window gc (x . y) (width . height) (angle1 . angle2)

Draw a single filled circular or elliptical arc in window using the graphics context gc. The center of the circle or ellipse is the center of an imaginary rectangle at (x, y). The major and minor axes are the (width, height) of that rectangle. The arc sweeps from angle1 to angle2; positive angles are rotated counter-clockwise from zero, and negative angles are rotated clockwise from zero.

Function: x-fill-polygon window gc points #!optional draw-mode

Draw a single filled polygon in window using the graphics context gc. Points is a list of (x, y) pairs that defines the polygon vertices.

Draw-mode is a hint to the X server on how to draw the polygon; if supplied, it should be one of the symbols convex or non-convex. The default mode is “Convex”.

Function: x-fill-rectangle window gc (x . y) (width . height)

Draw a filled rectangle with its top-left corner at (x, y) and dimensions (width, height) in window using the graphics context gc.

Function: x-gc-p obj

Returns t if obj is an X GraphicsContext object.

Function: x-gc-set-dashes gc pixels-list #!optional offset

Set the dash style of graphics context gc to the value of pixels-list. Pixels-list is a list of cons cells ((pixels-on . pixels-off) ...) indicating runs of on and off pixels in a dash segment. If offset is given, this should be an integer indicating the number of pixels to offset the dashes.

Function: x-window-back-buffer window

Return the X object ID (an integer) for the back buffer associated with window. If no such back buffer exists, the function will attempt to create one.

If the function is unable to find or create a back buffer (possibly because the X server does not support them), it returns the window’s own ID.

Function: x-window-swap-buffers window

Swap the fore and back buffers of the window associated with window. If the X server does not support double buffers, the function quietly does nothing.

Two functions to draw strings are there. If you need to write a message like display-message use x-draw-string. If you need to write on the root-window directly, use x-draw-text.

Function: x-draw-string window gc (x . y) string #!optional font

Draw the specified string at (x, y) in window using the graphics context gc. If font is specified use that font. See also x-draw-text.

Function: x-draw-text window gc (x . y) string

Draw the specified string at (x, y) in window using the graphics context gc. See also x-draw-string.


Next: , Previous: , Up: Low-level X Interface   [Contents][Index]