Hi,
I'm trying to get Protel 99SE working under Wine. It's nearly there, in fact it's totally usable, but some slight niggles remain (as can be seen in the appDB). I'm a coder, and I am actively looking at the code to see what I can do. I'm also a total newbie to Wine development, and while I'm reading the ML archives and generally trying to sponge up as much as I can by myself, I'd prefer a bit of advice!
My first job was to find a problem where some lines are drawn a single pixel wide, when they should be several pixels wide. After some digging, I found that the DC is in MM_ISOTROPIC mapping mode, and that a line with width 1 is not being transformed. Wider lines do get transformed, and lines of width 0 are correctly drawn a single pixel wide.
The culprit in this case is line 67 of dlls/winex11.drv/pen.c, which says
physDev->pen.width = logpen.lopnWidth.x; ** if ((logpen.lopnStyle & PS_GEOMETRIC) || (physDev->pen.width > 1)) { physDev->pen.width = X11DRV_XWStoDS( physDev, physDev->pen.width ); if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width; }
If I change that line to
if ((logpen.lopnStyle & PS_GEOMETRIC) || (physDev->pen.width > 0))
my problem goes away, but I'm concerned that it isn't appropriate for other mapping modes. I can do something a bit more conservative like
if ((logpen.lopnStyle & PS_GEOMETRIC) || (physDev->pen.width > 1) || ((GetMapMode ( physDev->hdc ) == MM_ISOTROPIC) && (physDev->pen.width == 1)))
and it Works For Me (tm).
I've tried to do some tests in Windows to see what happens in different mapping modes, and I'm getting there, but this is new stuff for me so it's fairly slow going. In particular, it seems that the line with in anisotropic map mode will depend on whether the line is vertical or horizontal etc.
So, I have a couple of questions:
1) Is the mailing list or bugzilla a better place to discuss this sort of thing?
2) Should I continue to investigate the issue in Windows, or is there some gdi guru out there that can save me the effort by telling me all about pen width mapping?
3) What is the normal flow of things here: do people fix their bug specifically and then move on, or is it preferred to investigate the issue fully and make sure the solution is truly correct?
Thanks for your time! Rob.
You may want to try and write a regression test (a small amount of C code calling the function/functions in such a way that the problem you see can be seen as output value) to show what windows does in this case; if then the values are corrected under wine with your changes, it shows you're going in the right direction :-)
HTH,
Joris
On Tuesday 11 July 2006 18:01, Rob Brown wrote:
Hi,
I'm trying to get Protel 99SE working under Wine. It's nearly there, in fact it's totally usable, but some slight niggles remain (as can be seen in the appDB).
Does it install out of the box, or does it need some Windows components?
Did you use the installer, or copy the installation from a Windows machine?
I have written a unix utility to convert a .ddb to a .zip, if you're interested let me know and I'll sanitize it a bit and can post it under some free software license.
Cheers, Kuba
As has been mentioned already a Wine regression test would be ideal here. In this case it's slightly tricky as you're testing a graphical component however it's still achievable. I'd suggest you add a test to gdi/tests/pen.c that creates a 1bpp dibsection, selects that into a dc, draws lines on it with a selection of pens in different graphics modes. After each line get the bits from the dibsection and compare them to what you've found out Windows gives you and then clear the dibsection before drawing with the next pen/graphics mode. If you need any help with this then please let me know.
Huw.