GObject Generator

There has been recent talk about GObject Generators, so I’m going to throw my own one into the mix. It’s based on Ross’ gobject.py, but given a fresh dose of GTK+ and auto completion love.


If you’d like to try it out, there is a git repository available:

git clone http://gnome.org/~thos/git/gobject-gen.git

I’d like to move it to GNOME git, but before I do it needs a decent project name. Does anyone have any suggestions? Something descriptive but unique, preferably with only 2 syllables.

Kudos to the Anjuta GObject generator for the auto completion idea. Also, before any one suggests it, I know about Vala but we’re not using it for this project, so it’s of no use.

Vim Command of the Day

vim-editor_logo_bigger In the office we have two white boards that where going rather underused. Last week I decided to rectify this by drawing FOSS propaganda on one of them. On the same day, Damien (of Shave fame) happened to show us all a new Vim command we hadn’t used before, so I suggested we start a Vim Command of the Day sheet on the other white board. We’ve taken this into the 21st century as well, so anyone can follow Damien’s encyclopedic knowledge on Vim through the magic of twitter: @vcotwdorso (short for, “vim command of the week day or so”, because Damien didn’t want to be restricted to updating it just once a day)

Dear lazy web…

Does anyone know what’s happened to vim’s “comment” feature in Debian Lenny? It seems this feature is enabled (i.e. –version shows +comment) and the default string set, but it just doesn’t work. Does any one have any ideas?

Update: many thanks to Lubomir; the answer was that the ‘r’ and ‘o’ options where missing from formatoptions.

Dublin Hackfest

This week I am in Dublin for the GTK+ theming hackfest. On Monday we spent a long time throwing ideas around and discussing various approaches. Thankfully since then, we got on with some proper hacking. I’ve been working on two things:

cairo based engine api

Ben and I have been working on completely converting the default GTK+ theme to cairo so that it will be easier to move to a completely cairo based api for theme engines in the future. This would allow third parties to draw widgets without the need for a GdkDrawable, or even X11 itself.

Css styling in GTK+

Rob and I also discussed CSS themeing and how we might implement this within GTK+. We decided it would be good to implement a way of styling generic GObject types as not all objects on screen and GtkWidgets (e.g. GtkCellRenderer). We decided to make a GStylesheet object which acts as a data store (implemented as a GObject wrapper around libcroco, which we’ve also been enhancing) and a GStylable interface (which would replace the style properties in GTK+). Apart from allowing us to style any GObject with CSS, this also allows third parties to retrieve style properties without creating their own fake GTK+ widget.

I’ve just created myself an account on github, and am pushing my work from this week there: http://github.com/thos

New art.gnome.org

Just updated art.gnome.org with the art-hub branch. This is a move in a slightly new direction for art.gnome.org, trying to focus on helping artists wanting to get involved in artwork for GNOME and free software. The user submitted themes and artwork are still there and at some point I hope to go through and pick out some of the best ones to create a new gallery of top quality artwork for GNOME. Many thanks to Andreas for the new front page design and all those in #gnome-art who helped out with testing and made suggestions.

CSS Styling in Clutter

As CSS styling is becoming more and more popular in application design, I’ve been experimenting at work with applying this to Clutter. We already have an experimental widget set built on top of Clutter called Tidy. Using Robert Staudinger’s css selection engine and libcroco, I was able to apply style information from a stylesheet to Tidy widgets.

Images are also supported using the “background-image” property.

One big question for us was how many properties do we expose to CSS and how does it interact with the JSON functionality. For the moment, we are concentrating on using CSS to allow developers and designers to assign the same properties on many widgets. Internally, this is achieved using a “Stylable” interface and a Style object. The Style object is simply a data store that holds all the data associated with the CSS style sheet. The Sytable interface can be implemented by any GObject and used to install hooks for CSS properties. The Stylable object can query the Style and retrieve the values it needs.

An interesting aspect of this approach is that it doesn’t limit theming to just Widget derived classes. Any object can be made Stylable and obtain style data. This would be useful for other toolkits such as GTK+, where objects like CellRenderers currently cannot be styled in the theme because they do not derive from GtkWidget.