Since someone at http://gravity24hr.com/berdp/ leaked my test build
without making sure they had the sources to comply with the GPL,
since anyway I'll have to do it someday,
here is the full monty:
Consider this one as a WIP.
Now, before anyone jumps on screaming like mad about putting a C++ file
in the CVS, as if C++ was an horrible decease, let me say :
no there is no other way than C++. The BeOS API *is* in C++ for all
that matters, so it's mandatory. I just hope that won't give birth to a
stupid troll as it did on ffmpeg-devel when I asked to put a .cpp file
in their CVS, which now nobody even notice about.
Please note there is only one (big) cpp file, and I don't intend on
adding more (except probably one for sound stuff), the current policy
being to make as less modifications as possible to the existing and put
the rest in there.
Some modifications on x11stubs aren't definitive, it's just one way
that works, if anyone has better suggestion, go on. Mostly it's about
read=5Fkeyboard=5Fstate(), which isn't used for BeOS (the state value is
still passed on but unused), I think #ifndefing its body to avoid the
XQueryPointer might be simpler. Anyway I think XQueryPointer is still
needed for rdp2vnc (though I didn't try to build it), I found odd that
it wasn't there already.
The .rdef file is used to add icons and some other infos to the binary.
Btw, I have those 16x16 and 32x32 icons available as XPM files too,
might be nice to use them for Gnome maybe. I just did them with the
convert ptog fro ImageMagick from the homepage logo.
I didn't include keysym.h, though I think it wouldn't hurt having in
there, since it's not something that will change a lot...
Btw, also note that BeOS applications are always multithreaded.
(one thread is spawn for each window)
Currently the input handling is done from the window thread
(=3Dnot the main thread), including the calls to rdp=5Fsend=5Finput().
I didn't notice any problem with that, as it seems the input and
drawing stuff are cleanly separated. Except sometimes a recv error
'connection reset by peer', though I'm not sure it comes from that.
The drawing part on the other hand is called from the main thread,
after locking the view we draw on, which is against regular design of a
BeOS application, as it's supposed to be drawn on in the window thread,
thus the warning in the comments. But it works fine.
I also noted a strange behaviour with SHIFT-arrows: the arrows are sent
after unasserting SHIFT, so one can't select text with the keyboard. I
believe this comes from xkeymap.c, though I didn't test the X1 version
against that. Any confirmation =3F