Commit f4d78d53 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

gdi32: Support saving EMR_EXTESCAPE record in spool file.

parent a79c2fd3
......@@ -655,8 +655,17 @@ INT WINAPI Escape( HDC hdc, INT escape, INT in_count, const char *in_data, void
INT WINAPI ExtEscape( HDC hdc, INT escape, INT input_size, const char *input,
INT output_size, char *output )
{
struct print *print;
DC_ATTR *dc_attr;
if (is_meta_dc( hdc ))
return METADC_ExtEscape( hdc, escape, input_size, input, output_size, output );
if (!(dc_attr = get_dc_attr( hdc ))) return 0;
if ((print = get_dc_print( dc_attr )) && dc_attr->emf)
{
int ret = EMFDC_ExtEscape( dc_attr, escape, input_size, input, output_size, output );
if (ret) return ret;
}
return NtGdiExtEscape( hdc, NULL, 0, escape, input_size, input, output_size, output );
}
......
......@@ -1167,6 +1167,38 @@ BOOL EMFDC_PolyDraw( DC_ATTR *dc_attr, const POINT *pts, const BYTE *types, DWOR
return ret;
}
INT EMFDC_ExtEscape( DC_ATTR *dc_attr, INT escape, INT input_size, const char *input,
INT output_size, char *output)
{
struct EMREXTESCAPE
{
EMR emr;
DWORD escape;
DWORD size;
BYTE data[1];
} *emr;
size_t size;
if (escape == QUERYESCSUPPORT) return 0;
size = FIELD_OFFSET( struct EMREXTESCAPE, data[input_size] );
size = (size + 3) & ~3;
if (!(emr = HeapAlloc( GetProcessHeap(), 0, size ))) return 0;
emr->emr.iType = EMR_EXTESCAPE;
emr->emr.nSize = size;
emr->escape = escape;
emr->size = input_size;
memcpy(emr->data, input, input_size);
emfdc_record( get_dc_emf( dc_attr ), &emr->emr );
HeapFree( GetProcessHeap(), 0, emr );
if (output_size && output) return 0;
if (escape == PASSTHROUGH || escape == POSTSCRIPT_PASSTHROUGH)
input_size -= sizeof(WORD);
return input_size ? input_size : 1;
}
BOOL EMFDC_ExtFloodFill( DC_ATTR *dc_attr, INT x, INT y, COLORREF color, UINT fill_type )
{
EMREXTFLOODFILL emr;
......
......@@ -187,6 +187,8 @@ extern BOOL EMFDC_Ellipse( DC_ATTR *dc_attr, INT left, INT top, INT right,
extern BOOL EMFDC_EndPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExcludeClipRect( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern INT EMFDC_ExtEscape( DC_ATTR *dc_attr, INT escape, INT input_size, const char *input,
INT output_size, char *output) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtFloodFill( DC_ATTR *dc_attr, INT x, INT y, COLORREF color,
UINT fill_type ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtSelectClipRgn( DC_ATTR *dc_attr, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment