<<<<<<<<<<<<<<<<

xdrawable(x) Xlib xdrawable(x)

NAME

xdrawable - a destination of graphics operations.

DESCRIPTION

Both pixmaps and windows may be used as destinations of graphics operations. Collectively, these are known as drawables. An xdrawable should never be instantiated since it is an abstract class.

SUPERCLASS

object

INSTANCE VARIABLES

depth is the depth of the drawable. Typical values are 1, 8 and 24.

display is the name of an xdisplay object. The default is the class xdisplay.

gc is the name of an xgc object. There is no default at this time. A graphics context is necessary to do any graphics operations.

height is the height (in pixels) of the drawable.

id is a pointer to an X Window structure or an X Pixmap structure.

screen is the name of an xscreen instance. If no screen is specified, the default screen of the X display is used. The screen is used during creation, so make sure to set this instance variable before you create the drawable.

width is the width (in pixels) of the drawable.

xy is the current x and y for graphics operations such as put_image. xy is specified in pixels.

MESSAGES

@ x y sets the instance variable xy. (synonym to xy=)

copy_area: from_drawable width height copies the area from the argument drawable into this drawable. The xy of both the from_drawable and this drawable must be set to indicate the origins in the source and destination.

copy_plane: from_drawable width height plane copies a plane from the argument drawable into this drawable. The xy of both the from_drawable and this drawable must be set to indicate the origins in the source and destination.

depth= depth sets the depth instance variable.

depth? returns the value of the depth instance variable on the argument stack.

display= display_object_name sets the display instance variable.

display? returns the value of the display instance variable on the argument stack.

draw_arc: x y width height angle1 angle2 draws an arc at point (x,y) with the specified width and height starting at angle1 for angle2 degrees. Angles are specified in degrees. (Note that this is different from Xlib, where angles are specified in 64ths of degrees.)

draw_arcs: x y width height angle1 angle2 (repeat for each arc) draws arcs specified in arguments. See draw_arc: for argument descriptions.

draw_image_string: string draws a string using both the foreground and background colors of the graphics context.

draw_line: x1 y1 x2 y2 draws a line from (x1, y1) to (x2, y2).

draw_lines: x1 y1 (repeat for each coordinate) mode draws lines for the coordinates specified. The mode indicates whether the coordinates are relative to the origin (0 for CoordModeOrigin) or to the previous coordinate in the argument list (1 for CoordModePrevious).

draw_point: x y draws a point at position (x, y), where x and y are specified in pixels.

draw_points: x y (repeat for each point) draws points at (x, y) positions, where x's and y's are specified in pixels.

draw_rectangle: x y width height draws a rectangle at position (x, y) with the specified width and height, where the arguments are specified in pixels.

draw_rectangles: x y width height (repeat for each rectangle)

draws rectangles specified in arguments. See draw_rectangle for argument descriptions.

draw_segments: x1 y1 x2 y2 (repeat for each line segment) draws a set of disconnected lines.

draw_string: string draws a string using the foreground color only.

fill_arc: x y width height angle1 angle2 fills an arc at point (x,y) with the specified width and height starting at angle1 for angle2 degrees. Angles are specified in degrees. (Note that this is different from Xlib, where angles are specified in 64ths of degrees.)

fill_arcs: x y width height angle1 angle2 (repeat for each arc) fills arcs specified in arguments. See fill_arc: for argument descriptions.

fill_polygon: x1 y1 (repeat for each coordinate) shape mode fills a polygon that is specified by the given coordinates. Shape allows you to speed up the filing by giving the workstation a hint about the complexity of the polygon. Possible values are 0 (Complex), 1 (Nonconvex) or 2 (Convex). The mode indicates whether the coordinates are relative to the origin (0 for CoordModeOrigin) or to the previous coordinate in the argument list (1 for CoordModePrevious).

fill_rectangle: x y width height fills a rectangle at position (x, y) with the specified width and height, where the arguments are specified in pixels.

fill_rectangles: x y width height (repeat for each rectangle) fills rectangles specified in arguments. See fill_rectangle for argument descriptions.

gc= gc_object_name sets the gc instance variable.

gc? returns the value of the gc instance variable on the argument stack.

height= height sets the height instance variable.

height? returns the value of the height instance variable

on the argument stack.

height= value adds the argument value to the height instance variable.

id? returns the value of the id instance variable on the argument stack. id_as_int? returns the value of the id instance variable on the argument stack as an integer rather than a OBJECT pointer.

id= id sets the id instance variable. Usually this is set when the drawable is created. One time that you may want to set the id yourself is if you need to use the default root window. In that case, you would get the id of the default root window from the display and set the id of a drawable. You should not call create! when setting the id yourself.

put_image: image puts the image on the drawable. Image is the name of an ximage object.

screen? retreives the screen instance variable.

screen= sets the screen instance variable. Note: timing is important. You must set the screen before creation.

width= width sets the width instance variable.

width? returns the value of the width instance variable on the argument stack.

width= value adds the argument value to the width instance variable.

xy= (x_value, y_value) sets the xy instance variable.

xy? returns the value of the xy instance variable on the argument stack.

EXAMPLE

/* draw a string in a window */ xwindow new: the_drawable

gc= an_xgc_that_has_been_created

draw_string: "hello world!";

SEE ALSO

xwindow, xpixmap


Last Updated On: Fri Mar 10 15:38:44 1995

Please send comments and suggestions to

its-documentation@rpi.edu

Keyword Search of RPInfo Consulting Pages and NewsCache