pavouk/lgi — pull request #21 by psychon (2012-07-12 14:55:00+00:00)
Title: Fix various errors in the cairo bindings

The commit message should explain this well enough:

I went through the list of cairo functions in override/cairo.lua and compared
each one with cairo's source code. This patch fixes the various inconsistencies
and errors that I spotted.

Also, I removed the 'since' attribute for the mesh pattern constructor, because
the all of the mesh patterns already have the right since attribute.

The binding for cairo_recording_surface_create() is still flawed.

There is a special behavior for its second argument being NULL. I don't know how
something like this can be expressed in lgi (it creates a new cairo_rectangle_t
when I call the function with a nil argument, doesn't it?).

I have one more (unrelated) question:
Would you be interested in more "since" attributes? The code seems to assume at least cairo 1.10 currently. That's almost two years old and should be 'good enough'. I just wondered about this when I saw you adding that "since" magic for the mesh pattern bindings (great trick btw!).

Oh and when I said 'one', I meant 'two':
How extensive should the test suite be? I think some of the problems here could have been found by tests which call each functions at least once ("does it crash?"), but for others it might be necessary to do some more intensive tests. Would you want me to invest time in writing lots of tests?