b3d534afc4e1b77b1ae6bc5be58f6a3d8044834a
[reactos.git] / reactos / dll / win32 / gdi32 / objects / arc.c
1 #include "precomp.h"
2
3 BOOL
4 WINAPI
5 Arc(
6 HDC hDC,
7 int nLeftRect,
8 int nTopRect,
9 int nRightRect,
10 int nBottomRect,
11 int nXStartArc,
12 int nYStartArc,
13 int nXEndArc,
14 int nYEndArc
15 )
16 {
17 #if 0
18 // Handle something other than a normal dc object.
19 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
20 {
21 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
22 // Call Wine (rewrite of) MFDRV_MetaParam8
23 return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8)
24 else
25 {
26 PLDC pLDC = GdiGetLDC(hDC);
27 if ( !pLDC )
28 {
29 SetLastError(ERROR_INVALID_HANDLE);
30 return FALSE;
31 }
32 if (pLDC->iType == LDC_EMFLDC)
33 {
34 // Call Wine (rewrite of) EMFDRV_ArcChordPie
35 BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC);
36 return Ret;
37 }
38 return FALSE;
39 }
40 }
41 #endif
42 return NtGdiArcInternal(GdiTypeArc,
43 hDC,
44 nLeftRect,
45 nTopRect,
46 nRightRect,
47 nBottomRect,
48 nXStartArc,
49 nYStartArc,
50 nXEndArc,
51 nYEndArc);
52 }
53
54
55 /*
56 * @implemented
57 */
58 BOOL
59 STDCALL
60 AngleArc(HDC hDC,
61 int X,
62 int Y,
63 DWORD Radius,
64 FLOAT StartAngle,
65 FLOAT SweepAngle)
66 {
67 gxf_long worker, worker1;
68
69 worker.f = StartAngle;
70 worker1.f = SweepAngle;
71
72 #if 0
73 // Handle something other than a normal dc object.
74 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
75 {
76 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
77 return FALSE; //No meta support for AngleArc
78 else
79 {
80 PLDC pLDC = GdiGetLDC(hDC);
81 if ( !pLDC )
82 {
83 SetLastError(ERROR_INVALID_HANDLE);
84 return FALSE;
85 }
86 if (pLDC->iType == LDC_EMFLDC)
87 {
88 BOOL Ret = EMFDRV_AngleArc( hDC, X, Y, Radius, StartAngle, SweepAngle);
89 return Ret;
90 }
91 return FALSE;
92 }
93 }
94 #endif
95 return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l);
96 }
97
98 BOOL
99 WINAPI
100 ArcTo(
101 HDC hDC,
102 int nLeftRect,
103 int nTopRect,
104 int nRightRect,
105 int nBottomRect,
106 int nXRadial1,
107 int nYRadial1,
108 int nXRadial2,
109 int nYRadial2)
110 {
111 #if 0
112 // Handle something other than a normal dc object.
113 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
114 {
115 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
116 return FALSE; //No meta support for ArcTo
117 else
118 {
119 PLDC pLDC = GdiGetLDC(hDC);
120 if ( !pLDC )
121 {
122 SetLastError(ERROR_INVALID_HANDLE);
123 return FALSE;
124 }
125 if (pLDC->iType == LDC_EMFLDC)
126 {
127 BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO);
128 return Ret;
129 }
130 return FALSE;
131 }
132 }
133 #endif
134 return NtGdiArcInternal(GdiTypeArcTo,
135 hDC,
136 nLeftRect,
137 nTopRect,
138 nRightRect,
139 nBottomRect,
140 nXRadial1,
141 nYRadial1,
142 nXRadial2,
143 nYRadial2);
144 }
145
146 BOOL
147 WINAPI
148 Chord(
149 HDC hDC,
150 int nLeftRect,
151 int nTopRect,
152 int nRightRect,
153 int nBottomRect,
154 int nXRadial1,
155 int nYRadial1,
156 int nXRadial2,
157 int nYRadial2)
158 {
159 #if 0
160 // Handle something other than a normal dc object.
161 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
162 {
163 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
164 return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8)
165 else
166 {
167 PLDC pLDC = GdiGetLDC(hDC);
168 if ( !pLDC )
169 {
170 SetLastError(ERROR_INVALID_HANDLE);
171 return FALSE;
172 }
173 if (pLDC->iType == LDC_EMFLDC)
174 {
175 BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD);
176 return Ret;
177 }
178 return FALSE;
179 }
180 }
181 #endif
182 return NtGdiArcInternal(GdiTypeChord,
183 hDC,
184 nLeftRect,
185 nTopRect,
186 nRightRect,
187 nBottomRect,
188 nXRadial1,
189 nYRadial1,
190 nXRadial2,
191 nYRadial2);
192 }
193
194
195 /*
196 * @unimplemented
197 */
198 BOOL
199 STDCALL
200 Pie(
201 HDC hDC,
202 int a1,
203 int a2,
204 int a3,
205 int a4,
206 int a5,
207 int a6,
208 int a7,
209 int a8
210 )
211 {
212 #if 0
213 // Handle something other than a normal dc object.
214 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
215 {
216 if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
217 return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8)
218 else
219 {
220 PLDC pLDC = GdiGetLDC(hDC);
221 if ( !pLDC )
222 {
223 SetLastError(ERROR_INVALID_HANDLE);
224 return FALSE;
225 }
226 if (pLDC->iType == LDC_EMFLDC)
227 {
228 BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE);
229 return Ret;
230 }
231 return FALSE;
232 }
233 }
234 #endif
235 return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8);
236 }
237
238