[GDI32] Update Wine Metafile Code

Sync/Port: Metafile code from wine.

Patches by Jacek Caban, Daniel Lehman, Zhiyi Zhang. Gabriel Ivancescu, Michael Stefaniuc, Francois Gouget, Nikolay Sivov Dmitry Timoshkov, Andrew EiKum, Piotr Caban and Alexandre Julliard.

This commit is dedicated to George Bisoc!
This commit is contained in:
James Tabor 2021-09-27 16:18:20 -05:00
parent 9c1c88de3e
commit fc16259faf
25 changed files with 5207 additions and 1362 deletions

View file

@ -215,6 +215,7 @@ extern "C" {
#define META_SETPOLYFILLMODE 0x106
#define META_SETSTRETCHBLTMODE 0x107
#define META_SETTEXTCHAREXTRA 0x108
#define META_SETLAYOUT 0x149
#define META_SETTEXTCOLOR 0x209
#define META_SETTEXTJUSTIFICATION 0x20A
#define META_SETWINDOWORG 0x20B

View file

@ -563,21 +563,14 @@ extern ULONG gcClientObj;
VOID
WINAPI
METADC_DeleteObject(HGDIOBJ hobj);
METADC_RosGlueDeleteObject(HGDIOBJ hobj);
BOOL
WINAPI
METADC_DeleteDC(
METADC_RosGlueDeleteDC(
_In_ HDC hdc);
INT
WINAPI
METADC16_Escape(
_In_ HDC hdc,
_In_ INT nEscape,
_In_ INT cbInput,
_In_ LPCSTR lpvInData,
_Out_ LPVOID lpvOutData);
BOOL METADC_DeleteDC( HDC hdc );
BOOL
WINAPI
@ -591,155 +584,323 @@ METADC_ExtTextOutW(
UINT cchString,
const INT *lpDx);
BOOL
WINAPI
METADC_PatBlt(
_In_ HDC hdc,
_In_ INT xLeft,
_In_ INT yTop,
_In_ INT nWidth,
_In_ INT nHeight,
_In_ DWORD dwRop);
/* The following METADC_* functions follow this pattern: */
#define HANDLE_METADC0P(_RetType, _Func, dwError, hdc, ...) \
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
{ \
DWORD_PTR dwResult; \
if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc)) \
{ \
return (_RetType)dwResult; \
} \
}
#define HANDLE_METADC(_RetType, _Func, dwError, hdc, ...) \
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
{ \
DWORD_PTR dwResult = 1; \
if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc, __VA_ARGS__)) \
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) \
{ \
return (_RetType)dwResult; \
return (_RetType)METADC_##_Func(hdc, __VA_ARGS__); \
} \
else \
{ \
PLDC pLDC = GdiGetLDC(hdc); \
_RetType _Ret = dwError; \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(_Ret = (_RetType)EMFDC_##_Func(pLDC, __VA_ARGS__)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
} \
}
typedef enum _DCFUNC
{
//DCFUNC_AbortDoc,
DCFUNC_AbortPath,
DCFUNC_AlphaBlend, // UNIMPLEMENTED
DCFUNC_AngleArc, // UNIMPLEMENTED
DCFUNC_Arc,
DCFUNC_ArcTo, // UNIMPLEMENTED
DCFUNC_BeginPath,
//DCFUNC_BitBlt,
DCFUNC_Chord,
DCFUNC_CloseFigure,
DCFUNC_Ellipse,
DCFUNC_EndPath,
DCFUNC_ExcludeClipRect,
DCFUNC_ExtEscape,
DCFUNC_ExtFloodFill,
DCFUNC_ExtSelectClipRgn,
DCFUNC_ExtTextOut,
DCFUNC_FillPath,
DCFUNC_FillRgn,
DCFUNC_FlattenPath,
DCFUNC_FrameRgn,
DCFUNC_GetDeviceCaps,
DCFUNC_GdiComment,
DCFUNC_GradientFill, // UNIMPLEMENTED
DCFUNC_IntersectClipRect,
DCFUNC_InvertRgn,
DCFUNC_LineTo,
DCFUNC_MaskBlt, // UNIMPLEMENTED
DCFUNC_ModifyWorldTransform,
DCFUNC_MoveTo,
DCFUNC_OffsetClipRgn,
DCFUNC_OffsetViewportOrgEx,
DCFUNC_OffsetWindowOrgEx,
DCFUNC_PathToRegion, // UNIMPLEMENTED
DCFUNC_PatBlt,
DCFUNC_Pie,
DCFUNC_PlgBlt, // UNIMPLEMENTED
DCFUNC_PolyBezier,
DCFUNC_PolyBezierTo,
DCFUNC_PolyDraw,
DCFUNC_Polygon,
DCFUNC_Polyline,
DCFUNC_PolylineTo,
DCFUNC_PolyPolygon,
DCFUNC_PolyPolyline,
DCFUNC_RealizePalette,
DCFUNC_Rectangle,
DCFUNC_RestoreDC,
DCFUNC_RoundRect,
DCFUNC_SaveDC,
DCFUNC_ScaleViewportExtEx,
DCFUNC_ScaleWindowExtEx,
DCFUNC_SelectBrush,
DCFUNC_SelectClipPath,
DCFUNC_SelectFont,
DCFUNC_SelectPalette,
DCFUNC_SelectPen,
DCFUNC_SetDCBrushColor,
DCFUNC_SetDCPenColor,
DCFUNC_SetDIBitsToDevice,
DCFUNC_SetBkColor,
DCFUNC_SetBkMode,
DCFUNC_SetLayout,
//DCFUNC_SetMapMode,
DCFUNC_SetPixel,
DCFUNC_SetPolyFillMode,
DCFUNC_SetROP2,
DCFUNC_SetStretchBltMode,
DCFUNC_SetTextAlign,
DCFUNC_SetTextCharacterExtra,
DCFUNC_SetTextColor,
DCFUNC_SetTextJustification,
DCFUNC_SetViewportExtEx,
DCFUNC_SetViewportOrgEx,
DCFUNC_SetWindowExtEx,
DCFUNC_SetWindowOrgEx,
DCFUNC_SetWorldTransform,
DCFUNC_StretchBlt,
DCFUNC_StrokeAndFillPath,
DCFUNC_StrokePath,
DCFUNC_TransparentBlt, // UNIMPLEMENTED
DCFUNC_WidenPath,
} DCFUNC;
BOOL
METADC_Dispatch(
_In_ DCFUNC eFunction,
_Out_ PDWORD_PTR pdwResult,
_In_ DWORD_PTR dwError,
_In_ HDC hdc,
...);
#define HANDLE_METADC2(_RetType, _Func, hdc, ...) \
#define HANDLE_METADC16(_RetType, _Func, dwError, hdc, ...) \
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
{ \
_RetType result; \
if (METADC_##_Func(&result, hdc, __VA_ARGS__)) \
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) \
{ \
return result; \
return METADC_##_Func(hdc, __VA_ARGS__); \
} \
}
BOOL
WINAPI
METADC_GetAndSetDCDWord(
_Out_ PDWORD pdwResult,
_In_ HDC hdc,
_In_ UINT u,
_In_ DWORD dwIn,
_In_ ULONG ulMFId,
_In_ USHORT usMF16Id,
_In_ DWORD dwError);
#define HANDLE_METADC0P(_RetType, _Func, dwError, hdc, ...) \
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
{ \
PLDC pLDC = NULL; \
_RetType _Ret = dwError; \
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) \
{ \
return (_RetType)_Ret; \
} \
pLDC = GdiGetLDC(hdc); \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(_Ret = (_RetType)EMFDC_##_Func(pLDC)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
}
#define HANDLE_EMETAFDC(_RetType, _Func, dwError, hdc, ...) \
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
{ \
PLDC pLDC = NULL; \
_RetType _Ret = dwError; \
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) \
{ \
return (_RetType)_Ret; \
} \
pLDC = GdiGetLDC(hdc); \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(_Ret = EMFDC_##_Func(pLDC, __VA_ARGS__)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
}
#define HANDLE_METADC1P(_RetType, _Func, dwError, hdc, ...) \
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) \
{ \
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) \
{ \
return (_RetType)METADC_##_Func(hdc); \
} \
else \
{ \
PLDC pLDC = GdiGetLDC(hdc); \
_RetType _Ret = dwError; \
if ( !pLDC ) \
{ \
SetLastError(ERROR_INVALID_HANDLE); \
return (_RetType)_Ret; \
} \
if ( pLDC->iType == LDC_EMFLDC && !(_Ret = (_RetType)EMFDC_##_Func(pLDC)) ) \
{ \
return (_RetType)_Ret; \
} \
/* Fall through to support information DC's.*/ \
} \
}
BOOL WINAPI METADC_SetD(_In_ HDC hdc,_In_ DWORD dwIn,_In_ USHORT usMF16Id);
BOOL WINAPI EMFDC_SetD(_In_ PLDC pldc,_In_ DWORD dwIn,_In_ ULONG ulMFId);
HDC WINAPI GdiConvertAndCheckDC(HDC hdc);
HENHMETAFILE WINAPI SetEnhMetaFileBitsAlt( PDWORD pdw, LPWSTR FilePart, HANDLE hFile, LARGE_INTEGER li);
/* meta dc files */
extern BOOL METADC_Arc( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_BitBlt( HDC hdc_dst, INT x_dst, INT y_dst, INT width, INT height,
HDC hdc_src, INT x_src, INT y_src, DWORD rop );
extern BOOL METADC_Chord( HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart,
INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_Ellipse( HDC hdc, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExcludeClipRect( HDC hdc, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtEscape( HDC hdc, INT escape, INT input_size, LPCSTR input, INT output_size, LPVOID output ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtFloodFill( HDC hdc, INT x, INT y, COLORREF color,
UINT fill_type ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL METADC_FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN;
extern INT METADC_GetDeviceCaps( HDC hdc, INT cap );
extern BOOL METADC_IntersectClipRect( HDC hdc, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL METADC_InvertRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_OffsetClipRgn( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_OffsetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_OffsetWindowOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL METADC_PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop );
extern BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_PolyPolygon( HDC hdc, const POINT *points, const INT *counts,
UINT polygons ) DECLSPEC_HIDDEN;
extern BOOL METADC_Polygon( HDC hdc, const POINT *points, INT count ) DECLSPEC_HIDDEN;
extern BOOL METADC_Polyline( HDC hdc, const POINT *points,INT count) DECLSPEC_HIDDEN;
extern BOOL METADC_RealizePalette( HDC hdc ) DECLSPEC_HIDDEN;
extern BOOL METADC_Rectangle( HDC hdc, INT left, INT top, INT right, INT bottom) DECLSPEC_HIDDEN;
extern BOOL METADC_RestoreDC( HDC hdc, INT level ) DECLSPEC_HIDDEN;
extern BOOL METADC_RoundRect( HDC hdc, INT left, INT top, INT right, INT bottom,
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
extern BOOL METADC_SaveDC( HDC hdc ) DECLSPEC_HIDDEN;
extern BOOL METADC_ScaleViewportExtEx( HDC hdc, INT x_num, INT x_denom, INT y_num,
INT y_denom ) DECLSPEC_HIDDEN;
extern BOOL METADC_ScaleWindowExtEx( HDC hdc, INT x_num, INT x_denom, INT y_num,
INT y_denom ) DECLSPEC_HIDDEN;
extern HGDIOBJ METADC_SelectObject( HDC hdc, HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern BOOL METADC_SelectPalette( HDC hdc, HPALETTE palette ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetBkColor( HDC hdc, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetBkMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern INT METADC_SetDIBitsToDevice( HDC hdc, INT x_dest, INT y_dest, DWORD width, DWORD height,
INT x_src, INT y_src, UINT startscan, UINT lines,
const void *bits, const BITMAPINFO *info,
UINT coloruse ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetLayout( HDC hdc, DWORD layout ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetTextCharacterExtra( HDC hdc, INT extra ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetMapMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetMapperFlags( HDC hdc, DWORD flags ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetPixel( HDC hdc, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetPolyFillMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetRelAbs( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetROP2( HDC hdc, INT rop ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetStretchBltMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetTextAlign( HDC hdc, UINT align ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetTextColor( HDC hdc, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetTextJustification( HDC hdc, INT extra, INT breaks ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetViewportExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetWindowExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetWindowOrgEx( HDC, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_StretchBlt( HDC hdc_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop );
extern INT METADC_StretchDIBits( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
INT x_src, INT y_src, INT width_src, INT height_src,
const void *bits, const BITMAPINFO *info, UINT coloruse,
DWORD rop ) DECLSPEC_HIDDEN;
/* enhanced metafiles */
extern BOOL EMFDC_AbortPath( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_AlphaBlend( LDC *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
BLENDFUNCTION blend_function );
extern BOOL EMFDC_AngleArc( LDC *dc_attr, INT x, INT y, DWORD radius, FLOAT start,
FLOAT sweep ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ArcChordPie( LDC *dc_attr, INT left, INT top, INT right,
INT bottom, INT xstart, INT ystart, INT xend,
INT yend, DWORD type ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_BeginPath( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_BitBlt( LDC *dc_attr, INT x_dst, INT y_dst, INT width, INT height,
HDC hdc_src, INT x_src, INT y_src, DWORD rop );
extern BOOL EMFDC_CloseFigure( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern void EMFDC_DeleteDC( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Ellipse( LDC *dc_attr, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_EndPath( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExcludeClipRect( LDC *dc_attr, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtFloodFill( LDC *dc_attr, INT x, INT y, COLORREF color,
UINT fill_type ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtSelectClipRgn( LDC *dc_attr, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ExtTextOut( LDC *dc_attr, INT x, INT y, UINT flags, const RECT *rect,
const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FillPath( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FillRgn( LDC *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FlattenPath( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_FrameRgn( LDC *dc_attr, HRGN hrgn, HBRUSH hbrush, INT width,
INT height ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_GradientFill( LDC *dc_attr, TRIVERTEX *vert_array, ULONG nvert,
void *grad_array, ULONG ngrad, ULONG mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_IntersectClipRect( LDC *dc_attr, INT left, INT top, INT right,
INT bottom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_InvertRgn( LDC *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_LineTo( LDC *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ModifyWorldTransform( LDC *dc_attr, const XFORM *xform,
DWORD mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_MoveTo( LDC *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_OffsetClipRgn( LDC *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PaintRgn( LDC *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PatBlt( LDC *dc_attr, INT left, INT top, INT width, INT height, DWORD rop );
extern BOOL EMFDC_PolyBezier( LDC *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyBezierTo( LDC *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyDraw( LDC *dc_attr, const POINT *points, const BYTE *types,
DWORD count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyPolyline( LDC *dc_attr, const POINT *points, const DWORD *counts,
DWORD polys ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyPolygon( LDC *dc_attr, const POINT *points, const INT *counts,
UINT polys ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Polygon( LDC *dc_attr, const POINT *points, INT count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Polyline( LDC *dc_attr, const POINT *points, INT count) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolylineTo( LDC *dc_attr, const POINT *points, INT count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_Rectangle( LDC *dc_attr, INT left, INT top, INT right,
INT bottom) DECLSPEC_HIDDEN;
extern BOOL EMFDC_RestoreDC( LDC *dc_attr, INT level ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_RoundRect( LDC *dc_attr, INT left, INT top, INT right, INT bottom,
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SaveDC( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ScaleViewportExtEx( LDC *dc_attr, INT x_num, INT x_denom, INT y_num,
INT y_denom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ScaleWindowExtEx( LDC *dc_attr, INT x_num, INT x_denom, INT y_num,
INT y_denom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SelectClipPath( LDC *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SelectObject( LDC *dc_attr, HGDIOBJ obj ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SelectPalette( LDC *dc_attr, HPALETTE palette ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetArcDirection( LDC *dc_attr, INT dir ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetBkColor( LDC *dc_attr, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetBkMode( LDC *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetDCBrushColor( LDC *dc_attr, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetDCPenColor( LDC *dc_attr, COLORREF color ) DECLSPEC_HIDDEN;
extern INT EMFDC_SetDIBitsToDevice( LDC *dc_attr, INT x_dest, INT y_dest, DWORD width,
DWORD height, INT x_src, INT y_src, UINT startscan,
UINT lines, const void *bits, const BITMAPINFO *info,
UINT coloruse ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetLayout( LDC *dc_attr, DWORD layout ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetMapMode( LDC *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetMapperFlags( LDC *dc_attr, DWORD flags ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetPixel( LDC *dc_attr, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetPolyFillMode( LDC *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetROP2( LDC *dc_attr, INT rop ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetStretchBltMode( LDC *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetTextAlign( LDC *dc_attr, UINT align ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetTextColor( LDC *dc_attr, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetTextJustification( LDC *dc_attr, INT extra, INT breaks ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetViewportExtEx( LDC *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetViewportOrgEx( LDC *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetWindowExtEx( LDC *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetWindowOrgEx( LDC *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetWorldTransform( LDC *dc_attr, const XFORM *xform ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_StretchBlt( LDC *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop );
extern BOOL EMFDC_StretchDIBits( LDC *dc_attr, INT x_dst, INT y_dst, INT width_dst,
INT height_dst, INT x_src, INT y_src, INT width_src,
INT height_src, const void *bits, const BITMAPINFO *info,
UINT coloruse, DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_StrokeAndFillPath( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_StrokePath( LDC *dc_attr ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_WidenPath( LDC *dc_attr ) DECLSPEC_HIDDEN;
BOOL EMFDC_MaskBlt( LDC *dc_attr, INT xDest, INT yDest, INT cx, INT cy, HDC hdcSrc, INT xSrc, INT ySrc, HBITMAP hbmMask, INT xMask, INT yMask, DWORD dwRop);
BOOL EMFDC_PlgBlt( LDC *dc_attr, const POINT * ppt, HDC hdcSrc, INT xSrc, INT ySrc, INT cx, INT cy, HBITMAP hbmMask, INT xMask, INT yMask);
BOOL EMFDC_TransparentBlt( LDC *dc_attr, INT xDst, INT yDst, INT cxDst, INT cyDst, HDC hdcSrc, INT xSrc, INT ySrc, INT cxSrc, INT cySrc, UINT crTransparent);
BOOL EMFDC_SetBrushOrg( LDC *dc_attr, INT x, INT y);
BOOL EMFDC_SetMetaRgn( LDC *dc_attr );
INT EMFDC_WriteNamedEscape( LDC *dc_attr, PWCHAR pDriver, INT nEscape, INT cbInput, LPCSTR lpszInData);
INT EMFDC_WriteEscape( LDC *dc_attr, INT nEscape, INT cbInput, LPSTR lpszInData, DWORD emrType);
FORCEINLINE BOOL EMFDC_Arc( PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_ARC );
}
FORCEINLINE BOOL EMFDC_ArcTo( PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_ARCTO );
}
FORCEINLINE BOOL EMFDC_Chord( PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_CHORD );
}
FORCEINLINE BOOL EMFDC_Pie( PLDC dc_attr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDC_ArcChordPie( dc_attr, left, top, right, bottom, xstart, ystart, xend, yend, EMR_PIE );
}
BOOL WINAPI EMFDC_GdiComment( HDC hdc, UINT bytes, const BYTE *buffer );
/* EOF */

View file

@ -66,7 +66,7 @@ Escape(
if (ulObjType == GDILoObjType_LO_METADC16_TYPE)
{
return METADC16_Escape(hdc, nEscape, cbInput, lpvInData, lpvOutData);
return METADC_ExtEscape(hdc, nEscape, cbInput, lpvInData, 0, lpvOutData);
}
switch (nEscape)

View file

@ -54,15 +54,15 @@ AngleArc(
_In_ FLOAT eStartAngle,
_In_ FLOAT eSweepAngle)
{
HANDLE_METADC(BOOL,
HANDLE_EMETAFDC(BOOL,
AngleArc,
FALSE,
hdc,
x,
y,
dwRadius,
RCAST(DWORD, eStartAngle),
RCAST(DWORD, eSweepAngle));
eStartAngle,
eSweepAngle);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
@ -87,7 +87,7 @@ ArcTo(
_In_ INT xRadial2,
_In_ INT yRadial2)
{
HANDLE_METADC(BOOL,
HANDLE_EMETAFDC(BOOL,
ArcTo,
FALSE,
hdc,

View file

@ -811,7 +811,7 @@ StretchDIBits(
BOOL Hit = FALSE;
DPRINT("StretchDIBits %p : %p : %u\n", lpBits, lpBitsInfo, iUsage);
#if 0
HANDLE_METADC( int,
StretchDIBits,
0,
@ -828,11 +828,10 @@ StretchDIBits(
lpBitsInfo,
iUsage,
dwRop );
#endif
if ( GdiConvertAndCheckDC(hdc) == NULL ) return 0;
pConvertedInfo = ConvertBitmapInfo(lpBitsInfo, iUsage, &ConvertedInfoSize,
FALSE);
pConvertedInfo = ConvertBitmapInfo(lpBitsInfo, iUsage, &ConvertedInfoSize, FALSE);
if (!pConvertedInfo)
{
return 0;
@ -878,10 +877,22 @@ StretchDIBits(
(pConvertedInfo->bmiHeader.biCompression == BI_JPEG ||
pConvertedInfo->bmiHeader.biCompression == BI_PNG )) )*/
{
LinesCopied = NtGdiStretchDIBitsInternal(hdc, XDest, YDest, nDestWidth, nDestHeight, XSrc,
YSrc, nSrcWidth, nSrcHeight, pvSafeBits, pConvertedInfo, (DWORD) iUsage, dwRop,
ConvertedInfoSize, cjBmpScanSize,
NULL);
LinesCopied = NtGdiStretchDIBitsInternal( hdc,
XDest,
YDest,
nDestWidth,
nDestHeight,
XSrc,
YSrc,
nSrcWidth,
nSrcHeight,
pvSafeBits,
pConvertedInfo,
(DWORD) iUsage,
dwRop,
ConvertedInfoSize,
cjBmpScanSize,
NULL );
}
if (pvSafeBits)
RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits);

View file

@ -142,7 +142,7 @@ SetMapMode(
/* Handle METADC16 here, since we don't have a DCATTR. */
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) \
{
return GetAndSetDCDWord(hdc, GdiGetSetMapMode, iMode, 0, 0, 0 );
return METADC_SetMapMode(hdc, iMode);
}
/* Get the DC attribute */
@ -157,7 +157,7 @@ SetMapMode(
if ((iMode != pdcattr->iMapMode) || (iMode == MM_ISOTROPIC))
{
pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
return GetAndSetDCDWord(hdc, GdiGetSetMapMode, iMode, 0, 0, 0 );
return GetAndSetDCDWord(hdc, GdiGetSetMapMode, iMode, EMR_SETMAPMODE, 0, 0 );
}
return pdcattr->iMapMode;
@ -323,11 +323,11 @@ ModifyWorldTransform(
if (dwMode == MWT_SET)
{
HANDLE_METADC(BOOL, SetWorldTransform, FALSE, hdc, pxform);
HANDLE_EMETAFDC(BOOL, SetWorldTransform, FALSE, hdc, pxform);
}
else
{
HANDLE_METADC(BOOL, ModifyWorldTransform, FALSE, hdc, pxform, dwMode);
HANDLE_EMETAFDC(BOOL, ModifyWorldTransform, FALSE, hdc, pxform, dwMode);
}
/* Get the DC attribute */
@ -470,7 +470,7 @@ SetViewportExtEx(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, SetViewportExtEx, FALSE, hdc, nXExtent, nYExtent, lpSize);
HANDLE_METADC(BOOL, SetViewportExtEx, FALSE, hdc, nXExtent, nYExtent);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -537,7 +537,7 @@ SetWindowOrgEx(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, SetWindowOrgEx, FALSE, hdc, X, Y, lpPoint);
HANDLE_METADC(BOOL, SetWindowOrgEx, FALSE, hdc, X, Y);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -589,7 +589,7 @@ SetWindowExtEx(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, SetWindowExtEx, FALSE, hdc, nXExtent, nYExtent, lpSize);
HANDLE_METADC(BOOL, SetWindowExtEx, FALSE, hdc, nXExtent, nYExtent);
/* Get the DC attr */
pdcattr = GdiGetDcAttr(hdc);
@ -660,7 +660,7 @@ SetViewportOrgEx(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, SetViewportOrgEx, FALSE, hdc, X, Y, lpPoint);
HANDLE_METADC(BOOL, SetViewportOrgEx, FALSE, hdc, X, Y);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -707,7 +707,7 @@ ScaleViewportExtEx(
_In_ INT yDenom,
_Out_ LPSIZE lpSize)
{
HANDLE_METADC(BOOL, ScaleViewportExtEx, FALSE, hdc, xNum, xDenom, yNum, yDenom, lpSize);
HANDLE_METADC(BOOL, ScaleViewportExtEx, FALSE, hdc, xNum, xDenom, yNum, yDenom);
if (!GdiGetDcAttr(hdc))
{
@ -731,7 +731,7 @@ ScaleWindowExtEx(
_In_ INT yDenom,
_Out_ LPSIZE lpSize)
{
HANDLE_METADC(BOOL, ScaleWindowExtEx, FALSE, hdc, xNum, xDenom, yNum, yDenom, lpSize);
HANDLE_METADC(BOOL, ScaleWindowExtEx, FALSE, hdc, xNum, xDenom, yNum, yDenom);
if (!GdiGetDcAttr(hdc))
{
@ -863,7 +863,7 @@ OffsetViewportOrgEx(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, OffsetViewportOrgEx, FALSE, hdc, nXOffset, nYOffset, lpPoint);
HANDLE_METADC16(BOOL, OffsetViewportOrgEx, FALSE, hdc, nXOffset, nYOffset);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -895,6 +895,9 @@ OffsetViewportOrgEx(
pdcattr->ptlViewportOrg.x += nXOffset;
pdcattr->ptlViewportOrg.y += nYOffset;
}
HANDLE_EMETAFDC(BOOL, SetViewportOrgEx, FALSE, hdc, pdcattr->ptlViewportOrg.x, pdcattr->ptlViewportOrg.y);
return TRUE;
// return NtGdiOffsetViewportOrgEx(hdc, nXOffset, nYOffset, lpPoint);
@ -914,7 +917,7 @@ OffsetWindowOrgEx(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, OffsetWindowOrgEx, FALSE, hdc, nXOffset, nYOffset, lpPoint);
HANDLE_METADC16(BOOL, OffsetWindowOrgEx, FALSE, hdc, nXOffset, nYOffset);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -946,6 +949,9 @@ OffsetWindowOrgEx(
pdcattr->ptlWindowOrg.y += nYOffset;
pdcattr->lWindowOrgx += nXOffset;
}
HANDLE_EMETAFDC(BOOL, SetWindowOrgEx, FALSE, hdc, pdcattr->ptlWindowOrg.x, pdcattr->ptlWindowOrg.y);
return TRUE;
// return NtGdiOffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);

View file

@ -281,47 +281,34 @@ BOOL
WINAPI
DeleteDC(HDC hdc)
{
BOOL bResult = TRUE;
PLDC pLDC = NULL;
HANDLE hPrinter = NULL;
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
pLDC = GdiGetLDC(hdc);
if (hType != GDILoObjType_LO_DC_TYPE)
{
return METADC_DeleteDC(hdc);
return METADC_RosGlueDeleteDC(hdc);
}
bResult = NtGdiDeleteObjectApp(hdc);
//if ( ghICM || pdcattr->pvLIcm )
// IcmDeleteLocalDC( hdc, pdcattr, NULL );
if (bResult && pLDC)
{
DPRINT1("Delete the Local DC structure\n");
LocalFree( pLDC );
}
if (hPrinter)
fpClosePrinter(hPrinter);
return bResult;
return NtGdiDeleteObjectApp(hdc);
}
/*
* @unimplemented
* @implemented
*/
INT
WINAPI
SaveDC(IN HDC hdc)
{
HANDLE_METADC0P(INT, SaveDC, 0, hdc);
HANDLE_METADC1P(INT, SaveDC, 0, hdc);
return NtGdiSaveDC(hdc);
}
/*
* @unimplemented
* @implemented
*/
BOOL
WINAPI
@ -381,7 +368,7 @@ SetArcDirection(
_In_ HDC hdc,
_In_ INT nDirection)
{
return GetAndSetDCDWord(hdc, GdiGetSetArcDirection, nDirection, 0, 0, 0);
return GetAndSetDCDWord(hdc, GdiGetSetArcDirection, nDirection, EMR_SETARCDIRECTION, 0, 0);
}
/*
@ -565,21 +552,43 @@ GetDeviceCaps(
_In_ int nIndex)
{
PDC_ATTR pdcattr;
PLDC pldc;
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
PDEVCAPS pDevCaps = GdiDevCaps; // Primary display device capabilities.
DPRINT("Device CAPS1\n");
HANDLE_METADC(INT, GetDeviceCaps, 0, hdc, nIndex);
HANDLE_METADC16(INT, GetDeviceCaps, 0, hdc, nIndex);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
if (pdcattr == NULL)
if ( hType != GDILoObjType_LO_DC_TYPE && hType != GDILoObjType_LO_METADC16_TYPE )
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
pldc = GdiGetLDC(hdc);
if ( !pldc )
{
SetLastError(ERROR_INVALID_HANDLE);
return 0;
}
if (!(pldc->Flags & LDC_DEVCAPS) )
{
if (!NtGdiGetDeviceCapsAll(hdc, &pldc->DevCaps) )
SetLastError(ERROR_INVALID_PARAMETER);
if (!(pdcattr->ulDirty_ & DC_PRIMARY_DISPLAY))
return NtGdiGetDeviceCaps(hdc, nIndex);
pldc->Flags |= LDC_DEVCAPS;
}
pDevCaps = &pldc->DevCaps;
}
else
{
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
if ( pdcattr == NULL )
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
if (!(pdcattr->ulDirty_ & DC_PRIMARY_DISPLAY))
return NtGdiGetDeviceCaps(hdc, nIndex);
}
switch (nIndex)
{
@ -725,7 +734,7 @@ SetRelAbs(
HDC hdc,
INT Mode)
{
return GetAndSetDCDWord(hdc, GdiGetSetRelAbs, Mode, 0, 0, 0);
return GetAndSetDCDWord(hdc, GdiGetSetRelAbs, Mode, 0, META_SETRELABS, 0);
}
@ -743,9 +752,22 @@ GetAndSetDCDWord(
_In_ DWORD dwError)
{
DWORD dwResult;
PLDC pldc;
/* This is a special API, handle it appropriately */
HANDLE_METADC2(DWORD, GetAndSetDCDWord, hdc, u, dwIn, ulMFId, usMF16Id, dwError);
if ( GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE &&
ulMFId != EMR_MAX + 1 )
{
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE)
{
return METADC_SetD( hdc, dwIn, usMF16Id );
}
pldc = GdiGetLDC(hdc);
if ( pldc->iType == LDC_EMFLDC)
{
if (!EMFDC_SetD( pldc, dwIn, ulMFId ))
return 0;
}
}
/* Call win32k to do the real work */
if (!NtGdiGetAndSetDCDword(hdc, u, dwIn, &dwResult))
@ -896,7 +918,7 @@ SetDCBrushColor(
}
/* We handle only enhanced meta DCs here */
HANDLE_METADC(COLORREF, SetDCBrushColor, CLR_INVALID, hdc, crColor);
HANDLE_EMETAFDC(COLORREF, SetDCBrushColor, CLR_INVALID, hdc, crColor);
/* Get old color and store the new */
crOldColor = pdcattr->ulBrushClr;
@ -932,7 +954,7 @@ SetDCPenColor(
}
/* We handle only enhanced meta DCs here */
HANDLE_METADC(COLORREF, SetDCPenColor, CLR_INVALID, hdc, crColor);
HANDLE_EMETAFDC(COLORREF, SetDCPenColor, CLR_INVALID, hdc, crColor);
/* Get old color and store the new */
crOldColor = pdcattr->ulPenClr;
@ -1292,7 +1314,7 @@ SelectPalette(
HPALETTE hpal,
BOOL bForceBackground)
{
HANDLE_METADC(HPALETTE, SelectPalette, NULL, hdc, hpal, bForceBackground);
HANDLE_METADC(HPALETTE, SelectPalette, NULL, hdc, hpal);
return NtUserSelectPalette(hdc, hpal, bForceBackground);
}
@ -1392,7 +1414,7 @@ GdiSelectBrush(
PDC_ATTR pdcattr;
HBRUSH hbrOld;
HANDLE_METADC(HBRUSH, SelectBrush, NULL, hdc, hbr);
HANDLE_METADC(HBRUSH, SelectObject, NULL, hdc, hbr);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -1422,7 +1444,7 @@ GdiSelectPen(
PDC_ATTR pdcattr;
HPEN hpenOld;
HANDLE_METADC(HPEN, SelectPen, NULL, hdc, hpen);
HANDLE_METADC(HPEN, SelectObject, NULL, hdc, hpen);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -1452,7 +1474,7 @@ GdiSelectFont(
PDC_ATTR pdcattr;
HFONT hfontOld;
HANDLE_METADC(HFONT, SelectFont, NULL, hdc, hfont);
HANDLE_METADC(HFONT, SelectObject, NULL, hdc, hfont);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);

View file

@ -6,35 +6,31 @@
/*
* @unimplemented
*/
DWORD
BOOL
WINAPI
IsValidEnhMetaRecord(
DWORD a0,
DWORD a1
)
PVOID pv0,
PVOID pv1)
{
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
return FALSE;
}
/*
* @unimplemented
*/
DWORD
BOOL
WINAPI
IsValidEnhMetaRecordOffExt(
DWORD a0,
DWORD a1,
DWORD a2,
DWORD a3
)
PVOID pv0,
PVOID pv1,
DWORD dwOffset,
DWORD dwExtends )
{
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
return FALSE;
}
/*
@ -136,9 +132,7 @@ GdiComment(
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_ALTDC_TYPE)
return TRUE;
HANDLE_METADC(BOOL, GdiComment, FALSE, hdc, cbSize, lpData);
return TRUE;
return EMFDC_GdiComment( hdc, cbSize, lpData );
}
/*
@ -147,10 +141,9 @@ GdiComment(
UINT
WINAPI
GetEnhMetaFilePixelFormat(
HENHMETAFILE hemf,
UINT cbBuffer,
PIXELFORMATDESCRIPTOR *ppfd
)
HENHMETAFILE hemf,
UINT cbBuffer,
PIXELFORMATDESCRIPTOR *ppfd )
{
ENHMETAHEADER pemh;

View file

@ -323,14 +323,15 @@ DeleteObject(HGDIOBJ hObject)
if ((DWORD_PTR)hObject & GDI_HANDLE_STOCK_MASK)
{
/* Ignore the attempt to delete a stock object */
DPRINT("Trying to delete system object 0x%p\n", hObject);
DPRINT1("Trying to delete system object 0x%p\n", hObject);
return TRUE;
}
/* If we have any METAFILE objects, we need to check them */
if (gcClientObj > 0)
{
METADC_DeleteObject(hObject);
DPRINT("Going Glue\n");
METADC_RosGlueDeleteObject(hObject);
}
/* Switch by object type */
@ -349,16 +350,7 @@ DeleteObject(HGDIOBJ hObject)
case GDILoObjType_LO_REGION_TYPE:
return DeleteRegion(hObject);
#if 0
case GDI_OBJECT_TYPE_METADC:
return MFDRV_DeleteObject( hObject );
case GDI_OBJECT_TYPE_EMF:
{
PLDC pLDC = GdiGetLDC(hObject);
if ( !pLDC ) return FALSE;
return EMFDRV_DeleteObject( hObject );
}
#endif
case GDILoObjType_LO_BRUSH_TYPE:
case GDILoObjType_LO_PEN_TYPE:
case GDILoObjType_LO_EXTPEN_TYPE:

View file

@ -17,19 +17,15 @@
*/
BOOL
WINAPI
GdiIsPlayMetafileDC(HDC hDC)
GdiIsPlayMetafileDC(HDC hdc)
{
#if 0
PLDC pLDC = GdiGetLDC(hDC);
if ( pLDC )
PDC_ATTR pdcattr = GdiGetDcAttr(hdc);
if ( pdcattr )
{
if ( pLDC->Flags & LDC_PLAY_MFDC ) return TRUE;
return !!( pdcattr->ulDirty_ & DC_PLAYMETAFILE );
}
return FALSE;
#else
UNIMPLEMENTED;
return FALSE;
#endif
}
/*
@ -49,17 +45,13 @@ GdiIsMetaFileDC(HDC hdc)
if (ulObjType == GDILoObjType_LO_ALTDC_TYPE)
{
#if 0
PLDC pLDC = GdiGetLDC(hdc);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if ( pLDC->iType == LDC_EMFLDC) return TRUE;
return FALSE;
#endif
return TRUE;
return !!( pLDC->iType == LDC_EMFLDC );
}
return FALSE;
@ -70,29 +62,26 @@ GdiIsMetaFileDC(HDC hdc)
*/
BOOL
WINAPI
GdiIsMetaPrintDC(HDC hDC)
GdiIsMetaPrintDC(HDC hdc)
{
#if 0
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
if ( hType != GDILoObjType_LO_DC_TYPE )
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
if ( hType == GDILoObjType_LO_METADC16_TYPE )
return FALSE;
else
{
PLDC pLDC = GdiGetLDC(hDC);
PLDC pLDC = GdiGetLDC(hdc);
if ( !pLDC )
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if ( pLDC->Flags & LDC_META_PRINT) return TRUE;
return !!( pLDC->Flags & LDC_META_PRINT );
}
}
return FALSE;
#else
UNIMPLEMENTED;
return FALSE;
#endif
}
// NOTE: I wanna use GdiCreateLocalMetaFilePict and GdiConvertMetaFilePict

View file

@ -29,7 +29,7 @@ MoveToEx(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, MoveTo, FALSE, hdc, x, y, ppt);
HANDLE_METADC(BOOL, MoveTo, FALSE, hdc, x, y);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -265,7 +265,7 @@ PolyBezier(
_In_reads_(cpt) const POINT *apt,
_In_ DWORD cpt)
{
HANDLE_METADC(BOOL, PolyBezier, FALSE, hdc, apt, cpt);
HANDLE_EMETAFDC(BOOL, PolyBezier, FALSE, hdc, apt, cpt);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
@ -283,7 +283,7 @@ PolyBezierTo(
_In_reads_(cpt) const POINT *apt,
_In_ DWORD cpt)
{
HANDLE_METADC(BOOL, PolyBezierTo, FALSE, hdc, apt, cpt);
HANDLE_EMETAFDC(BOOL, PolyBezierTo, FALSE, hdc, apt, cpt);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
@ -302,7 +302,7 @@ PolyDraw(
_In_reads_(cpt) const BYTE *aj,
_In_ INT cpt)
{
HANDLE_METADC(BOOL, PolyDraw, FALSE, hdc, apt, aj, cpt);
HANDLE_EMETAFDC(BOOL, PolyDraw, FALSE, hdc, apt, aj, cpt);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
@ -356,7 +356,7 @@ PolylineTo(
_In_reads_(cpt) const POINT *apt,
_In_ DWORD cpt)
{
HANDLE_METADC(BOOL, PolylineTo, FALSE, hdc, apt, cpt);
HANDLE_EMETAFDC(BOOL, PolylineTo, FALSE, hdc, apt, cpt);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
@ -397,7 +397,7 @@ PolyPolyline(
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE)
return FALSE;
HANDLE_METADC(BOOL, PolyPolyline, FALSE, hdc, apt, asz, csz);
HANDLE_EMETAFDC(BOOL, PolyPolyline, FALSE, hdc, apt, asz, csz);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
@ -461,9 +461,9 @@ BitBlt(
return PatBlt(hdcDest, xDest, yDest, cx, cy, dwRop);
}
/* For meta DCs we use StretchBlt */
/* For meta DCs we use StretchBlt via emfdc.c */
HANDLE_METADC(BOOL,
StretchBlt,
BitBlt,
FALSE,
hdcDest,
xDest,
@ -473,8 +473,6 @@ BitBlt(
hdcSrc,
xSrc,
ySrc,
cx,
cy,
dwRop);
if ( GdiConvertAndCheckDC(hdcDest) == NULL ) return FALSE;
@ -494,7 +492,7 @@ PatBlt(
{
PDC_ATTR pdcattr;
HANDLE_METADC(BOOL, PatBlt, FALSE, hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
HANDLE_EMETAFDC(BOOL, PatBlt, FALSE, hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
@ -686,7 +684,7 @@ MaskBlt(
_In_ INT yMask,
_In_ DWORD dwRop)
{
HANDLE_METADC(BOOL,
HANDLE_EMETAFDC(BOOL,
MaskBlt,
FALSE,
hdcDest,
@ -737,7 +735,7 @@ PlgBlt(
_In_ INT xMask,
_In_ INT yMask)
{
HANDLE_METADC(BOOL,
HANDLE_EMETAFDC(BOOL,
PlgBlt,
FALSE,
hdcDest,
@ -785,7 +783,7 @@ GdiAlphaBlend(
if (GDI_HANDLE_GET_TYPE(hdcSrc) == GDI_OBJECT_TYPE_METADC) return FALSE;
HANDLE_METADC(BOOL,
HANDLE_EMETAFDC(BOOL,
AlphaBlend,
FALSE,
hdcDst,
@ -835,7 +833,7 @@ GdiTransparentBlt(
_In_ INT cySrc,
_In_ UINT crTransparent)
{
HANDLE_METADC(BOOL,
HANDLE_EMETAFDC(BOOL,
TransparentBlt,
FALSE,
hdcDst,
@ -868,7 +866,9 @@ GdiGradientFill(
_In_ ULONG nCount,
_In_ ULONG ulMode)
{
HANDLE_METADC(BOOL, GradientFill, FALSE, hdc, pVertex, nVertex, pMesh, nCount, ulMode);
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE) return TRUE;
HANDLE_EMETAFDC(BOOL, GradientFill, FALSE, hdc, pVertex, nVertex, pMesh, nCount, ulMode);
if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;

View file

@ -138,7 +138,10 @@ WINAPI
RealizePalette(
_In_ HDC hdc) /* [in] Handle of device context */
{
HANDLE_METADC0P(UINT, RealizePalette, GDI_ERROR, hdc);
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE)
{
return METADC_RealizePalette(hdc);
}
if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE)
{

View file

@ -120,7 +120,7 @@ WINAPI
PathToRegion(
HDC hdc)
{
HANDLE_METADC0P(HRGN, PathToRegion, NULL, hdc);
HANDLE_METADC0P(HRGN, AbortPath, NULL, hdc);
return NtGdiPathToRegion(hdc);
}
@ -192,6 +192,6 @@ SelectClipPath(
HDC hdc,
int iMode)
{
HANDLE_METADC(BOOL, SelectClipPath, FALSE, hdc, iMode);
HANDLE_EMETAFDC(BOOL, SelectClipPath, FALSE, hdc, iMode);
return NtGdiSelectClipPath(hdc, iMode);
}

View file

@ -1086,20 +1086,22 @@ int
WINAPI
SetMetaRgn(HDC hDC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC)
return NtGdiSetMetaRgn(hDC);
#if 0
PLDC pLDC = GdiGetLDC(hDC);
if ( pLDC && GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_METADC )
if (GDI_HANDLE_GET_TYPE(hDC) != GDILoObjType_LO_DC_TYPE)
{
if (pLDC->iType == LDC_EMFLDC || EMFDRV_SetMetaRgn(hDC))
PLDC pLDC = GdiGetLDC(hDC);
if ( pLDC && GDI_HANDLE_GET_TYPE(hDC) != GDILoObjType_LO_METADC16_TYPE )
{
return NtGdiSetMetaRgn(hDC);
if (pLDC->iType == LDC_EMFLDC && !EMFDC_SetMetaRgn( pLDC ))
{
return ERROR;
}
}
else
{
SetLastError(ERROR_INVALID_HANDLE);
return ERROR;
}
}
#endif
return ERROR;
return NtGdiSetMetaRgn(hDC);
}

View file

@ -782,10 +782,7 @@ SetTextCharacterExtra(
return 0x80000000;
}
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE)
{
HANDLE_METADC(INT, SetTextCharacterExtra, 0x80000000, hdc, nCharExtra);
}
HANDLE_METADC16(INT, SetTextCharacterExtra, 0x80000000, hdc, nCharExtra);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);
@ -935,10 +932,7 @@ SetTextJustification(
{
PDC_ATTR pdcattr;
if (GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE)
{
HANDLE_METADC(BOOL, SetTextJustification, FALSE, hdc, nBreakExtra, nBreakCount);
}
HANDLE_METADC16(BOOL, SetTextJustification, FALSE, hdc, nBreakExtra, nBreakCount);
/* Get the DC attribute */
pdcattr = GdiGetDcAttr(hdc);

View file

@ -6,20 +6,11 @@ include_directories(
.)
list(APPEND SOURCE
emfdc.c
emfdrv.c
enhmetafile.c
metadc.c
metafile.c
path.c
enhmfdrv/bitblt.c
enhmfdrv/dc.c
enhmfdrv/graphics.c
enhmfdrv/init.c
enhmfdrv/objects.c
mfdrv/bitblt.c
mfdrv/dc.c
mfdrv/graphics.c
mfdrv/init.c
mfdrv/objects.c
mfdrv/text.c
rosglue.c)
add_library(winegdi ${SOURCE})

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,430 @@
/*
* Enhanced MetaFile driver
*
* Copyright 1999 Huw D M Davies
* Copyright 2021 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
//#include "ntgdi_private.h"
#include "wine/config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winnls.h"
#include "winerror.h"
#include "gdi_private.h"
#ifdef __REACTOS__
#include "wine/winternl.h"
#else
#include "winternl.h"
#endif
#include "wine/wingdi16.h"
#include "wine/debug.h"
#define M_PI 3.14159265358979323846
#define M_PI_2 1.570796326794896619
static void emfdrv_update_bounds( WINEDC *dc, RECTL *rect )
{
RECTL *bounds = &dc->emf_bounds;
RECTL vport_rect = *rect;
//lp_to_dp( dc, (POINT *)&vport_rect, 2 );
LPtoDP(dc->hdc, (POINT *)&vport_rect, 2 );
/* The coordinate systems may be mirrored
(LPtoDP handles points, not rectangles) */
if (vport_rect.left > vport_rect.right)
{
LONG temp = vport_rect.right;
vport_rect.right = vport_rect.left;
vport_rect.left = temp;
}
if (vport_rect.top > vport_rect.bottom)
{
LONG temp = vport_rect.bottom;
vport_rect.bottom = vport_rect.top;
vport_rect.top = temp;
}
if (bounds->left > bounds->right)
{
/* first bounding rectangle */
*bounds = vport_rect;
}
else
{
bounds->left = min( bounds->left, vport_rect.left );
bounds->top = min( bounds->top, vport_rect.top );
bounds->right = max( bounds->right, vport_rect.right );
bounds->bottom = max( bounds->bottom, vport_rect.bottom );
}
}
BOOL EMFDRV_LineTo( WINEDC *dc, INT x, INT y )
{
RECTL bounds;
POINT pt;
//pt = dc->attr->cur_pos;
GetCurrentPositionEx(dc->hdc, &pt);
bounds.left = min( x, pt.x );
bounds.top = min( y, pt.y );
bounds.right = max( x, pt.x );
bounds.bottom = max( y, pt.y );
emfdrv_update_bounds( dc, &bounds );
return TRUE;
}
BOOL EMFDRV_RoundRect( WINEDC *dc, INT left, INT top, INT right,
INT bottom, INT ell_width, INT ell_height )
{
RECTL bounds;
if (left == right || top == bottom) return FALSE;
bounds.left = min( left, right );
bounds.top = min( top, bottom );
bounds.right = max( left, right );
bounds.bottom = max( top, bottom );
if (GetGraphicsMode(dc->hdc) == GM_COMPATIBLE)//dc->attr->graphics_mode == GM_COMPATIBLE)
{
bounds.right--;
bounds.bottom--;
}
emfdrv_update_bounds( dc, &bounds );
return TRUE;
}
BOOL EMFDRV_ArcChordPie( WINEDC *dc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend, DWORD type )
{
INT temp, x_centre, y_centre, i;
double angle_start, angle_end;
double xinter_start, yinter_start, xinter_end, yinter_end;
EMRARC emr;
RECTL bounds;
if (left == right || top == bottom) return FALSE;
if (left > right) { temp = left; left = right; right = temp; }
if (top > bottom) { temp = top; top = bottom; bottom = temp; }
if (GetGraphicsMode(dc->hdc) == GM_COMPATIBLE)//dc->attr->graphics_mode == GM_COMPATIBLE)
{
right--;
bottom--;
}
emr.emr.iType = type;
emr.emr.nSize = sizeof(emr);
emr.rclBox.left = left;
emr.rclBox.top = top;
emr.rclBox.right = right;
emr.rclBox.bottom = bottom;
emr.ptlStart.x = xstart;
emr.ptlStart.y = ystart;
emr.ptlEnd.x = xend;
emr.ptlEnd.y = yend;
/* Now calculate the BBox */
x_centre = (left + right + 1) / 2;
y_centre = (top + bottom + 1) / 2;
xstart -= x_centre;
ystart -= y_centre;
xend -= x_centre;
yend -= y_centre;
/* invert y co-ords to get angle anti-clockwise from x-axis */
angle_start = atan2( -(double)ystart, (double)xstart );
angle_end = atan2( -(double)yend, (double)xend );
/* These are the intercepts of the start/end lines with the arc */
xinter_start = (right - left + 1)/2 * cos(angle_start) + x_centre;
yinter_start = -(bottom - top + 1)/2 * sin(angle_start) + y_centre;
xinter_end = (right - left + 1)/2 * cos(angle_end) + x_centre;
yinter_end = -(bottom - top + 1)/2 * sin(angle_end) + y_centre;
if (angle_start < 0) angle_start += 2 * M_PI;
if (angle_end < 0) angle_end += 2 * M_PI;
if (angle_end < angle_start) angle_end += 2 * M_PI;
bounds.left = min( xinter_start, xinter_end );
bounds.top = min( yinter_start, yinter_end );
bounds.right = max( xinter_start, xinter_end );
bounds.bottom = max( yinter_start, yinter_end );
for (i = 0; i <= 8; i++)
{
if(i * M_PI / 2 < angle_start) /* loop until we're past start */
continue;
if(i * M_PI / 2 > angle_end) /* if we're past end we're finished */
break;
/* the arc touches the rectangle at the start of quadrant i, so adjust
BBox to reflect this. */
switch(i % 4) {
case 0:
bounds.right = right;
break;
case 1:
bounds.top = top;
break;
case 2:
bounds.left = left;
break;
case 3:
bounds.bottom = bottom;
break;
}
}
/* If we're drawing a pie then make sure we include the centre */
if (type == EMR_PIE)
{
if (bounds.left > x_centre) bounds.left = x_centre;
else if (bounds.right < x_centre) bounds.right = x_centre;
if (bounds.top > y_centre) bounds.top = y_centre;
else if (bounds.bottom < y_centre) bounds.bottom = y_centre;
}
else if (type == EMR_ARCTO)
{
POINT pt;
//pt = dc->attr->cur_pos;
GetCurrentPositionEx(dc->hdc, &pt);
bounds.left = min( bounds.left, pt.x );
bounds.top = min( bounds.top, pt.y );
bounds.right = max( bounds.right, pt.x );
bounds.bottom = max( bounds.bottom, pt.y );
}
emfdrv_update_bounds( dc, &bounds );
return TRUE;
}
BOOL EMFDRV_Arc( WINEDC *dc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDRV_ArcChordPie( dc, left, top, right, bottom, xstart, ystart,
xend, yend, EMR_ARC );
}
BOOL EMFDRV_ArcTo( WINEDC *dc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDRV_ArcChordPie( dc, left, top, right, bottom, xstart, ystart,
xend, yend, EMR_ARCTO );
}
BOOL EMFDRV_Pie( WINEDC *dc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDRV_ArcChordPie( dc, left, top, right, bottom, xstart, ystart,
xend, yend, EMR_PIE );
}
BOOL EMFDRV_Chord( WINEDC *dc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
return EMFDRV_ArcChordPie( dc, left, top, right, bottom, xstart, ystart,
xend, yend, EMR_CHORD );
}
BOOL EMFDRV_Ellipse( WINEDC *dc, INT left, INT top, INT right, INT bottom )
{
RECTL bounds;
if (left == right || top == bottom) return FALSE;
bounds.left = min( left, right );
bounds.top = min( top, bottom );
bounds.right = max( left, right );
bounds.bottom = max( top, bottom );
if (GetGraphicsMode(dc->hdc) == GM_COMPATIBLE)//dc->attr->graphics_mode == GM_COMPATIBLE)
{
bounds.right--;
bounds.bottom--;
}
emfdrv_update_bounds( dc, &bounds );
return TRUE;
}
BOOL EMFDRV_Rectangle( WINEDC *dc, INT left, INT top, INT right, INT bottom )
{
RECTL bounds;
if (left == right || top == bottom) return FALSE;
bounds.left = min( left, right );
bounds.top = min( top, bottom );
bounds.right = max( left, right );
bounds.bottom = max( top, bottom );
if (GetGraphicsMode(dc->hdc) == GM_COMPATIBLE)//dc->attr->graphics_mode == GM_COMPATIBLE)
{
bounds.right--;
bounds.bottom--;
}
emfdrv_update_bounds( dc, &bounds );
return TRUE;
}
COLORREF EMFDRV_SetPixel( WINEDC *dc, INT x, INT y, COLORREF color )
{
RECTL bounds;
bounds.left = bounds.right = x;
bounds.top = bounds.bottom = y;
emfdrv_update_bounds( dc, &bounds );
return CLR_INVALID;
}
BOOL EMFDRV_PolylineTo( WINEDC *dc, const POINT *pt, INT count )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_PolyBezier( WINEDC *dc, const POINT *pts, DWORD count )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_PolyBezierTo( WINEDC *dc, const POINT *pts, DWORD count )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_PolyPolyline( WINEDC *dc, const POINT *pt,
const DWORD *counts, UINT polys )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_PolyPolygon( WINEDC *dc, const POINT *pt,
const INT *counts, UINT polys )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_PolyDraw( WINEDC *dc, const POINT *pts,
const BYTE *types, DWORD count )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_FillRgn( WINEDC *dc, HRGN hrgn, HBRUSH hbrush )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_FrameRgn( WINEDC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_InvertRgn( WINEDC *dc, HRGN hrgn )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_ExtTextOut( WINEDC *dc, INT x, INT y, UINT flags, const RECT *lprect,
LPCWSTR str, UINT count, const INT *lpDx )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_GradientFill( WINEDC *dc, TRIVERTEX *vert_array, ULONG nvert,
void *grad_array, ULONG ngrad, ULONG mode )
{
/* FIXME: update bounding rect */
return TRUE;
}
BOOL EMFDRV_FillPath( WINEDC *dc )
{
/* FIXME: update bound rect */
return TRUE;
}
BOOL EMFDRV_StrokeAndFillPath( WINEDC *dc )
{
/* FIXME: update bound rect */
return TRUE;
}
BOOL EMFDRV_StrokePath( WINEDC *dc )
{
/* FIXME: update bound rect */
return TRUE;
}
BOOL EMFDRV_AlphaBlend( WINEDC *dc_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
HDC dc_src, INT x_src, INT y_src, INT width_src, INT height_src,
BLENDFUNCTION func )
{
/* FIXME: update bound rect */
return TRUE;
}
BOOL EMFDRV_PatBlt( WINEDC *dc, INT left, INT top, INT width, INT height, DWORD rop )
{
/* FIXME: update bound rect */
return TRUE;
}
INT EMFDRV_StretchDIBits( WINEDC *dc, INT x_dst, INT y_dst, INT width_dst,
INT height_dst, INT x_src, INT y_src, INT width_src,
INT height_src, const void *bits, BITMAPINFO *info,
UINT wUsage, DWORD dwRop )
{
/* FIXME: Update bound rect */
return height_src;
}
INT EMFDRV_SetDIBitsToDevice( WINEDC *dc, INT x_dst, INT y_dst, DWORD width,
DWORD height, INT x_src, INT y_src, UINT startscan,
UINT lines, const void *bits, BITMAPINFO *info,
UINT usage )
{
/* FIXME: Update bound rect */
return lines;
}
HBITMAP EMFDRV_SelectBitmap( WINEDC *dc, HBITMAP hbitmap )
{
return 0;
}

View file

@ -48,6 +48,16 @@
WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
static CRITICAL_SECTION enhmetafile_cs;
static CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &enhmetafile_cs,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": enhmetafile_cs") }
};
static CRITICAL_SECTION enhmetafile_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
typedef struct
{
ENHMETAHEADER *emh;
@ -246,7 +256,7 @@ static inline BOOL is_dib_monochrome( const BITMAPINFO* info )
/****************************************************************************
* EMF_Create_HENHMETAFILE
*/
HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk )
HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, DWORD filesize, BOOL on_disk )
{
HENHMETAFILE hmf;
ENHMETAFILEOBJ *metaObj;
@ -263,6 +273,11 @@ HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk )
emh->iType, emh->dSignature);
return 0;
}
if (filesize < emh->nBytes)
{
WARN("File truncated (got %u bytes, header says %u)\n", emh->nBytes, filesize);
return 0;
}
if (!(metaObj = HeapAlloc( GetProcessHeap(), 0, sizeof(*metaObj) ))) return 0;
@ -279,15 +294,22 @@ HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk )
*/
static BOOL EMF_Delete_HENHMETAFILE( HENHMETAFILE hmf )
{
ENHMETAFILEOBJ *metaObj = free_gdi_handle( hmf );
ENHMETAFILEOBJ *metaObj;
BOOL Ret = FALSE;
if(!metaObj) return FALSE;
if(metaObj->on_disk)
UnmapViewOfFile( metaObj->emh );
else
HeapFree( GetProcessHeap(), 0, metaObj->emh );
return HeapFree( GetProcessHeap(), 0, metaObj );
EnterCriticalSection( &enhmetafile_cs );
metaObj = free_gdi_handle( hmf );
if(metaObj)
{
if(metaObj->on_disk)
UnmapViewOfFile( metaObj->emh );
else
HeapFree( GetProcessHeap(), 0, metaObj->emh );
HeapFree( GetProcessHeap(), 0, metaObj );
Ret = TRUE;
}
LeaveCriticalSection( &enhmetafile_cs );
return Ret;
}
/******************************************************************
@ -298,13 +320,17 @@ static BOOL EMF_Delete_HENHMETAFILE( HENHMETAFILE hmf )
static ENHMETAHEADER *EMF_GetEnhMetaHeader( HENHMETAFILE hmf )
{
ENHMETAHEADER *ret = NULL;
ENHMETAFILEOBJ *metaObj = GDI_GetObjPtr( hmf, OBJ_ENHMETAFILE );
ENHMETAFILEOBJ *metaObj;
EnterCriticalSection( &enhmetafile_cs );
metaObj = GDI_GetObjPtr( hmf, OBJ_ENHMETAFILE );
TRACE("hmf %p -> enhmetaObj %p\n", hmf, metaObj);
if (metaObj)
{
ret = metaObj->emh;
GDI_ReleaseObj( hmf );
}
LeaveCriticalSection( &enhmetafile_cs );
return ret;
}
@ -317,6 +343,9 @@ static HENHMETAFILE EMF_GetEnhMetaFile( HANDLE hFile )
ENHMETAHEADER *emh;
HANDLE hMapping;
HENHMETAFILE hemf;
DWORD filesize;
filesize = GetFileSize( hFile, NULL );
hMapping = CreateFileMappingA( hFile, NULL, PAGE_READONLY, 0, 0, NULL );
emh = MapViewOfFile( hMapping, FILE_MAP_READ, 0, 0, 0 );
@ -324,7 +353,7 @@ static HENHMETAFILE EMF_GetEnhMetaFile( HANDLE hFile )
if (!emh) return 0;
hemf = EMF_Create_HENHMETAFILE( emh, TRUE );
hemf = EMF_Create_HENHMETAFILE( emh, filesize, TRUE );
if (!hemf)
UnmapViewOfFile( emh );
return hemf;
@ -467,7 +496,7 @@ HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT bufsize, const BYTE *buf)
ENHMETAHEADER *emh = HeapAlloc( GetProcessHeap(), 0, bufsize );
HENHMETAFILE hmf;
memmove(emh, buf, bufsize);
hmf = EMF_Create_HENHMETAFILE( emh, FALSE );
hmf = EMF_Create_HENHMETAFILE( emh, bufsize, FALSE );
if (!hmf)
HeapFree( GetProcessHeap(), 0, emh );
return hmf;
@ -1127,6 +1156,31 @@ BOOL WINAPI PlayEnhMetaFileRecord(
break;
}
case EMR_POLYDRAW16:
{
const EMRPOLYDRAW16 *pPolyDraw16 = (const EMRPOLYDRAW16 *)mr;
const POINTS *ptl = pPolyDraw16->apts;
POINT *pts = HeapAlloc(GetProcessHeap(), 0, pPolyDraw16->cpts * sizeof(POINT));
DWORD i;
/* NB abTypes array doesn't start at pPolyDraw16->abTypes. It's actually
pPolyDraw16->apts + pPolyDraw16->cpts. */
const BYTE *types = (BYTE*)(pPolyDraw16->apts + pPolyDraw16->cpts);
if (!pts)
break;
for (i = 0; i < pPolyDraw16->cpts; ++i)
{
pts[i].x = ptl[i].x;
pts[i].y = ptl[i].y;
}
PolyDraw(hdc, pts, types, pPolyDraw16->cpts);
HeapFree(GetProcessHeap(), 0, pts);
break;
}
case EMR_STRETCHDIBITS:
{
const EMRSTRETCHDIBITS *pStretchDIBits = (const EMRSTRETCHDIBITS *)mr;
@ -2231,15 +2285,33 @@ BOOL WINAPI PlayEnhMetaFileRecord(
break;
}
case EMR_POLYDRAW16:
case EMR_DRAWESCAPE:
{
PEMRESCAPE pemr = (PEMRESCAPE)mr;
DrawEscape( hdc, pemr->iEsc, pemr->cjIn, (LPCSTR)pemr->Data );
break;
}
case EMR_EXTESCAPE:
{
PEMRESCAPE pemr = (PEMRESCAPE)mr;
ExtEscape( hdc, pemr->iEsc, pemr->cjIn, (LPCSTR)pemr->Data, 0, NULL );
break;
}
case EMR_NAMEDESCAPE:
{
PEMRNAMEDESCAPE pemr = (PEMRNAMEDESCAPE)mr;
INT rounded_size = (pemr->cjIn+3) & ~3;
NamedEscape( hdc, (PWCHAR)&pemr->Data[rounded_size], pemr->iEsc, pemr->cjIn, (LPSTR)pemr->Data, 0, NULL );
break;
}
case EMR_GLSRECORD:
case EMR_GLSBOUNDEDRECORD:
case EMR_DRAWESCAPE:
case EMR_EXTESCAPE:
case EMR_STARTDOC:
case EMR_SMALLTEXTOUT:
case EMR_FORCEUFIMAPPING:
case EMR_NAMEDESCAPE:
case EMR_COLORCORRECTPALETTE:
case EMR_SETICMPROFILEA:
case EMR_SETICMPROFILEW:
@ -2262,7 +2334,6 @@ BOOL WINAPI PlayEnhMetaFileRecord(
return TRUE;
}
/*****************************************************************************
*
* EnumEnhMetaFile (GDI32.@)
@ -2358,13 +2429,14 @@ BOOL WINAPI EnumEnhMetaFile(
info->state.next = NULL;
info->save_level = 0;
info->saved_state = NULL;
info->init_transform = info->state.world_transform;
ht = (HANDLETABLE*) &info[1];
ht->objectHandle[0] = hmf;
for(i = 1; i < emh->nHandles; i++)
ht->objectHandle[i] = NULL;
if(hdc)
if(hdc && !is_meta_dc( hdc ))
{
savedMode = SetGraphicsMode(hdc, GM_ADVANCED);
GetWorldTransform(hdc, &savedXform);
@ -2394,17 +2466,7 @@ BOOL WINAPI EnumEnhMetaFile(
old_polyfill = SetPolyFillMode(hdc, ALTERNATE);
old_stretchblt = SetStretchBltMode(hdc, BLACKONWHITE);
if ( IS_WIN9X() )
{
/* Win95 leaves the vp/win ext/org info alone */
info->init_transform.eM11 = 1.0;
info->init_transform.eM12 = 0.0;
info->init_transform.eM21 = 0.0;
info->init_transform.eM22 = 1.0;
info->init_transform.eDx = 0.0;
info->init_transform.eDy = 0.0;
}
else
if (!IS_WIN9X() )
{
/* WinNT combines the vp/win ext/org info into a transform */
double xscale, yscale;
@ -2463,6 +2525,14 @@ BOOL WINAPI EnumEnhMetaFile(
{
emr = (ENHMETARECORD *)((char *)emh + offset);
if (offset + 8 > emh->nBytes ||
offset > offset + emr->nSize ||
offset + emr->nSize > emh->nBytes)
{
WARN("record truncated\n");
break;
}
/* In Win9x mode we update the xform if the record will produce output */
if (hdc && IS_WIN9X() && emr_produces_output(emr->iType))
EMF_Update_MF_Xform(hdc, info);
@ -2472,7 +2542,7 @@ BOOL WINAPI EnumEnhMetaFile(
offset += emr->nSize;
}
if (hdc)
if (hdc && !is_meta_dc( hdc ))
{
SetStretchBltMode(hdc, old_stretchblt);
SetPolyFillMode(hdc, old_polyfill);
@ -2536,8 +2606,7 @@ BOOL WINAPI PlayEnhMetaFile(
const RECT *lpRect /* [in] rectangle to place metafile inside */
)
{
return EnumEnhMetaFile(hdc, hmf, EMF_PlayEnhMetaFileCallback, NULL,
lpRect);
return EnumEnhMetaFile(hdc, hmf, EMF_PlayEnhMetaFileCallback, NULL, lpRect);
}
/*****************************************************************************
@ -2568,7 +2637,7 @@ HENHMETAFILE WINAPI CopyEnhMetaFileA(
if (!file) {
emrDst = HeapAlloc( GetProcessHeap(), 0, emrSrc->nBytes );
memcpy( emrDst, emrSrc, emrSrc->nBytes );
hmfDst = EMF_Create_HENHMETAFILE( emrDst, FALSE );
hmfDst = EMF_Create_HENHMETAFILE( emrDst, emrSrc->nBytes, FALSE );
if (!hmfDst)
HeapFree( GetProcessHeap(), 0, emrDst );
} else {
@ -2610,7 +2679,7 @@ HENHMETAFILE WINAPI CopyEnhMetaFileW(
if (!file) {
emrDst = HeapAlloc( GetProcessHeap(), 0, emrSrc->nBytes );
memcpy( emrDst, emrSrc, emrSrc->nBytes );
hmfDst = EMF_Create_HENHMETAFILE( emrDst, FALSE );
hmfDst = EMF_Create_HENHMETAFILE( emrDst, emrSrc->nBytes, FALSE );
if (!hmfDst)
HeapFree( GetProcessHeap(), 0, emrDst );
} else {

View file

@ -26,7 +26,33 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include <wine/gdi_driver.h>
#define GDILoObjType_LO_DC_TYPE 0x10000
#define GDILoObjType_LO_FONT_TYPE 0xa0000
#define GDILoObjType_LO_BRUSH_TYPE 0x100000
#define GDILoObjType_LO_ALTDC_TYPE 0x210000
#define GDILoObjType_LO_PEN_TYPE 0x300000
#define GDILoObjType_LO_EXTPEN_TYPE 0x500000
#define GDILoObjType_LO_METAFILE16_TYPE 0x260000
#define GDILoObjType_LO_METAFILE_TYPE 0x460000
#define GDILoObjType_LO_METADC16_TYPE 0x660000
#define GDI_HANDLE_TYPE_MASK 0x007f0000
#define GDI_HANDLE_GET_TYPE(h) \
(((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK)
HRGN APIENTRY NtGdiPathToRegion(_In_ HDC hdc);
HDC APIENTRY NtGdiCreateMetafileDC(_In_ HDC hdc);
#define GdiWorldSpaceToDeviceSpace 0x204
BOOL APIENTRY NtGdiGetTransform(_In_ HDC hdc,_In_ DWORD iXform, _Out_ LPXFORM pxf);
/* Get/SetBounds/Rect support. */
#define DCB_WINDOWMGR 0x8000 /* Queries the Windows bounding rectangle instead of the application's */
BOOL WINAPI GetBoundsRectAlt(HDC hdc,LPRECT prc,UINT flags);
BOOL WINAPI SetBoundsRectAlt(HDC hdc,LPRECT prc,UINT flags);
HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject,_In_ UINT eObjType);
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj);
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj);
/* Metafile defines */
#define META_EOF 0x0000
@ -43,6 +69,15 @@ typedef struct {
INT nBreakCount;
} EMRSETTEXTJUSTIFICATION, *PEMRSETTEXTJUSTIFICATION;
typedef struct tagEMRESCAPE {
EMR emr;
INT iEsc;
INT cjIn;
BYTE Data[1];
} EMRESCAPE, *PEMRESCAPE, EMRNAMEDESCAPE, *PEMRNAMEDESCAPE;
INT WINAPI NamedEscape(HDC,PWCHAR,INT,INT,LPSTR,INT,LPSTR);
struct gdi_obj_funcs
{
HGDIOBJ (*pSelectObject)( HGDIOBJ handle, HDC hdc );
@ -56,15 +91,14 @@ struct gdi_obj_funcs
#define LDC_LDC 0x00000001
#define LDC_EMFLDC 0x00000002
typedef struct emf *PEMF;
typedef struct tagWINEDC
{
HDC hdc;
ULONG Flags;
INT iType;
union {
PVOID pvEmfDC; /* Pointer to ENHMETAFILE structure */
PHYSDEV physDev; /* current top of the physdev stack */
};
PEMF emf; /* Pointer to ENHMETAFILE structure */
LPWSTR pwszPort;
ABORTPROC pAbortProc;
DWORD CallBackTick;
@ -72,21 +106,27 @@ typedef struct tagWINEDC
PDEVMODEW pdm;
PVOID pUMPDev;
PVOID pUMdhpdev;
PVOID UFIHashTable[3];
ULONG ufi[2];
PVOID pvEMFSpoolData;
ULONG cjSize;
LIST_ENTRY leRecords;
ULONG DevCaps[36];
HBRUSH hBrush;
HPEN hPen;
////
struct gdi_physdev NullPhysDev;
LONG refcount; /* thread refcount */
INT saveLevel;
HFONT hFont;
HPALETTE hPalette;
INT save_level;
RECTL emf_bounds;
} WINEDC, DC;
WINEDC* get_physdev_dc( PHYSDEV dev );
static inline BOOL is_meta_dc( HDC hdc )
{
return GDI_HANDLE_GET_TYPE(hdc) == GDILoObjType_LO_METADC16_TYPE;
}
/* brush.c */
extern BOOL get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void **bits, UINT *usage ) DECLSPEC_HIDDEN;
extern BOOL get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage ) DECLSPEC_HIDDEN;
/* dc.c */
extern DC *alloc_dc_ptr( WORD magic ) DECLSPEC_HIDDEN;
@ -98,7 +138,7 @@ extern void release_dc_ptr( DC *dc ) DECLSPEC_HIDDEN;
extern int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) DECLSPEC_HIDDEN;
/* enhmetafile.c */
extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk ) DECLSPEC_HIDDEN;
extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, DWORD filesize, BOOL on_disk ) DECLSPEC_HIDDEN;
/* gdiobj.c */
extern HGDIOBJ alloc_gdi_handle( void *obj, WORD type, const struct gdi_obj_funcs *funcs ) DECLSPEC_HIDDEN;
@ -117,13 +157,11 @@ extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCVOID filename, BOO
#include <pshpack2.h>
typedef struct
{
DWORD magic; /* WMFC */
WORD unk04; /* 1 */
WORD unk06; /* 0 */
WORD unk08; /* 0 */
WORD unk0a; /* 1 */
DWORD magic; /* WMFC */
DWORD comment_type; /* Always 0x00000001 */
DWORD version; /* Always 0x00010000 */
WORD checksum;
DWORD unk0e; /* 0 */
DWORD flags; /* Always 0 */
DWORD num_chunks;
DWORD chunk_size;
DWORD remaining_size;
@ -137,29 +175,10 @@ typedef struct
extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg) DECLSPEC_HIDDEN;
extern UINT WINAPI GDIRealizePalette( HDC hdc ) DECLSPEC_HIDDEN;
DWORD WINAPI GetDCDWord(_In_ HDC hdc,_In_ UINT u,_In_ DWORD dwError);
#define EMR_SETLINKEDUFI 119
#define GET_DC_PHYSDEV(dc,func) \
get_physdev_entry_point( (dc)->physDev, FIELD_OFFSET(struct gdi_dc_funcs,func))
static inline PHYSDEV pop_dc_driver( DC *dc, const struct gdi_dc_funcs *funcs )
{
PHYSDEV dev, *pdev = &dc->physDev;
while (*pdev && (*pdev)->funcs != funcs) pdev = &(*pdev)->next;
if (!*pdev) return NULL;
dev = *pdev;
*pdev = dev->next;
return dev;
}
static inline PHYSDEV find_dc_driver( DC *dc, const struct gdi_dc_funcs *funcs )
{
PHYSDEV dev;
for (dev = dc->physDev; dev; dev = dev->next) if (dev->funcs == funcs) return dev;
return NULL;
}
/* Undocumented value for DIB's iUsage: Indicates a mono DIB w/o pal entries */
#define DIB_PAL_MONO 2
@ -196,8 +215,6 @@ BOOL APIENTRY NtGdiGetTransform( _In_ HDC hdc, _In_ DWORD iXform, _Out_ LPXFORM
HGDIOBJ WINAPI GdiFixUpHandle(HGDIOBJ hGdiObj);
#define get_full_gdi_handle GdiFixUpHandle
extern void push_dc_driver_ros(PHYSDEV *dev, PHYSDEV physdev, const struct gdi_dc_funcs *funcs);
#define push_dc_driver push_dc_driver_ros
#if 0
BOOL WINAPI SetWorldTransformForMetafile(HDC hdc, const XFORM *pxform);
#define SetWorldTransform SetWorldTransformForMetafile
@ -211,5 +228,36 @@ BOOL WINAPI SetWorldTransformForMetafile(HDC hdc, const XFORM *pxform);
#undef ASSERT
#define ASSERT(x) if (!(x)) DbgRaiseAssertionFailure()
BOOL EMFDRV_LineTo( WINEDC *dc, INT x, INT y );
BOOL EMFDRV_RoundRect( WINEDC *dc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height );
BOOL EMFDRV_ArcChordPie( WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend, DWORD type );
BOOL EMFDRV_Arc( WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend );
BOOL EMFDRV_ArcTo( WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend );
BOOL EMFDRV_Pie( WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend );
BOOL EMFDRV_Chord( WINEDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend );
BOOL EMFDRV_Ellipse( WINEDC *dc, INT left, INT top, INT right, INT bottom );
BOOL EMFDRV_Rectangle( WINEDC *dc, INT left, INT top, INT right, INT bottom );
COLORREF EMFDRV_SetPixel( WINEDC *dc, INT x, INT y, COLORREF color );
BOOL EMFDRV_PolylineTo( WINEDC *dc, const POINT *pt, INT count );
BOOL EMFDRV_PolyBezier( WINEDC *dc, const POINT *pts, DWORD count );
BOOL EMFDRV_PolyBezierTo( WINEDC *dc, const POINT *pts, DWORD count );
BOOL EMFDRV_PolyPolyline( WINEDC *dc, const POINT *pt, const DWORD *counts, UINT polys );
BOOL EMFDRV_PolyPolygon( WINEDC *dc, const POINT *pt, const INT *counts, UINT polys );
BOOL EMFDRV_PolyDraw( WINEDC *dc, const POINT *pts, const BYTE *types, DWORD count );
BOOL EMFDRV_FillRgn( WINEDC *dc, HRGN hrgn, HBRUSH hbrush );
BOOL EMFDRV_FrameRgn( WINEDC *dc, HRGN hrgn, HBRUSH hbrush, INT width, INT height );
BOOL EMFDRV_InvertRgn( WINEDC *dc, HRGN hrgn );
BOOL EMFDRV_ExtTextOut( WINEDC *dc, INT x, INT y, UINT flags, const RECT *lprect,LPCWSTR str, UINT count, const INT *lpDx );
BOOL EMFDRV_GradientFill( WINEDC *dc, TRIVERTEX *vert_array, ULONG nvert, void *grad_array, ULONG ngrad, ULONG mode );
BOOL EMFDRV_FillPath( WINEDC *dc );
BOOL EMFDRV_StrokeAndFillPath( WINEDC *dc );
BOOL EMFDRV_StrokePath( WINEDC *dc );
BOOL EMFDRV_AlphaBlend( WINEDC *dc_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst,HDC dc_src, INT x_src, INT y_src, INT width_src, INT height_src, BLENDFUNCTION func );
BOOL EMFDRV_PatBlt( WINEDC *dc, INT left, INT top, INT width, INT height, DWORD rop );
INT EMFDRV_StretchDIBits( WINEDC *dc, INT x_dst, INT y_dst, INT width_dst,INT height_dst, INT x_src, INT y_src, INT width_src, INT height_src, const void *bits, BITMAPINFO *info, UINT wUsage, DWORD dwRop );
INT EMFDRV_SetDIBitsToDevice( WINEDC *dc, INT x_dst, INT y_dst, DWORD width, DWORD height, INT x_src, INT y_src, UINT startscan, UINT lines, const void *bits, BITMAPINFO *info, UINT usage );
HBITMAP EMFDRV_SelectBitmap( WINEDC *dc, HBITMAP hbitmap );
#endif /* __WINE_GDI_PRIVATE_H */

File diff suppressed because it is too large Load diff

View file

@ -1143,12 +1143,10 @@ static BOOL add_mf_comment(HDC hdc, HENHMETAFILE emf)
if(!chunk) goto end;
chunk->magic = WMFC_MAGIC;
chunk->unk04 = 1;
chunk->unk06 = 0;
chunk->unk08 = 0;
chunk->unk0a = 1;
chunk->comment_type = 0x1;
chunk->version = 0x00010000;
chunk->checksum = 0; /* We fixup the first chunk's checksum before returning from GetWinMetaFileBits */
chunk->unk0e = 0;
chunk->flags = 0;
chunk->num_chunks = (size + max_chunk_size - 1) / max_chunk_size;
chunk->chunk_size = max_chunk_size;
chunk->remaining_size = size;

File diff suppressed because it is too large Load diff

View file

@ -294,11 +294,16 @@ typedef struct _LDC
PDEVMODEW pdm;
PVOID pUMPDev; /* Ptr to User Mode Printer Device structure */
PUMDHPDEV pUMdhpdev; /* Ptr to Combined UMPD and DHPDEV structure */
PVOID UFIHashTable[3];
UNIVERSAL_FONT_ID ufi;
PVOID pvEMFSpoolData;
ULONG cjSize;
LIST_ENTRY leRecords;
DEVCAPS DevCaps;
HBRUSH BrushColor;
HPEN PenColor;
// wine data
DWORD dwData[7];
DWORD dwData[5];
} LDC, *PLDC;
typedef struct _DC_ATTR

View file

@ -575,7 +575,7 @@ typedef struct _SBINFOEX
SCROLLINFO ScrollInfo;
} SBINFOEX, *PSBINFOEX;
/* State Flags !Not Implemented! */
/* State Flags !Not ALL Implemented! */
#define WNDS_HASMENU 0X00000001
#define WNDS_HASVERTICALSCROOLLBAR 0X00000002
#define WNDS_HASHORIZONTALSCROLLBAR 0X00000004
@ -611,7 +611,7 @@ typedef struct _SBINFOEX
#define WNDSACTIVEFRAME 0x00000006
/* State2 Flags !Not Implemented! */
/* State2 Flags !Not ALL Implemented! */
#define WNDS2_WMPAINTSENT 0X00000001
#define WNDS2_ENDPAINTINVALIDATE 0X00000002
#define WNDS2_STARTPAINT 0X00000004