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



commit 8a54c78e6b7ec723111f9c674b66bc5fe210776b
Author: Ell <ell_se yahoo com>
Date:   Fri Jan 17 12:01:57 2020 +0200

    app: add gimp_gegl_node_get_key()
    
    ... which gets an operation-class key for the operation associated
    with the node, if any.

 app/gegl/gimp-gegl-utils.c | 16 ++++++++++++++++
 app/gegl/gimp-gegl-utils.h | 43 +++++++++++++++++++++++--------------------
 2 files changed, 39 insertions(+), 20 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index cd6925bbdf..0d38cf0f71 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -167,6 +167,22 @@ gimp_gegl_node_is_area_filter_operation (GeglNode *node)
          GEGL_IS_OPERATION_META (operation);
 }
 
+const gchar *
+gimp_gegl_node_get_key (GeglNode    *node,
+                        const gchar *key)
+{
+  const gchar *operation_name;
+
+  g_return_val_if_fail (GEGL_IS_NODE (node), NULL);
+
+  operation_name = gegl_node_get_operation (node);
+
+  if (operation_name)
+    return gegl_operation_get_key (operation_name, key);
+  else
+    return NULL;
+}
+
 const Babl *
 gimp_gegl_node_get_format (GeglNode    *node,
                            const gchar *pad_name)
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index 948158f15d..4f50fdcdd5 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -22,34 +22,37 @@
 #define __GIMP_GEGL_UTILS_H__
 
 
-GType        gimp_gegl_get_op_enum_type              (const gchar         *operation,
-                                                      const gchar         *property);
+GType         gimp_gegl_get_op_enum_type              (const gchar         *operation,
+                                                       const gchar         *property);
 
-GeglColor  * gimp_gegl_color_new                     (const GimpRGB       *rgb);
+GeglColor   * gimp_gegl_color_new                     (const GimpRGB       *rgb);
 
-void         gimp_gegl_progress_connect              (GeglNode            *node,
-                                                      GimpProgress        *progress,
-                                                      const gchar         *text);
+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);
-gboolean     gimp_gegl_node_is_area_filter_operation (GeglNode            *node);
+gboolean      gimp_gegl_node_is_source_operation      (GeglNode            *node);
+gboolean      gimp_gegl_node_is_point_operation       (GeglNode            *node);
+gboolean      gimp_gegl_node_is_area_filter_operation (GeglNode            *node);
 
-const Babl * gimp_gegl_node_get_format               (GeglNode            *node,
-                                                      const gchar         *pad_name);
+const gchar * gimp_gegl_node_get_key                  (GeglNode            *node,
+                                                      const gchar          *key);
 
-void         gimp_gegl_node_set_underlying_operation (GeglNode           *node,
-                                                      GeglNode           *operation);
-GeglNode   * gimp_gegl_node_get_underlying_operation (GeglNode           *node);
+const Babl  * gimp_gegl_node_get_format               (GeglNode            *node,
+                                                       const gchar         *pad_name);
 
-gboolean     gimp_gegl_param_spec_has_key            (GParamSpec          *pspec,
-                                                      const gchar         *key,
-                                                      const gchar         *value);
+void          gimp_gegl_node_set_underlying_operation (GeglNode           *node,
+                                                       GeglNode           *operation);
+GeglNode    * gimp_gegl_node_get_underlying_operation (GeglNode           *node);
 
-GeglBuffer * gimp_gegl_buffer_dup                    (GeglBuffer          *buffer);
+gboolean      gimp_gegl_param_spec_has_key            (GParamSpec          *pspec,
+                                                       const gchar         *key,
+                                                       const gchar         *value);
 
-gboolean     gimp_gegl_buffer_set_extent             (GeglBuffer          *buffer,
-                                                      const GeglRectangle *extent);
+GeglBuffer  * gimp_gegl_buffer_dup                    (GeglBuffer          *buffer);
+
+gboolean      gimp_gegl_buffer_set_extent             (GeglBuffer          *buffer,
+                                                       const GeglRectangle *extent);
 
 
 #endif /* __GIMP_GEGL_UTILS_H__ */


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