Mapping mode functions should change dc settings when dc is an enhmf.

This commit is contained in:
Huw D M Davies 2002-08-17 18:32:12 +00:00 committed by Alexandre Julliard
parent d788939d8f
commit 3d10c1fc6e
7 changed files with 187 additions and 136 deletions

View file

@ -85,15 +85,6 @@ INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
return EMFDRV_WriteRecord( dev, &emr.emr ); return EMFDRV_WriteRecord( dev, &emr.emr );
} }
INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode )
{
EMRSETMAPMODE emr;
emr.emr.iType = EMR_SETMAPMODE;
emr.emr.nSize = sizeof(emr);
emr.iMode = mode;
return EMFDRV_WriteRecord( dev, &emr.emr );
}
INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
{ {
EMREXCLUDECLIPRECT emr; EMREXCLUDECLIPRECT emr;

View file

@ -80,8 +80,8 @@ extern BOOL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn );
extern BOOL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y ); extern BOOL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_MoveTo( PHYSDEV dev, INT x, INT y ); extern BOOL EMFDRV_MoveTo( PHYSDEV dev, INT x, INT y );
extern INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ); extern BOOL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn );
extern BOOL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top, extern BOOL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top,
INT width, INT height, DWORD rop ); INT width, INT height, DWORD rop );
@ -101,9 +101,9 @@ extern BOOL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top,
INT right, INT bottom, INT ell_width, INT right, INT bottom, INT ell_width,
INT ell_height ); INT ell_height );
extern INT EMFDRV_SaveDC( PHYSDEV dev ); extern INT EMFDRV_SaveDC( PHYSDEV dev );
extern BOOL EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, extern INT EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum,
INT xDenom, INT yNum, INT yDenom ); INT xDenom, INT yNum, INT yDenom );
extern BOOL EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, extern INT EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom,
INT yNum, INT yDenom ); INT yNum, INT yDenom );
extern HBITMAP EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ); extern HBITMAP EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle );
extern HBRUSH EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ); extern HBRUSH EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle );
@ -125,10 +125,10 @@ extern INT EMFDRV_SetROP2( PHYSDEV dev, INT rop );
extern INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ); extern INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode );
extern UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ); extern UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align );
extern COLORREF EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ); extern COLORREF EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color );
extern BOOL EMFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y );
extern BOOL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, extern BOOL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst,
INT widthDst, INT heightDst, INT widthDst, INT heightDst,
PHYSDEV devSrc, INT xSrc, INT ySrc, PHYSDEV devSrc, INT xSrc, INT ySrc,

View file

@ -20,7 +20,17 @@
#include "enhmfdrv/enhmetafiledrv.h" #include "enhmfdrv/enhmetafiledrv.h"
BOOL EMFDRV_SetViewportExt( PHYSDEV dev, INT cx, INT cy ) INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode )
{
EMRSETMAPMODE emr;
emr.emr.iType = EMR_SETMAPMODE;
emr.emr.nSize = sizeof(emr);
emr.iMode = mode;
return EMFDRV_WriteRecord( dev, &emr.emr );
}
INT EMFDRV_SetViewportExt( PHYSDEV dev, INT cx, INT cy )
{ {
EMRSETVIEWPORTEXTEX emr; EMRSETVIEWPORTEXTEX emr;
@ -32,7 +42,7 @@ BOOL EMFDRV_SetViewportExt( PHYSDEV dev, INT cx, INT cy )
return EMFDRV_WriteRecord( dev, &emr.emr ); return EMFDRV_WriteRecord( dev, &emr.emr );
} }
BOOL EMFDRV_SetWindowExt( PHYSDEV dev, INT cx, INT cy ) INT EMFDRV_SetWindowExt( PHYSDEV dev, INT cx, INT cy )
{ {
EMRSETWINDOWEXTEX emr; EMRSETWINDOWEXTEX emr;
@ -44,7 +54,7 @@ BOOL EMFDRV_SetWindowExt( PHYSDEV dev, INT cx, INT cy )
return EMFDRV_WriteRecord( dev, &emr.emr ); return EMFDRV_WriteRecord( dev, &emr.emr );
} }
BOOL EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) INT EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y )
{ {
EMRSETVIEWPORTORGEX emr; EMRSETVIEWPORTORGEX emr;
@ -56,7 +66,7 @@ BOOL EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y )
return EMFDRV_WriteRecord( dev, &emr.emr ); return EMFDRV_WriteRecord( dev, &emr.emr );
} }
BOOL EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) INT EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y )
{ {
EMRSETWINDOWORGEX emr; EMRSETWINDOWORGEX emr;
@ -68,8 +78,8 @@ BOOL EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y )
return EMFDRV_WriteRecord( dev, &emr.emr ); return EMFDRV_WriteRecord( dev, &emr.emr );
} }
BOOL EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
INT yDenom ) INT yDenom )
{ {
EMRSCALEVIEWPORTEXTEX emr; EMRSCALEVIEWPORTEXTEX emr;
@ -83,8 +93,8 @@ BOOL EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
return EMFDRV_WriteRecord( dev, &emr.emr ); return EMFDRV_WriteRecord( dev, &emr.emr );
} }
BOOL EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
INT yDenom ) INT yDenom )
{ {
EMRSCALEWINDOWEXTEX emr; EMRSCALEWINDOWEXTEX emr;
@ -97,5 +107,3 @@ BOOL EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
return EMFDRV_WriteRecord( dev, &emr.emr ); return EMFDRV_WriteRecord( dev, &emr.emr );
} }

View file

@ -27,89 +27,95 @@
*/ */
INT MFDRV_SetMapMode( PHYSDEV dev, INT mode ) INT MFDRV_SetMapMode( PHYSDEV dev, INT mode )
{ {
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev; if(!MFDRV_MetaParam1( dev, META_SETMAPMODE, mode ))
INT prevMode = GetMapMode( physDev->hdc ); return FALSE;
MFDRV_MetaParam1( dev, META_SETMAPMODE, mode ); return GDI_NO_MORE_WORK;
return prevMode;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_SetViewportExt * MFDRV_SetViewportExt
*/ */
BOOL MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) INT MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y )
{ {
MFDRV_MetaParam2( dev, META_SETVIEWPORTEXT, x, y ); if(!MFDRV_MetaParam2( dev, META_SETVIEWPORTEXT, x, y ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_SetViewportOrg * MFDRV_SetViewportOrg
*/ */
BOOL MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) INT MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y )
{ {
MFDRV_MetaParam2( dev, META_SETVIEWPORTORG, x, y ); if(!MFDRV_MetaParam2( dev, META_SETVIEWPORTORG, x, y ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_SetWindowExt * MFDRV_SetWindowExt
*/ */
BOOL MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) INT MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y )
{ {
MFDRV_MetaParam2( dev, META_SETWINDOWEXT, x, y ); if(!MFDRV_MetaParam2( dev, META_SETWINDOWEXT, x, y ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_SetWindowOrg * MFDRV_SetWindowOrg
*/ */
BOOL MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) INT MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y )
{ {
MFDRV_MetaParam2( dev, META_SETWINDOWORG, x, y ); if(!MFDRV_MetaParam2( dev, META_SETWINDOWORG, x, y ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_OffsetViewportOrg * MFDRV_OffsetViewportOrg
*/ */
BOOL MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) INT MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y )
{ {
MFDRV_MetaParam2( dev, META_OFFSETVIEWPORTORG, x, y ); if(!MFDRV_MetaParam2( dev, META_OFFSETVIEWPORTORG, x, y ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_OffsetWindowOrg * MFDRV_OffsetWindowOrg
*/ */
BOOL MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) INT MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y )
{ {
MFDRV_MetaParam2( dev, META_OFFSETWINDOWORG, x, y ); if(!MFDRV_MetaParam2( dev, META_OFFSETWINDOWORG, x, y ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_ScaleViewportExt * MFDRV_ScaleViewportExt
*/ */
BOOL MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom ) INT MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom )
{ {
MFDRV_MetaParam4( dev, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom ); if(!MFDRV_MetaParam4( dev, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }
/*********************************************************************** /***********************************************************************
* MFDRV_ScaleWindowExt * MFDRV_ScaleWindowExt
*/ */
BOOL MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom ) INT MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom )
{ {
MFDRV_MetaParam4( dev, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom ); if(!MFDRV_MetaParam4( dev, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom ))
return TRUE; return FALSE;
return GDI_NO_MORE_WORK;
} }

View file

@ -86,9 +86,9 @@ extern INT MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, I
extern BOOL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ); extern BOOL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn );
extern BOOL MFDRV_LineTo( PHYSDEV dev, INT x, INT y ); extern BOOL MFDRV_LineTo( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_MoveTo( PHYSDEV dev, INT x, INT y ); extern BOOL MFDRV_MoveTo( PHYSDEV dev, INT x, INT y );
extern INT MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ); extern INT MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ); extern INT MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ); extern INT MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ); extern BOOL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn );
extern BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, extern BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height,
DWORD rop ); DWORD rop );
@ -108,10 +108,10 @@ extern BOOL MFDRV_RoundRect( PHYSDEV dev, INT left, INT top,
INT right, INT bottom, INT ell_width, INT right, INT bottom, INT ell_width,
INT ell_height ); INT ell_height );
extern INT MFDRV_SaveDC( PHYSDEV dev ); extern INT MFDRV_SaveDC( PHYSDEV dev );
extern BOOL MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, extern INT MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
INT yDenom ); INT yDenom );
extern BOOL MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, extern INT MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
INT yDenom ); INT yDenom );
extern HBITMAP MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ); extern HBITMAP MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle );
extern HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ); extern HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle );
extern BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode ); extern BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode );
@ -130,10 +130,10 @@ extern UINT MFDRV_SetTextAlign( PHYSDEV dev, UINT align );
extern INT MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ); extern INT MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra );
extern COLORREF MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ); extern COLORREF MFDRV_SetTextColor( PHYSDEV dev, COLORREF color );
extern INT MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks ); extern INT MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks );
extern BOOL MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ); extern INT MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ); extern INT MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ); extern INT MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ); extern INT MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y );
extern BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, extern BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst,
INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc, INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc,
INT widthSrc, INT heightSrc, DWORD rop ); INT widthSrc, INT heightSrc, DWORD rop );

View file

@ -144,20 +144,24 @@ BOOL WINAPI LPtoDP( HDC hdc, LPPOINT points, INT count )
*/ */
INT WINAPI SetMapMode( HDC hdc, INT mode ) INT WINAPI SetMapMode( HDC hdc, INT mode )
{ {
INT prevMode; INT ret;
INT horzSize, vertSize, horzRes, vertRes; INT horzSize, vertSize, horzRes, vertRes;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return 0; if (!dc) return 0;
if (dc->funcs->pSetMapMode) if (dc->funcs->pSetMapMode)
{ {
prevMode = dc->funcs->pSetMapMode( dc->physDev, mode ); if((ret = dc->funcs->pSetMapMode( dc->physDev, mode )) != TRUE)
goto done; {
if(ret == GDI_NO_MORE_WORK)
ret = TRUE;
goto done;
}
} }
TRACE("%04x %d\n", hdc, mode ); TRACE("%04x %d\n", hdc, mode );
prevMode = dc->MapMode; ret = dc->MapMode;
horzSize = GetDeviceCaps( hdc, HORZSIZE ); horzSize = GetDeviceCaps( hdc, HORZSIZE );
vertSize = GetDeviceCaps( hdc, VERTSIZE ); vertSize = GetDeviceCaps( hdc, VERTSIZE );
horzRes = GetDeviceCaps( hdc, HORZRES ); horzRes = GetDeviceCaps( hdc, HORZRES );
@ -210,7 +214,7 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
DC_UpdateXforms( dc ); DC_UpdateXforms( dc );
done: done:
GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hdc );
return prevMode; return ret;
} }
@ -219,13 +223,17 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
*/ */
BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size ) BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size )
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pSetViewportExt) if (dc->funcs->pSetViewportExt)
{ {
ret = dc->funcs->pSetViewportExt( dc->physDev, x, y ); if((ret = dc->funcs->pSetViewportExt( dc->physDev, x, y )) != TRUE)
goto done; {
if(ret == GDI_NO_MORE_WORK)
ret = TRUE;
goto done;
}
} }
if (size) if (size)
{ {
@ -254,22 +262,28 @@ BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size )
*/ */
BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt ) BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pSetViewportOrg) if (dc->funcs->pSetViewportOrg)
ret = dc->funcs->pSetViewportOrg( dc->physDev, x, y );
else
{ {
if (pt) if((ret = dc->funcs->pSetViewportOrg( dc->physDev, x, y )) != TRUE)
{ {
pt->x = dc->vportOrgX; if(ret == GDI_NO_MORE_WORK)
pt->y = dc->vportOrgY; ret = TRUE;
} goto done;
dc->vportOrgX = x; }
dc->vportOrgY = y;
DC_UpdateXforms( dc );
} }
if (pt)
{
pt->x = dc->vportOrgX;
pt->y = dc->vportOrgY;
}
dc->vportOrgX = x;
dc->vportOrgY = y;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hdc );
return ret; return ret;
} }
@ -280,13 +294,17 @@ BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
*/ */
BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size ) BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pSetWindowExt) if (dc->funcs->pSetWindowExt)
{ {
ret = dc->funcs->pSetWindowExt( dc->physDev, x, y ); if((ret = dc->funcs->pSetWindowExt( dc->physDev, x, y )) != TRUE)
goto done; {
if(ret == GDI_NO_MORE_WORK)
ret = TRUE;
goto done;
}
} }
if (size) if (size)
{ {
@ -315,21 +333,27 @@ BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
*/ */
BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt ) BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pSetWindowOrg) ret = dc->funcs->pSetWindowOrg( dc->physDev, x, y ); if (dc->funcs->pSetWindowOrg)
else
{ {
if (pt) if((ret = dc->funcs->pSetWindowOrg( dc->physDev, x, y )) != TRUE)
{ {
pt->x = dc->wndOrgX; if(ret == GDI_NO_MORE_WORK)
pt->y = dc->wndOrgY; ret = TRUE;
} goto done;
dc->wndOrgX = x; }
dc->wndOrgY = y;
DC_UpdateXforms( dc );
} }
if (pt)
{
pt->x = dc->wndOrgX;
pt->y = dc->wndOrgY;
}
dc->wndOrgX = x;
dc->wndOrgY = y;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hdc );
return ret; return ret;
} }
@ -340,22 +364,27 @@ BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
*/ */
BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt) BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt)
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pOffsetViewportOrg) if (dc->funcs->pOffsetViewportOrg)
ret = dc->funcs->pOffsetViewportOrg( dc->physDev, x, y );
else
{ {
if (pt) if((ret = dc->funcs->pOffsetViewportOrg( dc->physDev, x, y )) != TRUE)
{ {
pt->x = dc->vportOrgX; if(ret == GDI_NO_MORE_WORK)
pt->y = dc->vportOrgY; ret = TRUE;
} goto done;
dc->vportOrgX += x; }
dc->vportOrgY += y;
DC_UpdateXforms( dc );
} }
if (pt)
{
pt->x = dc->vportOrgX;
pt->y = dc->vportOrgY;
}
dc->vportOrgX += x;
dc->vportOrgY += y;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hdc );
return ret; return ret;
} }
@ -366,22 +395,27 @@ BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt)
*/ */
BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt ) BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pOffsetWindowOrg) if (dc->funcs->pOffsetWindowOrg)
ret = dc->funcs->pOffsetWindowOrg( dc->physDev, x, y );
else
{ {
if (pt) if((ret = dc->funcs->pOffsetWindowOrg( dc->physDev, x, y )) != TRUE)
{ {
pt->x = dc->wndOrgX; if(ret == GDI_NO_MORE_WORK)
pt->y = dc->wndOrgY; ret = TRUE;
} goto done;
dc->wndOrgX += x; }
dc->wndOrgY += y;
DC_UpdateXforms( dc );
} }
if (pt)
{
pt->x = dc->wndOrgX;
pt->y = dc->wndOrgY;
}
dc->wndOrgX += x;
dc->wndOrgY += y;
DC_UpdateXforms( dc );
done:
GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hdc );
return ret; return ret;
} }
@ -393,13 +427,17 @@ BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom, BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
INT yNum, INT yDenom, LPSIZE size ) INT yNum, INT yDenom, LPSIZE size )
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pScaleViewportExt) if (dc->funcs->pScaleViewportExt)
{ {
ret = dc->funcs->pScaleViewportExt( dc->physDev, xNum, xDenom, yNum, yDenom ); if((ret = dc->funcs->pScaleViewportExt( dc->physDev, xNum, xDenom, yNum, yDenom )) != TRUE)
goto done; {
if(ret == GDI_NO_MORE_WORK)
ret = TRUE;
goto done;
}
} }
if (size) if (size)
{ {
@ -431,13 +469,17 @@ BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom, BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom,
INT yNum, INT yDenom, LPSIZE size ) INT yNum, INT yDenom, LPSIZE size )
{ {
BOOL ret = TRUE; INT ret = TRUE;
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->funcs->pScaleWindowExt) if (dc->funcs->pScaleWindowExt)
{ {
ret = dc->funcs->pScaleWindowExt( dc->physDev, xNum, xDenom, yNum, yDenom ); if((ret = dc->funcs->pScaleWindowExt( dc->physDev, xNum, xDenom, yNum, yDenom )) != TRUE)
goto done; {
if(ret == GDI_NO_MORE_WORK)
ret = TRUE;
goto done;
}
} }
if (size) if (size)
{ {

View file

@ -199,8 +199,8 @@ typedef struct tagDC_FUNCS
BOOL (*pLineTo)(PHYSDEV,INT,INT); BOOL (*pLineTo)(PHYSDEV,INT,INT);
BOOL (*pMoveTo)(PHYSDEV,INT,INT); BOOL (*pMoveTo)(PHYSDEV,INT,INT);
INT (*pOffsetClipRgn)(PHYSDEV,INT,INT); INT (*pOffsetClipRgn)(PHYSDEV,INT,INT);
BOOL (*pOffsetViewportOrg)(PHYSDEV,INT,INT); INT (*pOffsetViewportOrg)(PHYSDEV,INT,INT);
BOOL (*pOffsetWindowOrg)(PHYSDEV,INT,INT); INT (*pOffsetWindowOrg)(PHYSDEV,INT,INT);
BOOL (*pPaintRgn)(PHYSDEV,HRGN); BOOL (*pPaintRgn)(PHYSDEV,HRGN);
BOOL (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD); BOOL (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD);
BOOL (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); BOOL (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
@ -219,8 +219,8 @@ typedef struct tagDC_FUNCS
BOOL (*pRestoreDC)(PHYSDEV,INT); BOOL (*pRestoreDC)(PHYSDEV,INT);
BOOL (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT); BOOL (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT);
INT (*pSaveDC)(PHYSDEV); INT (*pSaveDC)(PHYSDEV);
BOOL (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT); INT (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT);
BOOL (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT); INT (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT);
HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP); HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH); HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
BOOL (*pSelectClipPath)(PHYSDEV,INT); BOOL (*pSelectClipPath)(PHYSDEV,INT);
@ -249,10 +249,10 @@ typedef struct tagDC_FUNCS
INT (*pSetTextCharacterExtra)(PHYSDEV,INT); INT (*pSetTextCharacterExtra)(PHYSDEV,INT);
DWORD (*pSetTextColor)(PHYSDEV,DWORD); DWORD (*pSetTextColor)(PHYSDEV,DWORD);
INT (*pSetTextJustification)(PHYSDEV,INT,INT); INT (*pSetTextJustification)(PHYSDEV,INT,INT);
BOOL (*pSetViewportExt)(PHYSDEV,INT,INT); INT (*pSetViewportExt)(PHYSDEV,INT,INT);
BOOL (*pSetViewportOrg)(PHYSDEV,INT,INT); INT (*pSetViewportOrg)(PHYSDEV,INT,INT);
BOOL (*pSetWindowExt)(PHYSDEV,INT,INT); INT (*pSetWindowExt)(PHYSDEV,INT,INT);
BOOL (*pSetWindowOrg)(PHYSDEV,INT,INT); INT (*pSetWindowOrg)(PHYSDEV,INT,INT);
INT (*pStartDoc)(PHYSDEV,const DOCINFOA*); INT (*pStartDoc)(PHYSDEV,const DOCINFOA*);
INT (*pStartPage)(PHYSDEV); INT (*pStartPage)(PHYSDEV);
BOOL (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD); BOOL (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD);
@ -264,6 +264,10 @@ typedef struct tagDC_FUNCS
BOOL (*pWidenPath)(PHYSDEV); BOOL (*pWidenPath)(PHYSDEV);
} DC_FUNCTIONS; } DC_FUNCTIONS;
/* Certain functions will do no further processing if the driver returns this.
Used by mfdrv for example. */
#define GDI_NO_MORE_WORK 2
/* DC hook codes */ /* DC hook codes */
#define DCHC_INVALIDVISRGN 0x0001 #define DCHC_INVALIDVISRGN 0x0001
#define DCHC_DELETEDC 0x0002 #define DCHC_DELETEDC 0x0002