2 * Metafile driver graphics functions
4 * Copyright 1993, 1994 Alexandre Julliard
13 #include "metafiledrv.h"
16 /**********************************************************************
20 MFDRV_MoveToEx(DC
*dc
,INT32 x
,INT32 y
,LPPOINT32 pt
)
22 if (!MF_MetaParam2(dc
,META_MOVETO
,x
,y
))
27 pt
->x
= dc
->w
.CursPosX
;
28 pt
->y
= dc
->w
.CursPosY
;
35 /***********************************************************************
39 MFDRV_LineTo( DC
*dc
, INT32 x
, INT32 y
)
41 return MF_MetaParam2(dc
, META_LINETO
, x
, y
);
45 /***********************************************************************
49 MFDRV_Arc( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
50 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
52 return MF_MetaParam8(dc
, META_ARC
, left
, top
, right
, bottom
,
53 xstart
, ystart
, xend
, yend
);
57 /***********************************************************************
61 MFDRV_Pie( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
62 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
64 return MF_MetaParam8(dc
, META_PIE
, left
, top
, right
, bottom
,
65 xstart
, ystart
, xend
, yend
);
69 /***********************************************************************
73 MFDRV_Chord( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
74 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
76 return MF_MetaParam8(dc
, META_CHORD
, left
, top
, right
, bottom
,
77 xstart
, ystart
, xend
, yend
);
80 /***********************************************************************
84 MFDRV_Ellipse( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
)
86 return MF_MetaParam4(dc
, META_ELLIPSE
, left
, top
, right
, bottom
);
89 /***********************************************************************
93 MFDRV_Rectangle(DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
)
95 return MF_MetaParam4(dc
, META_RECTANGLE
, left
, top
, right
, bottom
);
98 /***********************************************************************
102 MFDRV_RoundRect( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
103 INT32 bottom
, INT32 ell_width
, INT32 ell_height
)
105 return MF_MetaParam6(dc
, META_ROUNDRECT
, left
, top
, right
, bottom
,
106 ell_width
, ell_height
);
109 /***********************************************************************
113 MFDRV_SetPixel( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
)
115 return MF_MetaParam4(dc
, META_SETPIXEL
, x
, y
,HIWORD(color
),LOWORD(color
));
119 /**********************************************************************
123 MFDRV_Polyline( DC
*dc
, const POINT32
* pt
, INT32 count
)
129 pt16
= (LPPOINT16
)xmalloc(sizeof(POINT16
)*count
);
130 for (i
=count
;i
--;) CONV_POINT32TO16(&(pt
[i
]),&(pt16
[i
]));
131 ret
= MF_MetaPoly(dc
, META_POLYLINE
, pt16
, count
);
138 /**********************************************************************
142 MFDRV_Polygon( DC
*dc
, const POINT32
* pt
, INT32 count
)
148 pt16
= (LPPOINT16
)xmalloc(sizeof(POINT16
)*count
);
149 for (i
=count
;i
--;) CONV_POINT32TO16(&(pt
[i
]),&(pt16
[i
]));
150 ret
= MF_MetaPoly(dc
, META_POLYGON
, pt16
, count
);
157 /**********************************************************************
161 MFDRV_PolyPolygon( DC
*dc
, const POINT32
* pt
, const INT32
* counts
, UINT32 polygons
)
165 const POINT32
* curpt
=pt
;
168 for (i
=0;i
<polygons
;i
++) {
169 pt16
=(LPPOINT16
)xmalloc(sizeof(POINT16
)*counts
[i
]);
170 for (j
=counts
[i
];j
--;) CONV_POINT32TO16(&(curpt
[j
]),&(pt16
[j
]));
171 ret
= MF_MetaPoly(dc
, META_POLYGON
, pt16
, counts
[i
]);
181 /**********************************************************************
185 MFDRV_ExtFloodFill( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
, UINT32 fillType
)
187 return MF_MetaParam4(dc
,META_FLOODFILL
,x
,y
,HIWORD(color
),LOWORD(color
));
191 /**********************************************************************
195 MFDRV_PaintRgn( DC
*dc
, HRGN32 hrgn
)
198 index
= MF_CreateRegion( dc
, hrgn
);
201 return MF_MetaParam1( dc
, META_PAINTREGION
, index
);
205 /**********************************************************************
209 MFDRV_SetBkColor( DC
*dc
, COLORREF color
)
211 return MF_MetaParam2(dc
, META_SETBKCOLOR
, HIWORD(color
), LOWORD(color
));
215 /**********************************************************************
219 MFDRV_SetTextColor( DC
*dc
, COLORREF color
)
221 return MF_MetaParam2(dc
, META_SETTEXTCOLOR
, HIWORD(color
), LOWORD(color
));