Bubble service

From Solipsis

A service for displaying speech, thought and action bubbles on the wxclient's viewport. Bubbles are associated with a peer and may have a predefined lifespan.

bubblescreenie.png


At present, the project is mostly a learning exercise. I am releasing it because it may be useful to other non-core developers who are interested in developing service plugins. It demonastrates a way (if not the right way) to:

  • Plug in to the service framework
  • Interface with the wxNavigator viewport to adorn peer avatars
  • Send and receive service messages via the Solipsis network

I would like to improve the educational value of the code, so please submit suggestions and patches. (Use Talk:Bubble service for now.)

Table of contents

Releases

bubble-0.1

WARNING! This plugin executes data from the wire ("eval(wire_data, {'__builtins__':{}})"). I think this is done safely... You might not.

License

This distribution may be used for any purpose, including repackaging and redistributing under a new license.

Download

Download bubble-0.1.tgz (http://mkp.ca/~mike/bubble-0.1.tgz)

Install

Extract contents of archive to your "main" folder. Ie, the folder that contains "twistednode.py" and "navigator.py". Then start or restart your navigator.

Usage

Whenever you enter a message in the chat window, it will appear in a bubble above your avatar in the main window. So will messages from other people with the bubble plugin. Chat messages from people without the plugin do not appear in bubbles.

To do

There may be cases where threads are crossed (eg, when the chat plugin's UI thread calls sendBubble). Seems to work.

The dirtied rectangle size is misreported by the painter.

The wire protocol is a joke -- SORRY! Turns out Marshallable isn't for what I thought it was for.

Text in bubbles is not wrapped, formatted or truncated. This includes bubbles sent over the wire; packet bounds could easilly be exceeded.

It would be nice if bubbles were composed of segments which could expire independantly and have distinct styles.

Prerelease

To do

Before a version is publicly released, the protocol needs to be improved. Presently, a raw string is sent. Need to send a marshallable containing style, lifespan, content, and maybe fg/bg colours.

Not going to spend much effort on rendering until it's clear we're stuck with wx for the long term.

related web sites