GNOME Bugzilla – Bug 596656
[PATCH] Vala bindings for graphviz (libgvc)
Last modified: 2010-02-18 23:19:58 UTC
Created attachment 144193 [details] libgvc.vapi These bindings are not complete (graphviz is pretty big) but they are sufficient for many of the core use cases such as: * rendering graphs to PNG or SVG etc * extracting x,y coordinates (for custom rendering) * setting attributes on nodes and edges (including graphviz so called "HTML strings") You can also do these things without getting GCC compiler warnings etc. There is a code sample included in the top of the .vapi file for demo / getting started purposes.
Created attachment 144738 [details] [review] libgvc.vapi Here is a new version that includes the following improvements: * add VAPI for aginitlib (optional low-level initialization of graphviz) * change some return values from void to int (so errors can be read) * add Error namespace for graphviz error handling * add VAPI for layout_jobs/render_jobs (low-level functions used by valadoc code) * declare free_function for node/edge/graph and remove explicit free functions * add VAPI for Graph.read() function (used by valadoc code) The main reason for doing this improved version is to cover the graphviz sufficiently well to eventually convert Valadoc to this VAPI (they currently have their own VAPI locally in their GIT). I ended up not merging their VAPI into mine because I don't want to add stuff to the VAPI which I havn't tested and they seem to have a lot stuff "translated from C but never tested".
I think it might be better to go ahead and include everything so that people will be able to test them. We can just make it clear (on http://live.gnome.org/Vala/BindingsStatus) that the binding is experimental, and fix bugs as they are reported. Other than that, the only thing I would change is that some of your enum elements include the A prefix--it would be more vala-like to get rid of that and either use a cprefix on the enum or a cname on the member.
commit 629178ced95326c2161f61fabea3d231debe7711 Author: Martin Olsson <martin@minimum.se> Date: Thu Feb 18 15:14:01 2010 -0800 Add libgvc (graphviz) bindings. Fixes bug 596656.