Commit da580c47 authored by Alexandre Julliard's avatar Alexandre Julliard

Added ExtSelectClipRgn to the DC interface and implemented it for

standard and enhanced metafiles.
parent 58faa1cf
......@@ -89,6 +89,7 @@ static struct graphics_driver *create_driver( HMODULE module )
GET_FUNC(ExtDeviceMode);
GET_FUNC(ExtEscape);
GET_FUNC(ExtFloodFill);
GET_FUNC(ExtSelectClipRgn);
GET_FUNC(ExtTextOut);
GET_FUNC(FillPath);
GET_FUNC(FillRgn);
......@@ -133,7 +134,6 @@ static struct graphics_driver *create_driver( HMODULE module )
GET_FUNC(SelectBitmap);
GET_FUNC(SelectBrush);
GET_FUNC(SelectClipPath);
GET_FUNC(SelectClipRgn);
GET_FUNC(SelectFont);
GET_FUNC(SelectPalette);
GET_FUNC(SelectPen);
......
......@@ -128,6 +128,28 @@ INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y )
return EMFDRV_WriteRecord( dev, &emr.emr );
}
INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode )
{
EMREXTSELECTCLIPRGN *emr;
DWORD size, rgnsize;
BOOL ret;
rgnsize = GetRegionData( hrgn, 0, NULL );
size = rgnsize + sizeof(*emr) - 1;
emr = HeapAlloc( GetProcessHeap(), 0, size );
GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
emr->emr.iType = EMR_EXTSELECTCLIPRGN;
emr->emr.nSize = size;
emr->cbRgnData = rgnsize;
emr->iMode = mode;
ret = EMFDRV_WriteRecord( dev, &emr->emr );
HeapFree( GetProcessHeap(), 0, emr );
return ret ? SIMPLEREGION : ERROR;
}
DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
{
EMRSETMAPPERFLAGS emr;
......
......@@ -58,10 +58,9 @@ extern BOOL EMFDRV_CloseFigure( PHYSDEV dev );
extern BOOL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top,
INT right, INT bottom );
extern BOOL EMFDRV_EndPath( PHYSDEV dev );
extern INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right,
INT bottom );
extern BOOL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y,
COLORREF color, UINT fillType );
extern INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom );
extern BOOL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType );
extern INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode );
extern BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
UINT flags, const RECT *lprect, LPCSTR str,
UINT count, const INT *lpDx );
......
......@@ -57,6 +57,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
NULL, /* pExtDeviceMode */
NULL, /* pExtEscape */
EMFDRV_ExtFloodFill, /* pExtFloodFill */
EMFDRV_ExtSelectClipRgn, /* pExtSelectClipRgn */
NULL, /* pExtTextOut */
EMFDRV_FillPath, /* pFillPath */
EMFDRV_FillRgn, /* pFillRgn */
......@@ -101,7 +102,6 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
EMFDRV_SelectBitmap, /* pSelectBitmap */
EMFDRV_SelectBrush, /* pSelectBrush */
EMFDRV_SelectClipPath, /* pSelectClipPath */
NULL, /* pSelectClipRgn */
EMFDRV_SelectFont, /* pSelectFont */
NULL, /* pSelectPalette */
EMFDRV_SelectPen, /* pSelectPen */
......
......@@ -372,6 +372,25 @@ MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y )
/**********************************************************************
* MFDRV_ExtSelectClipRgn
*/
INT MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode )
{
INT16 iRgn;
if (mode != RGN_COPY)
{
FIXME( "mode %d not supported\n", mode );
return ERROR;
}
iRgn = MFDRV_CreateRegion( dev, hrgn );
if(iRgn == -1)
return ERROR;
return MFDRV_MetaParam1( dev, META_SELECTCLIPREGION, iRgn ) ? SIMPLEREGION : ERROR;
}
/**********************************************************************
* MFDRV_SetBkColor
*/
COLORREF
......
......@@ -58,6 +58,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
NULL, /* pExtDeviceMode */
MFDRV_ExtEscape, /* pExtEscape */
MFDRV_ExtFloodFill, /* pExtFloodFill */
MFDRV_ExtSelectClipRgn, /* pExtSelectClipRgn */
MFDRV_ExtTextOut, /* pExtTextOut */
MFDRV_FillPath, /* pFillPath */
MFDRV_FillRgn, /* pFillRgn */
......@@ -102,7 +103,6 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_SelectBitmap, /* pSelectBitmap */
MFDRV_SelectBrush, /* pSelectBrush */
MFDRV_SelectClipPath, /* pSelectClipPath */
NULL, /* pSelectClipRgn */
MFDRV_SelectFont, /* pSelectFont */
NULL, /* pSelectPalette */
MFDRV_SelectPen, /* pSelectPen */
......
......@@ -72,8 +72,8 @@ extern INT MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT
bottom );
extern INT MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
INT cbOutput, LPVOID out_data );
extern BOOL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y,
COLORREF color, UINT fillType );
extern BOOL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType );
extern INT MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode );
extern BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
UINT flags, const RECT *lprect, LPCWSTR str,
UINT count, const INT *lpDx );
......
......@@ -85,6 +85,7 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
WIN16DRV_ExtDeviceMode, /* pExtDeviceMode */
WIN16DRV_ExtEscape, /* pExtEscape */
NULL, /* pExtFloodFill */
NULL, /* pExtSelectClipRgn */
WIN16DRV_ExtTextOut, /* pExtTextOut */
NULL, /* pFillPath */
NULL, /* pFillRgn */
......@@ -129,7 +130,6 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
WIN16DRV_SelectBitmap, /* pSelectBitmap */
WIN16DRV_SelectBrush, /* pSelectBrush */
NULL, /* pSelectClipPath */
NULL, /* pSelectClipRgn */
WIN16DRV_SelectFont, /* pSelectFont */
NULL, /* pSelectPalette */
WIN16DRV_SelectPen, /* pSelectPen */
......
......@@ -167,6 +167,7 @@ typedef struct tagDC_FUNCS
INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
BOOL (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
INT (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT);
BOOL (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
BOOL (*pFillPath)(PHYSDEV);
BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
......@@ -211,7 +212,6 @@ typedef struct tagDC_FUNCS
HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
BOOL (*pSelectClipPath)(PHYSDEV,INT);
INT (*pSelectClipRgn)(PHYSDEV,HRGN);
HFONT (*pSelectFont)(PHYSDEV,HFONT);
HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
HPEN (*pSelectPen)(PHYSDEV,HPEN);
......
......@@ -91,6 +91,13 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
TRACE("%04x %04x %d\n", hdc, hrgn, fnMode );
if (dc->funcs->pExtSelectClipRgn)
{
retval = dc->funcs->pExtSelectClipRgn( dc->physDev, hrgn, fnMode );
GDI_ReleaseObj( hdc );
return retval;
}
if (!hrgn)
{
if (fnMode == RGN_COPY)
......
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