[gimp] app: add gimp_filter_stack_new(filter_type)



commit 7c96952bd4f8f894e80e483ecbaf3ad8f6d5ddfe
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 11 19:04:51 2013 +0200

    app: add gimp_filter_stack_new(filter_type)

 app/core/gimpfilterstack.c |   12 ++++++++++++
 app/core/gimpfilterstack.h |    5 +++--
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpfilterstack.c b/app/core/gimpfilterstack.c
index deed88c..ed88235 100644
--- a/app/core/gimpfilterstack.c
+++ b/app/core/gimpfilterstack.c
@@ -150,6 +150,18 @@ gimp_filter_stack_reorder (GimpContainer *container,
 
 /*  public functions  */
 
+GimpContainer *
+gimp_filter_stack_new (GType filter_type)
+{
+  g_return_val_if_fail (g_type_is_a (filter_type, GIMP_TYPE_FILTER), NULL);
+
+  return g_object_new (GIMP_TYPE_FILTER_STACK,
+                       "name",          g_type_name (filter_type),
+                       "children-type", filter_type,
+                       "policy",        GIMP_CONTAINER_POLICY_STRONG,
+                       NULL);
+}
+
 GeglNode *
 gimp_filter_stack_get_graph (GimpFilterStack *stack)
 {
diff --git a/app/core/gimpfilterstack.h b/app/core/gimpfilterstack.h
index 1632011..b980848 100644
--- a/app/core/gimpfilterstack.h
+++ b/app/core/gimpfilterstack.h
@@ -46,9 +46,10 @@ struct _GimpFilterStackClass
 };
 
 
-GType      gimp_filter_stack_get_type  (void) G_GNUC_CONST;
+GType           gimp_filter_stack_get_type  (void) G_GNUC_CONST;
+GimpContainer * gimp_filter_stack_new       (GType            filter_type);
 
-GeglNode * gimp_filter_stack_get_graph (GimpFilterStack *stack);
+GeglNode *      gimp_filter_stack_get_graph (GimpFilterStack *stack);
 
 
 #endif  /*  __GIMP_FILTER_STACK_H__  */


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