[gimp] app: add gimpdrawable-filter.[ch] to access the filters



commit 85fef12865fce8b5c45df0079db9388a4b78be17
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 12 12:55:15 2013 +0200

    app: add gimpdrawable-filter.[ch] to access the filters

 app/core/Makefile.am           |    2 +
 app/core/gimpdrawable-filter.c |   65 ++++++++++++++++++++++++++++++++++++++++
 app/core/gimpdrawable-filter.h |   33 ++++++++++++++++++++
 3 files changed, 100 insertions(+), 0 deletions(-)
---
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index 3371463..eb87117 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -126,6 +126,8 @@ libappcore_a_sources = \
        gimpdrawable-combine.h                  \
        gimpdrawable-equalize.c                 \
        gimpdrawable-equalize.h                 \
+       gimpdrawable-filter.c                   \
+       gimpdrawable-filter.h                   \
        gimpdrawable-foreground-extract.c       \
        gimpdrawable-foreground-extract.h       \
        gimpdrawable-histogram.c                \
diff --git a/app/core/gimpdrawable-filter.c b/app/core/gimpdrawable-filter.c
new file mode 100644
index 0000000..3cc7570
--- /dev/null
+++ b/app/core/gimpdrawable-filter.c
@@ -0,0 +1,65 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpdrawable-filter.c
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+
+#include "core-types.h"
+
+#include "gimpdrawable.h"
+#include "gimpdrawable-filter.h"
+#include "gimpdrawable-private.h"
+#include "gimpfilter.h"
+#include "gimpfilterstack.h"
+
+
+void
+gimp_drawable_add_filter (GimpDrawable *drawable,
+                          GimpFilter   *filter)
+{
+  g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
+  g_return_if_fail (GIMP_IS_FILTER (filter));
+
+  gimp_container_add (drawable->private->filter_stack,
+                      GIMP_OBJECT (filter));
+}
+
+void
+gimp_drawable_remove_filter (GimpDrawable *drawable,
+                             GimpFilter   *filter)
+{
+  g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
+  g_return_if_fail (GIMP_IS_FILTER (filter));
+
+  gimp_container_remove (drawable->private->filter_stack,
+                         GIMP_OBJECT (filter));
+}
+
+gboolean
+gimp_drawable_has_filter (GimpDrawable *drawable,
+                          GimpFilter   *filter)
+{
+  g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
+  g_return_val_if_fail (GIMP_IS_FILTER (filter), FALSE);
+
+  return gimp_container_have (drawable->private->filter_stack,
+                              GIMP_OBJECT (filter));
+}
+
diff --git a/app/core/gimpdrawable-filter.h b/app/core/gimpdrawable-filter.h
new file mode 100644
index 0000000..65237e1
--- /dev/null
+++ b/app/core/gimpdrawable-filter.h
@@ -0,0 +1,33 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpdrawable-filter.h
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_DRAWABLE_FILTER_H__
+#define __GIMP_DRAWABLE_FILTER_H__
+
+
+void       gimp_drawable_add_filter    (GimpDrawable *drawable,
+                                        GimpFilter   *filter);
+void       gimp_drawable_remove_filter (GimpDrawable *drawable,
+                                        GimpFilter   *filter);
+
+gboolean   gimp_drawable_has_filter    (GimpDrawable *drawable,
+                                        GimpFilter   *filter);
+
+
+#endif /* __GIMP_DRAWABLE_FILTER_H__ */


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