gdi: A better workaround for extended user style pens.

This commit is contained in:
Dmitry Timoshkov 2006-03-09 15:12:43 +08:00 committed by Alexandre Julliard
parent 76c469e5a4
commit 434a60ba1d
4 changed files with 56 additions and 36 deletions

View File

@ -401,16 +401,21 @@ static HPEN EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen )
if (!GetObjectW( hPen, sizeof(emr.lopn), &emr.lopn ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hPen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hPen);
return 0;
}
emr.lopn.lopnStyle = elp.elpPenStyle;
emr.lopn.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hPen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hPen, size, elp );
/* FIXME: add support for user style pens */
emr.lopn.lopnStyle = elp->elpPenStyle;
emr.lopn.lopnWidth.x = elp->elpWidth;
emr.lopn.lopnWidth.y = 0;
emr.lopn.lopnColor = elp.elpColor;
emr.lopn.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
emr.emr.iType = EMR_CREATEPEN;

View File

@ -406,16 +406,21 @@ HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN hpen )
if (!GetObject16( HPEN_16(hpen), sizeof(logpen), &logpen ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hpen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hpen);
return 0;
}
logpen.lopnStyle = elp.elpPenStyle;
logpen.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hpen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp );
/* FIXME: add support for user style pens */
logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth;
logpen.lopnWidth.y = 0;
logpen.lopnColor = elp.elpColor;
logpen.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
index = MFDRV_CreatePenIndirect( dev, hpen, &logpen );

View File

@ -44,16 +44,21 @@ HPEN PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hpen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hpen);
return 0;
}
logpen.lopnStyle = elp.elpPenStyle;
logpen.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hpen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp );
/* FIXME: add support for user style pens */
logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth;
logpen.lopnWidth.y = 0;
logpen.lopnColor = elp.elpColor;
logpen.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
TRACE("hpen = %p colour = %08lx\n", hpen, logpen.lopnColor);

View File

@ -41,16 +41,21 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen )
if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hpen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hpen);
return 0;
}
logpen.lopnStyle = elp.elpPenStyle;
logpen.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hpen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp );
/* FIXME: add support for user style pens */
logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth;
logpen.lopnWidth.y = 0;
logpen.lopnColor = elp.elpColor;
logpen.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK;