Small Stakes

Tonight I released version 2.17.90 of the GNOME Utilities package.

It’s not just another release: it marks the end of the work on the interactive dialog of the screenshot utility:

GNOME Screenshot Interactive

Now every command line switch is replicated on the interactive dialog that comes up when you launch the screenshot utility either from the menu or from the command line using the --interactive switch; each setting is taken into account, so calling gnome-screenshot --interactive --delay=5 --window --border-effect=border will change the UI accordingly (this very command line produced the dialog above).

This point release also marks the beginning of the work for the next development cycle; instead on working on the main trunk, I’ll open branches for the features I plan to add to the various components of the Utilities package:

  • plugin support for the System Log Viewer; this has already been written by the (great and incredibly patient) Lin Ma from Sun, but it still needs some cleaning up;
  • local sources for the Dictionary; as above, there already is a patch but needs to be cleaned up;
  • a new save dialog for the Screenshot utility;
  • add an area selector for the Screenshot, so you can pick a specific part of the desktop;

I’m also considering dropping the Dictionary applet from the Utilities, as its functionalities are pretty much covered by the plugin of the deskbar applet, and the deskbar applet is considerably more worth your panel space. The only thing that keeps me from removing the applet is that the deskbar applet is written in Python, and this might be an issue for slower machines; I could move the applet out of tree into its own package and let the distributions or the single users pick it up.

What I would really like to do in the next cycle is to revive GFloppy. At the moment, is compiled conditionally and it’s pretty much useless unless you have a floppy drive and the floppy utilities installed (it can use HAL to check for the available drives, but HAL doesn’t have the ability to programmatically format a volume); since not many computers come with a floppy drive anymore, I’d like for someone with HAL knowledge to pick GFloppy up and find a way to make it work with removable devices, like USB or flash solid state memories. Otherwise, I’ll have to consider dropping GFloppy too, as I don’t have a floppy drive anymore and can’t obviously maintain an application I can’t test.

Finally: if you have a small utility you deem useful enough to end up into the Utilities package, send me an email and propose it for inclusion.

Wonderboy

A couple of days ago, thos wrote about the branding of the GNOME System Monitor; soon after that, a bug was opened about the image – how the colour was off for every non-blue theme, and how it went against the GNOME logo branding rules – and the image was removed. I liked the branding, though; and so did Luca Cavalli – so much, actually, that he wrote a patch for having the image coloured depending on the theme and with a full GNOME logo:

Themed System Monitor Image

According to him, the patch still needs some clean ups, but I think now it would really be a great thing to have in the System Monitor for GNOME 2.18. Update@2007-01T09:44: the patch has been attached to bug #377144.

Well That Was Easy

After a bit more than six months of work, Clutter 0.2.0 is finally out!

We put a lot of effort in making the API a bit less rough around the edges, and adding new features at the same time. Like the new Behaviour objects which can be used to control multiple actors using a function of time; or the fixed point API, which should make Clutter work fast even on embedded devices; or the Pango integration, which should keep the texture memory usage low and give you all the features of pango. On top of that, there’s the new memory management semantic of the actors – now working like GTK+ widgets: now you just ave to add an actor to a group, and the group itself will be responsible of deallocating the memory when the group gets destroyed.

Along with the core library there’s a GStreamer integration library, which you can use to add audio and video support to a Clutter application; a Cairo integration library, for drawing directly on a Clutter texture actor; and, obviously, Perl and Python bindings, so that you don’t have to use C to use Clutter.

Clutter is still a work in progress, and we at OpenedHand hope to add even more new features in the 0.3 development cycle – some of them are already planned and in the works right now. What we need are application developers willing to use Clutter and telling us what we need to add to Clutter to make it rock even more.

John Saw That Number

Thanks to Ross and his mad python-fu skillz, now we have a working Python binding for gtkunique – for the brave souls which may want to use it.

The repositories locations have been changed, after the servers update at OpenedHand, so here’s where the fun is:

  trunk:  bzr branch http://folks.o-hand.com/~ebassi/bzr/gtkunique
  python: bzr branch http://folks.o-hand.com/~ebassi/bzr/pygtkunique
  perl:   bzr branch http://folks.o-hand.com/~ebassi/bzr/gtkunique-perl

Testing is greatly appreciated.

gtkunique future: GtkUnique is API frozen, and feature complete as far as I’m concerned (bug fixing and eventual feature requests notwithstanding). I’ve opened a bug for integration into GTK+: #378260. You can watch it and give your opinion there.

The Engine Driver

Here we are again with the Dictionary hacking; I left my development trunk with barely enough time to close crashers and brown paper bags patchs, and now I’m finally able to return working on it.

Here’s an interesting bug, about the poor discoverability of the look up process. First of all: discoverability? Is that even a word? Who the hell filed that bug? Opened by Emmanue… ehr… looks uncomfortably away.

Anyway, linguistic issues aside, the issue is interesting: some complained that the old Dictionary had a BFB and the new Dictionary has, well, nothing – the word is searched by activating the entry. This makes sense if you are typing the word, but it breaks down if you are pasting a word into the entry as you have to reach out for the keyboard and press enter. The idea was adding a “Go” button, removable by turning off a knob inside GConf. Then I realised that the label bound to the entry could be removed in favour of a button with no relief; it would keep the current appearance of the Dictionary while adding the “mouse-only” interaction requested (and by having a mnemonic, you can also activate the entry using the button’s mnemonic tag). It’s an experiment: the bug I linked has a full patch for the button+GConf knob (courtesy of Stephen Cook, kudos to him), so if people are going to throw themselves out of the window, I’ll gladly forget my solution and apply the patch.

Another couple of squashed bugs: you cannot edit a dictionary source and even if you could, the advanced settings do not work anyway. Both these bugs are really missing implementations of existing features: the source editing was mostly in place before the code freeze of GNOME 2.16, while the advanced settings required two widgets (the database chooser and the strategy chooser) that weren’t ready in time for the UI freeze of last January. Now that I have written both widgets and that I have time to finish what I started, the source dialog has been overhauled, and it allows choosing the database and the matching strategy for the chosen source, both when adding and when editing it.

strategy chooser

Speaking of the strategy chooser, I’ve added it to the sidebar, and like the database chooser allows you to set a matching strategy for the session, so you can use the default strategy (the same set for the source) or whatever strategies the source supports; I’ll add a “reset and use the default” button, which is also currently missing from the database chooser.

Here’s the real tricky bug: adding the speller widget to the dictionary applet. I thought about it, and how integrating the speller inside the applet, now that we have that widget. While inside the application having a sidebar makes sense, the same doesn’t not hold for the applet, as it would make it really big. For this reason, I added the speller widget (and every other page inside the sidebar) as pages of a notebook; you can switch between each of them using a drop-down menu – effectively making the whole applet work like the application’s sidebar.

As for the new features: four months ago I began hacking on a parser for the DICT file format, which is used to store a database (a single “dictionary” in a dictionary source) for dictd to use. It took a bit to get ahold of the actual format, but once found I wrote a small parser object, modelled on the GKeyFile object used to parse the desktop entry files. You can use it to load the dictionary and the index from data, or from file; you can just preload the index or load everything; you can even begin with an empty object, fill stuff and write it down. Unfortunately, it doesn’t support compressed files – but it should be enough for closing this bug, and work as a base for the StarDict dictionary parser (this I’ll have to write really from scratch, as the C++ parser code sucks horribly).

dictionary with syntax highlighting

Finally, from the old-dictionary-feature-ported-to-the-new-dictionary department, the syntax highlighting has come back! Well, not entirely: just the links and the phonetics have been reinstated, and links still don’t work. Links are colored using the gtk-link-color style property, which is also used by link buttons and the like (if your application renders hyperlinks or something like them, please use that style property!). The reason why I disabled the syntax highlighting was that there’s no formal definition for the dictionary syntax: it really can break at any given time – as you’ll see when using it; also, the highlighting code was really messy, so I had to rewrite it and that took time.

All of this is going to hit HEAD this week or so.

There are plenty of other bugs lying around in Bugzilla, though; I hope to have more time during December to look at them and squash some more; but you know the drill: if you have your own pet bug scratch an itch and provide a patch. ;-)

Twist The Knife

Dear LazyWeb:

I’m trying to clean up the python bindings for the next release of a GObject-based library, so I’m using pygtk and its codegen magic; unfortunately, being codegen.py an incredibly bad program, I can’t see why or how it’s failing to read the .defs and .override files, and why it doesn’t generate anything. Is there a way to have some sort of error message or information except for the quite useless statistics recap? I’m using the same build system used by pygtk, so this must work if you apply enough bad mojo somewhere. I don’t want to dwelve into the 1707 lines of dense python – I’d rather spend my time binding a library.

Thanks.

Three hours, and many curses, later: it seems that I have mistakenly deleted a '%%' between a ‘ignore-blob’ declaration and the body of the override file. This, for posterity, is logically equivalent to “ignore whatever exists after this space”. which is, all in all, logically coherent, and I’m more than willing to beat my head against the wall for my stupidity. But if codegen.py had a “verbose” mode (instead of me sprinkling the code with “print” statements) I would have found this way sooner than the three hours it took me. A simple line redirected to stderr telling me “hey, I’m ignoring this and that” would have been sufficient.

Song for Sunshine

I just made two releases for gnome-utils: the first is 2.16.2, another release in the stable branch, which fixes a couple of bugs in Baobab and Screenshot that were also fixed in HEAD and deemed important enough to be backported.

The second release is – finally – 2.17.0, the first release of the new unstable release cycle which will lead to gnome-utils 2.18.0.

The major change in this release is in Baobab, which acquired the new, spiffy, cairo-based ringchart view, thanks to the hard work of Fabio, Paolo, Alejandro and Miguel. Baobab also dropped the search option, which mostly replicated the Search Tool already included in gnome-utils. Baobab user interface was cleaned up, its memory consumption was reduced and many bugs were fixed.

The other modules in gnome-utils got some love, but not much; my development tree still doesn’t build well and it’s not ready for inclusion in HEAD, but I plan to work on it before the next release.

As usual, download, test and file bugs.

Little Earthquakes

After two weeks without working on it, this evening I finally returned to GtkUnique and finished the bacon-like backend. Now, beside using D-Bus and Xlibs, you can use Un*x sockets as an IPC method to send a command to a running instance of an application which is using GtkUnique.

Next items in the TODO are:

  • Add more documentation on the protocol used in the three backends;
  • Fix the Perl bindings;
  • Finish and publish the Python bindings;

In the meantime, you can grab GtkUnique 0.5.0 here or pull it from the bazaar repository.

Love and Communication

For the Google Summer of Code, Vytas Liuolia wrote the (very much needed) guniqueapp library; just a small recap: libguniqueapp allows the creation of single instance applications, that is applications that gets instanced once and each subsequent instance just quits – or send a command to the currently running instance.

Libguniqueapp has two available backends: D-Bus, as default, and bacon (a Un*x socket living in /tmp and used to send and receive commands). After reading about guniqueapp on desktop-devel-list, I began hacking on it in order to add a new backend, using X itself as an IPC mechanism.

Single instance applications are used on the desktop (Gedit, Mozilla, Epiphany, Evince – the list goes on), but are very interesting for an embedded device because of the the memory and/or screen real estate limitations. On the Maemo platform, for instance, this issue has been solved by having each application behave as a D-Bus service: each time an application is launched a new object on the bus is created and subsequent instances just abort. Not every embedded platform uses (or can use) D-Bus, though, hence the need for anothe IPC mechanism – like the Xlibs-based backend.

In the process of adding this new backend I’ve accidentally broken the whole guniqueapp codebase; I know, I’m really sloppy at the times. Reassembling the pieces together using GTK+ coding style (which, even though it uses the evil 2-spaces indentation from hell, I actually prefer using when programming using GObject/GTK-based stuff) and clearly hiding the backend stuff under the carpet, something else came out of it – GtkUnique.

GtkUnique is pretty much similar to guniqueapp, except that:

  • the backend implementations have been more cleanly separated and hidden in helper libraries;
  • there’s an Xlibs-based backend, which is preferred right after the D-Bus backend;
  • the IPC channel is bidirectional; that is: the message sent from a second instance to the first instance of the application has a return code, in case the operation that has been requested failed;
  • the D-Bus backend has been changed: the name of the application is used as the object on the bus, so you don’t have awkward stuff like org.gnome.GUniqueApp.YourApp but something a bit more friendly like tld.your-company.YourApp;
  • also in the D-Bus backend, the SendMessage message has been changed: it now accepts a stringified command, which is the “nick” value of the GtkUniqueCommand enum object; this way you can send commands like activate or new instead of integers on the wire;
  • the GtkUniqueApp object keeps track of the top-level windows of the application;
  • I’ve added API documentation using gtk-doc;
  • Perl and Python bindings are in the works;

You may think of GtkUnique as a fork of guniqueapp; really, it’s more of an experiment I wrote to get more aquainted with Xlibs (for instance: now I learned the hard way that you must remember to use XSelectInput() on a window to get the PropertyNotify events) and D-Bus programming. I intend to use GtkUnique inside the next release of the Dictionary and inside another project of mine, so I’ll keep on working on it.

If you want to play with it, just pull the bazaar repository from here:

  main:  bzr branch http://o-hand.com/~ebassi/bzr/gtkunique
  perl bindings: bzr branch http://o-hand.com/~ebassi/bzr/gtkunique-perl

and there’s a tarball available here

Note on the library: the libbacon-like backend is broken at the moment, as I’m still playing with it.

Note on the bindings: I’ll add the branch for the python bindings as soon as I have them in a buildable state. The Perl bindings are very rough at the moment – the make test phase fails and while you can send a message from a Perl application to a C application sharing the same name, you can’t do the opposite.

Special Delivery

I almost forgot – this should tell you how bad a maintainer I am ;-) – but Lennart’s blog reminded me: the ringchart code hit Baobab HEAD:

Baobab Ringchart

The ringchart view is really nice – even though I still very much like the treemap – but the real improvements are in Baobab’s user interface, which got streamlined and made simpler. Kudos to both Fabio Marzocca, Paolo Borelli and to all the people at Igalia who worked really hard in order to make the next stable release of Baobab rock.

I did not package a gnome-utils tarball in time for 2.17.1, as I’m still working on my development tree for both the dictionary and the screenshot tool; but since I got a couple of bug fixes (backported to the stable branch) I plan to do a 2.16.2 release this weekend and a 2.17.1 before the end of the month. In the meantime: grab a snapshot from CVS and test away!