<kc version="0.1.0">

<title>Wine Traffic</title>

<author contact="mailto:vinn@theshell.com">Brian Vincent</author>

<issue num="157" date="14 Feb 2003 00:00:00 -0800" />

<intro>
<p>This is the 157th release of the Wine's kernel cousin publication. 
It's main goal is to serve as a Valentines Day reminder.
It also serves to inform you of what's going on around Wine (the Un*x 
windows emulator).</p>
</intro>


<stats posts="175" size="608" contrib="63" multiples="34" lastweek="34">

<person posts="18" size="57" who="Dan Kegel" />
<person posts="12" size="36" who="Tony Lambregts" />
<person posts="7" size="15" who="J. Grant" />
<person posts="6" size="35" who="Eric Pouech" />
<person posts="6" size="31" who="Gregory M. Turner" />
<person posts="6" size="15" who="Sylvain Petreolle" />
<person posts="6" size="15" who="Drew \DanteAliegri\ Ogle" />
<person posts="5" size="51" who="Shachar Shemesh" />
<person posts="5" size="15" who="Mike Hearn" />
<person posts="5" size="10" who="Felipe W Damasio" />
<person posts="4" size="11" who="Mike Hearn" />
<person posts="4" size="10" who="Bill Medland" />
<person posts="4" size="10" who="Alexandre Julliard" />
<person posts="8" size="18" who="Dimitrie O. Paun" />
<person posts="4" size="9" who="Dmitry Timoshkov" />
<person posts="3" size="12" who="David Miller" />
<person posts="3" size="11" who="Ulrik Mikaelsson" />
<person posts="3" size="9" who="Huw D M Davies" />
<person posts="3" size="9" who="David Fraser" />
<person posts="3" size="8" who="Uwe Bonnes" />
<person posts="3" size="8" who="Ove Kaaven" />
<person posts="3" size="7" who="Fabian Cenedese" />
<person posts="3" size="7" who="Marcus Meissner" />
<person posts="3" size="6" who="Francois Gouget" />
<person posts="3" size="6" who="Lionel Ulmer" />
<person posts="2" size="12" who="David Miller" />
<person posts="2" size="8" who="Dave" />
<person posts="2" size="7" who="Ulrich Czekalla" />
<person posts="2" size="6" who="Martin Wilck" />
<person posts="2" size="6" who="Michael Stefaniuc" />
<person posts="3" size="9" who="Vincent Beron" />
<person posts="2" size="4" who="Steven Edwards" />
<person posts="2" size="4" who="Robert Reif" />
<person posts="1" size="44" who="Jeremy Newman" />
<person posts="1" size="6" who="Shachar Shemesh" />
<person posts="1" size="4" who="Roderick Colenbrander" />
<person posts="1" size="4" who="Geoff Thorpe" />
<person posts="1" size="3" who="(ATMRD)" />
<person posts="1" size="3" who="James K Whiting" />
<person posts="1" size="3" who="Brian Vincent" />
<person posts="1" size="2" who="SodaPop" />
<person posts="1" size="2" who="Z_God" />
<person posts="1" size="2" who="Rolf Kalbermatter" />
<person posts="1" size="2" who="Pierre d'Herbemont" />
<person posts="1" size="2" who="Jukka Heinonen" />
<person posts="1" size="2" who="Robert North" />
<person posts="1" size="2" who="John Kopplin" />
<person posts="1" size="2" who="Christian Kristukat" />
<person posts="1" size="2" who="Paul McNett" />
<person posts="1" size="2" who="Dave Pickles" />
<person posts="1" size="2" who="(David.Goodenough)" />
<person posts="1" size="2" who="Ferenc Wagner" />
<person posts="1" size="2" who="Rein Klazes" />
<person posts="1" size="2" who="ArchAngel_Nix" />
<person posts="1" size="1" who="Gerald Pfeifer" />
<person posts="1" size="1" who="Peter Hunnisett" />
<person posts="1" size="1" who="Duane Clark" />
<person posts="1" size="1" who="Enrico Horn" />
<person posts="1" size="1" who="(fenix)" />
<person posts="1" size="1" who="Andreas Mohr" />

</stats>

<section 
	title="News: Linux Desktop Consortium" 
	subject="News"
	archive="http://www.pcworld.com/news/article/0,aid,109266,00.asp" 
	posts="1"
	startdate="08 Feb 2003 00:00:00 -0800"
	enddate="14 Feb 2003 00:00:00 -0800"
>
<topic>News</topic>
<mention></mention>
<mention>Jeremy White</mention>
<mention>News</mention>

<p>Looks like a new advocacy committee is in town - the Linux Desktop
Consortium.  What makes this notable (from a Wine perspective) is
that CodeWeaver's Jeremy White is the interim chairman.  PC World has
an article discussing 
<a href="http://www.pcworld.com/news/article/0,aid,109266,00.asp">the
role of the new organization</a>.  Anyone else not excited?</p>

</section>



<section 
	title="Code to Test / Learn With" 
	subject="Good source of test case source?"
	archive="http://www.winehq.com/hypermail/wine-devel/2003/02/0315.html" 
	posts="1"
	startdate="08 Feb 2003 00:00:00 -0800"
>
<topic>Documentation</topic>
<mention></mention>

<p>Dan Kegel gave a pointer for anyone looking for code snippets
to test or learn Windows programming:</p>
<quote who="Dan Kegel"><p>

So where should a developer go to find good code snippets
when writing Wine regression or compliance tests, without
running afoul of copyright laws?
</p><p>
One possibility is 
<a href="http://www.codeproject.com">http://www.codeproject.com</a>.
Their submission page, 
<a href="http://www.codeproject.com/info/submit.asp">
http://www.codeproject.com/info/submit.asp</a>, quite clearly states:
</p><p>
<blockquote>
"If you post to CodeProject then you retain copyright of your article and code.
You also give CodeProject permission to use it in a fair manner and also permit
all developers to freely use the code in their own applications.  ...
You are more than welcome to submit code that is already published at
another site, provided you own the copyright on that article, and provided
you have not given the other site exclusive rights to your article."
</blockquote>
</p><p>
That sounds like code at CodeProject is fair game.
Do other (smarter) people agree?  I ask, of course, because I'd
like to make sure it'll be ok to submit a testcase based
partly on CodeProject code.
</p></quote>


</section>




<section 
	title="Clipboard Implementation" 
	subject="X11 Clipboard implementation"
	archive="http://www.winehq.com/hypermail/wine-devel/2003/02/0379.html" 
	posts="10"
	startdate="12 Feb 2003 00:00:00 -0800"
>
<topic>Integration</topic>
<mention>CodeWeavers</mention>
<mention></mention>

<p>Mike Hearn looked at the clipboard code and wasn't 
happy with what he found:</p>

<quote who="Mike Hearn"><p>
I've been poking around inside the wine clipboard system, in an attempt
to make it properly compliant with the agreed upon specs over at 
<ul><a href="http://www.freedesktop.org/standards/clipboards.txt">
http://www.freedesktop.org/standards/clipboards.txt</a></ul>
</p><p>
At the moment, Wine mixes up CLIPBOARD and PRIMARY, which is not a good
idea. Ideally, Wine would work like GTK, Qt, Mozilla and all the rest
do, which is to keep CLIPBOARD for ctrl-c, ctrl-v type operations, and
primary for selected text/middle click.
</p><p>
When you select some text in say notepad, both CLIPBOARD and PRIMARY are
grabbed, which is wrong, only primary should be grabbed. In a similar
fashion, when you select Edit | Copy only CLIPBOARD should be grabbed.
</p><p>
Currently, selecting text in Wine doesn't do anything (at least, not in
notepad). So, the obvious way to fix that would be to introduce a new
Wine-specific API, that lets the Wine controls call SetSelectedText or
something, which then interfaces with X.
</p><p>
So, I think x11drv/clipboard.c should be changed to basically eliminate
references to PRIMARY, as without the ability to deal with middle clicks
and grab-on-select, Wine has no business changing that selection.
</p><p>
Therefore my questions are:
<ol>
<li> Should I try and hack up a patch to stop wine using PRIMARY?</li>
<li> What are the rules governing new wine specific APIs. I know the DLL
Separation work is supposed to eliminate them, but there are no FAQs
anywhere on it that I can see, could somebody explain this please?</li>
</ol></p></quote>

<p>Ulrich Czekalla wrote back to say he was already working on
changes to the clipboard:</p>
<quote who="Ulrich Czekalla"><p>
 You may be able to hack some of the controls to support text selection
 but you won't be able to do it for the general case. For example this
 wouldn't work in Word. So I don't see this working. In fact it could
 break assumption made by the application. In my opinion, the only way to
 copy data from a Windows App to X is via control-c/Clipboard API. 
</p><p>
In Windows, to copy data you generally need to select the data (Under X
this would grab the PRIMARY selection) and then hit control-c (Under X
this would grab the CLIPBOARD selection). 
</p><p>
In think we should always be grabbing both PRIMARY and CLIPBOARD and
releasing them when we loose either (ClearAllSelections=1). This seemed
to be the least confusing for many users as well. 
</p><p>
I'm in the process of finishing a large clipboard patch for CodeWeavers
that should also address the dll separation issues. Hopefully I'll get
the patch together soon and post it to the list.
</p></quote>

<p>Mike didn't like the idea of grabbing both and thought the spec
was pretty clear on this.  Ulrich wrote back to explain the
reasoning:</p>
<quote who="Ulrich Czekalla"><p>
 As you pointed out, if we can't use text
 selection to pass data via PRIMARY (because Windows apps don't allow
 this) then it follows that we should only use CLIPBOARD. But when I
 select and copy text from Word, I want be able to paste it into my
 xterm! I find this to be a common complaint.
</p><p>
 I guess in Wine we have been simulating the selection of data into
 PRIMARY by assuming that if you copied data into the clipboard you
 probably selected it.
</p><p>
 Your right though, Wine apps may be somewhat unique but at the end of
 the day its behaviour is non-standard. What does everyone else think?
 This is one area that most people will have an opinion :)
</p></quote>

<p>Mike didn't think the problem was with Wine though,
<quote who="Mike Hearn">
If xterm can't use the CLIPBOARD selection then it's broken I'm afraid.
gnome-terminal for instance can use both (shift-ctrl-v pastes
clipboard). I guess Konsole is similar. The solution isn't to break
wine, really it's to unbreak xterm (or for you to use a different
terminal emulator).</quote></p>

<p>Several people went back and forth about using the middle mouse
button to paste text from the clipboard.  No conclusion was reached
but it was pointed out that supporting it would be difficult, if
not impossible, simply because the middle mouse button may be used
in an application.  I guess we'll wait for Ulrich's patch and see
if anything noticably misbehaves.</p>  


</section>




<section 
	title="Smatch" 
	subject="smatch, something like the Stanford Checker"
	archive="http://www.winehq.com/hypermail/wine-devel/2003/02/0333.html" 
	posts="2"
	startdate="09 Feb 2003 00:00:00 -0800"
	enddate="10 Feb 2003 00:00:00 -0800"
>
<topic>Debugging</topic>
<mention></mention>

<p>Michael Stefaniuc gave a pointer to a program he thought could
be useful:</p>
<quote who="Michael Stefaniuc"><p>

i always dreamed to have something like the Stanford Checker for Wine
and some days ago i've seen on freshmeat 
<a href="http://smatch.sourceforge.net/">smatch</a>. It's a 
project from KernelJanitors and
it seems useful, at least it's worth an entry on Dimi's janitorial
page.
</p><p>
A short description:
<ul>
Smatch is basicaly a patch to gcc-3.1.1 that makes the gcc dump out it's
internal represantation of the code and a set of perl modules/scripts to
ease the parsing of the dumped code. Most of the perl scripts are for
the Linux Kernel but writing new scripts seems to be easy. I wrote
(well, mostly adapted an existing script for the kernel) one script
<a href="http://people.redhat.com/mstefani/wine/smatch/enter_leave.pl">
http://people.redhat.com/mstefani/wine/smatch/enter_leave.pl</a>
(if we decide to adopt smatch it should probably go to 
<tt>$wine/tools/smatch/</tt>)
to find code path with missing LeaveCriticalSection's. Scripts to find
some other usefull things like fd, DC, GDI obejects leaks should be easy
to write.
</ul></p></quote>

<p>Michael went on to write some test scripts, located some problems,
and submitted patches to correct them.  Dimi added it to his
<a href="http://www.dssd.ca/wine/Wine-Janitorial.html">Wine Janitorial</a>
page.</p>



</section>





<section 
	title="Testing for Unimplemented Functionality" 
	subject="CreateNamedPipe questions"
	archive="http://www.winehq.com/hypermail/wine-devel/2003/02/0420.html" 
	posts="5"
	startdate="13 Feb 2003 00:00:00 -0800"
>
<topic>Testing</topic>
<mention></mention>

<p>Dan Kegel had a question about how a test 
should perform on different platforms:</p>
<quote who="Dan Kegel"><p>
Oddly enough, it looks like it's ok to pass
NULL as the filename to CreateNamedPipe.
Anyone know what programs do that, and why?
</p><p>
Here's a patch that makes our CreateNamedPipe check
for legal filenames (or NULL).  It should probably
allow forward slashes...
The patch also adds a quickie regression test,
but I still have to use late binding for CreateNamedPipe
(or is it ok for the test to fail on win9x?).
</p></quote><p>

Francois Gouget pointed out a workaround for the test
failing:</p><quote who="Francois Gouget"><p>

 Tests should succeed on all Windows platforms. For platforms where
the API is not supported, the individual checks should be skipped.
Typically this involves either:
<ol>
<li> either using GetProcAddress if the API is missing altogether on some
platforms</li>
<li> of calling the API and testing for the error code, usually
ERROR_CALL_NOT_IMPLEMENTED</li></ol>
</p><p>
CreateNamedPipe{A,W} exists on Win95 so at most you will need something
along the lines of 2.
</p></quote>



</section>

</kc>

