Thursday, March 12, 2009

Twitter client with inkface-pygame v0.2.2

Here is an update on the Inkface library. But before that let me give a background of the project for the benefit of new readers that will be reading this post via Planet Maemo.

Inkface is an SVG based GUI framework. Unlike the desktops - where GUI components need to be keyboard/mouse friendly; the handheld GUIs need to be finger friendly. Therefore the handheld GUI components should be naturally manipulatable - like parts of an image. Therefore inkface provides a framework in which, GUI is composed in an image editor like Inkscape, instead of rigidly coded in the program. The various elements of SVG image are presented as python objects to the programmer who can then write his program logic using these elements as widgets.

The current version of inkface uses pycairo for vector graphics rendering and uses pygame as backend surface to draw on. A clutter backend is in the plans.

With that background, let me show a demo of an app that I designed (in Inkscape) and coded (in python) using inkface-pygame library v0.2.2. It's a twitter client. The demo shows how the GUI can be changed vastly by merely changing the SVG files and doing no change in the code at all. (the --theme option tells the app to just use a different set of SVG files) The first one is the default theme and the later has a vintage look.



The whole GUI consists of only 2 SVG images (corresponding to 2 screens - login and main twits page). So to create a new theme one only needs to create/change these two SVG files in Inkscape. Compare this to the traditional approach where a theme consists of tens of PNG images of specific sizes.

I was aiming to release it as an app for diablo, but I had to postpone the plan. For improving the performance during animation, I used pygame's features that are only available in v1.8.x and I later found that Diablo ships with pygame v1.7.x. So I need to work around this incompatibility before I release it for n8x0 devices.

For more information on the project check out the wiki. You can download v0.2.2 tarball from here. It is pure python code and can be tried on desktop. For details on the changelog of v0.2.2 check my post on the mailing list here.

2 comments:

thp said...

Neat. I wonder how the performance on N8x0 is. Maybe you can post a video of this app running on your N810?

Also, is there some way of having an on-screen keyboard for N800 users?

Jayesh said...

> Maybe you can post a video of this app running on your N810?

I am definitely going to post a video of this running in Dialo SDK. However, unfortunately I have lost my n810 to a pickpocketer last month :(( [I know. It's hard to get over]

I am trying to see if I can get inkface-pygame working on my Neo Freerunner, that will at least give me some feel of how it performs on real hardware.

I will release the deb packages for all to try and hopefully someone will report back after trying it on their n810.

> on-screen keyboard for N800 users?

Yeah sure. I have designed virtual keyboards with every version of inkface. For the inkface-pygame there is a simple animated keyboard with three themes available under tests directory (inkface-pygame/tests/keyboard.py)