Added ExtSelectClipRgn to the DC interface and implemented it for
standard and enhanced metafiles.
This commit is contained in:
parent
58faa1cf7f
commit
da580c47ff
|
@ -89,6 +89,7 @@ static struct graphics_driver *create_driver( HMODULE module )
|
||||||
GET_FUNC(ExtDeviceMode);
|
GET_FUNC(ExtDeviceMode);
|
||||||
GET_FUNC(ExtEscape);
|
GET_FUNC(ExtEscape);
|
||||||
GET_FUNC(ExtFloodFill);
|
GET_FUNC(ExtFloodFill);
|
||||||
|
GET_FUNC(ExtSelectClipRgn);
|
||||||
GET_FUNC(ExtTextOut);
|
GET_FUNC(ExtTextOut);
|
||||||
GET_FUNC(FillPath);
|
GET_FUNC(FillPath);
|
||||||
GET_FUNC(FillRgn);
|
GET_FUNC(FillRgn);
|
||||||
|
@ -133,7 +134,6 @@ static struct graphics_driver *create_driver( HMODULE module )
|
||||||
GET_FUNC(SelectBitmap);
|
GET_FUNC(SelectBitmap);
|
||||||
GET_FUNC(SelectBrush);
|
GET_FUNC(SelectBrush);
|
||||||
GET_FUNC(SelectClipPath);
|
GET_FUNC(SelectClipPath);
|
||||||
GET_FUNC(SelectClipRgn);
|
|
||||||
GET_FUNC(SelectFont);
|
GET_FUNC(SelectFont);
|
||||||
GET_FUNC(SelectPalette);
|
GET_FUNC(SelectPalette);
|
||||||
GET_FUNC(SelectPen);
|
GET_FUNC(SelectPen);
|
||||||
|
|
|
@ -128,6 +128,28 @@ INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y )
|
||||||
return EMFDRV_WriteRecord( dev, &emr.emr );
|
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 )
|
DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
|
||||||
{
|
{
|
||||||
EMRSETMAPPERFLAGS emr;
|
EMRSETMAPPERFLAGS emr;
|
||||||
|
|
|
@ -58,10 +58,9 @@ extern BOOL EMFDRV_CloseFigure( PHYSDEV dev );
|
||||||
extern BOOL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top,
|
extern BOOL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top,
|
||||||
INT right, INT bottom );
|
INT right, INT bottom );
|
||||||
extern BOOL EMFDRV_EndPath( PHYSDEV dev );
|
extern BOOL EMFDRV_EndPath( PHYSDEV dev );
|
||||||
extern INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right,
|
extern INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom );
|
||||||
INT bottom );
|
extern BOOL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType );
|
||||||
extern BOOL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y,
|
extern INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode );
|
||||||
COLORREF color, UINT fillType );
|
|
||||||
extern BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
|
extern BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
|
||||||
UINT flags, const RECT *lprect, LPCSTR str,
|
UINT flags, const RECT *lprect, LPCSTR str,
|
||||||
UINT count, const INT *lpDx );
|
UINT count, const INT *lpDx );
|
||||||
|
|
|
@ -57,6 +57,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
|
||||||
NULL, /* pExtDeviceMode */
|
NULL, /* pExtDeviceMode */
|
||||||
NULL, /* pExtEscape */
|
NULL, /* pExtEscape */
|
||||||
EMFDRV_ExtFloodFill, /* pExtFloodFill */
|
EMFDRV_ExtFloodFill, /* pExtFloodFill */
|
||||||
|
EMFDRV_ExtSelectClipRgn, /* pExtSelectClipRgn */
|
||||||
NULL, /* pExtTextOut */
|
NULL, /* pExtTextOut */
|
||||||
EMFDRV_FillPath, /* pFillPath */
|
EMFDRV_FillPath, /* pFillPath */
|
||||||
EMFDRV_FillRgn, /* pFillRgn */
|
EMFDRV_FillRgn, /* pFillRgn */
|
||||||
|
@ -101,7 +102,6 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
|
||||||
EMFDRV_SelectBitmap, /* pSelectBitmap */
|
EMFDRV_SelectBitmap, /* pSelectBitmap */
|
||||||
EMFDRV_SelectBrush, /* pSelectBrush */
|
EMFDRV_SelectBrush, /* pSelectBrush */
|
||||||
EMFDRV_SelectClipPath, /* pSelectClipPath */
|
EMFDRV_SelectClipPath, /* pSelectClipPath */
|
||||||
NULL, /* pSelectClipRgn */
|
|
||||||
EMFDRV_SelectFont, /* pSelectFont */
|
EMFDRV_SelectFont, /* pSelectFont */
|
||||||
NULL, /* pSelectPalette */
|
NULL, /* pSelectPalette */
|
||||||
EMFDRV_SelectPen, /* pSelectPen */
|
EMFDRV_SelectPen, /* pSelectPen */
|
||||||
|
|
|
@ -371,6 +371,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
|
* MFDRV_SetBkColor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -58,6 +58,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
||||||
NULL, /* pExtDeviceMode */
|
NULL, /* pExtDeviceMode */
|
||||||
MFDRV_ExtEscape, /* pExtEscape */
|
MFDRV_ExtEscape, /* pExtEscape */
|
||||||
MFDRV_ExtFloodFill, /* pExtFloodFill */
|
MFDRV_ExtFloodFill, /* pExtFloodFill */
|
||||||
|
MFDRV_ExtSelectClipRgn, /* pExtSelectClipRgn */
|
||||||
MFDRV_ExtTextOut, /* pExtTextOut */
|
MFDRV_ExtTextOut, /* pExtTextOut */
|
||||||
MFDRV_FillPath, /* pFillPath */
|
MFDRV_FillPath, /* pFillPath */
|
||||||
MFDRV_FillRgn, /* pFillRgn */
|
MFDRV_FillRgn, /* pFillRgn */
|
||||||
|
@ -102,7 +103,6 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
||||||
MFDRV_SelectBitmap, /* pSelectBitmap */
|
MFDRV_SelectBitmap, /* pSelectBitmap */
|
||||||
MFDRV_SelectBrush, /* pSelectBrush */
|
MFDRV_SelectBrush, /* pSelectBrush */
|
||||||
MFDRV_SelectClipPath, /* pSelectClipPath */
|
MFDRV_SelectClipPath, /* pSelectClipPath */
|
||||||
NULL, /* pSelectClipRgn */
|
|
||||||
MFDRV_SelectFont, /* pSelectFont */
|
MFDRV_SelectFont, /* pSelectFont */
|
||||||
NULL, /* pSelectPalette */
|
NULL, /* pSelectPalette */
|
||||||
MFDRV_SelectPen, /* pSelectPen */
|
MFDRV_SelectPen, /* pSelectPen */
|
||||||
|
|
|
@ -72,8 +72,8 @@ extern INT MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT
|
||||||
bottom );
|
bottom );
|
||||||
extern INT MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
|
extern INT MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
|
||||||
INT cbOutput, LPVOID out_data );
|
INT cbOutput, LPVOID out_data );
|
||||||
extern BOOL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y,
|
extern BOOL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType );
|
||||||
COLORREF color, UINT fillType );
|
extern INT MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode );
|
||||||
extern BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
|
extern BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y,
|
||||||
UINT flags, const RECT *lprect, LPCWSTR str,
|
UINT flags, const RECT *lprect, LPCWSTR str,
|
||||||
UINT count, const INT *lpDx );
|
UINT count, const INT *lpDx );
|
||||||
|
|
|
@ -85,6 +85,7 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
|
||||||
WIN16DRV_ExtDeviceMode, /* pExtDeviceMode */
|
WIN16DRV_ExtDeviceMode, /* pExtDeviceMode */
|
||||||
WIN16DRV_ExtEscape, /* pExtEscape */
|
WIN16DRV_ExtEscape, /* pExtEscape */
|
||||||
NULL, /* pExtFloodFill */
|
NULL, /* pExtFloodFill */
|
||||||
|
NULL, /* pExtSelectClipRgn */
|
||||||
WIN16DRV_ExtTextOut, /* pExtTextOut */
|
WIN16DRV_ExtTextOut, /* pExtTextOut */
|
||||||
NULL, /* pFillPath */
|
NULL, /* pFillPath */
|
||||||
NULL, /* pFillRgn */
|
NULL, /* pFillRgn */
|
||||||
|
@ -129,7 +130,6 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
|
||||||
WIN16DRV_SelectBitmap, /* pSelectBitmap */
|
WIN16DRV_SelectBitmap, /* pSelectBitmap */
|
||||||
WIN16DRV_SelectBrush, /* pSelectBrush */
|
WIN16DRV_SelectBrush, /* pSelectBrush */
|
||||||
NULL, /* pSelectClipPath */
|
NULL, /* pSelectClipPath */
|
||||||
NULL, /* pSelectClipRgn */
|
|
||||||
WIN16DRV_SelectFont, /* pSelectFont */
|
WIN16DRV_SelectFont, /* pSelectFont */
|
||||||
NULL, /* pSelectPalette */
|
NULL, /* pSelectPalette */
|
||||||
WIN16DRV_SelectPen, /* pSelectPen */
|
WIN16DRV_SelectPen, /* pSelectPen */
|
||||||
|
|
|
@ -167,6 +167,7 @@ typedef struct tagDC_FUNCS
|
||||||
INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
|
INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
|
||||||
INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
|
INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
|
||||||
BOOL (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
|
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 (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
|
||||||
BOOL (*pFillPath)(PHYSDEV);
|
BOOL (*pFillPath)(PHYSDEV);
|
||||||
BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
|
BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
|
||||||
|
@ -211,7 +212,6 @@ typedef struct tagDC_FUNCS
|
||||||
HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
|
HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
|
||||||
HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
|
HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
|
||||||
BOOL (*pSelectClipPath)(PHYSDEV,INT);
|
BOOL (*pSelectClipPath)(PHYSDEV,INT);
|
||||||
INT (*pSelectClipRgn)(PHYSDEV,HRGN);
|
|
||||||
HFONT (*pSelectFont)(PHYSDEV,HFONT);
|
HFONT (*pSelectFont)(PHYSDEV,HFONT);
|
||||||
HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
|
HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
|
||||||
HPEN (*pSelectPen)(PHYSDEV,HPEN);
|
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 );
|
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 (!hrgn)
|
||||||
{
|
{
|
||||||
if (fnMode == RGN_COPY)
|
if (fnMode == RGN_COPY)
|
||||||
|
|
Loading…
Reference in New Issue