Daniel Santos : winex11.drv: Add on-screen PS_USERSTYLE support to pens.

Alexandre Julliard julliard at winehq.org
Fri Oct 14 14:14:50 CDT 2011


Module: wine
Branch: master
Commit: f2ad9df45d1ca32ac38ea25f860c28bbf88b65b1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f2ad9df45d1ca32ac38ea25f860c28bbf88b65b1

Author: Daniel Santos <danielfsantos at att.net>
Date:   Fri Oct 14 00:32:05 2011 -0500

winex11.drv: Add on-screen PS_USERSTYLE support to pens.

---

 dlls/winex11.drv/pen.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c
index 45a1f6f..b677515 100644
--- a/dlls/winex11.drv/pen.c
+++ b/dlls/winex11.drv/pen.c
@@ -42,11 +42,11 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen )
     X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
     LOGPEN logpen;
     int i;
+    EXTLOGPEN *elp = NULL;
 
     if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
     {
         /* must be an extended pen */
-        EXTLOGPEN *elp;
         INT size = GetObjectW( hpen, 0, NULL );
 
         if (!size) return 0;
@@ -55,13 +55,10 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, 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;
-
-        HeapFree( GetProcessHeap(), 0, elp );
     }
     else
         physDev->pen.ext = 0;
@@ -109,8 +106,10 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen )
             memcpy(physDev->pen.dashes, PEN_alternate, physDev->pen.dash_len);
             break;
       case PS_USERSTYLE:
-        FIXME("PS_USERSTYLE is not supported\n");
-        /* fall through */
+            physDev->pen.dash_len = min(elp->elpNumEntries, MAX_DASHLEN);
+            for(i = 0; i < physDev->pen.dash_len ; i++)
+                physDev->pen.dashes[i] = min(elp->elpStyleEntry[i], 255);
+            break;
       default:
         physDev->pen.dash_len = 0;
         break;
@@ -120,6 +119,8 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen )
         for(i = 0; i < physDev->pen.dash_len; i++)
             physDev->pen.dashes[i] *= (physDev->pen.width ? physDev->pen.width : 1);
 
+    HeapFree( GetProcessHeap(), 0, elp );
+
     return hpen;
 }
 




More information about the wine-cvs mailing list