Support for VMware video drivers
[reactos.git] / reactos / subsys / win32k / objects / fillshap.c
1
2 #undef WIN32_LEAN_AND_MEAN
3 #include <windows.h>
4 #include <ddk/ntddk.h>
5 #include <win32k/fillshap.h>
6 #include <win32k/dc.h>
7 #include <win32k/pen.h>
8 #include <include/object.h>
9 #include <include/inteng.h>
10
11 #define NDEBUG
12 #include <win32k/debug1.h>
13
14 BOOL
15 STDCALL
16 W32kChord(HDC hDC,
17 int LeftRect,
18 int TopRect,
19 int RightRect,
20 int BottomRect,
21 int XRadial1,
22 int YRadial1,
23 int XRadial2,
24 int YRadial2)
25 {
26 UNIMPLEMENTED;
27 }
28
29 BOOL
30 STDCALL
31 W32kEllipse(HDC hDC,
32 int LeftRect,
33 int TopRect,
34 int RightRect,
35 int BottomRect)
36 {
37 UNIMPLEMENTED;
38 }
39
40 BOOL
41 STDCALL
42 W32kPie(HDC hDC,
43 int LeftRect,
44 int TopRect,
45 int RightRect,
46 int BottomRect,
47 int XRadial1,
48 int YRadial1,
49 int XRadial2,
50 int YRadial2)
51 {
52 UNIMPLEMENTED;
53 }
54
55 BOOL
56 STDCALL
57 W32kPolygon(HDC hDC,
58 CONST PPOINT Points,
59 int Count)
60 {
61 UNIMPLEMENTED;
62 }
63
64 BOOL
65 STDCALL
66 W32kPolyPolygon(HDC hDC,
67 CONST LPPOINT Points,
68 CONST LPINT PolyCounts,
69 int Count)
70 {
71 UNIMPLEMENTED;
72 }
73
74 BOOL
75 STDCALL
76 W32kRectangle(HDC hDC,
77 int LeftRect,
78 int TopRect,
79 int RightRect,
80 int BottomRect)
81 {
82 DC *dc = DC_HandleToPtr(hDC);
83 SURFOBJ *SurfObj = (SURFOBJ*)AccessUserObject((ULONG)dc->Surface);
84 PBRUSHOBJ BrushObj;
85 BOOL ret;
86 PRECTL RectBounds;
87 PENOBJ * pen;
88 RECTL DestRect;
89
90 if(!dc)
91 return FALSE;
92
93 RectBounds = GDIOBJ_LockObj(dc->w.hGCClipRgn, GO_REGION_MAGIC);
94 //ei not yet implemented ASSERT(RectBounds);
95
96 if(PATH_IsPathOpen(dc->w.path)) {
97 ret = PATH_Rectangle(hDC, LeftRect, TopRect, RightRect, BottomRect);
98 } else {
99 // Draw the rectangle with the current pen
100 pen = (PENOBJ*) GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
101 ASSERT(pen);
102 BrushObj = (PBRUSHOBJ)PenToBrushObj(dc, pen);
103 GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC );
104
105 LeftRect += dc->w.DCOrgX;
106 RightRect += dc->w.DCOrgX;
107 TopRect += dc->w.DCOrgY;
108 BottomRect += dc->w.DCOrgY;
109
110 ret = IntEngLineTo(SurfObj,
111 NULL, // ClipObj,
112 BrushObj,
113 LeftRect, TopRect, RightRect, TopRect,
114 RectBounds, // Bounding rectangle
115 dc->w.ROPmode); // MIX
116
117 ret = IntEngLineTo(SurfObj,
118 NULL, // ClipObj,
119 BrushObj,
120 RightRect, TopRect, RightRect, BottomRect,
121 RectBounds, // Bounding rectangle
122 dc->w.ROPmode); // MIX
123
124 ret = IntEngLineTo(SurfObj,
125 NULL, // ClipObj,
126 BrushObj,
127 LeftRect, BottomRect, RightRect, BottomRect,
128 RectBounds, // Bounding rectangle
129 dc->w.ROPmode); // MIX
130
131 ret = IntEngLineTo(SurfObj,
132 NULL, // ClipObj,
133 BrushObj,
134 LeftRect, TopRect, LeftRect, BottomRect,
135 RectBounds, // Bounding rectangle
136 dc->w.ROPmode); // MIX */
137
138 // FIXME: BrushObj is obtained above; decide which one is correct
139 BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
140
141 if (BrushObj)
142 {
143 if (BrushObj->logbrush.lbStyle != BS_NULL)
144 {
145 DestRect.left = LeftRect + 1;
146 DestRect.right = RightRect - 1;
147 DestRect.top = TopRect + 1;
148 DestRect.bottom = BottomRect - 1;
149 ret = EngBitBlt(SurfObj,
150 NULL,
151 NULL,
152 NULL,
153 NULL,
154 &DestRect,
155 NULL,
156 NULL,
157 BrushObj,
158 NULL,
159 PATCOPY);
160 }
161 }
162 GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC );
163 }
164
165 // FIXME: Move current position in DC?
166 GDIOBJ_UnlockObj(dc->w.hGCClipRgn, GO_REGION_MAGIC);
167 DC_ReleasePtr( hDC );
168 return TRUE;
169 }
170
171 BOOL
172 STDCALL
173 W32kRoundRect(HDC hDC,
174 int LeftRect,
175 int TopRect,
176 int RightRect,
177 int BottomRect,
178 int Width,
179 int Height)
180 {
181 UNIMPLEMENTED;
182 }