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.

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.

Failsafe

About JSON-GLib: things have gone quiet on that front, but lately I’ve resumed working on it ((In a couple of separate branches, for the time being, but when those are ready, they will be merged back into master and will be released as 0.6.0)).

I decided to try the new GLib test framework that has landed in the 2.15 cycle; GLib and GTK+ are both already using it, and now a branch of JSON-GLib is GTest-powered. Setting it up is not hard – but it requires some changes in the build environment. The API is quite straightforward — just call:

  g_test_init (&argc, &argv, NULL);

inside your main, then add the test functions with:

  g_test_add_func ("/test-section/foo", test_function_foo);
  g_test_add_func ("/test-section/bar", test_function_bar);

and finally run the test using:

  return g_test_run ();

which will return the exit code used by the gtester program to determined whether the successfully test passed or not.

The test suite is built along with your library or application, but run only with make check and make distcheck. There’s also an automatic report generator which will dump an XML file with the results, which you can then parse to create HTML pages or other forms of report. The rest of the work is putting a set of pre-cooked declarations for the Makefile templates into the root of your project; including it in every Makefile.am file; create some tests directories; and dump there the test units. I bet that Anjuta or other IDEs with autotools support can be tweaked to do this stuff for you.

JSON-GLib is now using GTest to test the data types API (for the time being, Array and part of the Node) and the Parser behaviour; nothing very complicated, at first, but it’s good to have it all automated and a simple make away. Adding new test cases to exercise the whole API will be the priority in the next weeks.