No subject

Hans Hans
Tue Mar 17 14:04:44 CDT 2009


hans at breuer.org</a>&gt;<br>
Date: Sun, 29 Mar 2009 18:27:29 +0200<br>
Subject: implement PS_USERSTYLE handling, tested with Dia(win32) - see<br>
=A0<a href=3D"http://hans.breuer.org/dia/dia-wine.htm" target=3D"_blank">ht=
tp://hans.breuer.org/dia/dia-wine.htm</a><br>
<br>
---<br>
=A0dlls/winex11.drv/pen.c | =A0 31 +++++++++++++++++++++++++++----<br>
=A01 files changed, 27 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c<br>
index 49fe74c..039798e 100644<br>
--- a/dlls/winex11.drv/pen.c<br>
+++ b/dlls/winex11.drv/pen.c<br>
@@ -54,12 +54,33 @@ HPEN CDECL X11DRV_SelectPen( X11DRV_PDEVICE *physDev,<b=
r>
HPEN hpen )<br>
 =A0 =A0 =A0 =A0 elp =3D HeapAlloc( GetProcessHeap(), 0, size );<br>
<br>
 =A0 =A0 =A0 =A0 GetObjectW( hpen, size, elp );<br>
- =A0 =A0 =A0 =A0/* FIXME: add support for user style pens */<br>
 =A0 =A0 =A0 =A0 logpen.lopnStyle =3D elp-&gt;elpPenStyle;<br>
 =A0 =A0 =A0 =A0 logpen.lopnWidth.x =3D elp-&gt;elpWidth;<br>
 =A0 =A0 =A0 =A0 logpen.lopnWidth.y =3D 0;<br>
 =A0 =A0 =A0 =A0 logpen.lopnColor =3D elp-&gt;elpColor;<br>
-<br>
+ =A0 =A0 =A0 =A0/* support for user style pens */<br>
+ =A0 =A0 =A0 =A0if (MAX_DASHLEN &lt; elp-&gt;elpNumEntries)<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0FIXME(&quot;PS_USERSTYLE: len(dashes)&gt;MAX_DASHL=
EN %d,%d\n&quot;, elp-&gt;elpNumEntries, MAX_DASHLEN);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0physDev-&gt;pen.dash_len =3D 0;<br>
+ =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0BOOL overflow =3D FALSE;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0physDev-&gt;pen.dash_len =3D elp-&gt;elpNumEntries=
;<br>
+ =A0 =A0 =A0 =A0 =A0 =A0for (i =3D 0; i &lt; elp-&gt;elpNumEntries; ++i)<b=
r>
+ =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (elp-&gt;elpStyleEntry[i] &gt; 255)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0overflow =3D TRUE; /* can&#39;t fi=
t the type */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0physDev-&gt;pen.dashes[i] =3D 255;=
<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0physDev-&gt;pen.dashes[i] =3D (cha=
r)elp-&gt;elpStyleEntry[i];<br>
+ =A0 =A0 =A0 =A0 =A0 =A0}<br>
+ =A0 =A0 =A0 =A0 =A0 =A0if (overflow)<br>
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FIXME(&quot;PS_USERSTYLE: dashes clipped (=
type overflow)\n&quot;);<br>
+ =A0 =A0 =A0 =A0}<br>
 =A0 =A0 =A0 =A0 HeapFree( GetProcessHeap(), 0, elp );<br>
 =A0 =A0 }<br>
 =A0 =A0 else<br>
@@ -108,14 +129,16 @@ HPEN CDECL X11DRV_SelectPen( X11DRV_PDEVICE *physDev,=
<br>
HPEN hpen )<br>
 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(physDev-&gt;pen.dashes, PEN_alternate,<br>
physDev-&gt;pen.dash_len);<br>
 =A0 =A0 =A0 =A0 =A0 =A0 break;<br>
 =A0 =A0 =A0 case PS_USERSTYLE:<br>
- =A0 =A0 =A0 =A0FIXME(&quot;PS_USERSTYLE is not supported\n&quot;);<br>
+ =A0 =A0 =A0 =A0 =A0 =A0/* handled above */<br>
+ =A0 =A0 =A0 =A0 =A0 =A0break;<br>
 =A0 =A0 =A0 =A0 /* fall through */</blockquote><div>The comment here is no=
 longer required. <br></div><blockquote class=3D"gmail_quote" style=3D"bord=
er-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-l=
eft: 1ex;">
<br>
 =A0 =A0 =A0 default:<br>
 =A0 =A0 =A0 =A0 physDev-&gt;pen.dash_len =3D 0;<br>
 =A0 =A0 =A0 =A0 break;<br>
 =A0 =A0 }<br>
 =A0 =A0 if(physDev-&gt;pen.ext &amp;&amp; physDev-&gt;pen.dash_len &amp;&a=
mp;<br>
- =A0 =A0 =A0 =A0(logpen.lopnStyle &amp; PS_STYLE_MASK) !=3D PS_ALTERNATE)<=
br>
+ =A0 =A0 =A0 =A0(logpen.lopnStyle &amp; PS_STYLE_MASK) !=3D PS_ALTERNATE &=
amp;&amp;<br>
+ =A0 =A0 =A0 =A0(logpen.lopnStyle &amp; PS_STYLE_MASK) !=3D PS_USERSTYLE)<=
br>
 =A0 =A0 =A0 =A0 for(i =3D 0; i &lt; physDev-&gt;pen.dash_len; i++)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 physDev-&gt;pen.dashes[i] *=3D (physDev-&gt;pen.wi=
dth ?<br>
physDev-&gt;pen.width : 1);<br><font color=3D"#888888">
<br>
-- <br>
1.6.0.6<br>
<br>
<br>
-------- Hans &quot;at&quot; Breuer &quot;dot&quot; Org -----------<br>
Tell me what you need, and I&#39;ll tell you how to<br>
get along without it. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Dilbert<br>
<br>
<br>
</font></blockquote></div><br>

--00163641695d2f113d0466e2860a--



More information about the wine-devel mailing list