Commit d3afda38 authored by Øyvind Kolås's avatar Øyvind Kolås

added a function to remove a node from the tree programatically. hooked

* 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).

svn path=/trunk/; revision=2715
parent edd8954c
2008-11-09 Øyvind Kolås <pippin@gimp.org>
* 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).
2008-11-09 Øyvind Kolås <pippin@gimp.org>
* gegl/gegl-config.c: (gegl_config_init): changed tile size to 64x128
......
......@@ -932,6 +932,21 @@ static void path_slice (cairo_t *cr,
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)
......
......@@ -403,6 +403,17 @@ add_sibling_op (GtkAction *action, gpointer userdata)
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment