Introducing: Clutter-vala!

Matthew Allum asked me to maintain the Clutter Vala bindings on the clutter repository and today we just moved the code and I added the test case for the actors to the source tree. You can read the announcement on the clutter blog.

OGG / YouTube

Now you can grab them from the official clutter repository:

$ svn co http://svn.o-hand.com/repos/clutter/trunk/bindings/clutter-vala/clutter

Or browse as well. I would like to thank Matthew and Juerg for being both very supportive maintainers of both Clutter and Vala.

Timeline Widget

I’ve been working on a generic time group selector widget, a similar widget to the one used on F-Spot. I’m implementing it in Vala so it can be reused for other languages/apps/libraries.

So far, it takes a data model that may contain a GDate field, and it generates bars with the amount of items of each month:

Obviously it needs some work, but it’s going pretty straightforward and it can be used as an example on how to create widgets with the Cairo bindings.

I’ve uploaded the code to a public git repository:

$ git clone http://www.gnome.org/~aruiz/vala/time-select.git

To test it, you only need to have vala installed (get the latest release) and just run make.

Jython reaches stable realse

As an accidental Java programmer, and as a Python lover, I’m really excited to realize that Jython 2.2 has reached stable status, releasing the first production release ever.

I’m really excited to see what’s going on on the Jython/JRuby front, although I would like to see as much progress on Jython as in JRuby (the NetBeans 6.0 integration is pretty neat). Not really because of the language, since I find Ruby pretty neat once you get used to it, but because I find Django more convinient if you want do delegate the templates to a html/css/js hacker instead of creating the view using sourcecode.

It would be nice to get the scalability and speed of Java (despite the startup time, Java web apps are in fact faster than php/python/ruby equivalents) on Python frameworks.

Go Jython, go! 🙂

Bind them all!

I’ve been working on some vala bindings lately. My main purposes is to reuse some opt components to create a proper PDF viewer with transition support for presentations.

Poppler!

To be able to load pdf documents in Vala, I’ve made poppler-glib bindings and a proof of concept app:

 OGG/YouTube

Binding Source: poppler-glib.vala

Test Source:     pop.vala

Clutter 0.4

I’ve updated the clutter bindings, I wanted to be sure that the api coverage and the bindings were alright, so I started porting the test suite to vala. So far I’ve succesfully ported the test-actors test, and despite some problems with the Math package and some minor tweaks, it works!

OGG / YouTube

Binding Source: clutter-0.4.vala

Test Source:     test-actors.vala

The binding generator of vala needs some love yet, it doesn’t convert GError parameters into throw statements and some functions are not properly wrapped. However, it does the 90% of the job pretty well, and with some tweaking, it’ll be even better soon.

The first vala browser.

Vala is a C# like language compiler that translate the source code into C. It’s intended to provide a higher level language to GLib/GObject/Gtk+ and friends.

Today, in more or less one hour, I’ve been able to write a GtkMozEmbed binding for vala. Note that I haven’t write a binding ever in my life before and despite that, it’s been pretty straightforward.

I’ve also wrote a small app to show the browser, and there we go:

Vala goes online!

To get the source code of what I did, take a look at #463438‘s attachments.

My conclusion here is that vala is really close to become a serious option to write platform libraries and applications instead of C within the Desktop, you get the best of both worlds, a high level language, and the C (non VM) performance, portability and easy of bind from other languages, and since vala adds some explicit object semantic, write bindings from vala code could be even more straightforward.

Another problem that it potentially solves is the pain of reuse code from others, most people tend to no inherit in GObject since it involves lots of annoying copypaste, which drive us to better integration and a better reutilization of the code.

Congrats to Jürg Billeter for such a bold and simplified approach.

Oh, by the way, did I say that this approach is binding friendly already? 😉

Clutter’s opt gets asynchronous

I’m trying to get asynchronous slide loading in opt to don’t waste so much memory while loading pdf presentations. (See o-hand‘s #410 to get the latest patch).

This is the first time that I do any kind of computer animation, and given the fact that my C skills are not any extraordinary, and that I did this hack in 1 hour (most of the time looking at others .h and .c to get used to the api). I think that we can say, from a empirical and scientific point of view that the Clutter API is extremely easy to use, in a nutshell, it rocks! (It also means, that our friends from openedhand rocks too).

The result is not any impressive, but I’m proud of it despite that, and that’s what matters the most:

YouTube / OGG

So far, what the patch does is create one slide per pdf page on the document and animate each actor on the slide. Next step is disallow the slide change until the pdf page is loaded.