summaryrefslogtreecommitdiffstats
path: root/ganv/canvas.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-24 22:07:24 +0000
committerDavid Robillard <d@drobilla.net>2012-04-24 22:07:24 +0000
commit3051e646d3f9b75d7fbc9ace3cc11966e9536274 (patch)
tree6187317200f284fe884cc92e3da45d6f8ffa527f /ganv/canvas.h
parent47e38b43ea9a56ef3a4fa4655e9c54d7c52d1d0d (diff)
downloadganv-3051e646d3f9b75d7fbc9ace3cc11966e9536274.tar.gz
ganv-3051e646d3f9b75d7fbc9ace3cc11966e9536274.tar.bz2
ganv-3051e646d3f9b75d7fbc9ace3cc11966e9536274.zip
Move more implementation to C GanvCanvas.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4265 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ganv/canvas.h')
-rw-r--r--ganv/canvas.h73
1 files changed, 69 insertions, 4 deletions
diff --git a/ganv/canvas.h b/ganv/canvas.h
index 352c13c..829b8e2 100644
--- a/ganv/canvas.h
+++ b/ganv/canvas.h
@@ -63,6 +63,10 @@ GType ganv_canvas_get_type(void);
GanvCanvas* ganv_canvas_new(double width, double height);
+/**
+ * ganv_canvas_resize:
+ * Resize the canvas to the given dimensions.
+ */
void
ganv_canvas_resize(GanvCanvas* canvas, double width, double height);
@@ -90,10 +94,6 @@ ganv_canvas_remove_edge_between(GanvCanvas* canvas,
double
ganv_canvas_get_default_font_size(const GanvCanvas* canvas);
-/** Get the current font size in points. */
-double
-ganv_canvas_get_font_size(const GanvCanvas* canvas);
-
void
ganv_canvas_set_font_size(GanvCanvas* canvas, double points);
@@ -118,6 +118,22 @@ ganv_canvas_for_each_node(GanvCanvas* canvas,
GanvNodeFunction f,
void* data);
+void
+ganv_canvas_for_each_selected_node(GanvCanvas* canvas,
+ GanvNodeFunction f,
+ void* data);
+
+/**
+ * ganv_canvas_for_each_edge:
+ * @canvas: The canvas.
+ * @f: (scope call): A function to call on every edge on @canvas.
+ * @data: Data to pass to @f.
+ */
+void
+ganv_canvas_for_each_edge(GanvCanvas* canvas,
+ GanvEdgeFunction f,
+ void* data);
+
/**
* ganv_canvas_for_each_edge_from:
* @canvas: The canvas.
@@ -151,6 +167,55 @@ ganv_canvas_for_each_edge_on(GanvCanvas* canvas,
const GanvNode* node,
GanvEdgeFunction f);
+/**
+ * ganv_canvas_destroy:
+ * Remove all items from the canvas.
+ */
+void
+ganv_canvas_destroy(GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_select_all:
+ * Select all items on the canvas.
+ */
+void
+ganv_canvas_select_all(GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_get_zoom:
+ * Return the current zoom factor (pixels per unit).
+ */
+double
+ganv_canvas_get_zoom(GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_get_font_size:
+ * Get the current font size in points.
+ */
+double
+ganv_canvas_get_font_size(const GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_set_scale:
+ * Set the zoom and font size for the canvas.
+ */
+void
+ganv_canvas_set_scale(GanvCanvas* canvas, double zoom, double points);
+
+/**
+ * ganv_canvas_get_move_cursor:
+ * Return the cursor to use while dragging canvas objects.
+ */
+GdkCursor*
+ganv_canvas_get_move_cursor(const GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_move_contents_to:
+ * Shift all canvas contents so the top-left object is at (x, y).
+ */
+void
+ganv_canvas_move_contents_to(GanvCanvas* canvas, double x, double y);
+
G_END_DECLS
#endif /* GANV_CANVAS_H */