Hans Breuer wrote:
From b89af7d06fc8cbf5210c61fd58ed62caeddad968 Mon Sep 17 00:00:00 2001 From: Hans Breuer hans@breuer.org Date: Sun, 29 Mar 2009 18:27:29 +0200 Subject: implement PS_USERSTYLE handling, tested with Dia(win32) - see http://hans.breuer.org/dia/dia-wine.htm
dlls/winex11.drv/pen.c | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c index 49fe74c..039798e 100644 --- a/dlls/winex11.drv/pen.c +++ b/dlls/winex11.drv/pen.c @@ -54,12 +54,33 @@ HPEN CDECL X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) 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;
/* support for user style pens */
if (MAX_DASHLEN < elp->elpNumEntries)
{
FIXME("PS_USERSTYLE: len(dashes)>MAX_DASHLEN %d,%d\n",
elp->elpNumEntries, MAX_DASHLEN);
physDev->pen.dash_len = 0;
}
else
{
BOOL overflow = FALSE;
physDev->pen.dash_len = elp->elpNumEntries;
for (i = 0; i < elp->elpNumEntries; ++i)
{
if (elp->elpStyleEntry[i] > 255)
{
overflow = TRUE; /* can't fit the type */
physDev->pen.dashes[i] = 255;
}
else
physDev->pen.dashes[i] =
(char)elp->elpStyleEntry[i];
}
if (overflow)
FIXME("PS_USERSTYLE: dashes clipped (type overflow)\n");
} else} HeapFree( GetProcessHeap(), 0, elp );
@@ -108,14 +129,16 @@ HPEN CDECL X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) memcpy(physDev->pen.dashes, PEN_alternate, physDev->pen.dash_len); break; case PS_USERSTYLE:
FIXME("PS_USERSTYLE is not supported\n");
/* handled above */
} if(physDev->pen.ext && physDev->pen.dash_len &&break; /* fall through */ default: physDev->pen.dash_len = 0; break;
(logpen.lopnStyle & PS_STYLE_MASK) != PS_ALTERNATE)
(logpen.lopnStyle & PS_STYLE_MASK) != PS_ALTERNATE &&
(logpen.lopnStyle & PS_STYLE_MASK) != PS_USERSTYLE) for(i = 0; i < physDev->pen.dash_len; i++) physDev->pen.dashes[i] *= (physDev->pen.width ?
physDev->pen.width : 1);
This needs a conformance test to show this is what happens in Windows. If this is not supported in certain versions, you will also need to add broken() code for those versions with what happens. Look at the Wine source code and search for the use of this call.
James McKenzie
At 05.04.2009 23:54, James McKenzie wrote:
Hans Breuer wrote:
From b89af7d06fc8cbf5210c61fd58ed62caeddad968 Mon Sep 17 00:00:00 2001 From: Hans Breuer hans@breuer.org Date: Sun, 29 Mar 2009 18:27:29 +0200 Subject: implement PS_USERSTYLE handling, tested with Dia(win32) - see http://hans.breuer.org/dia/dia-wine.htm
dlls/winex11.drv/pen.c | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-)
[...]
This needs a conformance test to show this is what happens in Windows. If this is not supported in certain versions, you will also need to add broken() code for those versions with what happens. Look at the Wine source code and search for the use of this call.
The only broken() calls I found are in */test/*. If I understood correctly for PS_USERSTYLE and ExtCreatePen these tests are allready there, see: dlls/gdi32/tests/pen.c
And they are un-effected by my patch, which is not changing any API behaviour, but just fixes the implementation to finally match the API.
Or am I still missing something?
Thanks, Hans
-------- Hans "at" Breuer "dot" Org ----------- Tell me what you need, and I'll tell you how to get along without it. -- Dilbert
Hans Breuer wrote:
At 05.04.2009 23:54, James McKenzie wrote:
Hans Breuer wrote:
From b89af7d06fc8cbf5210c61fd58ed62caeddad968 Mon Sep 17 00:00:00 2001 From: Hans Breuer hans@breuer.org Date: Sun, 29 Mar 2009 18:27:29 +0200 Subject: implement PS_USERSTYLE handling, tested with Dia(win32) - see http://hans.breuer.org/dia/dia-wine.htm
dlls/winex11.drv/pen.c | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-)
[...]
This needs a conformance test to show this is what happens in Windows. If this is not supported in certain versions, you will also need to add broken() code for those versions with what happens. Look at the Wine source code and search for the use of this call.
The only broken() calls I found are in */test/*. If I understood correctly for PS_USERSTYLE and ExtCreatePen these tests are allready there, see: dlls/gdi32/tests/pen.c
And they are un-effected by my patch, which is not changing any API behaviour, but just fixes the implementation to finally match the API.
Do they correct implementations to match Windows behavior and do tests exist for Wine that demonstrate this (the tests may be marked to_do wine and this marking needs to be removed.) If behavior is not implemented in a particular version of Windows or differs then the test needs to be marked as broken, which by your comments I will assume is already in place and correct. Thank you for fixing this as there are many areas where Wine is lacking in proper implementation and hacks and code workarounds exist at the present time.
Or am I still missing something?
No, you are not. It has been a very long week this week. I'm recovering, still, from the flu and other problems. If I've offended you, my apologies.
James McKenzie