]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/mi/mizerarc.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / mi / mizerarc.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
28 /* $XConsortium: mizerarc.h,v 5.13 94/04/17 20:28:04 dpw Exp $ */
29
30 typedef struct {
31     int x;
32     int y;
33     int mask;
34 } miZeroArcPtRec;
35
36 typedef struct {
37     int x, y, k1, k3, a, b, d, dx, dy;
38     int alpha, beta;
39     int xorg, yorg;
40     int xorgo, yorgo;
41     int w, h;
42     int initialMask;
43     miZeroArcPtRec start, altstart, end, altend;
44     int firstx, firsty;
45     int startAngle, endAngle;
46 } miZeroArcRec;
47
48 #define miCanZeroArc(arc) (((arc)->width == (arc)->height) || \
49                            (((arc)->width <= 800) && ((arc)->height <= 800)))
50
51 #define MIARCSETUP() \
52     x = info.x; \
53     y = info.y; \
54     k1 = info.k1; \
55     k3 = info.k3; \
56     a = info.a; \
57     b = info.b; \
58     d = info.d; \
59     dx = info.dx; \
60     dy = info.dy
61
62 #define MIARCOCTANTSHIFT(clause) \
63     if (a < 0) \
64     { \
65         if (y == info.h) \
66         { \
67             d = -1; \
68             a = b = k1 = 0; \
69         } \
70         else \
71         { \
72             dx = (k1 << 1) - k3; \
73             k1 = dx - k1; \
74             k3 = -k3; \
75             b = b + a - (k1 >> 1); \
76             d = b + ((-a) >> 1) - d + (k3 >> 3); \
77             if (dx < 0) \
78                 a = -((-dx) >> 1) - a; \
79             else \
80                 a = (dx >> 1) - a; \
81             dx = 0; \
82             dy = 1; \
83             clause \
84         } \
85     }
86
87 #define MIARCSTEP(move1,move2) \
88     b -= k1; \
89     if (d < 0) \
90     { \
91         x += dx; \
92         y += dy; \
93         a += k1; \
94         d += b; \
95         move1 \
96     } \
97     else \
98     { \
99         x++; \
100         y++; \
101         a += k3; \
102         d -= a; \
103         move2 \
104     }
105
106 #define MIARCCIRCLESTEP(clause) \
107     b -= k1; \
108     x++; \
109     if (d < 0) \
110     { \
111         a += k1; \
112         d += b; \
113     } \
114     else \
115     { \
116         y++; \
117         a += k3; \
118         d -= a; \
119         clause \
120     }
121
122 /* mizerarc.c */
123
124 extern Bool miZeroArcSetup(
125 #if NeedFunctionPrototypes
126     xArc * /*arc*/,
127     miZeroArcRec * /*info*/,
128     Bool /*ok360*/
129 #endif
130 );
131
132 extern DDXPointPtr miZeroArcPts(
133 #if NeedFunctionPrototypes
134     xArc * /*arc*/,
135     DDXPointPtr /*pts*/
136 #endif
137 );
138