Delivering the killing blow to libgnome

Getting rid of the libgnome[ui] dependency and of all the legacy stuff that it brings in has been a work in progress for many gnome applications. While replacing some old cruft has been very easy as soon as a proper replacement was put into GTK+ itself, there are a bunch of things for which figuring out what to do is not so clear… Now that we are at the start of the 2.22 cycle I’d like to get some feedback on the status of these things.

As you can probably guess I’ll take gedit as a case, but I think it is pretty much the same for many other applications. In order of importance, libgnome is still needed for:

  1. Bug-Buddy integration: gnome-program offers integration with our automated bug reporting infrastructure. This is something we cannot do without. I seem to understand that there has been work to make bug-buddy work as a gtk module or something, but it is absolutely not clear to me what is the current status. Is it already in gnome 2.20? How does it work? Do apps need to do something? Can I just drop gnome-program and things will work?
  2. gnome_authentication_manager_init() is another thing that we cannot absolutely avoid, otherwise remote file access will not work. I guess gio/GVFS comes into the picture here, but once again an executive summary on what to do for applications developers would be nice.
  3. gnome_accelerators_sync(): this may look pretty trivial (and in fact the function itself is pretty simple and easily reimplementable with gtk calls, however it is not clear to me what kind of magic gnome-program does on initialization to restore the edited shortcuts. Any suggestion is welcome.
  4. Displaying the Online Help: as far as I know gnome_help_display() is just a function that spawns yelp with the proper arguments, however it’s a bit silly to manually reimplement that in every app… what are the plans of Yelp/Rarian developers in this area?
  5. gnome_icon_lookup() is used to lookup an icon for a given file/mime type. Once again this fairly easily cut&pasted locally however I think we really need to put it somewhere our library stack: it is a common operation for many apps. GTK+ itself reimplements it internally for the file chooser and the recent manager, though unfortunately for some files it gives different results (as far as I recall libgnome does some special casing for some files).
  6. gnome-session: I know there is a new implementation of session saving in libegg, but it is not clear if it is still developed and targeted at gtk inclusion.

Unless I am missing some other magic feature that gnome-program provides, that is everything that libgnome[ui] is needed for (I am intentionally leaving out migration from gnome-print to gtk print stuff and from gnome-vfs to gvfs, since they are separate issues).

Will we manage to put the nails in libgnome’s coffin for 2.22?

GtkSourceView 2 API frozen

With yesterday night release of GtkSourceView 1.90.5 (which will likely become 2.0 next week) we consider the API frozen and in the future releases only API additions will happen.

Honestly we hoped to have more early adopters so that we could have more feedback on the API changes, but I can understand how painful it is to track a library that it is a bit of a moving target :)

Anyway, now it’s a good time to start porting your app to GtkSourceView 2 and an even better time to bind it to your favourite language (Python bindings are already available). Why? Because you get a way more accurate syntax highlighting and because you get support for style schemes.

I will not go into the details of the API changes (most of it should be straightforward), my advice is just to be careful with the memory management of the LanguageManager and StyleSchemeManager: unless you want to do advanced stuff like a style scheme editor or use two separate highlighting contexts in the same app, you should probably stick to the singletons provided by GtkSourceView itself.

That said, I should also point out that there are a few feature regressions with respect to GtkSourceView 1 and anyone getting ready to port his app should be aware of that:

  • Printing support was dropped: GtkSourceView 1 depended on gnome-print which is now deprecated, this days printing should be done with gtk itself.
  • GtkSourceMarkers were dropped: they were pretty much the only API that is not exercised by gedit and we didn’t feel comfortable enough with the API to set it in stone.

We are more than willing to reintroduce these features back in 2.2 (though printing is a bit of a gray area since bits of it really belong to gtk itself), but we need feedback from the apps using the library to get the API right!