Pogo Stick

apparently, some people — and I’m looking at you, Pippin — said that the Tweet repository is hard to find: you actually have to search in my blog.

well, not anymore: Tweet on GNOME Live

complete with a screenshot of the new UI, as suggested by Matthew Allum:

Tweet - Pogo style

Road to Somewhere

well, after eating my dog food for a while, it seems that Tweet is starting to get more useful.

first of all, now Tweet has an authentication dialog which allows you to enter your username and password the first time you run it:

Authentication/1

and even verify them beforehand:

Authentication/2
Authentication/3

then you get the list of statuses from the people you’re following:

Loading

you can scroll around using your mouse, and tap a row to get more informations about the status and the user:

Navigation

click on the screenshot…

as you can see, the UI is geared towards the touchscreen usage, but I plan to add key navigation soon.

still, there’s a lot to add: support for viewing your own statuses, direct messages, the list of people you’re following and the people following you — even the error messages are just printed to the console, even though I’m working on that.

the bits I’m most proud of:

  • the GTK+ integration: I’m retrieving the style information straight from the GtkWindow embedding the Clutter stage, and even if I had to fight with the utter mess that is the themeing code, I was able to gather enough to make Clutter play nice with a GTK+ environment1;
  • the small animation API I implemented on top of the Clutter animation framework, requiring a single function (plus two completely generic classes) to tween an actor between two states; for instance:
    tweet_actor_animate (info, TWEET_LINEAR, 250,
                         "y", tweet_interval_new (G_TYPE_INT, y + padding, 100 + padding),
                         "height", tweet_interval_new (G_TYPE_INT, 10, (height - (100 * 2))),
                         "opacity", tweet_interval_new (G_TYPE_UCHAR, 0, 196),
                         NULL);
    

    this is the code that animates the status information actor that appears overlayed on top of the status view2; I’d like to thank pippin for the idea about the API behaviour;

  • Twitter-GLib, the generic API for accessing Twitter throught its RESTful API, which thanks to LibSoup has been a breeze to write even in a clunky and not-at-all-web-two-point-oh-buzzword-compliant language like C;
  • the fact that Tweet is written in a very reusable manner (apart from the base scrollable list which comes from Tidy), with every piece neatly abstracted into its own class.
  • finally, the fact that after almost a year of basically working on libraries only I can still sit down and get an application from scratch to a usable state in a couple of weeks in my spare time — even if I have to write a library to get it done. :-)

by the way: is any artist out there interested in making an icon for Tweet? I really would like to avoid using Twitter’s own icon.

  1. in the screencast the scrollbar handle color, for instance, comes from the theme as well as the font []
  2. this kind of utility API is easy to achieve given the power and flexibility of the underlying framework — but it obviously limits what you can and cannot do, and if you ty to coerce it into being more generic you start losing bits and pieces and a simple API starts getting in your way instead of helping you; that’s why Clutter‘s animation framework might seem complicated at first: it’s trying very hard to allow you to build whatever animation you have in mind instead of limiting you []

Sincerest Forms of Flattery

tidy: they say that imitation is the sincerest form of flattery:

TidyFingerToggle

the actual amount of code is quite small, and it’s already available in Tidy.

challenges: Luca dared me into making a Clutter-based coverflow-like plugin for Rhythmbox, but it was Iain that picked the challenge up and wrote some basic code for it. I, on the other hand, don’t like coverflow for browsing my music collection, so I finally decided to write something for the Eye of GNOME — a Ken Burns effect slide show. it’s not at all finished, and if nobody picks it up, I’ll try and do my best to have it ready for GNOME 2.24, if EOG maintainers want it, of course. it’s not the best display of Clutter features — except the animation framework — but if you have hardware acceleration it will make slideshows look a lot nicer.

json-glib: this weekend I released the first developers snapshot of JSON-GLib 0.6; the API is stable, the test suite is rocking and this release finally fixes the last bit needed for full RFC 4627 compliance (Unicode escaping). I’m probably going to release 0.6.0 in a couple of weeks.

Helm, set a course… for love

a GNOME cruise? I already have the theme song…

GNOME-Love Boat, love exciting and new,
Come aboard, we're expecting you.

The GNOME-Love Boat soon will be making another release,
The GNOME-Love Boat promises something for everyone.

Set a course for adventure,
Your box's on a new romance.

And GNOME-Love
Won't hurt anymore,
It's an open source,
On a userfriendly shore.

it's GNOME-Love
Welcome aboard it's GNOME-love

When the Levee Breaks

Yesterday I decided to start working on the porting of the Gtk2::SourceView Perl module to the new upstream API. For my convenience, and because I know I’ll probably screw up, I decided to use a local git repository so I can experiment with all the branches I want before hitting CVS. Yes, you read that right: the Perl GTK+/GNOME bindings still use CVS on SourceForge.net1. Thus, I decided to import the whole gtk2-perl repository into a git one using git-cvsimport, and – lo and behold – after four hours of checkout, I got it on my machine, complete of full history.

The layout of the bindings modules is composed of a single CVS module and all the Perl modules are inside it; this is far from optimal with git2, so I proceeded to split up each Perl module into its own repository, with the help of git-filter-branch – a new command taken from the Cogito suite and added to the 1.5.3 release of git.

The filter-branch command is extremely powerful: it rewrites the history of a repository (which is a destructive operation) by passing a filter function on it. It has a set of predefined filters and contexts of operations, so what you need to do to split out a sub-directory into its own repository is call:

  $ git filter-branch --subdirectory-filter directory refspec

and after that you get all the files filtered out marked as new or modified, so you can use git reset --hard to get rid of them, and have your sub-directory contents as the only recognised content of the repository.

Unfortunately, you can’t really filter out a direct import of a CVS repository: git-cvsimport stores branches and tags, and filtering will most likely create dangling objects; so, what I did was cloning the original repository, to get rid of the local branches, and remove all the tags:

  $ git clone --no-hardlinks /tmp/gtk2-perl Gtk2-SourceView.git
  $ for TAG in `git tag`; do git tag -f -d ${TAG}; done

The --no-hardlinks switch is important for later – I have to thank Ricardo Signes for this tip; in short: it makes git use real copies instead of hardlinking files when cloning a local repository, and will make the garbage collection and pruning phases actually work and prune the unused objects from the git database.

At this point, I just filter-branched and reset:

  $ git filter-branch --subdirectory-filter Gtk2-SourceView HEAD
  $ git reset --hard

and then called:

  $ git gc --aggressive
  $ git prune

and finally obtained my local git repository of the Gtk2-SourceView module from the original CVS repository – with all the history on HEAD preserved. The good part is that the entire set of operations is very repetitive, so it’s suitable for scripting3. Yey for git! :-)

  1. there has been talk about moving them to GNOME CVS, then to SVN, but in the end the maintenance burden would be too high, and some of the members of the team would need at least SVN accounts anyway []
  2. or any other SCM software that is not CVS, for that matter []
  3. I did write a small script which extracted every Perl module sub-directory into its own git repository – but it’s mostly 50 lines sugarcoating the core 5 lines of actual work []

Release Craziness

Tonight it was release time – when GNOME tarballs were due in order to allow 48 hours of smoke testing before the actual release, on January 18th.

I did the gnome-utils release, and decided to hang out a bit on #gnome-hackers – and I would have better had not to, since everything happened tonight.

FIrst comes Guilherme de S. Pastore: the newly-appointed gnome-terminal mantainer couldn’t make this release on time, and asked for someone to ship the code inside HEAD; since I love gnome-terminal (usually, I have a dozen terminals laying around on my dozen-workspace layout), how could I not help, after glancing at the bunch of bug fixes Guilherme did in the last two weeks? Also, he is on the Account Team and enabled my SSH account as fast as he could in the occasion of the last release day, so I had a huge debt of gratitude with him.

After the usual ./autogen.sh && make && make distcheck cycle and update, I made the release, and hung around a bit more on the IRC channel.

A mere two hours before the end of the timeline (23:59 UTC), three patches still had to be applied to libgnome, libbonoboui and libgnomeui respectively, and then make a release of those three libraries. In a moment of slight insanity, I began working on it. The madness began.

Each patch applied cleanly to its library; I began making a libgnome release, but noticed that the patch broke libbonobo – upon which libgnomeui depends. I already did a commit to the CVS, so I had to track the origin of the breakage. It was an included header (popt.h) that was conditionally included using a pre-processor macro, but the data structures defined in there were still used and not conditionally compiled out using the same check. In order not to break everything, I had to roll out a new version of libgnome – with the header file unconditionally included. Minutes flew while make distcheck run. Finally, the 2.13.7 release of libgnome was ready. I had to install it on my system in order to make libbonoboui compile: with a mere hour to go, I still had to roll a release for libbonoboui and a release for libgnomeui.

Libbonoboui compiled fine – my fix worked fine. While I was uploading the libbonoboui’s tarball for release 2.13.1, make distcheck run inside libgnomeui. Twentyfive minutes to the deadline.

Finally, libgnomeui finished its check and created the tarball of the 2.13.2 release. I did the upload less than fifteen minutes before the deadline was due.

I’ve never had this much fun: it was a run against time, and against my CPU. Also, I gained a certain degree of automatism when dealing with the release process of a GNOME package. But, seriously: never, never again.