3 Copyright 1996, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
27 * (c) Copyright 1996 Hewlett-Packard Company
28 * (c) Copyright 1996 International Business Machines Corp.
29 * (c) Copyright 1996 Sun Microsystems, Inc.
30 * (c) Copyright 1996 Novell, Inc.
31 * (c) Copyright 1996 Digital Equipment Corp.
32 * (c) Copyright 1996 Fujitsu Limited
33 * (c) Copyright 1996 Hitachi, Ltd.
35 * Permission is hereby granted, free of charge, to any person obtaining
36 * a copy of this software and associated documentation files (the
37 * "Software"), to deal in the Software without restriction, including
38 * without limitation the rights to use, copy, modify, merge, publish,
39 * distribute, sublicense, and/or sell copies of the Software, and to
40 * permit persons to whom the Software is furnished to do so, subject
41 * to the following conditions:
43 * The above copyright notice and this permission notice shall be included
44 * in all copies or substantial portions of the Software.
46 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
49 * THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
50 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
51 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54 * Except as contained in this notice, the names of the copyright holders
55 * shall not be used in advertising or otherwise to promote the sale, use
56 * or other dealings in this Software without prior written authorization
57 * from said copyright holders.
60 /*******************************************************************
62 ** *********************************************************
66 ** * Contents: Code to set and fill spans in the PS DDX
68 ** * Created By: Roger Helmendach (Liberty Systems)
70 ** * Copyright: Copyright 1996 The Open Group, Inc.
72 ** *********************************************************
74 ********************************************************************/
76 #ifdef HAVE_DIX_CONFIG_H
77 #include <dix-config.h>
82 #include "windowstr.h"
86 DrawablePtr pDrawable
,
95 xRectangle
*rects
, *r
;
96 RegionPtr fillRegion
, region
= 0;
102 if( PsUpdateDrawableGC(pGC
, pDrawable
, &psOut
, &cMap
)==FALSE
) return;
105 * Build a region out of the spans
107 rects
= (xRectangle
*)xalloc(nSpans
*sizeof(xRectangle
));
108 xoffset
= pDrawable
->x
;
109 yoffset
= pDrawable
->y
;
111 for( i
= 0, r
= rects
; i
< nSpans
; i
++, r
++ )
113 r
->x
= pPoints
[i
].x
+ xoffset
;
114 r
->y
= pPoints
[i
].y
+ yoffset
;
115 r
->width
= pWidths
[i
];
118 fillRegion
= RECTS_TO_REGION(pGC
->pScreen
, nSpans
, rects
,
119 (fSorted
)?CT_YSORTED
:CT_UNSORTED
);
122 * Intersect this region with the clip region. Whatever's left,
125 /*REGION_INTERSECT(pGC->pScreen, region, fillRegion, pGC->clientClip);*/
127 pbox
= REGION_RECTS(region
);
128 nbox
= REGION_NUM_RECTS(region
);
131 /*###SEND_PCL( outFile, "\27%0B" );*/
136 sprintf( t, "PU%d,%d;RR%d,%d;", pbox->x1, pbox->y1, pbox->x2, pbox->y2);
137 SEND_PCL( outFile, t );
144 /*###SEND_PCL( outFile, "\27%0A" );*/
147 * Clean up the temporary regions
149 REGION_DESTROY(pGC
->pScreen
, fillRegion
);
150 REGION_DESTROY(pGC
->pScreen
, region
);
156 DrawablePtr pDrawable
,