Enhanced synchronization between playback thread and stop/close commands
[wine.git] / graphics / painting.c
blob54a0190da9d490eb016a36e93b1ed72f0fa5bc90
1 /*
2 * Misc. graphics operations
4 * Copyright 1993, 1994 Alexandre Julliard
5 * Copyright 1997 Bertho A. Stultiens
6 */
8 #include <string.h>
9 #include "dc.h"
10 #include "bitmap.h"
11 #include "heap.h"
12 #include "monitor.h"
13 #include "cache.h"
14 #include "region.h"
15 #include "path.h"
16 #include "debugtools.h"
17 #include "winerror.h"
18 #include "winuser.h"
19 #include "wine/winuser16.h"
21 DEFAULT_DEBUG_CHANNEL(gdi)
24 /***********************************************************************
25 * LineTo16 (GDI.19)
27 BOOL16 WINAPI LineTo16( HDC16 hdc, INT16 x, INT16 y )
29 return LineTo( hdc, x, y );
33 /***********************************************************************
34 * LineTo (GDI32.249)
36 BOOL WINAPI LineTo( HDC hdc, INT x, INT y )
38 DC * dc = DC_GetDCPtr( hdc );
39 BOOL ret;
41 if(!dc) return FALSE;
43 if(PATH_IsPathOpen(dc->w.path))
44 ret = PATH_LineTo(hdc, x, y);
45 else
46 ret = dc->funcs->pLineTo && dc->funcs->pLineTo(dc,x,y);
47 if(ret) {
48 dc->w.CursPosX = x;
49 dc->w.CursPosY = y;
51 return ret;
55 /***********************************************************************
56 * MoveTo16 (GDI.20)
58 DWORD WINAPI MoveTo16( HDC16 hdc, INT16 x, INT16 y )
60 POINT16 pt;
62 if (!MoveToEx16(hdc,x,y,&pt))
63 return 0;
64 return MAKELONG(pt.x,pt.y);
68 /***********************************************************************
69 * MoveToEx16 (GDI.483)
71 BOOL16 WINAPI MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
73 POINT pt32;
75 if (!MoveToEx( (HDC)hdc, (INT)x, (INT)y, &pt32 )) return FALSE;
76 if (pt) CONV_POINT32TO16( &pt32, pt );
77 return TRUE;
82 /***********************************************************************
83 * MoveToEx (GDI32.254)
85 BOOL WINAPI MoveToEx( HDC hdc, INT x, INT y, LPPOINT pt )
87 DC * dc = DC_GetDCPtr( hdc );
89 if(!dc) return FALSE;
91 if(pt) {
92 pt->x = dc->w.CursPosX;
93 pt->y = dc->w.CursPosY;
95 dc->w.CursPosX = x;
96 dc->w.CursPosY = y;
98 if(PATH_IsPathOpen(dc->w.path))
99 return PATH_MoveTo(hdc);
101 if(dc->funcs->pMoveToEx)
102 return dc->funcs->pMoveToEx(dc,x,y,pt);
103 return TRUE;
107 /***********************************************************************
108 * Arc16 (GDI.23)
110 BOOL16 WINAPI Arc16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
111 INT16 bottom, INT16 xstart, INT16 ystart,
112 INT16 xend, INT16 yend )
114 return Arc( (HDC)hdc, (INT)left, (INT)top, (INT)right,
115 (INT)bottom, (INT)xstart, (INT)ystart, (INT)xend,
116 (INT)yend );
120 /***********************************************************************
121 * Arc (GDI32.7)
123 BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right,
124 INT bottom, INT xstart, INT ystart,
125 INT xend, INT yend )
127 DC * dc = DC_GetDCPtr( hdc );
129 if(dc && PATH_IsPathOpen(dc->w.path))
130 return PATH_Arc(hdc, left, top, right, bottom, xstart, ystart, xend,
131 yend);
133 return dc && dc->funcs->pArc &&
134 dc->funcs->pArc(dc,left,top,right,bottom,xstart,ystart,xend,yend);
137 /***********************************************************************
138 * ArcTo (GDI32.8)
140 BOOL WINAPI ArcTo( HDC hdc,
141 INT left, INT top,
142 INT right, INT bottom,
143 INT xstart, INT ystart,
144 INT xend, INT yend )
146 BOOL result;
147 DC * dc = DC_GetDCPtr( hdc );
149 if(!dc) return FALSE;
151 if(dc->funcs->pArcTo)
152 return dc->funcs->pArcTo( dc, left, top, right, bottom,
153 xstart, ystart, xend, yend );
155 * Else emulate it.
156 * According to the documentation, a line is drawn from the current
157 * position to the starting point of the arc.
159 LineTo(hdc, xstart, ystart);
162 * Then the arc is drawn.
164 result = Arc(hdc,
165 left, top,
166 right, bottom,
167 xstart, ystart,
168 xend, yend);
171 * If no error occured, the current position is moved to the ending
172 * point of the arc.
174 if (result)
176 MoveToEx(hdc, xend, yend, NULL);
179 return result;
182 /***********************************************************************
183 * Pie16 (GDI.26)
185 BOOL16 WINAPI Pie16( HDC16 hdc, INT16 left, INT16 top,
186 INT16 right, INT16 bottom, INT16 xstart, INT16 ystart,
187 INT16 xend, INT16 yend )
189 return Pie( (HDC)hdc, (INT)left, (INT)top, (INT)right,
190 (INT)bottom, (INT)xstart, (INT)ystart, (INT)xend,
191 (INT)yend );
195 /***********************************************************************
196 * Pie (GDI32.262)
198 BOOL WINAPI Pie( HDC hdc, INT left, INT top,
199 INT right, INT bottom, INT xstart, INT ystart,
200 INT xend, INT yend )
202 DC * dc = DC_GetDCPtr( hdc );
204 return dc && dc->funcs->pPie &&
205 dc->funcs->pPie(dc,left,top,right,bottom,xstart,ystart,xend,yend);
209 /***********************************************************************
210 * Chord16 (GDI.348)
212 BOOL16 WINAPI Chord16( HDC16 hdc, INT16 left, INT16 top,
213 INT16 right, INT16 bottom, INT16 xstart, INT16 ystart,
214 INT16 xend, INT16 yend )
216 return Chord( hdc, left, top, right, bottom, xstart, ystart, xend, yend );
220 /***********************************************************************
221 * Chord (GDI32.14)
223 BOOL WINAPI Chord( HDC hdc, INT left, INT top,
224 INT right, INT bottom, INT xstart, INT ystart,
225 INT xend, INT yend )
227 DC * dc = DC_GetDCPtr( hdc );
229 return dc && dc->funcs->pChord &&
230 dc->funcs->pChord(dc,left,top,right,bottom,xstart,ystart,xend,yend);
234 /***********************************************************************
235 * Ellipse16 (GDI.24)
237 BOOL16 WINAPI Ellipse16( HDC16 hdc, INT16 left, INT16 top,
238 INT16 right, INT16 bottom )
240 return Ellipse( hdc, left, top, right, bottom );
244 /***********************************************************************
245 * Ellipse (GDI32.75)
247 BOOL WINAPI Ellipse( HDC hdc, INT left, INT top,
248 INT right, INT bottom )
250 DC * dc = DC_GetDCPtr( hdc );
252 return dc && dc->funcs->pEllipse &&
253 dc->funcs->pEllipse(dc,left,top,right,bottom);
257 /***********************************************************************
258 * Rectangle16 (GDI.27)
260 BOOL16 WINAPI Rectangle16( HDC16 hdc, INT16 left, INT16 top,
261 INT16 right, INT16 bottom )
263 return Rectangle( hdc, left, top, right, bottom );
267 /***********************************************************************
268 * Rectangle (GDI32.283)
270 BOOL WINAPI Rectangle( HDC hdc, INT left, INT top,
271 INT right, INT bottom )
273 DC * dc = DC_GetDCPtr( hdc );
275 if(dc && PATH_IsPathOpen(dc->w.path))
276 return PATH_Rectangle(hdc, left, top, right, bottom);
278 return dc && dc->funcs->pRectangle &&
279 dc->funcs->pRectangle(dc,left,top,right,bottom);
283 /***********************************************************************
284 * RoundRect16 (GDI.28)
286 BOOL16 WINAPI RoundRect16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
287 INT16 bottom, INT16 ell_width, INT16 ell_height )
289 return RoundRect( hdc, left, top, right, bottom, ell_width, ell_height );
293 /***********************************************************************
294 * RoundRect (GDI32.291)
296 BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right,
297 INT bottom, INT ell_width, INT ell_height )
300 if(ell_width == 0 || ell_height == 0) /* Just an optimization */
301 return Rectangle(hdc, left, top, right, bottom);
303 else {
304 DC * dc = DC_GetDCPtr( hdc );
306 return dc && dc->funcs->pRoundRect &&
307 dc->funcs->pRoundRect(dc,left,top,right,bottom,ell_width,ell_height);
311 /***********************************************************************
312 * SetPixel16 (GDI.31)
314 COLORREF WINAPI SetPixel16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
316 return SetPixel( hdc, x, y, color );
320 /***********************************************************************
321 * SetPixel (GDI32.327)
323 COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
325 DC * dc = DC_GetDCPtr( hdc );
327 if (!dc || !dc->funcs->pSetPixel) return 0;
328 return dc->funcs->pSetPixel(dc,x,y,color);
331 /***********************************************************************
332 * SetPixelV (GDI32.329)
334 BOOL WINAPI SetPixelV( HDC hdc, INT x, INT y, COLORREF color )
336 DC * dc = DC_GetDCPtr( hdc );
338 if (!dc || !dc->funcs->pSetPixel) return FALSE;
339 dc->funcs->pSetPixel(dc,x,y,color);
340 return TRUE;
343 /***********************************************************************
344 * GetPixel16 (GDI.83)
346 COLORREF WINAPI GetPixel16( HDC16 hdc, INT16 x, INT16 y )
348 return GetPixel( hdc, x, y );
352 /***********************************************************************
353 * GetPixel (GDI32.211)
355 COLORREF WINAPI GetPixel( HDC hdc, INT x, INT y )
357 DC * dc = DC_GetDCPtr( hdc );
359 if (!dc) return 0;
360 #ifdef SOLITAIRE_SPEED_HACK
361 return 0;
362 #endif
364 /* FIXME: should this be in the graphics driver? */
365 if (!PtVisible( hdc, x, y )) return 0;
366 if (!dc || !dc->funcs->pGetPixel) return 0;
367 return dc->funcs->pGetPixel(dc,x,y);
371 /******************************************************************************
372 * ChoosePixelFormat [GDI32.13]
373 * Matches a pixel format to given format
375 * PARAMS
376 * hdc [I] Device context to search for best pixel match
377 * ppfd [I] Pixel format for which a match is sought
379 * RETURNS
380 * Success: Pixel format index closest to given format
381 * Failure: 0
383 INT WINAPI ChoosePixelFormat( HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd )
385 FIXME("(%d,%p): stub\n",hdc,ppfd);
386 return 1;
390 /******************************************************************************
391 * SetPixelFormat [GDI32.328]
392 * Sets pixel format of device context
394 * PARAMS
395 * hdc [I] Device context to search for best pixel match
396 * iPixelFormat [I] Pixel format index
397 * ppfd [I] Pixel format for which a match is sought
399 * RETURNS STD
401 BOOL WINAPI SetPixelFormat( HDC hdc, int iPixelFormat,
402 const PIXELFORMATDESCRIPTOR* ppfd)
404 FIXME("(%d,%d,%p): stub\n",hdc,iPixelFormat,ppfd);
405 return TRUE;
409 /******************************************************************************
410 * GetPixelFormat [GDI32.212]
411 * Gets index of pixel format of DC
413 * PARAMETERS
414 * hdc [I] Device context whose pixel format index is sought
416 * RETURNS
417 * Success: Currently selected pixel format
418 * Failure: 0
420 int WINAPI GetPixelFormat( HDC hdc )
422 FIXME("(%d): stub\n",hdc);
423 return 1;
427 /******************************************************************************
428 * DescribePixelFormat [GDI32.71]
429 * Gets info about pixel format from DC
431 * PARAMS
432 * hdc [I] Device context
433 * iPixelFormat [I] Pixel format selector
434 * nBytes [I] Size of buffer
435 * ppfd [O] Pointer to structure to receive pixel format data
437 * RETURNS
438 * Success: Maximum pixel format index of the device context
439 * Failure: 0
441 int WINAPI DescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes,
442 LPPIXELFORMATDESCRIPTOR ppfd )
444 FIXME("(%d,%d,%d,%p): stub\n",hdc,iPixelFormat,nBytes,ppfd);
445 ppfd->nSize = nBytes;
446 ppfd->nVersion = 1;
447 return 3;
451 /******************************************************************************
452 * SwapBuffers [GDI32.354]
453 * Exchanges front and back buffers of window
455 * PARAMS
456 * hdc [I] Device context whose buffers get swapped
458 * RETURNS STD
460 BOOL WINAPI SwapBuffers( HDC hdc )
462 FIXME("(%d): stub\n",hdc);
463 return TRUE;
467 /***********************************************************************
468 * PaintRgn16 (GDI.43)
470 BOOL16 WINAPI PaintRgn16( HDC16 hdc, HRGN16 hrgn )
472 return PaintRgn( hdc, hrgn );
476 /***********************************************************************
477 * PaintRgn (GDI32.259)
479 BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn )
481 DC * dc = DC_GetDCPtr( hdc );
483 return dc && dc->funcs->pPaintRgn &&
484 dc->funcs->pPaintRgn(dc,hrgn);
488 /***********************************************************************
489 * FillRgn16 (GDI.40)
491 BOOL16 WINAPI FillRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush )
493 return FillRgn( hdc, hrgn, hbrush );
497 /***********************************************************************
498 * FillRgn (GDI32.101)
500 BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush )
502 BOOL retval;
503 HBRUSH prevBrush;
504 DC * dc = DC_GetDCPtr( hdc );
506 if (!dc) return FALSE;
507 if(dc->funcs->pFillRgn)
508 return dc->funcs->pFillRgn(dc, hrgn, hbrush);
510 prevBrush = SelectObject( hdc, hbrush );
511 if (!prevBrush) return FALSE;
512 retval = PaintRgn( hdc, hrgn );
513 SelectObject( hdc, prevBrush );
514 return retval;
518 /***********************************************************************
519 * FrameRgn16 (GDI.41)
521 BOOL16 WINAPI FrameRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush,
522 INT16 nWidth, INT16 nHeight )
524 return FrameRgn( hdc, hrgn, hbrush, nWidth, nHeight );
528 /***********************************************************************
529 * FrameRgn (GDI32.105)
531 BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush,
532 INT nWidth, INT nHeight )
534 HRGN tmp;
535 DC *dc = DC_GetDCPtr( hdc );
537 if(dc->funcs->pFrameRgn)
538 return dc->funcs->pFrameRgn( dc, hrgn, hbrush, nWidth, nHeight );
540 tmp = CreateRectRgn( 0, 0, 0, 0 );
541 if(!REGION_FrameRgn( tmp, hrgn, nWidth, nHeight )) return FALSE;
542 FillRgn( hdc, tmp, hbrush );
543 DeleteObject( tmp );
544 return TRUE;
548 /***********************************************************************
549 * InvertRgn16 (GDI.42)
551 BOOL16 WINAPI InvertRgn16( HDC16 hdc, HRGN16 hrgn )
553 return InvertRgn( hdc, hrgn );
557 /***********************************************************************
558 * InvertRgn (GDI32.246)
560 BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn )
562 HBRUSH prevBrush;
563 INT prevROP;
564 BOOL retval;
565 DC *dc = DC_GetDCPtr( hdc );
567 if(dc->funcs->pInvertRgn)
568 return dc->funcs->pInvertRgn( dc, hrgn );
570 prevBrush = SelectObject( hdc, GetStockObject(BLACK_BRUSH) );
571 prevROP = SetROP2( hdc, R2_NOT );
572 retval = PaintRgn( hdc, hrgn );
573 SelectObject( hdc, prevBrush );
574 SetROP2( hdc, prevROP );
575 return retval;
578 /**********************************************************************
579 * Polyline16 (GDI.37)
581 BOOL16 WINAPI Polyline16( HDC16 hdc, const POINT16* pt, INT16 count )
583 register int i;
584 BOOL16 ret;
585 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
586 count*sizeof(POINT) );
588 if (!pt32) return FALSE;
589 for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
590 ret = Polyline(hdc,pt32,count);
591 HeapFree( GetProcessHeap(), 0, pt32 );
592 return ret;
596 /**********************************************************************
597 * Polyline (GDI32.276)
599 BOOL WINAPI Polyline( HDC hdc, const POINT* pt, INT count )
601 DC * dc = DC_GetDCPtr( hdc );
603 return dc && dc->funcs->pPolyline &&
604 dc->funcs->pPolyline(dc,pt,count);
607 /**********************************************************************
608 * PolylineTo (GDI32.277)
610 BOOL WINAPI PolylineTo( HDC hdc, const POINT* pt, DWORD cCount )
612 DC * dc = DC_GetDCPtr( hdc );
613 BOOL ret;
615 if(!dc) return FALSE;
617 if(dc->funcs->pPolylineTo)
618 ret = dc->funcs->pPolylineTo(dc, pt, cCount);
620 else { /* do it using Polyline */
621 POINT *pts = HeapAlloc( GetProcessHeap(), 0,
622 sizeof(POINT) * (cCount + 1) );
623 if(!pts) return FALSE;
625 pts[0].x = dc->w.CursPosX;
626 pts[0].y = dc->w.CursPosY;
627 memcpy( pts + 1, pt, sizeof(POINT) * cCount );
628 ret = Polyline( hdc, pts, cCount + 1 );
629 HeapFree( GetProcessHeap(), 0, pts );
631 if(ret) {
632 dc->w.CursPosX = pt[cCount-1].x;
633 dc->w.CursPosY = pt[cCount-1].y;
635 return ret;
638 /**********************************************************************
639 * Polygon16 (GDI.36)
641 BOOL16 WINAPI Polygon16( HDC16 hdc, const POINT16* pt, INT16 count )
643 register int i;
644 BOOL ret;
645 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
646 count*sizeof(POINT) );
648 if (!pt32) return FALSE;
649 for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
650 ret = Polygon(hdc,pt32,count);
651 HeapFree( GetProcessHeap(), 0, pt32 );
652 return ret;
656 /**********************************************************************
657 * Polygon (GDI32.275)
659 BOOL WINAPI Polygon( HDC hdc, const POINT* pt, INT count )
661 DC * dc = DC_GetDCPtr( hdc );
663 return dc && dc->funcs->pPolygon &&
664 dc->funcs->pPolygon(dc,pt,count);
668 /**********************************************************************
669 * PolyPolygon16 (GDI.450)
671 BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts,
672 UINT16 polygons )
674 int i,nrpts;
675 LPPOINT pt32;
676 LPINT counts32;
677 BOOL16 ret;
679 nrpts=0;
680 for (i=polygons;i--;)
681 nrpts+=counts[i];
682 pt32 = (LPPOINT)HEAP_xalloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts);
683 for (i=nrpts;i--;)
684 CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
685 counts32 = (LPINT)HEAP_xalloc( GetProcessHeap(), 0,
686 polygons*sizeof(INT) );
687 for (i=polygons;i--;) counts32[i]=counts[i];
689 ret = PolyPolygon(hdc,pt32,counts32,polygons);
690 HeapFree( GetProcessHeap(), 0, counts32 );
691 HeapFree( GetProcessHeap(), 0, pt32 );
692 return ret;
695 /**********************************************************************
696 * PolyPolygon (GDI.450)
698 BOOL WINAPI PolyPolygon( HDC hdc, const POINT* pt, const INT* counts,
699 UINT polygons )
701 DC * dc = DC_GetDCPtr( hdc );
703 return dc && dc->funcs->pPolyPolygon &&
704 dc->funcs->pPolyPolygon(dc,pt,counts,polygons);
707 /**********************************************************************
708 * PolyPolyline (GDI32.272)
710 BOOL WINAPI PolyPolyline( HDC hdc, const POINT* pt, const DWORD* counts,
711 DWORD polylines )
713 DC * dc = DC_GetDCPtr( hdc );
715 return dc && dc->funcs->pPolyPolyline &&
716 dc->funcs->pPolyPolyline(dc,pt,counts,polylines);
719 /**********************************************************************
720 * ExtFloodFill16 (GDI.372)
722 BOOL16 WINAPI ExtFloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color,
723 UINT16 fillType )
725 return ExtFloodFill( hdc, x, y, color, fillType );
729 /**********************************************************************
730 * ExtFloodFill (GDI32.96)
732 BOOL WINAPI ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color,
733 UINT fillType )
735 DC *dc = DC_GetDCPtr( hdc );
737 return dc && dc->funcs->pExtFloodFill &&
738 dc->funcs->pExtFloodFill(dc,x,y,color,fillType);
742 /**********************************************************************
743 * FloodFill16 (GDI.25)
745 BOOL16 WINAPI FloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
747 return ExtFloodFill( hdc, x, y, color, FLOODFILLBORDER );
751 /**********************************************************************
752 * FloodFill (GDI32.104)
754 BOOL WINAPI FloodFill( HDC hdc, INT x, INT y, COLORREF color )
756 return ExtFloodFill( hdc, x, y, color, FLOODFILLBORDER );
760 /******************************************************************************
761 * PolyBezier16 [GDI.502]
763 BOOL16 WINAPI PolyBezier16( HDC16 hDc, const POINT16* lppt, INT16 cPoints )
765 int i;
766 BOOL16 ret;
767 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
768 cPoints*sizeof(POINT) );
769 if(!pt32) return FALSE;
770 for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i]));
771 ret= PolyBezier(hDc, pt32, cPoints);
772 HeapFree( GetProcessHeap(), 0, pt32 );
773 return ret;
776 /******************************************************************************
777 * PolyBezierTo16 [GDI.503]
779 BOOL16 WINAPI PolyBezierTo16( HDC16 hDc, const POINT16* lppt, INT16 cPoints )
781 int i;
782 BOOL16 ret;
783 LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
784 cPoints*sizeof(POINT) );
785 if(!pt32) return FALSE;
786 for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i]));
787 ret= PolyBezierTo(hDc, pt32, cPoints);
788 HeapFree( GetProcessHeap(), 0, pt32 );
789 return ret;
792 /******************************************************************************
793 * PolyBezier [GDI32.268]
794 * Draws one or more Bezier curves
796 * PARAMS
797 * hDc [I] Handle to device context
798 * lppt [I] Pointer to endpoints and control points
799 * cPoints [I] Count of endpoints and control points
801 * RETURNS STD
803 BOOL WINAPI PolyBezier( HDC hdc, const POINT* lppt, DWORD cPoints )
805 DC * dc = DC_GetDCPtr( hdc );
807 return dc && dc->funcs->pPolyBezier &&
808 dc->funcs->pPolyBezier(dc, lppt, cPoints);
811 /******************************************************************************
812 * PolyBezierTo [GDI32.269]
813 * Draws one or more Bezier curves
815 * PARAMS
816 * hDc [I] Handle to device context
817 * lppt [I] Pointer to endpoints and control points
818 * cPoints [I] Count of endpoints and control points
820 * RETURNS STD
822 BOOL WINAPI PolyBezierTo( HDC hdc, const POINT* lppt, DWORD cPoints )
824 DC * dc = DC_GetDCPtr( hdc );
825 BOOL ret;
827 if(!dc) return FALSE;
829 if(PATH_IsPathOpen(dc->w.path))
830 ret = PATH_PolyBezierTo(hdc, lppt, cPoints);
831 else
832 ret = dc->funcs->pPolyBezierTo &&
833 dc->funcs->pPolyBezierTo(dc, lppt, cPoints);
835 if(ret) {
836 dc->w.CursPosX = lppt[cPoints-1].x;
837 dc->w.CursPosY = lppt[cPoints-1].y;
839 return ret;
842 /***************************************************************
843 * AngleArc (GDI32.5)
846 BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius,
847 FLOAT eStartAngle, FLOAT eSweepAngle)
849 FIXME("AngleArc, stub\n");
850 return 0;
853 /***************************************************************
854 * PolyDraw (GDI32.270)
857 BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
858 DWORD cCount)
860 FIXME("PolyDraw, stub\n");
861 return 0;