1999-05-02 12:15:16 +02:00
|
|
|
/*
|
|
|
|
* Enhanced MetaFile driver dc value functions
|
|
|
|
*
|
|
|
|
* Copyright 1999 Huw D M Davies
|
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1999-05-02 12:15:16 +02:00
|
|
|
*/
|
2002-03-10 00:29:33 +01:00
|
|
|
|
2002-03-27 22:13:40 +01:00
|
|
|
#include "enhmfdrv/enhmetafiledrv.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1999-12-06 00:54:02 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
|
1999-05-02 12:15:16 +02:00
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_SaveDC( PHYSDEV dev )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
2011-03-15 20:17:58 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSaveDC );
|
|
|
|
INT ret = next->funcs->pSaveDC( next );
|
2009-04-07 20:32:58 +02:00
|
|
|
|
|
|
|
if (ret)
|
|
|
|
{
|
2011-03-15 20:17:58 +01:00
|
|
|
EMRSAVEDC emr;
|
2009-04-07 20:32:58 +02:00
|
|
|
emr.emr.iType = EMR_SAVEDC;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
EMFDRV_WriteRecord( dev, &emr.emr );
|
|
|
|
}
|
|
|
|
return ret;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
2011-03-15 20:17:58 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pRestoreDC );
|
2003-10-07 05:32:28 +02:00
|
|
|
EMFDRV_PDEVICE* physDev = (EMFDRV_PDEVICE*)dev;
|
2011-04-04 12:27:09 +02:00
|
|
|
DC *dc = get_dc_ptr( dev->hdc );
|
1999-05-02 12:15:16 +02:00
|
|
|
EMRRESTOREDC emr;
|
2009-04-07 20:41:41 +02:00
|
|
|
BOOL ret;
|
2003-10-07 05:32:28 +02:00
|
|
|
|
1999-05-02 12:15:16 +02:00
|
|
|
emr.emr.iType = EMR_RESTOREDC;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
2005-10-31 11:05:52 +01:00
|
|
|
|
|
|
|
if (level < 0)
|
|
|
|
emr.iRelative = level;
|
|
|
|
else
|
2007-09-12 20:23:03 +02:00
|
|
|
emr.iRelative = level - dc->saveLevel - 1;
|
2009-04-07 20:41:41 +02:00
|
|
|
release_dc_ptr( dc );
|
2005-10-31 11:05:52 +01:00
|
|
|
|
2009-04-07 20:41:41 +02:00
|
|
|
physDev->restoring++;
|
2011-03-15 20:17:58 +01:00
|
|
|
ret = next->funcs->pRestoreDC( next, level );
|
2009-04-07 20:41:41 +02:00
|
|
|
physDev->restoring--;
|
2005-10-31 11:05:52 +01:00
|
|
|
|
2009-04-07 20:41:41 +02:00
|
|
|
if (ret) EMFDRV_WriteRecord( dev, &emr.emr );
|
|
|
|
return ret;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
|
|
|
EMRSETTEXTALIGN emr;
|
|
|
|
emr.emr.iType = EMR_SETTEXTALIGN;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = align;
|
2011-03-10 21:58:47 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? align : GDI_ERROR;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_SetTextJustification(PHYSDEV dev, INT nBreakExtra, INT nBreakCount)
|
2003-10-10 02:06:59 +02:00
|
|
|
{
|
|
|
|
EMRSETTEXTJUSTIFICATION emr;
|
|
|
|
emr.emr.iType = EMR_SETTEXTJUSTIFICATION;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.nBreakExtra = nBreakExtra;
|
|
|
|
emr.nBreakCount = nBreakCount;
|
|
|
|
return EMFDRV_WriteRecord(dev, &emr.emr);
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_SetBkMode( PHYSDEV dev, INT mode )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
|
|
|
EMRSETBKMODE emr;
|
|
|
|
emr.emr.iType = EMR_SETBKMODE;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = mode;
|
2011-03-10 21:58:47 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
COLORREF EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
EMRSETBKCOLOR emr;
|
|
|
|
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
|
|
|
|
|
|
|
if (physDev->restoring) return color; /* don't output records during RestoreDC */
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETBKCOLOR;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.crColor = color;
|
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
COLORREF EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
EMRSETTEXTCOLOR emr;
|
|
|
|
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
|
|
|
|
|
|
|
|
if (physDev->restoring) return color; /* don't output records during RestoreDC */
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETTEXTCOLOR;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.crColor = color;
|
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_SetROP2( PHYSDEV dev, INT rop )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
|
|
|
EMRSETROP2 emr;
|
|
|
|
emr.emr.iType = EMR_SETROP2;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = rop;
|
2011-03-10 21:58:47 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? rop : 0;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
|
|
|
EMRSETPOLYFILLMODE emr;
|
|
|
|
emr.emr.iType = EMR_SETPOLYFILLMODE;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = mode;
|
2011-03-10 21:58:47 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
|
|
|
EMRSETSTRETCHBLTMODE emr;
|
|
|
|
emr.emr.iType = EMR_SETSTRETCHBLTMODE;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = mode;
|
2011-03-10 21:58:47 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_SetArcDirection(PHYSDEV dev, INT arcDirection)
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
EMRSETARCDIRECTION emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETARCDIRECTION;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iArcDirection = arcDirection;
|
|
|
|
return EMFDRV_WriteRecord(dev, &emr.emr) ? arcDirection : 0;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
2013-02-14 06:38:31 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExcludeClipRect );
|
1999-05-02 12:15:16 +02:00
|
|
|
EMREXCLUDECLIPRECT emr;
|
2013-02-14 06:38:31 +01:00
|
|
|
|
1999-05-02 12:15:16 +02:00
|
|
|
emr.emr.iType = EMR_EXCLUDECLIPRECT;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.rclClip.left = left;
|
|
|
|
emr.rclClip.top = top;
|
|
|
|
emr.rclClip.right = right;
|
|
|
|
emr.rclClip.bottom = bottom;
|
2013-02-15 06:06:33 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return ERROR;
|
|
|
|
return next->funcs->pExcludeClipRect( next, left, top, right, bottom );
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom)
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
2013-02-14 06:38:06 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pIntersectClipRect );
|
1999-05-02 12:15:16 +02:00
|
|
|
EMRINTERSECTCLIPRECT emr;
|
2013-02-14 06:38:06 +01:00
|
|
|
|
1999-05-02 12:15:16 +02:00
|
|
|
emr.emr.iType = EMR_INTERSECTCLIPRECT;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.rclClip.left = left;
|
|
|
|
emr.rclClip.top = top;
|
|
|
|
emr.rclClip.right = right;
|
|
|
|
emr.rclClip.bottom = bottom;
|
2013-02-15 06:06:33 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return ERROR;
|
|
|
|
return next->funcs->pIntersectClipRect( next, left, top, right, bottom );
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
2013-02-14 06:37:38 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetClipRgn );
|
1999-05-02 12:15:16 +02:00
|
|
|
EMROFFSETCLIPRGN emr;
|
2013-02-14 06:37:38 +01:00
|
|
|
|
1999-05-02 12:15:16 +02:00
|
|
|
emr.emr.iType = EMR_OFFSETCLIPRGN;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.ptlOffset.x = x;
|
|
|
|
emr.ptlOffset.y = y;
|
2013-02-15 06:06:33 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return ERROR;
|
|
|
|
return next->funcs->pOffsetClipRgn( next, x, y );
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode )
|
2002-05-09 06:03:46 +02:00
|
|
|
{
|
2013-02-13 09:47:13 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExtSelectClipRgn );
|
2002-05-09 06:03:46 +02:00
|
|
|
EMREXTSELECTCLIPRGN *emr;
|
|
|
|
DWORD size, rgnsize;
|
|
|
|
BOOL ret;
|
|
|
|
|
2002-05-29 00:47:49 +02:00
|
|
|
if (!hrgn)
|
|
|
|
{
|
|
|
|
if (mode != RGN_COPY) return ERROR;
|
|
|
|
rgnsize = 0;
|
|
|
|
}
|
|
|
|
else rgnsize = GetRegionData( hrgn, 0, NULL );
|
|
|
|
|
|
|
|
size = rgnsize + offsetof(EMREXTSELECTCLIPRGN,RgnData);
|
2002-05-09 06:03:46 +02:00
|
|
|
emr = HeapAlloc( GetProcessHeap(), 0, size );
|
2002-05-29 00:47:49 +02:00
|
|
|
if (rgnsize) GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
|
2002-05-09 06:03:46 +02:00
|
|
|
|
|
|
|
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 );
|
2013-02-13 09:47:13 +01:00
|
|
|
return ret ? next->funcs->pExtSelectClipRgn( next, hrgn, mode ) : ERROR;
|
2002-05-09 06:03:46 +02:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetMapMode );
|
|
|
|
EMRSETMAPMODE emr;
|
|
|
|
emr.emr.iType = EMR_SETMAPMODE;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = mode;
|
|
|
|
|
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return 0;
|
|
|
|
return next->funcs->pSetMapMode( next, mode );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_SetViewportExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetViewportExtEx );
|
|
|
|
EMRSETVIEWPORTEXTEX emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETVIEWPORTEXTEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.szlExtent.cx = cx;
|
|
|
|
emr.szlExtent.cy = cy;
|
|
|
|
|
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
|
|
|
return next->funcs->pSetViewportExtEx( next, cx, cy, size );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowExtEx );
|
|
|
|
EMRSETWINDOWEXTEX emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETWINDOWEXTEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.szlExtent.cx = cx;
|
|
|
|
emr.szlExtent.cy = cy;
|
|
|
|
|
2014-01-28 00:04:18 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
2011-03-11 12:03:41 +01:00
|
|
|
return next->funcs->pSetWindowExtEx( next, cx, cy, size );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetViewportOrgEx );
|
|
|
|
EMRSETVIEWPORTORGEX emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETVIEWPORTORGEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.ptlOrigin.x = x;
|
|
|
|
emr.ptlOrigin.y = y;
|
|
|
|
|
2014-01-28 00:04:18 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
2011-03-11 12:03:41 +01:00
|
|
|
return next->funcs->pSetViewportOrgEx( next, x, y, pt );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowOrgEx );
|
|
|
|
EMRSETWINDOWORGEX emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETWINDOWORGEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.ptlOrigin.x = x;
|
|
|
|
emr.ptlOrigin.y = y;
|
|
|
|
|
2014-01-28 00:04:18 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
2011-03-11 12:03:41 +01:00
|
|
|
return next->funcs->pSetWindowOrgEx( next, x, y, pt );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_ScaleViewportExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pScaleViewportExtEx );
|
|
|
|
EMRSCALEVIEWPORTEXTEX emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SCALEVIEWPORTEXTEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.xNum = xNum;
|
|
|
|
emr.xDenom = xDenom;
|
|
|
|
emr.yNum = yNum;
|
|
|
|
emr.yDenom = yDenom;
|
|
|
|
|
2014-01-28 00:04:18 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
2011-03-11 12:03:41 +01:00
|
|
|
return next->funcs->pScaleViewportExtEx( next, xNum, xDenom, yNum, yDenom, size );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom, SIZE *size )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pScaleWindowExtEx );
|
|
|
|
EMRSCALEWINDOWEXTEX emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SCALEWINDOWEXTEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.xNum = xNum;
|
|
|
|
emr.xDenom = xDenom;
|
|
|
|
emr.yNum = yNum;
|
|
|
|
emr.yDenom = yDenom;
|
|
|
|
|
2014-01-28 00:04:18 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
2011-03-11 12:03:41 +01:00
|
|
|
return next->funcs->pScaleWindowExtEx( next, xNum, xDenom, yNum, yDenom, size );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
DWORD EMFDRV_SetLayout( PHYSDEV dev, DWORD layout )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
EMRSETLAYOUT emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETLAYOUT;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = layout;
|
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? layout : GDI_ERROR;
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform)
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
2011-03-15 14:03:02 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWorldTransform );
|
2011-03-11 12:03:41 +01:00
|
|
|
EMRSETWORLDTRANSFORM emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETWORLDTRANSFORM;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.xform = *xform;
|
|
|
|
|
2011-03-15 14:03:02 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
|
|
|
return next->funcs->pSetWorldTransform( next, xform );
|
2011-03-11 12:03:41 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD mode)
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
2011-03-15 14:03:02 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pModifyWorldTransform );
|
2011-03-11 12:03:41 +01:00
|
|
|
EMRMODIFYWORLDTRANSFORM emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_MODIFYWORLDTRANSFORM;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.xform = *xform;
|
|
|
|
emr.iMode = mode;
|
|
|
|
|
2011-03-15 14:03:02 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
|
|
|
return next->funcs->pModifyWorldTransform( next, xform, mode );
|
2011-03-11 12:03:41 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetViewportOrgEx );
|
|
|
|
EMRSETVIEWPORTORGEX emr;
|
2011-03-28 17:00:47 +02:00
|
|
|
POINT prev;
|
2011-03-11 12:03:41 +01:00
|
|
|
|
2011-04-04 12:27:09 +02:00
|
|
|
GetViewportOrgEx( dev->hdc, &prev );
|
2011-03-11 12:03:41 +01:00
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETVIEWPORTORGEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
2011-03-28 17:00:47 +02:00
|
|
|
emr.ptlOrigin.x = prev.x + x;
|
|
|
|
emr.ptlOrigin.y = prev.y + y;
|
2011-03-11 12:03:41 +01:00
|
|
|
|
2014-01-28 00:04:18 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
2011-03-11 12:03:41 +01:00
|
|
|
return next->funcs->pOffsetViewportOrgEx( next, x, y, pt );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
|
2011-03-11 12:03:41 +01:00
|
|
|
{
|
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetWindowOrgEx );
|
|
|
|
EMRSETWINDOWORGEX emr;
|
2011-03-28 17:00:47 +02:00
|
|
|
POINT prev;
|
2011-03-11 12:03:41 +01:00
|
|
|
|
2011-04-04 12:27:09 +02:00
|
|
|
GetWindowOrgEx( dev->hdc, &prev );
|
2011-03-11 12:03:41 +01:00
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETWINDOWORGEX;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
2011-03-28 17:00:47 +02:00
|
|
|
emr.ptlOrigin.x = prev.x + x;
|
|
|
|
emr.ptlOrigin.y = prev.y + y;
|
2011-03-11 12:03:41 +01:00
|
|
|
|
2014-01-28 00:04:18 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
2011-03-11 12:03:41 +01:00
|
|
|
return next->funcs->pOffsetWindowOrgEx( next, x, y, pt );
|
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
|
1999-05-02 12:15:16 +02:00
|
|
|
{
|
|
|
|
EMRSETMAPPERFLAGS emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SETMAPPERFLAGS;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.dwFlags = flags;
|
|
|
|
|
2011-03-10 21:58:47 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr ) ? flags : GDI_ERROR;
|
1999-05-02 12:15:16 +02:00
|
|
|
}
|
1999-12-06 00:54:02 +01:00
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_AbortPath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRABORTPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_ABORTPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_BeginPath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRBEGINPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_BEGINPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_CloseFigure( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRCLOSEFIGURE emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_CLOSEFIGURE;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_EndPath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRENDPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_ENDPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_FillPath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRFILLPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_FILLPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
FIXME("Bounds\n");
|
|
|
|
emr.rclBounds.left = 0;
|
|
|
|
emr.rclBounds.top = 0;
|
|
|
|
emr.rclBounds.right = 0;
|
|
|
|
emr.rclBounds.bottom = 0;
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_FlattenPath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRFLATTENPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_FLATTENPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
2013-02-15 06:06:33 +01:00
|
|
|
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSelectClipPath );
|
1999-12-06 00:54:02 +01:00
|
|
|
EMRSELECTCLIPPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_SELECTCLIPPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
emr.iMode = iMode;
|
|
|
|
|
2013-02-15 06:06:33 +01:00
|
|
|
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
|
|
|
|
return next->funcs->pSelectClipPath( next, iMode );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRSTROKEANDFILLPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_STROKEANDFILLPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
FIXME("Bounds\n");
|
|
|
|
emr.rclBounds.left = 0;
|
|
|
|
emr.rclBounds.top = 0;
|
|
|
|
emr.rclBounds.right = 0;
|
|
|
|
emr.rclBounds.bottom = 0;
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_StrokePath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRSTROKEPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_STROKEPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
FIXME("Bounds\n");
|
|
|
|
emr.rclBounds.left = 0;
|
|
|
|
emr.rclBounds.top = 0;
|
|
|
|
emr.rclBounds.right = 0;
|
|
|
|
emr.rclBounds.bottom = 0;
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
BOOL EMFDRV_WidenPath( PHYSDEV dev )
|
1999-12-06 00:54:02 +01:00
|
|
|
{
|
|
|
|
EMRWIDENPATH emr;
|
|
|
|
|
|
|
|
emr.emr.iType = EMR_WIDENPATH;
|
|
|
|
emr.emr.nSize = sizeof(emr);
|
|
|
|
|
2002-03-28 23:22:05 +01:00
|
|
|
return EMFDRV_WriteRecord( dev, &emr.emr );
|
1999-12-06 00:54:02 +01:00
|
|
|
}
|
2002-08-17 02:25:05 +02:00
|
|
|
|
2011-07-13 14:56:12 +02:00
|
|
|
INT EMFDRV_GetDeviceCaps(PHYSDEV dev, INT cap)
|
2002-08-17 02:25:05 +02:00
|
|
|
{
|
|
|
|
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev;
|
|
|
|
|
2012-04-10 14:42:50 +02:00
|
|
|
return GetDeviceCaps( physDev->ref_dc, cap );
|
2002-08-17 02:25:05 +02:00
|
|
|
}
|