[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: ExtCreatePen- One more try
From:       Joshua Thielen <thielen () netperson ! net>
Date:       1999-05-31 0:40:21
[Download RAW message or body]

> I've got more of an idea of what has to be done now thanks to your help.I'll study
> up on the SDKdocs for these styles and make the appropriate changes if you like.

Now that I've looked at the API docs, I can see that PS_USERSTYLE and PS_ALTERNATE
aren't supported styles in Win95, only in NT. I don't have NT though, so I have no way
of testing out any implementation of these styles. I'll submit this patch to
wine-devel then, if it looks ok to you.

Thanks,
Joshua

["pen3.diff" (text/plain)]

--- /objects/pen.c	Thu Apr 22 12:27:53 1999
+++ objects/pen.c	Sun May 30 20:17:27 1999
@@ -97,19 +97,30 @@
                               const LOGBRUSH * brush, DWORD style_count,
                               const DWORD *style_bits )
 {
-    LOGPEN logpen;
+    PENOBJ * penPtr;
+    HPEN hpen;
 
     if ((style & PS_STYLE_MASK) == PS_USERSTYLE)
	FIXME(gdi, "PS_USERSTYLE not handled\n");
     if ((style & PS_TYPE_MASK) == PS_GEOMETRIC)
 	if (brush->lbHatch)
	    FIXME(gdi, "Hatches not implemented\n");
 
-    logpen.lopnStyle = style & ~PS_TYPE_MASK;
-    logpen.lopnWidth.x = (style & PS_GEOMETRIC) ? width : 1;
-    logpen.lopnWidth.y = 0;
-    logpen.lopnColor = brush->lbColor;
-    return CreatePenIndirect( &logpen );
+    hpen = GDI_AllocObject( sizeof(PENOBJ), PEN_MAGIC );
+    if (!hpen) return 0;
+    penPtr = (PENOBJ *)GDI_HEAP_LOCK( hpen );
+    penPtr->logpen.lopnStyle = style & ~PS_TYPE_MASK; 
+    
+    /* PS_USERSTYLE and PS_ALTERNATE workaround */   
+    if((penPtr->logpen.lopnStyle & PS_STYLE_MASK) > PS_INSIDEFRAME)
+       penPtr->logpen.lopnStyle = 
+         (penPtr->logpen.lopnStyle & ~PS_STYLE_MASK) | PS_SOLID;
+    
+    penPtr->logpen.lopnWidth.x = (style & PS_GEOMETRIC) ? width : 1; 
+    penPtr->logpen.lopnColor = brush->lbColor;
+    GDI_HEAP_UNLOCK( hpen );
+
+    return hpen;
 }
 
 /***********************************************************************

=========================================================================


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic