IRC Whiteboard

August 24, 2004

Let the record show…

I’d just like to state, for the record, that Owen Taylor has sullied his
fancy-pants GTK engineering self. Not content merely to perpetuate and even initiate nasty hacks on python internals,
his lust for for evil not sated by working on an IRC bot. No! Owen had to go
and work on an X-Chat plugin. Is this really a man you’d trust your widgets
with?

Whiteboard!

So a number of us (owen, colin, jrb, bryan, blizzard, j5 and myself) hacked this weekend on an allegedly multiprotocol whiteboard that currently supports direct TCP connections and, most notably, IRC. Hopefully we’ll get jabber support and gossip integration too. There’s an X-Chat plugin for it. There’s also a plugin for SupyBot for keeping a whiteboard with persistent state sitting on a channel. It doesn’t look pretty atm, but its a pretty good technology foundation.

Despite my constant bitching and moaning about having to implement the whiteboard protocol in the model, its actually pretty cool. Clients broadcast actions to create/delete generic objects or modify their properties. Currently we only support text and stroke objects, but it should be pretty easy to add others to the system now that the base infrastructure is in place. The protocol looks something like this:

  WHITEBOARD [channelname] 0+ <create ><text requestId="[uuid]" x="0" y="0", text="Hello"/>

If you’re using the SupyBot, it serves as the authoritative “master client” and echoes back actions if it accepts them or rejects them. The client-side model (this is the part I’m obsessed with because its where I spent most of my time) journals actions it initiates, and can snoop the channel when other clients broadcast (so you don’t have to wait for the server to echo, reduces latency which is important w/ IRC rate limiting) but only commits the changes as authoritative when the master client confirms them (otherwise they are rolled back).

I’m particularly proud to be able to say that I’m doing transaction stream compression by smooshing sequential modifications together before comitting them to the journal. “Look mommy, I’m Hans Reiser!”. OK, so its not really that hard, but it sounds 31337. Humor me, ok?

Code is in CVS module ‘whiteboard’. Its all written in python with pygtk and shouldn’t need anything special to work except for Cairo and pycairo. Now that we’ve done a good pass at the base pieces I think the actual drawing bits will get some more love/features in the next few days. High on my list are: erasing (*cough*), variable line width, hand-drawn-shape smoothing, and a highlighter. I’ve also got most of the pieces done for adding graphics tablet support. All that should be pretty easy except maybe shape smoothing (just don’t know how hard the algorithms for doing this are).