Release 970824
[wine/multimedia.git] / graphics / painting.c
blobefd785ab18b7da721427e63b0e795b3239c51a33
1 /*
2 * Misc. graphics operations
4 * Copyright 1993, 1994 Alexandre Julliard
5 */
7 #include <math.h>
8 #include <stdlib.h>
9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h>
11 #include <X11/Intrinsic.h>
12 #ifndef PI
13 #define PI M_PI
14 #endif
15 #include "gdi.h"
16 #include "dc.h"
17 #include "bitmap.h"
18 #include "callback.h"
19 #include "metafile.h"
20 #include "syscolor.h"
21 #include "palette.h"
22 #include "color.h"
23 #include "region.h"
24 #include "stddebug.h"
25 #include "debug.h"
26 #include "xmalloc.h"
29 /***********************************************************************
30 * LineTo16 (GDI.19)
32 BOOL16 WINAPI LineTo16( HDC16 hdc, INT16 x, INT16 y )
34 return LineTo32( hdc, x, y );
38 /***********************************************************************
39 * LineTo32 (GDI32.249)
41 BOOL32 WINAPI LineTo32( HDC32 hdc, INT32 x, INT32 y )
43 DC * dc = DC_GetDCPtr( hdc );
45 return dc && dc->funcs->pLineTo &&
46 dc->funcs->pLineTo(dc,x,y);
50 /***********************************************************************
51 * MoveTo (GDI.20)
53 DWORD WINAPI MoveTo( HDC16 hdc, INT16 x, INT16 y )
55 POINT16 pt;
57 if (!MoveToEx16(hdc,x,y,&pt))
58 return 0;
59 return MAKELONG(pt.x,pt.y);
63 /***********************************************************************
64 * MoveToEx16 (GDI.483)
66 BOOL16 WINAPI MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
68 POINT32 pt32;
70 if (!MoveToEx32( (HDC32)hdc, (INT32)x, (INT32)y, &pt32 )) return FALSE;
71 if (pt) CONV_POINT32TO16( &pt32, pt );
72 return TRUE;
77 /***********************************************************************
78 * MoveToEx32 (GDI32.254)
80 BOOL32 WINAPI MoveToEx32( HDC32 hdc, INT32 x, INT32 y, LPPOINT32 pt )
82 DC * dc = DC_GetDCPtr( hdc );
84 return dc && dc->funcs->pMoveToEx &&
85 dc->funcs->pMoveToEx(dc,x,y,pt);
89 /***********************************************************************
90 * Arc16 (GDI.23)
92 BOOL16 WINAPI Arc16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
93 INT16 bottom, INT16 xstart, INT16 ystart,
94 INT16 xend, INT16 yend )
96 return Arc32( (HDC32)hdc, (INT32)left, (INT32)top, (INT32)right,
97 (INT32)bottom, (INT32)xstart, (INT32)ystart, (INT32)xend,
98 (INT32)yend );
102 /***********************************************************************
103 * Arc32 (GDI32.7)
105 BOOL32 WINAPI Arc32( HDC32 hdc, INT32 left, INT32 top, INT32 right,
106 INT32 bottom, INT32 xstart, INT32 ystart,
107 INT32 xend, INT32 yend )
109 DC * dc = DC_GetDCPtr( hdc );
111 return dc && dc->funcs->pArc &&
112 dc->funcs->pArc(dc,left,top,right,bottom,xstart,ystart,xend,yend);
116 /***********************************************************************
117 * Pie16 (GDI.26)
119 BOOL16 WINAPI Pie16( HDC16 hdc, INT16 left, INT16 top,
120 INT16 right, INT16 bottom, INT16 xstart, INT16 ystart,
121 INT16 xend, INT16 yend )
123 return Pie32( (HDC32)hdc, (INT32)left, (INT32)top, (INT32)right,
124 (INT32)bottom, (INT32)xstart, (INT32)ystart, (INT32)xend,
125 (INT32)yend );
129 /***********************************************************************
130 * Pie32 (GDI32.262)
132 BOOL32 WINAPI Pie32( HDC32 hdc, INT32 left, INT32 top,
133 INT32 right, INT32 bottom, INT32 xstart, INT32 ystart,
134 INT32 xend, INT32 yend )
136 DC * dc = DC_GetDCPtr( hdc );
138 return dc && dc->funcs->pPie &&
139 dc->funcs->pPie(dc,left,top,right,bottom,xstart,ystart,xend,yend);
143 /***********************************************************************
144 * Chord16 (GDI.348)
146 BOOL16 WINAPI Chord16( HDC16 hdc, INT16 left, INT16 top,
147 INT16 right, INT16 bottom, INT16 xstart, INT16 ystart,
148 INT16 xend, INT16 yend )
150 return Chord32( hdc, left, top, right, bottom, xstart, ystart, xend, yend );
154 /***********************************************************************
155 * Chord32 (GDI32.14)
157 BOOL32 WINAPI Chord32( HDC32 hdc, INT32 left, INT32 top,
158 INT32 right, INT32 bottom, INT32 xstart, INT32 ystart,
159 INT32 xend, INT32 yend )
161 DC * dc = DC_GetDCPtr( hdc );
163 return dc && dc->funcs->pChord &&
164 dc->funcs->pChord(dc,left,top,right,bottom,xstart,ystart,xend,yend);
168 /***********************************************************************
169 * Ellipse16 (GDI.24)
171 BOOL16 WINAPI Ellipse16( HDC16 hdc, INT16 left, INT16 top,
172 INT16 right, INT16 bottom )
174 return Ellipse32( hdc, left, top, right, bottom );
178 /***********************************************************************
179 * Ellipse32 (GDI32.75)
181 BOOL32 WINAPI Ellipse32( HDC32 hdc, INT32 left, INT32 top,
182 INT32 right, INT32 bottom )
184 DC * dc = DC_GetDCPtr( hdc );
186 return dc && dc->funcs->pEllipse &&
187 dc->funcs->pEllipse(dc,left,top,right,bottom);
191 /***********************************************************************
192 * Rectangle16 (GDI.27)
194 BOOL16 WINAPI Rectangle16( HDC16 hdc, INT16 left, INT16 top,
195 INT16 right, INT16 bottom )
197 return Rectangle32( hdc, left, top, right, bottom );
201 /***********************************************************************
202 * Rectangle32 (GDI32.283)
204 BOOL32 WINAPI Rectangle32( HDC32 hdc, INT32 left, INT32 top,
205 INT32 right, INT32 bottom )
207 DC * dc = DC_GetDCPtr( hdc );
209 return dc && dc->funcs->pRectangle &&
210 dc->funcs->pRectangle(dc,left,top,right,bottom);
214 /***********************************************************************
215 * RoundRect16 (GDI.28)
217 BOOL16 WINAPI RoundRect16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
218 INT16 bottom, INT16 ell_width, INT16 ell_height )
220 return RoundRect32( hdc, left, top, right, bottom, ell_width, ell_height );
224 /***********************************************************************
225 * RoundRect32 (GDI32.291)
227 BOOL32 WINAPI RoundRect32( HDC32 hdc, INT32 left, INT32 top, INT32 right,
228 INT32 bottom, INT32 ell_width, INT32 ell_height )
230 DC * dc = DC_GetDCPtr( hdc );
232 return dc && dc->funcs->pRoundRect &&
233 dc->funcs->pRoundRect(dc,left,top,right,bottom,ell_width,ell_height);
237 /***********************************************************************
238 * FillRect16 (USER.81)
240 INT16 WINAPI FillRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
242 HBRUSH16 prevBrush;
244 /* coordinates are logical so we cannot fast-check 'rect',
245 * it will be done later in the PatBlt().
248 if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
249 PatBlt32( hdc, rect->left, rect->top,
250 rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
251 SelectObject16( hdc, prevBrush );
252 return 1;
256 /***********************************************************************
257 * FillRect32 (USER32.196)
259 INT32 WINAPI FillRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
261 HBRUSH32 prevBrush;
263 if (!(prevBrush = SelectObject32( hdc, hbrush ))) return 0;
264 PatBlt32( hdc, rect->left, rect->top,
265 rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
266 SelectObject32( hdc, prevBrush );
267 return 1;
271 /***********************************************************************
272 * InvertRect16 (USER.82)
274 void WINAPI InvertRect16( HDC16 hdc, const RECT16 *rect )
276 PatBlt32( hdc, rect->left, rect->top,
277 rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
281 /***********************************************************************
282 * InvertRect32 (USER32.329)
284 void WINAPI InvertRect32( HDC32 hdc, const RECT32 *rect )
286 PatBlt32( hdc, rect->left, rect->top,
287 rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
291 /***********************************************************************
292 * FrameRect16 (USER.83)
294 INT16 WINAPI FrameRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
296 HBRUSH16 prevBrush;
297 int left, top, right, bottom;
299 DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
300 if (!dc) return FALSE;
302 left = XLPTODP( dc, rect->left );
303 top = YLPTODP( dc, rect->top );
304 right = XLPTODP( dc, rect->right );
305 bottom = YLPTODP( dc, rect->bottom );
307 if ( (right <= left) || (bottom <= top) ) return 0;
308 if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
310 if (DC_SetupGCForBrush( dc ))
312 PatBlt32( hdc, rect->left, rect->top, 1,
313 rect->bottom - rect->top, PATCOPY );
314 PatBlt32( hdc, rect->right - 1, rect->top, 1,
315 rect->bottom - rect->top, PATCOPY );
316 PatBlt32( hdc, rect->left, rect->top,
317 rect->right - rect->left, 1, PATCOPY );
318 PatBlt32( hdc, rect->left, rect->bottom - 1,
319 rect->right - rect->left, 1, PATCOPY );
321 SelectObject16( hdc, prevBrush );
322 return 1;
326 /***********************************************************************
327 * FrameRect32 (USER32.202)
329 INT32 WINAPI FrameRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
331 RECT16 rect16;
332 CONV_RECT32TO16( rect, &rect16 );
333 return FrameRect16( (HDC16)hdc, &rect16, (HBRUSH16)hbrush );
337 /***********************************************************************
338 * SetPixel16 (GDI.31)
340 COLORREF WINAPI SetPixel16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
342 return SetPixel32( hdc, x, y, color );
346 /***********************************************************************
347 * SetPixel32 (GDI32.327)
349 COLORREF WINAPI SetPixel32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
351 DC * dc = DC_GetDCPtr( hdc );
353 if (!dc || !dc->funcs->pSetPixel) return 0;
354 return dc->funcs->pSetPixel(dc,x,y,color);
358 /***********************************************************************
359 * GetPixel16 (GDI.83)
361 COLORREF WINAPI GetPixel16( HDC16 hdc, INT16 x, INT16 y )
363 return GetPixel32( hdc, x, y );
367 /***********************************************************************
368 * GetPixel32 (GDI32.211)
370 COLORREF WINAPI GetPixel32( HDC32 hdc, INT32 x, INT32 y )
372 DC * dc = DC_GetDCPtr( hdc );
374 if (!dc) return 0;
375 #ifdef SOLITAIRE_SPEED_HACK
376 return 0;
377 #endif
379 /* FIXME: should this be in the graphics driver? */
380 if (!PtVisible32( hdc, x, y )) return 0;
381 if (!dc || !dc->funcs->pGetPixel) return 0;
382 return dc->funcs->pGetPixel(dc,x,y);
386 /***********************************************************************
387 * PaintRgn16 (GDI.43)
389 BOOL16 WINAPI PaintRgn16( HDC16 hdc, HRGN16 hrgn )
391 return PaintRgn32( hdc, hrgn );
395 /***********************************************************************
396 * PaintRgn32 (GDI32.259)
398 BOOL32 WINAPI PaintRgn32( HDC32 hdc, HRGN32 hrgn )
400 DC * dc = DC_GetDCPtr( hdc );
402 return dc && dc->funcs->pPaintRgn &&
403 dc->funcs->pPaintRgn(dc,hrgn);
407 /***********************************************************************
408 * FillRgn16 (GDI.40)
410 BOOL16 WINAPI FillRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush )
412 return FillRgn32( hdc, hrgn, hbrush );
416 /***********************************************************************
417 * FillRgn32 (GDI32.101)
419 BOOL32 WINAPI FillRgn32( HDC32 hdc, HRGN32 hrgn, HBRUSH32 hbrush )
421 BOOL32 retval;
422 HBRUSH32 prevBrush = SelectObject32( hdc, hbrush );
423 if (!prevBrush) return FALSE;
424 retval = PaintRgn32( hdc, hrgn );
425 SelectObject32( hdc, prevBrush );
426 return retval;
430 /***********************************************************************
431 * FrameRgn16 (GDI.41)
433 BOOL16 WINAPI FrameRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush,
434 INT16 nWidth, INT16 nHeight )
436 return FrameRgn32( hdc, hrgn, hbrush, nWidth, nHeight );
440 /***********************************************************************
441 * FrameRgn32 (GDI32.105)
443 BOOL32 WINAPI FrameRgn32( HDC32 hdc, HRGN32 hrgn, HBRUSH32 hbrush,
444 INT32 nWidth, INT32 nHeight )
446 HRGN32 tmp = CreateRectRgn32( 0, 0, 0, 0 );
447 if(!REGION_FrameRgn( tmp, hrgn, nWidth, nHeight )) return FALSE;
448 FillRgn32( hdc, tmp, hbrush );
449 DeleteObject32( tmp );
450 return TRUE;
454 /***********************************************************************
455 * InvertRgn16 (GDI.42)
457 BOOL16 WINAPI InvertRgn16( HDC16 hdc, HRGN16 hrgn )
459 return InvertRgn32( hdc, hrgn );
463 /***********************************************************************
464 * InvertRgn32 (GDI32.246)
466 BOOL32 WINAPI InvertRgn32( HDC32 hdc, HRGN32 hrgn )
468 HBRUSH32 prevBrush = SelectObject32( hdc, GetStockObject32(BLACK_BRUSH) );
469 INT32 prevROP = SetROP232( hdc, R2_NOT );
470 BOOL32 retval = PaintRgn32( hdc, hrgn );
471 SelectObject32( hdc, prevBrush );
472 SetROP232( hdc, prevROP );
473 return retval;
477 /***********************************************************************
478 * DrawFocusRect16 (USER.466)
480 void WINAPI DrawFocusRect16( HDC16 hdc, const RECT16* rc )
482 RECT32 rect32;
483 CONV_RECT16TO32( rc, &rect32 );
484 DrawFocusRect32( hdc, &rect32 );
488 /***********************************************************************
489 * DrawFocusRect32 (USER32.155)
491 * FIXME: PatBlt(PATINVERT) with background brush.
493 void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
495 HPEN32 hOldPen;
496 INT32 oldDrawMode, oldBkMode;
497 INT32 left, top, right, bottom;
499 DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
500 if (!dc) return;
502 left = XLPTODP( dc, rc->left );
503 top = YLPTODP( dc, rc->top );
504 right = XLPTODP( dc, rc->right );
505 bottom = YLPTODP( dc, rc->bottom );
507 hOldPen = SelectObject32( hdc, sysColorObjects.hpenWindowText );
508 oldDrawMode = SetROP232(hdc, R2_XORPEN);
509 oldBkMode = SetBkMode32(hdc, TRANSPARENT);
511 /* Hack: make sure the XORPEN operation has an effect */
512 dc->u.x.pen.pixel = (1 << screenDepth) - 1;
514 if (DC_SetupGCForPen( dc ))
515 XDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
516 dc->w.DCOrgX + left, dc->w.DCOrgY + top,
517 right-left-1, bottom-top-1 );
519 SetBkMode32(hdc, oldBkMode);
520 SetROP232(hdc, oldDrawMode);
521 SelectObject32(hdc, hOldPen);
525 /**********************************************************************
526 * Polyline16 (GDI.37)
528 BOOL16 WINAPI Polyline16( HDC16 hdc, LPPOINT16 pt, INT16 count )
530 register int i;
531 LPPOINT32 pt32 = (LPPOINT32)xmalloc(count*sizeof(POINT32));
532 BOOL16 ret;
534 for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
535 ret = Polyline32(hdc,pt32,count);
536 free(pt32);
537 return ret;
541 /**********************************************************************
542 * Polyline32 (GDI32.276)
544 BOOL32 WINAPI Polyline32( HDC32 hdc, const LPPOINT32 pt, INT32 count )
546 DC * dc = DC_GetDCPtr( hdc );
548 return dc && dc->funcs->pPolyline &&
549 dc->funcs->pPolyline(dc,pt,count);
553 /**********************************************************************
554 * Polygon16 (GDI.36)
556 BOOL16 WINAPI Polygon16( HDC16 hdc, LPPOINT16 pt, INT16 count )
558 register int i;
559 LPPOINT32 pt32 = (LPPOINT32)xmalloc(count*sizeof(POINT32));
560 BOOL32 ret;
563 for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
564 ret = Polygon32(hdc,pt32,count);
565 free(pt32);
566 return ret;
570 /**********************************************************************
571 * Polygon32 (GDI32.275)
573 BOOL32 WINAPI Polygon32( HDC32 hdc, LPPOINT32 pt, INT32 count )
575 DC * dc = DC_GetDCPtr( hdc );
577 return dc && dc->funcs->pPolygon &&
578 dc->funcs->pPolygon(dc,pt,count);
582 /**********************************************************************
583 * PolyPolygon16 (GDI.450)
585 BOOL16 WINAPI PolyPolygon16( HDC16 hdc, LPPOINT16 pt, LPINT16 counts,
586 UINT16 polygons )
588 int i,nrpts;
589 LPPOINT32 pt32;
590 LPINT32 counts32;
591 BOOL16 ret;
593 nrpts=0;
594 for (i=polygons;i--;)
595 nrpts+=counts[i];
596 pt32 = (LPPOINT32)xmalloc(sizeof(POINT32)*nrpts);
597 for (i=nrpts;i--;)
598 CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
599 counts32 = (LPINT32)xmalloc(polygons*sizeof(INT32));
600 for (i=polygons;i--;) counts32[i]=counts[i];
602 ret = PolyPolygon32(hdc,pt32,counts32,polygons);
603 free(counts32);
604 free(pt32);
605 return ret;
608 /**********************************************************************
609 * PolyPolygon32 (GDI.450)
611 BOOL32 WINAPI PolyPolygon32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts,
612 UINT32 polygons )
614 DC * dc = DC_GetDCPtr( hdc );
616 return dc && dc->funcs->pPolyPolygon &&
617 dc->funcs->pPolyPolygon(dc,pt,counts,polygons);
620 /**********************************************************************
621 * ExtFloodFill16 (GDI.372)
623 BOOL16 WINAPI ExtFloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color,
624 UINT16 fillType )
626 return ExtFloodFill32( hdc, x, y, color, fillType );
630 /**********************************************************************
631 * ExtFloodFill32 (GDI32.96)
633 BOOL32 WINAPI ExtFloodFill32( HDC32 hdc, INT32 x, INT32 y, COLORREF color,
634 UINT32 fillType )
636 DC *dc = DC_GetDCPtr( hdc );
638 return dc && dc->funcs->pExtFloodFill &&
639 dc->funcs->pExtFloodFill(dc,x,y,color,fillType);
643 /**********************************************************************
644 * FloodFill16 (GDI.25)
646 BOOL16 WINAPI FloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
648 return ExtFloodFill32( hdc, x, y, color, FLOODFILLBORDER );
652 /**********************************************************************
653 * FloodFill32 (GDI32.104)
655 BOOL32 WINAPI FloodFill32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
657 return ExtFloodFill32( hdc, x, y, color, FLOODFILLBORDER );
661 /**********************************************************************
662 * DrawEdge16 (USER.659)
664 BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
666 RECT32 rect32;
667 BOOL32 ret;
669 CONV_RECT16TO32( rc, &rect32 );
670 ret = DrawEdge32( hdc, &rect32, edge, flags );
671 CONV_RECT32TO16( &rect32, rc );
672 return ret;
676 /**********************************************************************
677 * DrawEdge32 (USER32.154)
679 BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
681 HBRUSH32 hbrushOld;
683 if (flags >= BF_DIAGONAL)
684 fprintf( stderr, "DrawEdge: unsupported flags %04x\n", flags );
686 dprintf_graphics( stddeb, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
687 hdc, rc->left, rc->top, rc->right, rc->bottom,
688 edge, flags );
690 /* First do all the raised edges */
692 hbrushOld = SelectObject32( hdc, sysColorObjects.hbrushBtnHighlight );
693 if (edge & BDR_RAISEDOUTER)
695 if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
696 1, rc->bottom - rc->top - 1, PATCOPY );
697 if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
698 rc->right - rc->left - 1, 1, PATCOPY );
700 if (edge & BDR_SUNKENOUTER)
702 if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
703 1, rc->bottom - rc->top, PATCOPY );
704 if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
705 rc->right - rc->left, 1, PATCOPY );
707 if (edge & BDR_RAISEDINNER)
709 if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
710 1, rc->bottom - rc->top - 2, PATCOPY );
711 if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
712 rc->right - rc->left - 2, 1, PATCOPY );
714 if (edge & BDR_SUNKENINNER)
716 if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
717 1, rc->bottom - rc->top - 2, PATCOPY );
718 if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
719 rc->right - rc->left - 2, 1, PATCOPY );
722 /* Then do all the sunken edges */
724 SelectObject32( hdc, sysColorObjects.hbrushBtnShadow );
725 if (edge & BDR_SUNKENOUTER)
727 if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
728 1, rc->bottom - rc->top - 1, PATCOPY );
729 if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
730 rc->right - rc->left - 1, 1, PATCOPY );
732 if (edge & BDR_RAISEDOUTER)
734 if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
735 1, rc->bottom - rc->top, PATCOPY );
736 if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
737 rc->right - rc->left, 1, PATCOPY );
739 if (edge & BDR_SUNKENINNER)
741 if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
742 1, rc->bottom - rc->top - 2, PATCOPY );
743 if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
744 rc->right - rc->left - 2, 1, PATCOPY );
746 if (edge & BDR_RAISEDINNER)
748 if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
749 1, rc->bottom - rc->top - 2, PATCOPY );
750 if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
751 rc->right - rc->left - 2, 1, PATCOPY );
754 SelectObject32( hdc, hbrushOld );
755 return TRUE;
759 /**********************************************************************
760 * DrawFrameControl16 (USER.656)
762 BOOL16 WINAPI DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 uType,
763 UINT16 uState )
765 fprintf( stdnimp,"DrawFrameControl16(%x,%p,%d,%x), empty stub!\n",
766 hdc,rc,uType,uState );
767 return TRUE;
771 /**********************************************************************
772 * DrawFrameControl32 (USER32.157)
774 BOOL32 WINAPI DrawFrameControl32( HDC32 hdc, LPRECT32 rc, UINT32 uType,
775 UINT32 uState )
777 fprintf( stdnimp,"DrawFrameControl32(%x,%p,%d,%x), empty stub!\n",
778 hdc,rc,uType,uState );
779 return TRUE;
782 /**********************************************************************
783 * DrawFrameControl32 (USER32.152)
785 BOOL32 WINAPI DrawAnimatedRects32( HWND32 hwnd, int idAni,
786 const LPRECT32 lprcFrom,
787 const LPRECT32 lprcTo )
789 fprintf( stdnimp,"DrawAnimatedRects32(%x,%d,%p,%p), empty stub!\n",
790 hwnd, idAni, lprcFrom, lprcTo );
791 return TRUE;
794 BOOL32 WINAPI DrawState32A(
795 HDC32 hdc,HBRUSH32 hbrush,DRAWSTATEPROC drawstateproc,
796 LPARAM lparam,WPARAM32 wparam,INT32 x,INT32 y,INT32 z,INT32 a,UINT32 b
798 fprintf(stderr,"DrawStateA(%x,%x,%p,0x%08lx,0x%08lx,%d,%d,%d,%d,%d),stub\n",
799 hdc,hbrush,drawstateproc,lparam,wparam,x,y,z,a,b
801 return TRUE;