[gimp/gimp-2-10] app: in GimpFilterTool, show region combo for non-point ops



commit 3e1a6315832118f2cd4ecc3b5ab362571ad53995
Author: Ell <ell_se yahoo com>
Date:   Sat Dec 29 20:22:32 2018 -0500

    app: in GimpFilterTool, show region combo for non-point ops
    
    In GimpFilterTool, show the region combo when applying a non-point
    op, as well as when applying a position-dependent point op.  The
    result of non-point ops may depend on the choice of input region,
    even if the op is not position-dependent.
    
    (cherry picked from commit 7949fd9a2867648772a0e4e15908c9666d749f3f)

 app/tools/gimpfiltertool.c | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c
index 2fd6bd322e..2ffc7cd2e7 100644
--- a/app/tools/gimpfiltertool.c
+++ b/app/tools/gimpfiltertool.c
@@ -25,6 +25,7 @@
 #include "config.h"
 
 #include <gegl.h>
+#include <gegl-plugin.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -298,14 +299,15 @@ gimp_filter_tool_initialize (GimpTool     *tool,
 
   if (! filter_tool->gui)
     {
-      GtkWidget *vbox;
-      GtkWidget *hbox;
-      GtkWidget *toggle;
-      GtkWidget *expander;
-      GtkWidget *frame;
-      GtkWidget *vbox2;
-      GtkWidget *combo;
-      gchar     *operation_name;
+      GtkWidget     *vbox;
+      GtkWidget     *hbox;
+      GtkWidget     *toggle;
+      GtkWidget     *expander;
+      GtkWidget     *frame;
+      GtkWidget     *vbox2;
+      GtkWidget     *combo;
+      GeglOperation *operation;
+      const gchar   *operation_name = NULL;
 
       /*  disabled for at least GIMP 2.8  */
       filter_tool->overlay = FALSE;
@@ -403,9 +405,10 @@ gimp_filter_tool_initialize (GimpTool     *tool,
       gtk_widget_show (toggle);
 
       /*  The area combo  */
-      gegl_node_get (filter_tool->operation,
-                     "operation", &operation_name,
-                     NULL);
+      operation = gegl_node_get_gegl_operation (filter_tool->operation);
+
+      if (operation)
+        operation_name = gegl_operation_get_name (operation);
 
       filter_tool->region_combo =
         gimp_prop_enum_combo_box_new (G_OBJECT (tool_info->tool_options),
@@ -414,14 +417,16 @@ gimp_filter_tool_initialize (GimpTool     *tool,
       gtk_box_pack_end (GTK_BOX (vbox), filter_tool->region_combo,
                         FALSE, FALSE, 0);
 
-      if (operation_name &&
-          gegl_operation_get_key (operation_name, "position-dependent"))
+      if (! (GEGL_IS_OPERATION_POINT_RENDER    (operation)  ||
+             GEGL_IS_OPERATION_POINT_FILTER    (operation)  ||
+             GEGL_IS_OPERATION_POINT_COMPOSER  (operation)  ||
+             GEGL_IS_OPERATION_POINT_COMPOSER3 (operation)) ||
+            (operation_name &&
+             gegl_operation_get_key (operation_name, "position-dependent")))
         {
           gtk_widget_show (filter_tool->region_combo);
         }
 
-      g_free (operation_name);
-
       /*  Fill in subclass widgets  */
       gimp_filter_tool_dialog (filter_tool);
     }


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