So... first-time post; been playing around with Nimrod for a little while now, and liking it.
I wanted good fast graphics and drawing primitives, so I wrote a binding for Cairo (http://www.cairographics.org):
This is generated by c2nim and then tweaked somewhat. The full set of APIs for cairo version 1.12.2 is included. The few that I've used so far work -- there's an example that draws an analog clock onto an SDL2 window (requires cairo and SDL2 installed).
License is MIT (cairo is dual LGPL/EPL); hope it can be useful! Any suggestions are welcome.
The full set of APIs for cairo version 1.12.2 is included.
Nice. I am also interested in bindings for latest cairo. As you may know I recently wrote some simple GTK3 wrappers and noticed that some cairo symbols where missing. (Recently I started making bindings for latest GLIB 2.40, but it will still need some time to finish...)
Generally I am asking myself if it may make sense to have true "first class" bindings available -- bindings where foreign objects are handled by the garbage collector, and where subclassing of foreign objects is possible. C++, Ruby, Vala and GoLang have such kind of bindings, but much glue code seems to be necessary. For GTK3 my feeling is, that such "first class" bindings bring not much benefit. What do you think about cairo? Or does your bindings even support that already? It would be nice to have at least for one package such a "first class" wrappers as an example available.
Best regards,
Stefan Salewski
Hmm, not sure how I missed that! Definitely don't need two bindings.
I'll try out the one that's there, if it's got everything then no need for mine. And yeah, babel would be the right home.
@Stefan: I agree that an example of handling foreign objects in the nimrod system, would be good. I'm not doing that, at least not yet, this is just a straight up binding of C functions to nimrod proc names. The cairo pattern seems to be basically
so it's pretty easy to manage manually. But that's probably not ideal as soon as you start to have long-lived objects, or if you compose widgets that share a drawing context or something. Which is kind of where I want to go with this.