[GDI32] Update Gdi Driver Header.
[reactos.git] / win32ss / gdi / gdi32 / wine / path.c
1 //
2 //
3 // Do not remove this file, "Justin Case" future maintenance issues with Path arises.......
4 //
5 //
6
7 #include <precomp.h>
8 #include "gdi_private.h"
9
10 #define NDEBUG
11 #include <debug.h>
12
13 WINEDC *get_nulldrv_dc( PHYSDEV dev );
14 const struct gdi_dc_funcs path_driver DECLSPEC_HIDDEN;
15
16 struct path_physdev
17 {
18 struct gdi_physdev dev;
19 //struct gdi_path *path;
20 BOOL HasPathHook;
21 };
22
23 static inline struct path_physdev *get_path_physdev( PHYSDEV dev )
24 {
25 return CONTAINING_RECORD( dev, struct path_physdev, dev );
26 }
27
28 /***********************************************************************
29 * pathdrv_BeginPath
30 */
31 static BOOL pathdrv_BeginPath( PHYSDEV dev )
32 {
33 DPRINT("pathdrv_BeginPath dev %p\n",dev);
34 return TRUE;
35 }
36
37
38 /***********************************************************************
39 * pathdrv_AbortPath
40 */
41 static BOOL pathdrv_AbortPath( PHYSDEV dev )
42 {
43 DC *dc = get_physdev_dc( dev );
44 DPRINT("pathdrv_AbortPath dev %p\n",dev);
45 path_driver.pDeleteDC( pop_dc_driver( dc, &path_driver ));
46 return TRUE;
47 }
48
49
50 /***********************************************************************
51 * pathdrv_EndPath
52 */
53 static BOOL pathdrv_EndPath( PHYSDEV dev )
54 {
55 struct path_physdev *physdev = get_path_physdev( dev );
56 DC *dc = get_physdev_dc( dev );
57
58 DPRINT("pathdrv_EndPath dev %p\n",dev);
59
60 pop_dc_driver( dc, &path_driver );
61 HeapFree( GetProcessHeap(), 0, physdev );
62
63 return TRUE;
64 }
65
66
67 /***********************************************************************
68 * pathdrv_CreateDC
69 */
70 static BOOL pathdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
71 LPCWSTR output, const DEVMODEW *devmode )
72 {
73 struct path_physdev *physdev = HeapAlloc( GetProcessHeap(), 0, sizeof(*physdev) );
74 DPRINT("pathdrv_CreateDC dev %p\n",dev);
75 if (!physdev) return FALSE;
76 push_dc_driver( dev, &physdev->dev, &path_driver );
77 return TRUE;
78 }
79
80
81 /*************************************************************
82 * pathdrv_DeleteDC
83 */
84 static BOOL pathdrv_DeleteDC( PHYSDEV dev )
85 {
86 struct path_physdev *physdev = get_path_physdev( dev );
87 DPRINT("pathdrv_DeleteDC dev %p\n",dev);
88 HeapFree( GetProcessHeap(), 0, physdev );
89 return TRUE;
90 }
91
92 /*************************************************************
93 * pathdrv_MoveTo
94 */
95 static BOOL pathdrv_MoveTo( PHYSDEV dev, INT x, INT y )
96 {
97 // struct path_physdev *physdev = get_path_physdev( dev );
98 // DC *dc = get_physdev_dc( dev );
99 DPRINT("pathdrv_MoveTo dev %p\n",dev);
100 return TRUE;
101 }
102
103
104 /*************************************************************
105 * pathdrv_LineTo
106 */
107 static BOOL pathdrv_LineTo( PHYSDEV dev, INT x, INT y )
108 {
109 // struct path_physdev *physdev = get_path_physdev( dev );
110 // DC *dc = get_physdev_dc( dev );
111 DPRINT("pathdrv_LineTo dev %p\n",dev);
112 return TRUE;
113 }
114
115
116 /*************************************************************
117 * pathdrv_Rectangle
118 */
119 static BOOL pathdrv_Rectangle( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
120 {
121 // struct path_physdev *physdev = get_path_physdev( dev );
122 // DC *dc = get_physdev_dc( dev );
123 DPRINT("pathdrv_Rectangle dev %p\n",dev);
124 return TRUE;
125 }
126
127
128 /*************************************************************
129 * pathdrv_RoundRect
130 */
131 static BOOL pathdrv_RoundRect( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height )
132 {
133 // struct path_physdev *physdev = get_path_physdev( dev );
134 // DC *dc = get_physdev_dc( dev );
135 DPRINT("pathdrv_RoundRect dev %p\n",dev);
136 return TRUE;
137 }
138
139
140 /*************************************************************
141 * pathdrv_Ellipse
142 */
143 static BOOL pathdrv_Ellipse( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
144 {
145 // struct path_physdev *physdev = get_path_physdev( dev );
146 // DC *dc = get_physdev_dc( dev );
147 DPRINT("pathdrv_Ellipse dev %p\n",dev);
148 return TRUE;
149 }
150
151 /*************************************************************
152 * pathdrv_AngleArc
153 */
154 static BOOL pathdrv_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT eStartAngle, FLOAT eSweepAngle)
155 {
156 DPRINT("pathdrv_AngleArc dev %p\n",dev);
157 return TRUE;
158 }
159
160
161 /*************************************************************
162 * pathdrv_Arc
163 */
164 static BOOL pathdrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
165 INT xstart, INT ystart, INT xend, INT yend )
166 {
167 // DC *dc = get_physdev_dc( dev );
168 DPRINT("pathdrv_Arc dev %p\n",dev);
169 return TRUE;
170 }
171
172
173 /*************************************************************
174 * pathdrv_ArcTo
175 */
176 static BOOL pathdrv_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
177 INT xstart, INT ystart, INT xend, INT yend )
178 {
179 // DC *dc = get_physdev_dc( dev );
180 DPRINT("pathdrv_ArcTo dev %p\n",dev);
181 return TRUE;
182 }
183
184
185 /*************************************************************
186 * pathdrv_Chord
187 */
188 static BOOL pathdrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
189 INT xstart, INT ystart, INT xend, INT yend )
190 {
191 // DC *dc = get_physdev_dc( dev );
192 DPRINT("pathdrv_Chord dev %p\n",dev);
193 return TRUE;
194 }
195
196
197 /*************************************************************
198 * pathdrv_Pie
199 */
200 static BOOL pathdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
201 INT xstart, INT ystart, INT xend, INT yend )
202 {
203 // DC *dc = get_physdev_dc( dev );
204 DPRINT("pathdrv_Pie dev %p\n",dev);
205 return TRUE;
206 }
207
208
209 /*************************************************************
210 * pathdrv_PolyBezierTo
211 */
212 static BOOL pathdrv_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD cbPoints )
213 {
214 // struct path_physdev *physdev = get_path_physdev( dev );
215 // DC *dc = get_physdev_dc( dev );
216 DPRINT("pathdrv_PolyBezierTo dev %p\n",dev);
217 return TRUE;
218 }
219
220
221 /*************************************************************
222 * pathdrv_PolyBezier
223 */
224 static BOOL pathdrv_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD cbPoints )
225 {
226 // struct path_physdev *physdev = get_path_physdev( dev );
227 // DC *dc = get_physdev_dc( dev );
228 DPRINT("pathdrv_PolyBezier dev %p\n",dev);
229 return TRUE;
230 }
231
232
233 /*************************************************************
234 * pathdrv_PolyDraw
235 */
236 static BOOL pathdrv_PolyDraw( PHYSDEV dev, const POINT *pts, const BYTE *types, DWORD cbPoints )
237 {
238 // struct path_physdev *physdev = get_path_physdev( dev );
239 // DC *dc = get_physdev_dc( dev );
240 DPRINT("pathdrv_PolyDraw dev %p\n",dev);
241 return TRUE;
242 }
243
244
245 /*************************************************************
246 * pathdrv_Polyline
247 */
248 static BOOL pathdrv_Polyline( PHYSDEV dev, const POINT *pts, INT count )
249 {
250 // struct path_physdev *physdev = get_path_physdev( dev );
251 // DC *dc = get_physdev_dc( dev );
252 DPRINT("pathdrv_PolyLine dev %p\n",dev);
253 return TRUE;
254 }
255
256
257 /*************************************************************
258 * pathdrv_PolylineTo
259 */
260 static BOOL pathdrv_PolylineTo( PHYSDEV dev, const POINT *pts, INT count )
261 {
262 // struct path_physdev *physdev = get_path_physdev( dev );
263 // DC *dc = get_physdev_dc( dev );
264 DPRINT("pathdrv_PolyLineTo dev %p\n",dev);
265 return TRUE;
266 }
267
268
269 /*************************************************************
270 * pathdrv_Polygon
271 */
272 static BOOL pathdrv_Polygon( PHYSDEV dev, const POINT *pts, INT count )
273 {
274 // struct path_physdev *physdev = get_path_physdev( dev );
275 // DC *dc = get_physdev_dc( dev );
276 DPRINT("pathdrv_Polygon dev %p\n",dev);
277 return TRUE;
278 }
279
280
281 /*************************************************************
282 * pathdrv_PolyPolygon
283 */
284 static BOOL pathdrv_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, UINT polygons )
285 {
286 // struct path_physdev *physdev = get_path_physdev( dev );
287 // DC *dc = get_physdev_dc( dev );
288 DPRINT("pathdrv_PolyPolygon dev %p\n",dev);
289 return TRUE;
290 }
291
292
293 /*************************************************************
294 * pathdrv_PolyPolyline
295 */
296 static BOOL pathdrv_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* counts, DWORD polylines )
297 {
298 // struct path_physdev *physdev = get_path_physdev( dev );
299 // DC *dc = get_physdev_dc( dev );
300 DPRINT("pathdrv_PolyPolyline dev %p\n",dev);
301 return TRUE;
302 }
303
304
305 /*************************************************************
306 * pathdrv_ExtTextOut
307 */
308 static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprc,
309 LPCWSTR str, UINT count, const INT *dx )
310 {
311 // struct path_physdev *physdev = get_path_physdev( dev );
312 DPRINT("pathdrv_ExtTextOut dev %p\n",dev);
313 return TRUE;
314 }
315
316 /*************************************************************
317 * pathdrv_CloseFigure
318 */
319 static BOOL pathdrv_CloseFigure( PHYSDEV dev )
320 {
321 // struct path_physdev *physdev = get_path_physdev( dev );
322 DPRINT("pathdrv_CloseFigure dev %p\n",dev);
323 return TRUE;
324 }
325
326
327 /***********************************************************************
328 * null driver fallback implementations
329 */
330
331 BOOL nulldrv_BeginPath( PHYSDEV dev )
332 {
333 DC *dc = get_nulldrv_dc( dev );
334 struct path_physdev *physdev;
335
336 if (!path_driver.pCreateDC( &dc->physDev, NULL, NULL, NULL, NULL ))
337 {
338 return FALSE;
339 }
340 physdev = get_path_physdev( find_dc_driver( dc, &path_driver ));
341 physdev->HasPathHook = TRUE;
342 DPRINT("nulldrv_BeginPath dev %p\n",dev);
343 DPRINT("nulldrv_BeginPath pd %p\n",physdev);
344 return TRUE;
345 }
346
347 BOOL nulldrv_EndPath( PHYSDEV dev )
348 {
349 DPRINT("nulldrv_EndPath dev %p\n",dev);
350 SetLastError( ERROR_CAN_NOT_COMPLETE );
351 return FALSE;
352 }
353
354 BOOL nulldrv_AbortPath( PHYSDEV dev )
355 {
356 //DC *dc = get_nulldrv_dc( dev );
357 DPRINT("nulldrv_AbortPath dev %p\n",dev);
358 //if (dc->path) free_gdi_path( dc->path );
359 //dc->path = NULL;
360 return TRUE;
361 }
362
363 BOOL nulldrv_CloseFigure( PHYSDEV dev )
364 {
365 DPRINT("nulldrv_CloseFigure dev %p\n",dev);
366 SetLastError( ERROR_CAN_NOT_COMPLETE );
367 return FALSE;
368 }
369
370 BOOL nulldrv_SelectClipPath( PHYSDEV dev, INT mode )
371 {
372 BOOL ret = FALSE;
373 HRGN hrgn = PathToRegion( dev->hdc );
374 DPRINT("nulldrv_SelectClipPath dev %p\n",dev);
375 if (hrgn)
376 {
377 ret = ExtSelectClipRgn( dev->hdc, hrgn, mode ) != ERROR;
378 DeleteObject( hrgn );
379 }
380 return ret;
381 // return TRUE;
382 }
383
384 BOOL nulldrv_FillPath( PHYSDEV dev )
385 {
386 DPRINT("nulldrv_FillPath dev %p\n",dev);
387 //if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
388 //AbortPath( dev->hdc );
389 return TRUE;
390 }
391
392 BOOL nulldrv_StrokeAndFillPath( PHYSDEV dev )
393 {
394 DPRINT("nulldrv_StrokeAndFillPath dev %p\n",dev);
395 //if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
396 //AbortPath( dev->hdc );
397 return TRUE;
398 }
399
400 BOOL nulldrv_StrokePath( PHYSDEV dev )
401 {
402 DPRINT("nulldrv_StrokePath dev %p\n",dev);
403 //if (GetPath( dev->hdc, NULL, NULL, 0 ) == -1) return FALSE;
404 //AbortPath( dev->hdc );
405 return TRUE;
406 }
407
408 BOOL nulldrv_FlattenPath( PHYSDEV dev )
409 {
410 /* DC *dc = get_nulldrv_dc( dev );
411 struct gdi_path *path; */
412 DPRINT("nulldrv_FlattenPath dev %p\n",dev);
413 /* if (!dc->path)
414 {
415 SetLastError( ERROR_CAN_NOT_COMPLETE );
416 return FALSE;
417 }
418 if (!(path = PATH_FlattenPath( dc->path ))) return FALSE;
419 free_gdi_path( dc->path );
420 dc->path = path;*/
421 return TRUE;
422 }
423
424 BOOL nulldrv_WidenPath( PHYSDEV dev )
425 {
426 /* DC *dc = get_nulldrv_dc( dev );
427 struct gdi_path *path;*/
428 DPRINT("nulldrv_WidenPath dev %p\n",dev);
429 /* if (!dc->path)
430 {
431 SetLastError( ERROR_CAN_NOT_COMPLETE );
432 return FALSE;
433 }
434 if (!(path = PATH_WidenPath( dc ))) return FALSE;
435 free_gdi_path( dc->path );
436 dc->path = path;*/
437 return TRUE;
438 }
439
440 const struct gdi_dc_funcs path_driver =
441 {
442 NULL, /* pAbortDoc */
443 pathdrv_AbortPath, /* pAbortPath */
444 NULL, /* pAlphaBlend */
445 pathdrv_AngleArc, /* pAngleArc */
446 pathdrv_Arc, /* pArc */
447 pathdrv_ArcTo, /* pArcTo */
448 pathdrv_BeginPath, /* pBeginPath */
449 NULL, /* pBlendImage */
450 pathdrv_Chord, /* pChord */
451 pathdrv_CloseFigure, /* pCloseFigure */
452 NULL, /* pCreateCompatibleDC */
453 pathdrv_CreateDC, /* pCreateDC */
454 pathdrv_DeleteDC, /* pDeleteDC */
455 NULL, /* pDeleteObject */
456 NULL, /* pDeviceCapabilities */
457 pathdrv_Ellipse, /* pEllipse */
458 NULL, /* pEndDoc */
459 NULL, /* pEndPage */
460 pathdrv_EndPath, /* pEndPath */
461 NULL, /* pEnumFonts */
462 NULL, /* pEnumICMProfiles */
463 NULL, /* pExcludeClipRect */
464 NULL, /* pExtDeviceMode */
465 NULL, /* pExtEscape */
466 NULL, /* pExtFloodFill */
467 NULL, /* pExtSelectClipRgn */
468 pathdrv_ExtTextOut, /* pExtTextOut */
469 NULL, /* pFillPath */
470 NULL, /* pFillRgn */
471 NULL, /* pFlattenPath */
472 NULL, /* pFontIsLinked */
473 NULL, /* pFrameRgn */
474 NULL, /* pGdiComment */
475 NULL, /* pGetBoundsRect */
476 NULL, /* pGetCharABCWidths */
477 NULL, /* pGetCharABCWidthsI */
478 NULL, /* pGetCharWidth */
479 NULL, /* pGetCharWidthInfo */
480 NULL, /* pGetDeviceCaps */
481 NULL, /* pGetDeviceGammaRamp */
482 NULL, /* pGetFontData */
483 NULL, /* pGetFontRealizationInfo */
484 NULL, /* pGetFontUnicodeRanges */
485 NULL, /* pGetGlyphIndices */
486 NULL, /* pGetGlyphOutline */
487 NULL, /* pGetICMProfile */
488 NULL, /* pGetImage */
489 NULL, /* pGetKerningPairs */
490 NULL, /* pGetNearestColor */
491 NULL, /* pGetOutlineTextMetrics */
492 NULL, /* pGetPixel */
493 NULL, /* pGetSystemPaletteEntries */
494 NULL, /* pGetTextCharsetInfo */
495 NULL, /* pGetTextExtentExPoint */
496 NULL, /* pGetTextExtentExPointI */
497 NULL, /* pGetTextFace */
498 NULL, /* pGetTextMetrics */
499 NULL, /* pGradientFill */
500 NULL, /* pIntersectClipRect */
501 NULL, /* pInvertRgn */
502 pathdrv_LineTo, /* pLineTo */
503 NULL, /* pModifyWorldTransform */
504 pathdrv_MoveTo, /* pMoveTo */
505 NULL, /* pOffsetClipRgn */
506 NULL, /* pOffsetViewportOrg */
507 NULL, /* pOffsetWindowOrg */
508 NULL, /* pPaintRgn */
509 NULL, /* pPatBlt */
510 pathdrv_Pie, /* pPie */
511 pathdrv_PolyBezier, /* pPolyBezier */
512 pathdrv_PolyBezierTo, /* pPolyBezierTo */
513 pathdrv_PolyDraw, /* pPolyDraw */
514 pathdrv_PolyPolygon, /* pPolyPolygon */
515 pathdrv_PolyPolyline, /* pPolyPolyline */
516 pathdrv_Polygon, /* pPolygon */
517 pathdrv_Polyline, /* pPolyline */
518 pathdrv_PolylineTo, /* pPolylineTo */
519 NULL, /* pPutImage */
520 NULL, /* pRealizeDefaultPalette */
521 NULL, /* pRealizePalette */
522 pathdrv_Rectangle, /* pRectangle */
523 NULL, /* pResetDC */
524 NULL, /* pRestoreDC */
525 pathdrv_RoundRect, /* pRoundRect */
526 NULL, /* pSaveDC */
527 NULL, /* pScaleViewportExt */
528 NULL, /* pScaleWindowExt */
529 NULL, /* pSelectBitmap */
530 NULL, /* pSelectBrush */
531 NULL, /* pSelectClipPath */
532 NULL, /* pSelectFont */
533 NULL, /* pSelectPalette */
534 NULL, /* pSelectPen */
535 NULL, /* pSetArcDirection */
536 NULL, /* pSetBkColor */
537 NULL, /* pSetBkMode */
538 NULL, /* pSetDCBrushColor */
539 NULL, /* pSetDCPenColor */
540 NULL, /* pSetDIBColorTable */
541 NULL, /* pSetDIBitsToDevice */
542 NULL, /* pSetDeviceClipping */
543 NULL, /* pSetDeviceGammaRamp */
544 NULL, /* pSetLayout */
545 NULL, /* pSetMapMode */
546 NULL, /* pSetMapperFlags */
547 NULL, /* pSetPixel */
548 NULL, /* pSetPolyFillMode */
549 NULL, /* pSetROP2 */
550 NULL, /* pSetRelAbs */
551 NULL, /* pSetStretchBltMode */
552 NULL, /* pSetTextAlign */
553 NULL, /* pSetTextCharacterExtra */
554 NULL, /* pSetTextColor */
555 NULL, /* pSetTextJustification */
556 NULL, /* pSetViewportExt */
557 NULL, /* pSetViewportOrg */
558 NULL, /* pSetWindowExt */
559 NULL, /* pSetWindowOrg */
560 NULL, /* pSetWorldTransform */
561 NULL, /* pStartDoc */
562 NULL, /* pStartPage */
563 NULL, /* pStretchBlt */
564 NULL, /* pStretchDIBits */
565 NULL, /* pStrokeAndFillPath */
566 NULL, /* pStrokePath */
567 NULL, /* pUnrealizePalette */
568 NULL, /* pWidenPath */
569 NULL, /* wine_get_wgl_driver */
570 GDI_PRIORITY_PATH_DRV /* priority */
571 };