>># 
>># Copyright 1990, 1991 by the Massachusetts Institute of Technology and
>># UniSoft Group Limited.
>># 
>># Permission to use, copy, modify, distribute, and sell this software and
>># its documentation for any purpose is hereby granted without fee,
>># provided that the above copyright notice appear in all copies and that
>># both that copyright notice and this permission notice appear in
>># supporting documentation, and that the names of MIT and UniSoft not be
>># used in advertising or publicity pertaining to distribution of the
>># software without specific, written prior permission.  MIT and UniSoft
>># make no representations about the suitability of this software for any
>># purpose.  It is provided "as is" without express or implied warranty.
>># 
>># $XConsortium: drwln.m,v 1.4 92/06/11 16:32:07 rws Exp $
>># 
>>#      SCCS:  @(#)  function.mc Rel 1.11	    (1/23/92)
>>#      SCCS:  @(#)  plane-mas.mc Rel 1.9	    (6/10/91)
>>#      SCCS:  @(#)  line-widt.mc Rel 1.12	    (12/12/91)
>>#      SCCS:  @(#)  line-styl.mc Rel 1.14	    (1/22/92)
>>#      SCCS:  @(#)  cap-style.mc Rel 1.17	    (6/15/92)
>>#      SCCS:  @(#)  fill-styl.mc Rel 1.8	    (12/20/91)
>>#      SCCS:  @(#)  subwindow.mc Rel 1.11	    (6/15/92)
>>#      SCCS:  @(#)  clip-x-or.mc Rel 1.10	    (4/29/92)
>>#      SCCS:  @(#)  clip-y-or.mc Rel 1.1	    (7/1/91)
>>#      SCCS:  @(#)  clip-mask.mc Rel 1.11	    (12/20/91)
>>#      SCCS:  @(#)  foregroun.mc Rel 1.15	    (10/4/91)
>>#      SCCS:  @(#)  backgroun.mc Rel 1.15	    (1/3/92)
>>#      SCCS:  @(#)  tile.mc Rel 1.1	    (7/1/91)
>>#      SCCS:  @(#)  stipple.mc Rel 1.1	    (7/1/91)
>>#      SCCS:  @(#)  ts-x-orig.mc Rel 1.5	    (12/20/91)
>>#      SCCS:  @(#)  ts-y-orig.mc Rel 1.1	    (7/1/91)
>>#      SCCS:  @(#)  dash-offs.mc Rel 1.9	    (12/20/91)
>>#      SCCS:  @(#)  dash-list.mc Rel 1.8	    (3/17/92)
>>#      SCCS:  @(#)  EDra.mc Rel 1.5	    (10/25/91)
>>#      SCCS:  @(#)  EGC.mc Rel 1.5	    (10/25/91)
>>#      SCCS:  @(#)  EMat1.mc Rel 1.5	    (10/25/91)
>>#      SCCS:  @(#)  EMat2.mc Rel 1.4	    (10/25/91)
>>#      SCCS:  @(#)  EMat3.mc Rel 1.5	    (10/25/91)
>>#
>>TITLE XDrawLine CH06
>>ASSERTION A XDrawLine-1
A call to XDrawLine draws a line between the pair of points
(x1,y1) and (x2,y2) in the drawable d.
>>STRATEGY
Draw line
Pixmap check
>>ASSERTION A XDrawLine-2
A call to XDrawLine does not perform joining at coincident
endpoints.
>>STRATEGY
Draw line
Draw line with one end point the same
Pixmap check
>>ASSERTION A XDrawLine-3
A call to XDrawLine does not draw a pixel more than once.
>>STRATEGY
Set function to GXxor
Draw line
Pixmap check
>>ASSERTION A XDrawLine-4
When lines intersect, then the intersecting pixels are
drawn multiple times.
>>STRATEGY
Draw line
Set function to GXxor
Draw another intersecting line
Pixmap check
>>ASSERTION A XDrawLine-5
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXclear, then the destination becomes (dst AND (NOT
plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXclear.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is 0.
>>ASSERTION A XDrawLine-6
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXand, then the destination becomes ((src AND dst) AND
plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXand.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is src&dest.
>>ASSERTION A XDrawLine-7
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXandReverse, then the destination becomes ((src AND (NOT
dst)) AND plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXandReverse.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is src&~dest.
>>ASSERTION A XDrawLine-8
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXcopy, then the destination becomes (src AND plane_mask)
OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXcopy.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is src.
>>ASSERTION A XDrawLine-9
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXandInverted, then the destination becomes (((NOT src) AND
dst) AND plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXandInverted.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~src&dest.
>>ASSERTION A XDrawLine-10
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXnoop, then the destination becomes (dst AND plane_mask)
OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXnoop.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is dest.
>>ASSERTION A XDrawLine-11
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXxor, then the destination becomes ((src XOR dst) AND
plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXxor.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is src^dest.
>>ASSERTION A XDrawLine-12
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is GXor,
then the destination becomes ((src OR dst) AND plane_mask)
OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXor.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is src|dest.
>>ASSERTION A XDrawLine-13
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXnor, then the destination becomes (((NOT src) AND (NOT
dst)) AND plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXnor.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~src&~dest.
>>ASSERTION A XDrawLine-14
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXequiv, then the destination becomes (((NOT src) XOR dst)
AND plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXequiv.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~src^dest.
>>ASSERTION A XDrawLine-15
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXinvert, then the destination becomes ((NOT dst) AND
plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXinvert.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~dest.
>>ASSERTION A XDrawLine-16
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXorReverse, then the destination becomes ((src OR (NOT
dst)) AND plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXorReverse.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is src|~dest.
>>ASSERTION A XDrawLine-17
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXcopyInverted, then the destination becomes ((NOT src) AND
plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXcopyInverted.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~src.
>>ASSERTION A XDrawLine-18
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXorInverted, then the destination becomes (((NOT src) OR
dst) AND plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXorInverted.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~src|dest.
>>ASSERTION A XDrawLine-19
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXnand, then the destination becomes (((NOT src) OR (NOT
dst)) AND plane_mask) OR (dst AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXnand.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~src|~dest.
>>ASSERTION A XDrawLine-20
When a graphics operation is performed and the source pixel
is src and the destination pixel is dst and function is
GXset, then the destination becomes ( plane_mask) OR (dst
AND (NOT plane_mask)).
>>STRATEGY
Find a point (f_pix_x, f_pix_y) that is drawn by the graphics operation.

Set function component of GC to GXset.
For destination pixel values dst = 0, 1, 2, 3
    For source pixel values of src = 0, 1
	Set all points in drawable to destination pixel value.
	Set foreground component of GC to source pixel value.
	  (or fill source drawable/image with source pixel value in the cases
	   of XCopyArea or XPutImage, while XCopyPlane always has it ~0 to
	   force a foreground fill).
	Do graphics operation.
	Verify that pixel value at f_pix_x, f_pix_y is ~0.
>>ASSERTION A XDrawLine-21
The value for plane_mask is truncated to the depth of the
GC.
>>STRATEGY
Set foreground to pattern of 1's and 0's
Set plane-mask to values larger than the depth.
Verify that result is what would be expected if the extra bits
 were masked off.
>>ASSERTION A XDrawLine-22
The plane_mask specifies which planes of the destination
are to be modified, one bit per plane, with bits being
assigned to planes from the least significant bit of the
word to the most significant bit.
>>STRATEGY
Set foreground to pattern of 1's and 0's
Select a variety of plane masks.
Verify that the expected pixels are drawn.
>>ASSERTION A XDrawLine-23
When line_width is greater than or equal to one, and the
center of a pixel is fully inside the boundary, then the
pixel is drawn.
>>STRATEGY
Draw a variety of lines with various widths.
Pixmap verify.
>>ASSERTION A XDrawLine-24
When line_width is greater than or equal to one, and the
center of the pixel is exactly on the boundary, and the
boundary is not horizontal, and the interior is immediately
to its right (x increasing direction), then the pixel is
drawn.
>>STRATEGY
Draw sloping line.
Verify that a pixel on the boundary is set.
(More complicated cases are covered by pixel verification elsewhere.)
>>ASSERTION A XDrawLine-25
When line_width is greater than or equal to one, and the
center of the pixel is exactly on the boundary, and the
boundary is horizontal, and the interior or the boundary is
immediately below (y increasing direction), and the interior
or the boundary is immediately to the right (x increasing
direction), then the pixel is drawn.
>>STRATEGY
Draw horizontal line.
Verify that pixels on boundary with interior below are set.
Verify that pixels on boundary with interior above are not set.
Verify that pixels on boundary with interior to the right are set.
Verify that pixels on boundary with interior to the left are not set.
>>ASSERTION B XDrawLine-26
When line_width is zero, then a one pixel wide line is
drawn using an unspecified, device-dependent algorithm.
>>STRATEGY
Draw horizontal zero width line.
Issue warning message if line is not one pixel in width.
Report assertion UNTESTED.
>>ASSERTION A XDrawLine-27
When line_width is zero, and a line is drawn unclipped from
[x1, y1] to [x2, y2] and another line is drawn unclipped
from [x1+dx, y1+dy] to [x2+dx, y2+dy], and a point [x, y] is
touched by drawing the first line, then point [x+dx, y+dy]
is touched by drawing the second line.
>>STRATEGY
Draw thin line.
Save image with origin based on line position.
Draw thin line displaced by fixed amount.
Save image with origin in same position relative to line.
Compare images.
>>ASSERTION - XDrawLine-28
When line_width is zero, and a line is drawn unclipped from
[x1, y1] to [x2, y2] and another line is drawn unclipped
from [x1+dx, y1+dy] to [x2+dx, y2+dy], and a point [x, y] is
not touched by drawing the first line, then point [x+dx,
y+dy] is not touched by drawing the second line.
>>ASSERTION - XDrawLine-29
When a line is clipped, and the point is inside the
clipping region, and the point would be touched by the
unclipped line, then the pixel is drawn.
>>ASSERTION - XDrawLine-30
When the line_style is LineSolid, then the full path of
the line is drawn.
>>ASSERTION A XDrawLine-31
When the line_style is LineOnOffDash, then cap_style
applies to all internal ends of the individual dashes,
except CapNotLast is treated as CapButt.
>>STRATEGY
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
Set the line_style of the GC to LineOnOffDash using XChangeGC.
Set the dash_list of the GC to using XSetDashes.
For cap_style CapNotLast, CapButt, CapProjecting, CapRound:
	Set the cap_style of the GC using XChangeGC.
	Draw paths.
	Pixmap verify.
	Clear drawable.
>>ASSERTION - XDrawLine-32
When line_style is LineSolid and fill_style is FillSolid,
then on a call to XDrawLine the source pixel for the drawing
operation is foreground.
>>ASSERTION - XDrawLine-33
When line_style is LineSolid and fill_style is FillTiled,
then on a call to XDrawLine the source for the drawing
operation is tile.
>>ASSERTION - XDrawLine-34
When line_style is LineSolid and fill_style is
FillOpaqueStippled, then on a call to XDrawLine the source
for the drawing operation is a tile with the same width and
height as stipple, but with background everywhere stipple
has a zero and with foreground everywhere stipple has a one.
>>ASSERTION - XDrawLine-35
When line_style is LineSolid and fill_style is FillStippled,
then on a call to XDrawLine the source for the drawing
operation is foreground masked by the stipple pattern tiled
in a single plane.
>>ASSERTION - XDrawLine-36
When line_style is LineOnOffDash and the dash is odd, then
nothing is drawn.
>>ASSERTION - XDrawLine-37
When line_style is LineOnOffDash and the dash is even and
fill_style is FillSolid, then on a call to XDrawLine the
source pixel for the drawing operation is foreground.
>>ASSERTION A XDrawLine-38
When line_style is LineOnOffDash and the dash is even and
fill_style is FillTiled, then on a call to XDrawLine the
source for the drawing operation is tile.
>>STRATEGY
Create a tile with depth of drawable.
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
If depth is greater than one, set the fg and bg in the tile
	to interesting values.
Set the tile component of the GC to tile using XSetTile.
Set fill-style to FillTiled using XSetFillStyle.
Set line-style to LineOnOffDash using XChangeGC.
Do graphics operation.
Pixmap verify.
>>ASSERTION A XDrawLine-39
When line_style is LineOnOffDash and the dash is even and
fill_style is FillOpaqueStippled, then on a call to
XDrawLine the source for the drawing operation is a tile
with the same width and height as stipple, but with
background everywhere stipple has a zero and with foreground
everywhere stipple has a one.
>>STRATEGY
Create a stipple bitmap.
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
Set the stipple component of the GC to stipple using XSetStipple.
Set fill-style to FillOpaqueStippled using XSetFillStyle.
Set line-style to LineOnOffDash using XChangeGC.
Do graphics operation.
Pixmap verify.
>>ASSERTION A XDrawLine-40
When line_style is LineOnOffDash and the dash is even and
fill_style is FillStippled, then on a call to XDrawLine the
source for the drawing operation is foreground masked by the
stipple pattern tiled in a single plane.
>>STRATEGY
Create a stipple bitmap.
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
Set the stipple component of the GC to stipple using XSetStipple.
Set fill-style to FillStippled using XSetFillStyle.
Set line-style to LineOnOffDash using XChangeGC.
Do graphics operation.
Pixmap verify.
>>ASSERTION A XDrawLine-41
When line_style is LineDoubleDash and the dash is even and
fill_style is FillSolid, then on a call to XDrawLine the
source pixel for the drawing operation is foreground.
>>STRATEGY
Draw complete path with line-style LineSolid and save results.
Clear drawable.
Draw same path with line-style LineDoubleDash
Reverse foreground and background.
Set gc function to GXor.
Draw same path again over previous drawing.
Check that the combined result is equivalent to using FillSolid.
>>ASSERTION A XDrawLine-42
When line_style is LineDoubleDash and the dash is even and
fill_style is FillTiled, then on a call to XDrawLine the
source for the drawing operation is tile.
>>STRATEGY
Create a tile with depth of drawable.
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
If depth is greater than one, set the fg and bg in the tile
	to interesting values.
Set the stipple component of the GC to stipple using XSetStipple.
Set the tile component of the GC to tile using XSetTile.
Set fill-style to FillTiled using XSetFillStyle.
Set line-style to LineDoubleDash using XChangeGC.
Do graphics operation.
Pixmap verify.
>>ASSERTION A XDrawLine-43
When line_style is LineDoubleDash and the dash is even and
fill_style is FillOpaqueStippled, then on a call to
XDrawLine the source for the drawing operation is a tile
with the same width and height as stipple, but with
background everywhere stipple has a zero and with foreground
everywhere stipple has a one.
>>STRATEGY
Create a stipple bitmap.
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
Set the stipple component of the GC to stipple using XSetStipple.
Set fill-style to FillOpaqueStippled using XSetFillStyle.
Set line-style to LineDoubleDash using XChangeGC.
Do graphics operation.
Pixmap verify.
>>ASSERTION A XDrawLine-44
When line_style is LineDoubleDash and the dash is even and
fill_style is FillStippled, then on a call to XDrawLine the
source for the drawing operation is foreground masked by the
stipple pattern tiled in a single plane.
>>STRATEGY
Create a stipple bitmap.
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
Set the stipple component of the GC to stipple using XSetStipple.
Set fill-style to FillStippled using XSetFillStyle.
Set line-style to LineDoubleDash using XChangeGC.
Do graphics operation.
Pixmap verify.
>>ASSERTION - XDrawLine-45
When line-style is LineDoubleDash and the dash is odd and
fill_style is FillSolid, then on a call to XDrawLine the
source for the drawing operation is background.
>>ASSERTION - XDrawLine-46
When line-style is LineDoubleDash and the dash is odd and
fill_style is FillTiled, then on a call to XDrawLine the
source for the drawing operation is tile.
>>ASSERTION - XDrawLine-47
When line-style is LineDoubleDash and the dash is odd and
fill_style is FillOpaqueStippled, then on a call to
XDrawLine the source for the drawing operation is a tile
with the same width and height as stipple, but with
background everywhere stipple has a zero and with foreground
everywhere stipple has a one.
>>ASSERTION - XDrawLine-48
When line-style is LineDoubleDash and the dash is odd and
fill_style is FillStippled, then on a call to XDrawLine the
source for the drawing operation is background masked by the
stipple pattern tiled in a single plane.
>>ASSERTION A XDrawLine-49
A call to XDrawLine does not draw each pixel of a
particular line more than once.
>>STRATEGY
For each line-style
  Draw line with gc function GXcopy.
  Save image.
  Clear drawable.
  Draw line with gc function GXxor
  Verify that the image is the same as that saved.
>>ASSERTION A XDrawLine-50
When line_width is greater than or equal to one, and
line_style is LineSolid, and a line is drawn from [x1, y1]
to [x2, y2], and a line is drawn from [x2, y2] to [x1, y1],
then the same pixels are drawn in each case.
>>STRATEGY
Draw lines in one direction.
Save image.
Clear drawable.
Draw lines in opposite direction.
Verify that the image is the same as that saved and that something was drawn.
>>ASSERTION A XDrawLine-51
When the cap_style is CapNotLast and the line_width is
greater than zero (> 0), then this is equivalent to CapButt.
>>STRATEGY
For a variety of line widths, both odd and even.
  Draw line with CapNotLast.
  Save the image on the drawable.
  Draw line with CapButt.
  Verify that the images drawn were the same.
>>ASSERTION A XDrawLine-52
When the cap_style is CapNotLast and the line_width is zero
(0), then this is equivalent to CapButt except that the
final endpoint is not drawn.
>>STRATEGY
Draw line with CapButt.
Set GC component function to GXxor.
Draw line with CapNotLast.
Verify that only the final end point is set.
>>ASSERTION A XDrawLine-53
When the cap_style is CapButt, then the line is square at
the endpoint (perpendicular to the slope of the line) with
no projection beyond.
>>STRATEGY
Draw line with CapButt and odd or even line width.
Pixmap verify.
>>ASSERTION A XDrawLine-54
When the cap_style is CapRound and line-width is zero, then
this is equivalent to CapButt.
>>STRATEGY
Draw line with CapRound.
Save the image on the drawable.
Draw line with CapButt.
Verify that the images drawn were the same.
>>ASSERTION A XDrawLine-55
When the cap_style is CapRound and line-width is not zero,
then the line has a circular arc, with the diamater equal to
the line_width, centred on the endpoint.
>>STRATEGY
For a variety of line widths.
  Draw line with CapRound.
  Pixmap verify.
>>ASSERTION A XDrawLine-56
When the cap_style is CapProjecting and line-width is zero,
then this is equivalent to CapButt.
>>STRATEGY
Draw line with CapProjecting.
Save the image on the drawable.
Draw line with CapButt.
Verify that the images drawn were the same.
>>ASSERTION A XDrawLine-57
When the cap_style is CapProjecting and line-width is not
zero, then the line is square at the end, but the path
continues beyond the endpoint for a distance equal to half
the line-width.
>>STRATEGY
Draw horizontal line.
Verify directly that path continues beyond end points.
Draw arbitrary line.
Pixmap verify.
>>ASSERTION A XDrawLine-58
When a line has coincident endpoints (x1=x2, y1=y2), and
the cap_style is applied to both endpoints and the
line_width is equal to zero and the cap_style is CapNotLast,
then the results are device-dependent, but the desired
effect is that nothing is drawn.
>>STRATEGY
Draw line with zero width and length.
Verify that nothing is drawn.
(Test always passes whatever the result.)
>>ASSERTION A XDrawLine-59
When a line has coincident endpoints (x1=x2, y1=y2), and
the cap_style is applied to both endpoints and the
line_width is equal to zero and the cap_style is CapRound,
then the results are the same as for CapButt with line_width
equal to zero.
>>STRATEGY
Draw zero length line with CapRound.
Save the image on the drawable.
Draw zero length line with CapButt.
Verify that the images drawn were the same.
>>ASSERTION A XDrawLine-60
When a line has coincident endpoints (x1=x2, y1=y2), and
the cap_style is applied to both endpoints and the
line_width is equal to zero and the cap_style is
CapProjecting, then the results are the same as for CapButt
with line_width equal to zero.
>>STRATEGY
Draw zero length line with CapProjecting.
Save the image on the drawable.
Draw zero length line with CapButt.
Verify that the images drawn were the same.
>>ASSERTION A XDrawLine-61
When a line has coincident endpoints (x1=x2, y1=y2), and
the cap_style is applied to both endpoints and the
line_width is not equal to zero and the cap_style is CapButt,
then nothing is drawn.
>>STRATEGY
Draw zero length line with CapButt.
Verify that the drawable is clear.
>>ASSERTION A XDrawLine-62
When a line has coincident endpoints (x1=x2, y1=y2), and
the cap_style is applied to both endpoints and the
line_width is not equal to zero and the cap_style is
CapRound, then the closed path is a circle, centered at the
endpoint, and with the diameter equal to the line-width.
>>STRATEGY
Draw zero length line with CapRound.
Pixmap verify.
>>ASSERTION A XDrawLine-63
When a line has coincident endpoints (x1=x2, y1=y2), and
the cap_style is applied to both endpoints and the
line_width is not equal to zero and the cap_style is
CapProjecting, then the closed path is a square, aligned
with the coordinate axes, centered at the endpoint, and with
the sides equal to the line-width.
>>STRATEGY
Draw zero length line with CapProjecting.
Verify area drawn directly.
>>ASSERTION - XDrawLine-64
When a cap_style is applied at an end point, then the phase
of the dash pattern is reset to the dash_offset.
>>ASSERTION A XDrawLine-65
When fill_style is FillSolid, then on a call to XDrawLine
the source pixel for the drawing operation is foreground.
>>STRATEGY
Set fill-style to FillSolid.
Do drawing operation.
Pixmap verify.
>>ASSERTION A XDrawLine-66
When fill-style is FillTiled, then on a call to XDrawLine
the source for the drawing operation is tile.
>>STRATEGY
Create a tile of appropriate depth.
If depth is greater than one, set the fg and bg in the tile
to interesting values.
Set fill-style to FillTiled.
Part 1.
Do drawing operation.
If FillRectangle operation
  Directly check using checktile.
else
  Pixmap verify.

Part 2.
Do drawing operation.
Reverse fg and bg in tile.
Set gc function to xor.
Repeat drawing operation.
Verify that result is the same as drawing solid line with xor
of the fg and bg.
(This also verifies for depth 1 screens that the background is being
drawn)

>>ASSERTION A XDrawLine-67
When fill_style is FillOpaqueStippled, then on a call to
XDrawLine the source for the drawing operation is a tile
with the same width and height as stipple, but with
background everywhere stipple has a zero and with foreground
everywhere stipple has a one.
>>STRATEGY
Create stipple.
Set fill-style to FillOpaqueStippled.
Do drawing operation.
Pixmap verify the results.

Reverse foreground and background pixels.
Combine drawing with previous drawing.
Verify that the results are the same as FillSolid with foreground
 equal to combination of fg and bg pixels.
>>ASSERTION A XDrawLine-68
When fill_style is FillStippled, then on a call to
XDrawLine the source for the drawing operation is foreground
masked by the stipple pattern tiled in a single plane.
>>STRATEGY
Create stipple
Set fill-style to FillStippled.
Set background to foreground pixel to verify it is not affecting things.
Do drawing. 
Pixmap verify.
>>ASSERTION A XDrawLine-69
When subwindow_mode is ClipByChildren, then the
destination window and source (if it is a window) are
clipped by all viewable InputOutput children.
>>STRATEGY
Set subwindow-mode to be ClipByChildren
Cover window with many strip sub-windows.
Do drawing operation
Verify that all subwindows are clear.
>>ASSERTION A XDrawLine-70
When subwindow_mode is IncludeInferiors, then neither the
destination window nor source (if it is a window) is clipped
by inferiors.
>>STRATEGY
Place subwindows over parts of the main window
Create subwindows over these windows as well.
Do graphics operation.
Verify that the operation was not affected.
>>ASSERTION A XDrawLine-71
When subwindow_mode is IncludeInferiors on a window of one
depth with mapped inferiors of differing depth, then no
errors occur.
>>STRATEGY
If only one depth window supported
  Result is UNSUPPORTED

Find two visuals with different depths.
Use one of these visuals to create a window.
Use the other to create a subwindow.
Verify that no errors occur.
For information purposes only see if graphics operation is rendered properly.
>>ASSERTION A XDrawLine-72
The clip origin coordinates clip-x-origin and clip-y-origin
are interpreted relative to the origin of the destination
drawable specified in the graphics operation.
>>STRATEGY
Create Pixmap and set clip-mask with it.
Vary clip origin
Verify nothing is drawn outside the clip_mask based on the origin.
Pixmap verify results inside the cliparea.
>>ASSERTION A XDrawLine-73
When the clip_mask is set to None, then the pixels are
always drawn regardless of the clip origin.
>>STRATEGY
Set clip mask to None
Verify that things are still drawn.
>>ASSERTION A XDrawLine-74
When pixels are outside the area covered by the clip_mask,
then they are not drawn.
>>STRATEGY
Create a pixmap depth 1.
Fill it with all ones.
Set this pixmap as the clip_mask.
Verify that nothing is drawn outside the clip-mask area.
Use a pixmap size of 5x5 to ensure that all tests have some part of the
drawing outside the clip-mask.
>>ASSERTION A XDrawLine-75
When pixels have a clip_mask bit set to 1, and they would
be drawn, then they are drawn.
>>STRATEGY
Do graphics operation.
Save the image on the drawable.
Clear drawable.
Create a pixmap depth 1 that is the same size as the window.
Set all bits in pixmap to 1.
Set GC component clip-mask to pixmap using XSetClipMask.
Do graphics operation.
Verify that the images drawn were the same.

Set pixmap to a pattern.
Do graphics operation.
Pixmap verify the result.
>>ASSERTION A XDrawLine-76
When pixels have a clip_mask bit set to 0, then they are
not drawn.
>>STRATEGY
Create a pixmap depth 1 that is the same size as the window.
Set all bits in pixmap to 0.
Set GC component clip_mask to pixmap using XSetClipMask.
Do graphics operation.
Verify that nothing is drawn.
>>ASSERTION A XDrawLine-77
The foregound component of the gc is used to determine the
foreground pixel value.
>>STRATEGY
Set foreground to various values.
Pixmap verify the results.
>>ASSERTION A XDrawLine-78
The value for foreground is truncated to the depth of the
GC.
>>STRATEGY
Set foreground to value with all bits set.
Find a non background pixel.
Check that this is truncated to the depth.
>>ASSERTION A XDrawLine-79
The background component of the gc is used to determine the
background pixel value.
>>STRATEGY
Set GC component background to various values.
Pixmap verify the results.
>>ASSERTION A XDrawLine-80
The value for background is truncated to the depth of the
GC.
>>STRATEGY
Set GC component background to value with all bits set.
If not (XDrawImageString  || XCopyPlane || XPutImage || XCopyArea)
  Set GC component stipple to all zeros
  Set GC component FillStyle to FillOpaqueStippled.
else if (XCopyPlane || XPutImage)
  Fill source drawable/image-bitmap with 0's to ensure we draw with background
else if XCopyArea
  Fill source drawable/image-bitmap with all 1's
Draw item.
Find a pixel with a value other than W_BG.
Check that this is truncated to the depth.
>>ASSERTION A XDrawLine-81
The tile/stipple origin coordinates ts-x-origin and
ts-y-origin are interpreted relative to the origin of the
destination drawable specified in the graphics operation.
>>STRATEGY
Create a stipple pixmap.
Set stipple component of GC to pixmap using XSetStipple.
For various tile/stipple origins:
	Set tile/stipple origin using XSetTSOrigin.
	Set fill-style to FillStippled using XSetFillStyle.
	Clear drawable.
	Do graphics operation.
	Pixmap verify.
Create a tile with depth of drawable.
Set tile component of GC to tile using XSetTile.
For various tile/stipple origins:
	Set tile/stipple origin using XSetTSOrigin.
	Set fill-style to FillTiled using XSetFillStyle.
	Clear drawable.
	Do graphics operation.
	Pixmap verify.
>>ASSERTION A XDrawLine-82
The dash_offset defines the phase of the pattern,
specifying how many pixels into the dash-list the pattern
begins in any single graphics request.
>>STRATEGY
For both odd and even line widths do:
	Set graphics coordinates for dashed lines 
		(includes horizontal and vertical cases,
		and includes joins and caps where relevant).
	Set the line_style of the GC to LineOnOffDash using XSetLineAttributes.
	For various dash_offsets:
		Set the dash_offset of the GC using XSetDashes.
		Clear drawable.
		Draw lines.
		Verify that dashes drawn correspond to dash_list (use pixmap checking).
	Set dash_offset of the GC to zero using XSetDashes.
	Clear drawable.
	Draw lines.
	Save the image on the drawable.
	Set dash_offset of the GC to multiple of combined dash length using XSetDashes.
	Clear drawable.
	Draw lines.
	Verify that the images drawn were the same.
>>ASSERTION A XDrawLine-83
The initial and alternate elements of the dash-list within
the GC specify the lengths of the even dashes and the second
and alternate elements specify the lengths of the odd
dashes.
>>STRATEGY
Set graphics coordinates for dashed lines 
	(includes horizontal and vertical cases,
	and includes joins and caps where relevant).
Set the line_style of the GC to LineOnOffDash using XChangeGC.
Set the dash_list of the GC to even length list using XSetDashes.
Clear drawable.
Draw lines.
Verify that dashes drawn correspond to dash_list (use pixmap checking).
Repeat with odd length dash_list.
Repeat with single dash of length 255 in dash_list.
>>ASSERTION A XDrawLine-84
The dashes component of the GC specifies the length of both
even and odd dashes.
>>STRATEGY
Set the dashes component of the GC using XChangeGC.
Draw lines.
Verify that even and odd dashes are same length (use pixmap checking).
>>ASSERTION - XDrawLine-85
When the line is horizontal, then the length of a dash is
measured along the x axis.
>>ASSERTION - XDrawLine-86
When the line is vertical, then the length of a dash is
measured along the y axis.
>>ASSERTION A XDrawLine-87
When a drawable argument does not name a valid Drawable,
then a BadDrawable error occurs.
>>STRATEGY
Create a bad drawable by creating and destroying a window.
Call test function using bad drawable as the drawable argument.
Verify that a BadDrawable error occurs.
>>ASSERTION A XDrawLine-88
When the GC argument does not name a defined GC, then a
BadGC error occurs.
>>STRATEGY
Create a GC.
Set GC id to -1 using XTestSetGContextOfGC.
Call test function using bad GC as the GC argument.
Verify that a BadGC error occurs.
>>ASSERTION A XDrawLine-89
When a drawable argument is an InputOnly window then a
BadMatch error occurs.
>>STRATEGY
Create an InputOnly window.
Call test function using InputOnly window as the drawable argument.
Verify that a BadMatch error occurs.
>>ASSERTION A XDrawLine-90
When the graphics context and the drawable do not have the
same depth, then a BadMatch error occurs.
>>STRATEGY
If only one depth supported
  report UNSUPPORTED
Create pixmap of depth 1.
Create gc of different depth.
Call test function with this pixmap and gc.
Verify that a BadMatch error occurs.
>>ASSERTION A XDrawLine-91
When the graphics context and the drawable were not created
for the same root, then a BadMatch error occurs.
>>STRATEGY
If multiple screens are supported
  Create pixmap of depth 1.
  Create gc on alternate screen.
  Call test function with this pixmap and gc.
  Verify that a BadMatch error occurs.
else
  report UNSUPPORTED
