-Don't include unistd.h unconditionally as it's not available in Visual
Studio, but include io.h where necessary.
-Avoid C99isms, and use _chsize_s in place of ftruncate when unistd.h is
not available (as in the case of Visual Studio)
We can't really know the client side keymaps, so we use the keysym
as the hardware keycode (essentially claiming to have a keyboard with
one key for all possible keysyms). This is not ideal, but its hard to
do better with no knowledge of the client side keyboard mappings.
(And html keyboard events suck badly...)
This just runs:
for i in *.[ch]; do
sed -i s/DisplayX11/DisplayBroadway/g $i;
sed -i s/PrivateX11/PrivateBroadway/g $i;
sed -i s/ImplX11/ImplBroadway/g $i;
sed -i s/KeymapX11/KeymapBroadway/g $i;
sed -i s/ScreenX11/ScreenBroadway/g $i;
sed -i s/GdkX11Monitor/GdkBroadwayMonitor/g $i;
sed -i s/_X11/_BROADWAY/g $i;
sed -i s/x11/broadway/g $i;
done