From ff13e55c16bd936b9d88635e885dbfc282c9a9d3 Mon Sep 17 00:00:00 2001 From: Ell Date: Wed, 27 Mar 2019 14:31:14 -0400 Subject: [PATCH] app: add gimp_gegl_node_is_source_operation() ... which determines if a node is a source operation. --- 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 9c4384d345..3d9890bd9f 100644 --- a/app/gegl/gimp-gegl-utils.c +++ b/app/gegl/gimp-gegl-utils.c @@ -119,6 +119,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 4fbe46f274..ef6050d264 100644 --- a/app/gegl/gimp-gegl-utils.h +++ b/app/gegl/gimp-gegl-utils.h @@ -32,6 +32,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,