summaryrefslogtreecommitdiffstats
path: root/ganv/canvas.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-04-26 16:49:15 +0000
committerDavid Robillard <d@drobilla.net>2014-04-26 16:49:15 +0000
commit65b14544b89afc3a7d3a7de57e6ef15ca8165bd0 (patch)
treeaff9e8f19197c83df67ff723ea154b7573880cdb /ganv/canvas.h
parentfb3498abb00ed3cf5c5938fcb1bffef163674274 (diff)
downloadganv-65b14544b89afc3a7d3a7de57e6ef15ca8165bd0.tar.gz
ganv-65b14544b89afc3a7d3a7de57e6ef15ca8165bd0.tar.bz2
ganv-65b14544b89afc3a7d3a7de57e6ef15ca8165bd0.zip
Clean up Ganv API.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5367 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ganv/canvas.h')
-rw-r--r--ganv/canvas.h129
1 files changed, 69 insertions, 60 deletions
diff --git a/ganv/canvas.h b/ganv/canvas.h
index a3444dc..02219c1 100644
--- a/ganv/canvas.h
+++ b/ganv/canvas.h
@@ -60,7 +60,7 @@ struct _GanvCanvasClass {
GtkLayoutClass parent_class;
/* Reserved for future expansion */
- gpointer spare_vmethods [4];
+ gpointer spare_vmethods[4];
};
GType ganv_canvas_get_type(void) G_GNUC_CONST;
@@ -94,6 +94,28 @@ GanvCanvas*
ganv_canvas_new(double width, double height);
/**
+ * ganv_canvas_clear:
+ * Remove all items from the canvas.
+ */
+void
+ganv_canvas_clear(GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_empty:
+ *
+ * Return value: True if there are no items on the canvas.
+ */
+gboolean
+ganv_canvas_empty(const GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_resize:
+ * Resize the canvas to the given dimensions.
+ */
+void
+ganv_canvas_resize(GanvCanvas* canvas, double width, double height);
+
+/**
* ganv_canvas_root:
* @canvas: A canvas.
*
@@ -158,7 +180,7 @@ ganv_canvas_set_center_scroll_region(GanvCanvas* canvas,
* Returns: Whether the scroll region is being centered in the canvas window.
*/
gboolean
-ganv_canvas_get_center_scroll_region(GanvCanvas* canvas);
+ganv_canvas_get_center_scroll_region(const GanvCanvas* canvas);
/**
* ganv_canvas_scroll_to:
@@ -187,21 +209,6 @@ void
ganv_canvas_get_scroll_offsets(const GanvCanvas* canvas, int* cx, int* cy);
/**
- * ganv_canvas_get_item_at:
- * @canvas: A canvas.
- * @x: X position in world coordinates.
- * @y: Y position in world coordinates.
- *
- * Looks for the item that is under the specified position, which must be
- * specified in world coordinates.
- *
- * Returns: (transfer none): The sought item, or NULL if no item is at the
- * specified coordinates.
- */
-GanvItem*
-ganv_canvas_get_item_at(GanvCanvas* canvas, double x, double y);
-
-/**
* ganv_canvas_w2c_affine:
* @canvas: A canvas.
* @matrix: An affine transformation matrix (return value).
@@ -293,11 +300,19 @@ ganv_canvas_world_to_window(GanvCanvas* canvas,
double* winy);
/**
- * ganv_canvas_resize:
- * Resize the canvas to the given dimensions.
+ * ganv_canvas_get_item_at:
+ * @canvas: A canvas.
+ * @x: X position in world coordinates.
+ * @y: Y position in world coordinates.
+ *
+ * Looks for the item that is under the specified position, which must be
+ * specified in world coordinates.
+ *
+ * Returns: (transfer none): The sought item, or NULL if no item is at the
+ * specified coordinates.
*/
-void
-ganv_canvas_resize(GanvCanvas* canvas, double width, double height);
+GanvItem*
+ganv_canvas_get_item_at(GanvCanvas* canvas, double x, double y);
/**
* ganv_canvas_get_edge:
@@ -311,6 +326,15 @@ ganv_canvas_get_edge(GanvCanvas* canvas,
GanvNode* head);
/**
+ * ganv_canvas_remove_edge:
+ *
+ * Remove @edge from the canvas.
+ */
+void
+ganv_canvas_remove_edge(GanvCanvas* canvas,
+ GanvEdge* edge);
+
+/**
* ganv_canvas_remove_edge_between:
*
* Remove the edge from @tail to @head if one exists.
@@ -321,14 +345,6 @@ ganv_canvas_remove_edge_between(GanvCanvas* canvas,
GanvNode* head);
/**
- * ganv_canvas_get_default_font_size:
- *
- * Get the default font size in points.
- */
-double
-ganv_canvas_get_default_font_size(const GanvCanvas* canvas);
-
-/**
* ganv_canvas_get_direction:
*
* Return the direction of signal flow.
@@ -345,14 +361,6 @@ void
ganv_canvas_set_direction(GanvCanvas* canvas, GanvDirection dir);
/**
- * ganv_canvas_clear_selection:
- *
- * Deselect any selected items on the canvas.
- */
-void
-ganv_canvas_clear_selection(GanvCanvas* canvas);
-
-/**
* ganv_canvas_arrange:
*
* Automatically arrange the canvas contents.
@@ -374,7 +382,7 @@ ganv_canvas_export_dot(GanvCanvas* canvas, const char* filename);
* Returns: true iff ganv is compiled with sprung layout support.
*/
gboolean
-ganv_canvas_supports_sprung_layout(GanvCanvas* canvas);
+ganv_canvas_supports_sprung_layout(const GanvCanvas* canvas);
/**
* ganv_canvas_set_sprung_layout:
@@ -392,7 +400,7 @@ ganv_canvas_set_sprung_layout(GanvCanvas* canvas, gboolean sprung_layout);
* Return true iff the canvas is locked and nodes may not move.
*/
gboolean
-ganv_canvas_get_locked(GanvCanvas* canvas);
+ganv_canvas_get_locked(const GanvCanvas* canvas);
/**
* ganv_canvas_for_each_node:
@@ -417,14 +425,6 @@ ganv_canvas_for_each_selected_node(GanvCanvas* canvas,
void* data);
/**
- * ganv_canvas_empty:
- *
- * Return value: True if there are no items on the canvas.
- */
-gboolean
-ganv_canvas_empty(const GanvCanvas* canvas);
-
-/**
* ganv_canvas_for_each_edge:
* @canvas: The canvas.
* @f: (scope call): A function to call on every edge on @canvas.
@@ -483,18 +483,19 @@ ganv_canvas_for_each_selected_edge(GanvCanvas* canvas,
void* data);
/**
- * ganv_canvas_clear:
- * Remove all items from the canvas.
+ * ganv_canvas_select_all:
+ * Select all items on the canvas.
*/
void
-ganv_canvas_clear(GanvCanvas* canvas);
+ganv_canvas_select_all(GanvCanvas* canvas);
/**
- * ganv_canvas_select_all:
- * Select all items on the canvas.
+ * ganv_canvas_clear_selection:
+ *
+ * Deselect any selected items on the canvas.
*/
void
-ganv_canvas_select_all(GanvCanvas* canvas);
+ganv_canvas_clear_selection(GanvCanvas* canvas);
/**
* ganv_canvas_get_zoom:
@@ -520,6 +521,21 @@ void
ganv_canvas_set_zoom(GanvCanvas* canvas, double zoom);
/**
+ * ganv_canvas_zoom_full:
+ * Zoom so all canvas contents are visible.
+ */
+void
+ganv_canvas_zoom_full(GanvCanvas* canvas);
+
+/**
+ * ganv_canvas_get_default_font_size:
+ *
+ * Get the default font size in points.
+ */
+double
+ganv_canvas_get_default_font_size(const GanvCanvas* canvas);
+
+/**
* ganv_canvas_get_font_size:
* Get the current font size in points.
*/
@@ -534,13 +550,6 @@ void
ganv_canvas_set_font_size(GanvCanvas* canvas, double points);
/**
- * ganv_canvas_zoom_full:
- * Zoom so all canvas contents are visible.
- */
-void
-ganv_canvas_zoom_full(GanvCanvas* canvas);
-
-/**
* ganv_canvas_get_move_cursor:
* Return the cursor to use while dragging canvas objects.
*/