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

xgc(x) Xlib xgc(x)

NAME

xgc - an X graphics context

DESCRIPTION

The xgc class provides an interface to an X graphics context. Using this class, several instance variables may be set to customize a graphics context. X defaults will be used for all attributes that are not set. Please note that the default values of the instance variables in the xgc class may not represent the X defaults. If you need a specific value, make sure to set it.

SUPERCLASS

object

INSTANCE VARIABLES

arc_mode specifies how the endpoints of arcs are connected when drawn. Two possible values are 0 (ArcChord) and 1 (ArcPieSlice).

background is a pixel value for the background drawing color.

cap_style specifies how the ends of lines will be capped. The possible values are 0 (CapNotLast), 1 (CapButt) 2 (CapRound) and 3 (CapProjecting).

clip_mask is a bitmap that indicates which pixels of the destination drawable can be affected by graphics requests. The clip_mask is specified by the name of an xpixmap object.

clip_x_origin specifies the x origin of the clip mask. Note: You'll probably want to adjust this to the x value of the xy instance variable of the window that you are drawing into.

clip_y_origin specifies the y origin of the clip mask. Note: You'll probably want to adjust this to the y value of the xy instance variable of the window that you are drawing into.

dashes is a list where each value specifies the length of a dash or a gap in a line. The initial and alternating values in the list specify dash lengths, while the rest of the values represent gap lengths. This pattern will be repeated when lines are drawn. (Make sure that the line style is set properly.) The dashes must be set after the graphics context

has been created.

dash_offset specifies how many pixels into the dash pattern (the dashes instance variable) the line drawing should begin.

display is the name of the associated xdisplay object.

drawable is the name an xdrawable object that is used when the gc is created to determine which screen the gc will be valid on. If none is specified, the default root window of the default screen of the display will be used.

fill_rule specifies how a polygon will be filled. Possible value s are 0 (EvenOddRule) and 1 (WindingRule).

fill_style controls whether the source graphics are drawn with a solid color, a tile or two stipple styles. Possible values are 0 (FillSolid), 1 (FillTiles), 2 (FillStippled) and 3 (FillOpaqueStippled).

font is the name of an xfont object. This font will be used when drawing text.

foreground is a pixel value for the foreground drawing color.

function specifies how the source and old destination pixels are used to compute the new destination pixel values. Possible values are 0 (clear), 1 (and), 2 (andReverse), 3 (copy), 4(andInverted), 5 (noop), 6 (xor), 7 (or), 8 (nor) 9 (equiv), 10 (invert), 11 (orReverse), 12 (copyInverted), 13 (orInverted), 14 (nand) and 15 (set).

graphics_exposures is a flag that tells whether or not you want to receive events when data is being copied from one drawable to another and a portion of the source drawable is unavailable.

id is a pointer to the X GC structure.

join_style defines how corners are drawn for wide lines. Possible values are 0 (JoinMiter), 1 (JoinRound) and 2 (JoinBevel).

line_style defines which sections of a line are drawn. Possible values are 0 (LineSolid), 1 (LineOnOffDash), and 2 (LineDoubleDash).

line_width sets the thickness of lines. Line_width is measured in pixels.

plane_mask is a bit mask that determines which planes in the destination drawable are modified. that you have allocated.

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 GC.

stipple is the name of an xpixmap object that will be used to pattern an area. The depth of the stipple should 1.

subwindow_mode controls whether subwindows obscure their parent. Possible values are 0 (ClipbyChildren) and 1 (IncludeInferiors).

tile is the name of an xpixmap object that will be used to pattern an area. The depth of the tile should be equal to the depth of the drawable.

ts_x_origin is the x value of the first tile when a tile pixmap is used to fill an area.

ts_y_origin is the y value of the first tile when a tile pixmap is used to fill an area.

valuemask is a bitmask that specifies which gc attributes have been set. This is automatically updated by the class when instance variables are set.

MESSAGES

arc_mode= value sets the arc_mode instance variable.

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

background= value sets the background instance variable.

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

cap_style= value sets the cap_style instance variable.

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

change! updates the graphics context. This message should be used after instance variables are updated!

clear_plane_mask! clears the plane_mask.

clear_valuemask! clears the valuemask.

clip_mask= pixmap sets the clip_mask instance variable.

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

clip_x_origin= value sets the clip_x_origin instance variable.

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

clip_y_origin= value sets the clip_y_origin instance variable.

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

create! creates the graphics context and sets the id.

create_xgc_values creates the XGCValues structure that keeps track of the values that have been set. This message sets the xgc_values instance variable.

dashes= values, dash_pattern= values sets the dashes instance variable.

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

dash_offset= value sets the dash_offset instance variable.

dash_offset? returns the value of the dash_offset 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.

drawable= drawable_object_name sets the drawable instance variable.

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

fill_rule= value sets the fill_rule instance variable.

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

fill_style= value sets the fill_style instance variable.

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

font= font_object_name sets the font instance variable.

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

foreground= value sets the foreground instance variable.

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

function= value sets the function instance variable.

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

graphics_exposures= value sets the graphics_exposures instance variable.

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

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

join_style= value sets the join_style instance variable.

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

line_style= value sets the line_style instance variable.

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

planes= planes clears and sets the planes_mask. The argument, planes, is a list of plane numbers in the range 0 <= plane_number < depth of drawable.

planes+ planes adds planes to the planes_mask. The argument, planes, is a list of plane numbers in the range 0 <= plane_number < depth of drawable.

planes- subtracts planes from the planes_mask.

screen? retreives the screen instance variable.

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

stipple= stipple_object_name sets the stipple instance variable.

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

subwindow_mode= value sets the subwindow_mode instance variable.

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

tile= tile_object_name sets the tile instance variable.

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

ts_x_origin= value sets the ts_x_origin instance variable.

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

ts_y_origin= value sets the ts_y_origin instance variable.

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

valuemask= value sets the valuemask instance variable. This should be set by the system rather than by the user.

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

EXAMPLE

/* create a gc, and set the a few attributes */ xgc new: the_gc

line_style = 1

line_width = 2

create!

dashes= (10, 10, 5, 5);

SEE ALSO

xdisplay, xdrawable, xfont, xpixmap


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

Please send comments and suggestions to

its-documentation@rpi.edu

Keyword Search of RPInfo Consulting Pages and NewsCache