[gimp/gimp-2-10] app: add gimp_gegl_node_is_source_operation()



commit 3518ab919784885dd5bc24947db3cad72c62ea74
Author: Ell <ell_se yahoo com>
Date:   Wed Mar 27 14:31:14 2019 -0400

    app: add gimp_gegl_node_is_source_operation()
    
    ... which determines if a node is a source operation.
    
    (cherry picked from commit ff13e55c16bd936b9d88635e885dbfc282c9a9d3)

 app/gegl/gimp-gegl-utils.c | 15 +++++++++++++++
 app/gegl/gimp-gegl-utils.h |  1 +
 2 files changed, 16 insertions(+)
---
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index a6d96f653b..91cc294645 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -116,6 +116,21 @@ gimp_gegl_progress_connect (GeglNode     *node,
                           (GDestroyNotify) g_free);
 }
 
+gboolean
+gimp_gegl_node_is_source_operation (GeglNode *node)
+{
+  GeglOperation *operation;
+
+  g_return_val_if_fail (GEGL_IS_NODE (node), FALSE);
+
+  operation = gegl_node_get_gegl_operation (node);
+
+  if (! operation)
+    return FALSE;
+
+  return GEGL_IS_OPERATION_SOURCE (operation);
+}
+
 gboolean
 gimp_gegl_node_is_point_operation (GeglNode *node)
 {
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index 1b95045102..ec42a33b02 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -31,6 +31,7 @@ void         gimp_gegl_progress_connect             (GeglNode            *node,
                                                      GimpProgress        *progress,
                                                      const gchar         *text);
 
+gboolean     gimp_gegl_node_is_source_operation     (GeglNode            *node);
 gboolean     gimp_gegl_node_is_point_operation      (GeglNode            *node);
 
 const Babl * gimp_gegl_node_get_format              (GeglNode            *node,


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