All the Old Showstoppers

okay, new rule ((apologies to Bill Maher)): it’s okay to install a GObject property like this:

pspec = g_param_spec_string ("title",
			     "Title",
			     "The title of the item",
			     NULL,
			     G_PARAM_READWRITE);
g_object_class_install_property (gobject_class, PROP_TITLE, pspec);

instead of the usual way you see in other GObject-based libraries, where we l33t h4x0rs dispense from the use of an explicit GParamSpec variable. this is especially true if you are trapped in 1983 and are still using an ANSI 80×25 terminal — though you should probably know that here, in 2008, 100+ columns are safe.

oh, and fill out the name and blurb fields of the property: GObject provides a little bit of introspection, but if you willfully ignore it then we can just forget about stuff like the GObject-Introspection project.

please, every time you install a property using a line like this:

g_object_class_install_property (
	gobject_class, PROP_TITLE,
	g_param_spec_string ("title", NULL, NULL, NULL,
	                     G_PARAM_READABLE | G_PARAM_WRITABLE));

an unfortunate incident will involve a bucket of puppies and a belt sander.

comments saying “gobject sucks you should be using ${ZEALOTS_OWN}” will be deleted without mercy because they miss the point by a hundred and fortyseven miles

In the Mood

well, I failed at blagging each day of the User Experience hackfest, but mostly because of the sheer amount of discussions, designs and work done.

during the first common session on monday we all decided to split off into four groups:

  • file management
  • window and application management
  • widgets/gadgets/applets
  • effects and animations

I decided to work on effects and animations, along with Eve, Neil, Matthew and Andreas ((who’s totally getting married — just as vuntz is expecting a baby)). the wiki page of our group lists most of the stuff that came up in the group discussions and brain storming ((or idea showering)). when not in the effects and animations group I was hanging around with the window and application management guys. since Tomas, Robert and Matthew have been working on a Clutter-based compositor for Metacity, I decided to give it a spin and work on some of the “animation tenets” that came up during the hackfest — like showing the direction of the workspace switching and provide a visual cue to the user that the windows are not going away forever, and are just being moved in another area of the screen. I know that Compiz is probably going to have these kind of effects some ten levels deep in the configuration manager, but the configuration UI always makes me want to carve my eyes out with a melon spoon while being bludgeoned to death, and the defaults are usually so bad that I develop seasickness after 15 minutes of continuous use — hence, the usage of the Clutter-powered Metacity.

the other groups did an awesome job as well: a lot of the ideas floating around will require hard work and time in order to be implemented, but they all contain a refreshing view of the desktop and challenge some of the fundamental tenets of the user interaction, based on the feedback from users and designers — and especially without resorting to something completely new or alien that will require years to get right for developers and to adjust the workflow for users, or just announcing new frameworks with the usual jingoistic tones common to open and closed software projects alike.

Flying Teapot

final checks and the usual ohmygodwhycan’tIfindanything mode before I take the flight to Boston for the User Experience hackfest organized by Owen, Federico and Vincent. Neil and I will be talking about Clutter, what it does, and what it can do to enhance the user experience on a modern desktop.

then, it’s Boston Summit time! it’s going to be my first summit, but given the past editions and the people attending I just know it’s going to be awesome.

see you in Boston!

Shiny

Tweet!

courtesy of Ulisse Perusin, Tweet now has a rocking icon.

since 0.2 has been released, I’ve also added:

  • a status icon to show error messages and the number of new statuses inside a tooltip; when clicking on it, it will bring up the Tweet window and, more importantly, it will disappear until the next update.
  • key navigation, which required a new release of Clutter-GTK
  • better word wrapping and dimensioning of the cells in the ListView
  • open up the browser when clicking on the user’s icon in the status information overlay

there are still features I’d like to work on before 0.4.0, but all in all current HEAD of master looks fairly stable and useful. if everything goes according to plan, I’ll spin 0.4.0 before GUADEC, and 0.6.0 after I port Tweet to the new shiny Clutter 0.8 API.

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+ environment ((in the screencast the scrollbar handle color, for instance, comes from the theme as well as the font));
  • 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 view ((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)); 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.

Some Things Come From Nothing

json-glib: 0.6 is out! please: download it, test it, use it. as far as I know, it has been packaged for Debian unstable, and has entered the NEW queue (kudos to Rob Bradford, esquire and fine gentleman).

debian: with the release of Hardy I decided to switch back to Debian after three years of Ubuntu. even though there are still some rough edges in Lenny, the support for laptops has definitely improved a lot and so I got back to my old love. starting from Gutsy, I found myself increasingly at odds with Ubuntu decisions and even though I upgraded my wife’s laptop to Hardy, I’m really glad I got back to Debian.

clutter/1: apparently, I’ll give a lightning talk about our reference toolkit for Clutter at this year’s GUADEC, in Istanbul. Øyvind proposed it for me because, regardless of being on the paper committee, I actually forgot the deadline for the CFPwhoops, maybe I shouldn’t have said that. :-) with the Tidy lightning talk and the Clutter guts talk given by Matthew, we decided for a high-level/low-level approach, instead of going for the usual this is teh Clutter, look at teh bling kind of talk. if you want to understand Clutter, Matthew’s talk is definitely where you want to be; as we all know:

Clutter = Clean and nice API + Performance + Portability + Integration = ♥

from my Clutter talk at FOSDEM

so, if you want to know how Clutter creates love, get to Istanbul this July. :-)

tweet: I started eating my own dogfood. Tweet is by no means complete or even guaranteed not to turn you into a goat and eat your breakfast — but now it works well enough for reading your own timeline and sending new statuses; and it doesn’t require trunk of anything any more, thanks to a Tidy transplant. I’m using Tweet as a way to see what kind of API is needed to properly integrate a Clutter canvas into a GTK+ application: colors, fonts, etc. if you want to try it out, contribute or just mock my insanity:

  git clone git://github.com/ebassi/tweet.git

clutter/2: we’re really close to a 0.7 release, which will mark the beginning of the slushy phase of the API; as far as documentation goes, we’re in pretty good shape already, at 93% for the Clutter namespace, and another 80% for the Cogl namespace. bindings will need to be updated — but the amount of new API is not that big, so it’s not going to be a long wait. I’m making a note here: huge success.

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.

Good Intentions/2

gtk+: I’ve been working again on the RecentManager and in trunk you’ll see some new stuff, namely:

  • use GIO to determine the MIME type of a URI, on every platform supported
  • use the file monitoring API to avoid polling the storage file
  • add a GtkSettings property for clamping the recently used resources list to a 30 days limit

more stuff I’d like to add is:

  • small parser changes to GBookmarkFile, to reflect changes in the spec
  • bulk addition, for applications storing multiple items when quitting
  • new API needed to follow the usability review in bug 349541
  • moving the RecentItem icon code to GIO, and add API to extract the thumbnail

twitter: I’ve been using Twitter a lot in the past two weeks; it’s nice, it makes it easier to copy and paste a quote or a thought, and the 160 characters limit is an interesting challenge. As it’s been ages since I last wrote an application ((lately all I’ve been doing was writing libraries)), I decided to start writing a Twitter reader/writer — using GTK+, Clutter and Tidy; without much thinking, I opened gvim and started writing code in C ((hey, that’s what I do for a living, it’s hard to switch off; plus, I could reuse some of the platform libraries)) — so, the obvious thing that happened was that I ended up writing a library yet again in order to use Twitter’s web API. luckily for me, libsoup has now a really nice API to work with; all you need is GET and POST to their RESTful API, retrieve the result, parse it through JSON-GLib, hide everything inside a new GObject and you have a wrapper around a web service. the application, you say? oh, I was sure I forgot something. well, it’s coming along — it just needs some work still.