]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/mi/mispans.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / mi / mispans.h
1 /***********************************************************
2
3 Copyright (c) 1989  X Consortium
4
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22 Except as contained in this notice, the name of the X Consortium shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from the X Consortium.
25
26
27 Copyright 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
28
29                         All Rights Reserved
30
31 Permission to use, copy, modify, and distribute this software and its 
32 documentation for any purpose and without fee is hereby granted, 
33 provided that the above copyright notice appear in all copies and that
34 both that copyright notice and this permission notice appear in 
35 supporting documentation, and that the name of Digital not be
36 used in advertising or publicity pertaining to distribution of the
37 software without specific, written prior permission.  
38
39 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45 SOFTWARE.
46
47 ******************************************************************/
48
49 /* $XConsortium: mispans.h,v 5.3 94/04/17 20:27:52 dpw Exp $ */
50
51 typedef struct {
52     int         count;          /* number of spans                  */
53     DDXPointPtr points;         /* pointer to list of start points  */
54     int         *widths;        /* pointer to list of widths        */
55 } Spans;
56
57 typedef struct {
58     int         size;           /* Total number of *Spans allocated     */
59     int         count;          /* Number of *Spans actually in group   */
60     Spans       *group;         /* List of Spans                        */
61     int         ymin, ymax;     /* Min, max y values encountered        */
62 } SpanGroup;
63
64 /* Initialize SpanGroup.  MUST BE DONE before use. */
65 extern void miInitSpanGroup(
66 #if NeedFunctionPrototypes
67     SpanGroup * /*spanGroup*/
68 #endif
69 );
70
71 /* Add a Spans to a SpanGroup. The spans MUST BE in y-sorted order */
72 extern void miAppendSpans(
73 #if NeedFunctionPrototypes
74     SpanGroup * /*spanGroup*/,
75     SpanGroup * /*otherGroup*/,
76     Spans * /*spans*/
77 #endif
78 );
79
80 /* Paint a span group, possibly with some overlap */
81 extern void miFillSpanGroup(
82 #if NeedFunctionPrototypes
83     DrawablePtr /*pDraw*/,
84     GCPtr /*pGC*/,
85     SpanGroup * /*spanGroup*/
86 #endif
87 );
88
89 /* Paint a span group, insuring that each pixel is painted at most once */
90 extern void miFillUniqueSpanGroup(
91 #if NeedFunctionPrototypes
92     DrawablePtr /*pDraw*/,
93     GCPtr /*pGC*/,
94     SpanGroup * /*spanGroup*/
95 #endif
96 );
97
98 /* Free up data in a span group.  MUST BE DONE or you'll suffer memory leaks */
99 extern void miFreeSpanGroup(
100 #if NeedFunctionPrototypes
101     SpanGroup * /*spanGroup*/
102 #endif
103 );
104
105 extern void miSubtractSpans(
106 #if NeedFunctionPrototypes
107     SpanGroup * /*spanGroup*/,
108     Spans * /*sub*/
109 #endif
110 );
111
112 extern void miDisposeSpanGroup(
113 #if NeedFunctionPrototypes
114     SpanGroup * /*spanGroup*/
115 #endif
116 );
117
118 extern int miClipSpans(
119 #if NeedFunctionPrototypes
120     RegionPtr /*prgnDst*/,
121     DDXPointPtr /*ppt*/,
122     int * /*pwidth*/,
123     int /*nspans*/,
124     DDXPointPtr /*pptNew*/,
125     int * /*pwidthNew*/,
126     int /*fSorted*/
127 #endif
128 );
129
130 /* Rops which must use span groups */
131 #define miSpansCarefulRop(rop)  (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2)
132 #define miSpansEasyRop(rop)     (!miSpansCarefulRop(rop))
133