diff options
Diffstat (limited to 'ganv')
-rw-r--r-- | ganv/Canvas.hpp | 1 | ||||
-rw-r--r-- | ganv/canvas.h | 13 | ||||
-rw-r--r-- | ganv/wrap.hpp | 5 |
3 files changed, 19 insertions, 0 deletions
diff --git a/ganv/Canvas.hpp b/ganv/Canvas.hpp index 88211d4..4a83de2 100644 --- a/ganv/Canvas.hpp +++ b/ganv/Canvas.hpp @@ -84,6 +84,7 @@ public: void remove_edge(Edge* edge); METHOD0(ganv_canvas, arrange); + METHODRET2(ganv_canvas, int, export_image, const char*, filename, bool, draw_background); METHOD1(ganv_canvas, export_dot, const char*, filename); METHODRET0(ganv_canvas, gboolean, supports_sprung_layout); METHODRET1(ganv_canvas, gboolean, set_sprung_layout, gboolean, sprung_layout); diff --git a/ganv/canvas.h b/ganv/canvas.h index 83e3f8a..e923f65 100644 --- a/ganv/canvas.h +++ b/ganv/canvas.h @@ -378,6 +378,19 @@ void ganv_canvas_arrange(GanvCanvas* canvas); /** + * ganv_canvas_export_image: + * + * Draw the canvas to an image file. The file type is determined by extension, + * currently supported: pdf, ps, svg, dot. + * + * Returns: 0 on success. + */ +int +ganv_canvas_export_image(GanvCanvas* canvas, + const char* filename, + gboolean draw_background); + +/** * ganv_canvas_export_dot: * * Write a Graphviz DOT description of the canvas to a file. diff --git a/ganv/wrap.hpp b/ganv/wrap.hpp index f4f2e9c..f907dea 100644 --- a/ganv/wrap.hpp +++ b/ganv/wrap.hpp @@ -76,6 +76,11 @@ private: \ return prefix##_##name(gobj(), a1); \ } +#define METHODRET2(prefix, ret, name, t1, a1, t2, a2) \ + virtual ret name(t1 a1, t2 a2) { \ + return prefix##_##name(gobj(), a1, a2); \ + } + #define METHODRETWRAP0(prefix, ret, name) \ virtual ret name() const { \ if (gobj()) { \ |