I’ve been meaning to post something for awhile, and just never seem to get around to it. But I’ve gotten a few emails from people asking about GtkOffscreenWindow, so I figured I should post something about it.

So last month there was a WebkitGTK hackfest in A Coruña, and that was really cool. Nice to see some friends again and to meet some cool new people.

People from the WebkitGTK hackfest

WebKitGTK Hackfest people at Torre de Hércules

We wanted to explore the possibility of rendering GTK+ widgets offscreen, rather than calling into the theming system to draw the widget. It turned out there wasn’t a convenient way to do this. There’s gtk_widget_get_snapshot(), but it seems to be more about taking screenshots of things that are displayed because you can’t really get a snapshot of something that you can’t already see. The window embedding stuff seemed a little low-level, complicated to setup, and in general not quite right for a task like this.

So now there is GtkOffscreenWindow. This is a totally offscreen, toplevel container widget that facilitates retrieving snapshots of widgets without them needing to be on the screen anywhere. You can setup a widget or a hierarchy of widgets and throw them in the container. You’ll have to wait until it’s processed an expose event, but then you can call gtk_offscreen_window_get_pixbuf() or gtk_offscreen_window_get_pixmap().

I must confess one obvious problem in this widget’s API, though. The widget derives from GtkWindow, but you should treat it as though it derives from GtkBin. This is kind of weird and unfortunate, but it’s for kind of internal reasons relating to the GTK+ theme system. If I (or someone else) is able to find a solution that can make the theming work correctly when this widget derives from GtkBin, then I will try to change it in GTK+ 3.0. So you’ve been warned!

The cool news is that GtkOffscreenWindow will be available soon in the upcoming release of GTK+ 2.20.

Gabriel and Fumika

And just before I left I got a chance to meet with Gabriel and Fumika, who both played violin in my old string quartet during undergrad. They are married now and live in A Coruña, and they play violin in the orchestra that is based there, Orquesta Sinfónica de Galicia. Interestingly, back when our quartet was together we were invited to perform at the opening of the Meadows Museum in Dallas and we had the opportunity to perform for the Spanish royal family. It was really nice to get to see them again finally and to see their children, Claudio Kenta and Lidia Aimi.

So I must say, the trip was really awesome. It was great to meet everyone, great to do some hacking. Thanks to the GNOME Foundation for sponsoring people and the event, thanks to Igalia for hosting the WebKitGTK hackfest, and thanks to Canonical for giving me a few days off to go and hack on open source with other people!

I feel like the only person who isn’t so excited by the N900. It looks like a beautiful device, and it’s built on the current Maemo platform that I’ve always liked and there’s so much to be excited about. But I’m not.

I feel like we’ve been wanting Nokia to make this device since Maemo was first released. They released an Internet tablet, and I figured maybe it’s just to get the platform out the door. Fine. But then they release another Internet tablet, and then another. They were cool devices, but I had no use for them. I just never wanted to carry around yet another device.

I’m not trying to start any discussion about the toolkits, that’s not at all the point. It’s just confusing that they would never make a useful device that anyone really cares about until after they’ve declared an end to the platform. Now that they have a device I want to buy, there’s no point in buying it since it appears to has no future.

July 6, 2009GeneralComments Off on ECMA C# standards community promise

Only a few days ago Richard Stallman was speaking here at the Gran Canaria Desktop Summit and the subject of Mono inevitably came up. There was heated debate between Richard and others in the community. His position seemed to be that Mono was an important tool for migrating foreign software to a free platform, but it should be discouraged for use in developing new free software, regardless of technical advantages, because he was unconvinced that we would be allowed to continue using it (that Microsoft would sue us and require us to stop using it, etc).

I had the opportunity to ask him a question about this, which was something roughly like, “Is there anything Microsoft could do or say that would resolve some of the uncertainty around this issue?” I was very happy that Richard’s response was “yes”, and he went on to say how Microsoft could be more clear in their position of allowing free implementations of C#.

Interestingly, news regarding the C# standards were released today that will hopefully clear up things for people who were not convinced before. Undoubtedly there will be haters who continue to hate, but I really will be interested to see what Richard’s position will be after this (not that his position will affect mine, but I’m still curious).

So GLib and GTK+ have officially moved from svn to git this week. I had been doing some work in my own git repos, but they were based on various git-svn checkouts and they were all hashed differently, so it wasn’t possible to just merge from one of them into the new official git repos.

It turns out that it’s quite easy to merge your history over, though. Here’s what I did.

Say there is an old git repo with a branch called new-awesome-stuff. You want to create a branch in the new git repo with the same name, and merge the history over.

There’s been some interest in getting some of the features from Christian Hammond’s awesome libsexy merged into GTK+, and I’m happy to report that some progress is finally being made on this. I just committed support for icons in entries into GTK+ a few minutes ago, and this will be available in GTK+ 2.16. This is based on SexyIconEntry, but supports some additional cool features that weren’t in SexyIconEntry. Some new things:

Set icons from pixbufs, stock items, GIcons, and icon names

Control sensitivity of each icon

Tooltips on icons

Drag and drop with icons

It’s also more memory efficient now, allocating the data and subwindows on demand. This is important since the new feature has been merged into GtkEntry itself rather than providing a new widget, and would more than double the size of every GtkEntry otherwise.

There’s been a lot of talk on the Gtk# mailing lists about the lack of a 2.12 installer for Win32. I finally took the time to roll a new MSI installer for Gtk# 2.12.3. But Medsphere is not using Gtk# 2.12, and we’re not planning to use it any time soon so I don’t think we really want to provide support for 2.12, or for 2.14 once it comes out, until we’re actually using them.

My long-term plan has been that I want to get gtk.org distributing its own official msi/msm installers for each component of the stack. Then other projects, such as gtk# or any gtk+ app, could consume the msm installers for their own msi containers.

Boston Summit is coming up pretty soon, and Brad and I plan to take the opportunity there to try to get Medsphere’s installer code into shape to do this and then push it into an upstream svn module, probably on Gnome’s svn.

Megan and I went to the House of Blues in Dallas last night for the Raconteurs concert there. It was really awesome! Birds of Avalon opened for them. I had never heard of them before, but I thought they were okay. They had a funny gimmick where they have these little plastic birds, that I guess are battery powered since their wings could flap quickly, and the lead singer would turn them on and throw them out into the audience during one of the big instrumental sections of one song near the end. The Raconteurs came out later and it was the best show.. they did some stuff from their first album, and the new album, and a few songs that they have never recorded yet. Lots of fun. And House of Blues is a cool place, except that they charge you $5 for a can of beer.

Now that things have settled down a little at work, we’re finally in the process of moving to gtk# 2.10 now. One of the cooler things that we can finally use now is the Gtk printing system. Previously we were using Gnome.Print on Linux and System.Windows.Forms.PrintDialog on Windows, which sucked for various reasons that you can probably guess. Obviously what we really needed was something we could use easily from both Linux and Windows.

Gtk.Print to the rescue! Except that it didn’t work on Windows yet. But in Berlin Behdad pointed me to #488833, to add support for cairo_win32_printing_surface to GTK. So once I got home I finished up the patch and it’s now committed to gtk+ svn trunk. Since it requires a new (and unstable) version of Cairo I can’t commit this support to gtk-2-12 branch, so I think I’m going to have to maintain a branch for Medsphere’s use.

This doesn’t solve print preview, though, so that’s the next thing I want to work on.