Hi Christian, On Fri, Jan 27, 2012 at 11:44:55AM +0100, Christian Kellermann wrote: > Hi all fans of cairo bindings, > > * Christian Kellermann <[email protected]> [120117 21:06]: > > * Markus Klotzbuecher <[email protected]> [120115 18:02]: > > > Is this branch available somewhere? I would prefer a correct but > > > untested version to my wrong but coincidentally working one :-) > > > > I am not sure yet what's best. What I am using now is this: > > > > > > (define %fill-matrix > > (foreign-lambda* (c-pointer cairo_matrix_t) > > ((f64vector v)) > > "cairo_matrix_t *m = malloc(sizeof(cairo_matrix_t)); > > int i=0; > > m->xx = v[i++]; > > m->xy = v[i++]; > > m->yx = v[i++]; > > m->yx = v[i++]; > > m->x0 = v[i++]; > > m->y0 = v[i++]; > > C_return(m);")) > > > > (define (cairo-transform/matrix ctx v) > > (when (not (= (vector-length v) 6)) > > (error "Vector size mismatch should be 6, is " (vector-length v))) > > (let ((m (%fill-matrix v))) > > (cairo-transform ctx m) > > (free m))) > > > > (define new-matrix > > (foreign-lambda* cairo_matrix_t () > > "C_return(malloc(sizeof(cairo_matrix_t)));")) > > > > There is still a freeing operation missing, I tend to use the > > cairo-transform/matrix procedure most of the time though. > > > > What do others think? > > Markus did you have a chance to have a look at the code? I would > love to release a new cairo version. If there are any missing > features on your wishlist, please let me know!
I unfortuately did not have any time to look into this so far. I hope to give it a try towards the end of the week. One (low priority) thing on my wishlist would be support for writing to svg files. I suppose the latter would be largely a duplication of the png code, but I have not looked into it yet. Thank you for your effort! Markus _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
