And life gets a little better

January 27, 2009

You know the feeling. You’re happily sitting there, coding away at some graphics or other code in C+GObject, and then comes the point where you need to add a signal to your object. But your object doesn’t have any signals yet, so you have to go find and copy the boilerplate. Ok, not a big deal, you say to yourself, it only takes a minute or two. Then you notice your signal takes multiple parameters, and thus you need to generate a marshaler.

At that point you go to add one to your foo-marshal.list file, only to realize you don’t have one yet! Now you need to copy a chunk Automake boilerplate, and apparently if you want to do it really correctly it involves three times as much boilerplate involving stamp files and other monsters.

It’s around this point you’re probably thinking that finding medieval torture devices and using them on yourself on live television would be a less painful remunerative occupation than programming. But there is hope – the awesome jdahlin wrote a patch. The problem – it’s not in GLib yet, and it’s unclear when it will be.

So maybe you don’t buy into the the pitch about polyglot applications yet, but the new GObject Introspection release, because it already depends on libffi, contains a slightly tweaked version of jdahlin’s patch, known as gi_cclosure_marshal_generic. Depend on introspection, and never deal with marshalers and other torture devices again!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: