gegl r2715 - in trunk: . bin



Author: ok
Date: Sun Nov  9 19:58:45 2008
New Revision: 2715
URL: http://svn.gnome.org/viewvc/gegl?rev=2715&view=rev

Log:
* bin/gegl-tree-editor-action.c: (gegl_remove_item): added a function
to remove a node from the tree programatically.
* bin/editor.c: (remove_item): hooked the remove action up to remove
the parent of the currently selected item, this should remove the
selected drawable, and it's filters as well since they are the
children of the parent (the composite op).


Modified:
   trunk/ChangeLog
   trunk/bin/editor.c
   trunk/bin/gegl-tree-editor-action.c

Modified: trunk/bin/editor.c
==============================================================================
--- trunk/bin/editor.c	(original)
+++ trunk/bin/editor.c	Sun Nov  9 19:58:45 2008
@@ -932,6 +932,21 @@
   cairo_close_path (cr);
 }
 
+void gegl_remove_item (GeglNode *node);
+
+static gint remove_item (gint argc, char **argv)
+{
+  GeglNode *self = tree_editor_get_active (editor.tree_editor);
+  GeglNode *parent = gegl_parent (self);
+
+  if (g_str_equal (gegl_node_get_operation (parent), "gegl:over"))
+    {
+      gegl_remove_item (parent);
+      g_print ("removed item\n");
+    }
+  return 0;
+}
+
 static gint set_state (gint argc, char **argv)
 {
   if (argv[1]==NULL)

Modified: trunk/bin/gegl-tree-editor-action.c
==============================================================================
--- trunk/bin/gegl-tree-editor-action.c	(original)
+++ trunk/bin/gegl-tree-editor-action.c	Sun Nov  9 19:58:45 2008
@@ -403,6 +403,17 @@
   gtk_tree_selection_select_iter (tree_selection, &iter);
 }
 
+
+void gegl_remove_item (GeglNode *node);
+void gegl_remove_item (GeglNode *node)
+{
+  /* hack hack */
+  tree_editor_set_active (editor.tree_editor, node);
+  remove_itm (NULL, tree_editor_get_treeview (editor.tree_editor));
+  node = tree_editor_get_active (editor.tree_editor);
+  property_editor_rebuild (editor.property_editor, node);
+}
+
 GeglNode *gegl_add_sibling (const gchar *type)
 {
   GeglNode *node;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]