2 * Metafile driver graphics functions
4 * Copyright 1993, 1994 Alexandre Julliard
14 #include "metafiledrv.h"
18 /**********************************************************************
22 MFDRV_MoveToEx(DC *dc,INT32 x,INT32 y,LPPOINT32 pt)
24 if (!MF_MetaParam2(dc,META_MOVETO,x,y))
29 pt->x = dc->w.CursPosX;
30 pt->y = dc->w.CursPosY;
37 /***********************************************************************
41 MFDRV_LineTo( DC *dc, INT32 x, INT32 y )
43 return MF_MetaParam2(dc, META_LINETO, x, y);
47 /***********************************************************************
51 MFDRV_Arc( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom,
52 INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
54 return MF_MetaParam8(dc, META_ARC, left, top, right, bottom,
55 xstart, ystart, xend, yend);
59 /***********************************************************************
63 MFDRV_Pie( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom,
64 INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
66 return MF_MetaParam8(dc, META_PIE, left, top, right, bottom,
67 xstart, ystart, xend, yend);
71 /***********************************************************************
75 MFDRV_Chord( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom,
76 INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
78 return MF_MetaParam8(dc, META_CHORD, left, top, right, bottom,
79 xstart, ystart, xend, yend);
82 /***********************************************************************
86 MFDRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom )
88 return MF_MetaParam4(dc, META_ELLIPSE, left, top, right, bottom);
91 /***********************************************************************
95 MFDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
97 return MF_MetaParam4(dc, META_RECTANGLE, left, top, right, bottom);
100 /***********************************************************************
104 MFDRV_RoundRect( DC *dc, INT32 left, INT32 top, INT32 right,
105 INT32 bottom, INT32 ell_width, INT32 ell_height )
107 return MF_MetaParam6(dc, META_ROUNDRECT, left, top, right, bottom,
108 ell_width, ell_height);
111 /***********************************************************************
115 MFDRV_SetPixel( DC *dc, INT32 x, INT32 y, COLORREF color )
117 return MF_MetaParam4(dc, META_SETPIXEL, x, y,HIWORD(color),LOWORD(color));
121 /**********************************************************************
125 MFDRV_Polyline( DC *dc, const LPPOINT32 pt, INT32 count )
131 pt16 = (LPPOINT16)xmalloc(sizeof(POINT16)*count);
132 for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i]));
133 ret = MF_MetaPoly(dc, META_POLYLINE, pt16, count);
140 /**********************************************************************
144 MFDRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count )
150 pt16 = (LPPOINT16)xmalloc(sizeof(POINT16)*count);
151 for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i]));
152 ret = MF_MetaPoly(dc, META_POLYGON, pt16, count);
159 /**********************************************************************
163 MFDRV_PolyPolygon( DC *dc, LPPOINT32 pt, LPINT32 counts, UINT32 polygons)
170 for (i=0;i<polygons;i++) {
171 pt16=(LPPOINT16)xmalloc(sizeof(POINT16)*counts[i]);
172 for (j=counts[i];j--;) CONV_POINT32TO16(&(curpt[j]),&(pt16[j]));
173 ret = MF_MetaPoly(dc, META_POLYGON, pt16, counts[i]);
183 /**********************************************************************
187 MFDRV_ExtFloodFill( DC *dc, INT32 x, INT32 y, COLORREF color, UINT32 fillType )
189 return MF_MetaParam4(dc,META_FLOODFILL,x,y,HIWORD(color),LOWORD(color));