gimp r27208 - in trunk: . app/core
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27208 - in trunk: . app/core
- Date: Fri, 10 Oct 2008 13:52:13 +0000 (UTC)
Author: mitch
Date: Fri Oct 10 13:52:13 2008
New Revision: 27208
URL: http://svn.gnome.org/viewvc/gimp?rev=27208&view=rev
Log:
2008-10-10 Michael Natterer <mitch gimp org>
* app/core/gimplayer.c: implement GimpItem::visibility-changed
and turn the layer's node into a nop when the layer is invisible.
(gimp_layer_get_node): connect the stuff to a nop here too for
invisible layers.
Modified:
trunk/ChangeLog
trunk/app/core/gimplayer.c
Modified: trunk/app/core/gimplayer.c
==============================================================================
--- trunk/app/core/gimplayer.c (original)
+++ trunk/app/core/gimplayer.c Fri Oct 10 13:52:13 2008
@@ -106,6 +106,7 @@
gchar **tooltip);
static void gimp_layer_removed (GimpItem *item);
+static void gimp_layer_visibility_changed (GimpItem *item);
static gboolean gimp_layer_is_attached (GimpItem *item);
static GimpItem * gimp_layer_duplicate (GimpItem *item,
GType new_type);
@@ -250,6 +251,7 @@
viewable_class->get_description = gimp_layer_get_description;
item_class->removed = gimp_layer_removed;
+ item_class->visibility_changed = gimp_layer_visibility_changed;
item_class->is_attached = gimp_layer_is_attached;
item_class->duplicate = gimp_layer_duplicate;
item_class->convert = gimp_layer_convert;
@@ -523,6 +525,39 @@
GIMP_ITEM_CLASS (parent_class)->removed (item);
}
+static void
+gimp_layer_visibility_changed (GimpItem *item)
+{
+ GimpLayer *layer = GIMP_LAYER (item);
+
+ if (layer->node)
+ {
+ GeglNode *input;
+ GeglNode *output;
+
+ input = gegl_node_get_input_proxy (layer->node, "input");
+ output = gegl_node_get_output_proxy (layer->node, "output");
+
+ if (gimp_item_get_visible (item))
+ {
+ gegl_node_connect_to (input, "output",
+ layer->mode_node, "input");
+ gegl_node_connect_to (layer->mode_node, "output",
+ output, "input");
+ }
+ else
+ {
+ gegl_node_disconnect (layer->mode_node, "input");
+
+ gegl_node_connect_to (input, "output",
+ output, "input");
+ }
+ }
+
+ if (GIMP_ITEM_CLASS (parent_class)->visibility_changed)
+ GIMP_ITEM_CLASS (parent_class)->visibility_changed (item);
+}
+
static gboolean
gimp_layer_is_attached (GimpItem *item)
{
@@ -1959,13 +1994,21 @@
gegl_node_connect_to (layer->opacity_node, "output",
layer->mode_node, "aux");
- input = gegl_node_get_input_proxy (layer->node, "input");
- gegl_node_connect_to (input, "output",
- layer->mode_node, "input");
-
+ input = gegl_node_get_input_proxy (layer->node, "input");
output = gegl_node_get_output_proxy (layer->node, "output");
- gegl_node_connect_to (layer->mode_node, "output",
- output, "input");
+
+ if (gimp_item_get_visible (GIMP_ITEM (layer)))
+ {
+ gegl_node_connect_to (input, "output",
+ layer->mode_node, "input");
+ gegl_node_connect_to (layer->mode_node, "output",
+ output, "input");
+ }
+ else
+ {
+ gegl_node_connect_to (input, "output",
+ output, "input");
+ }
return layer->node;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]