[gimp] app: move overlay to operations/layer-modes/ and call it GimpOperationOverlay



commit b001626b316aa8211276c35077e84873029e9069
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jan 9 23:50:42 2017 +0100

    app: move overlay to operations/layer-modes/ and call it GimpOperationOverlay

 app/gegl/gimp-gegl-nodes.c                         |    6 +-
 app/operations/Makefile.am                         |    2 -
 app/operations/gimp-operations.c                   |    4 +-
 app/operations/gimplayermodefunctions.c            |    4 +-
 app/operations/gimpoperationoverlaymode.h          |   61 ------------------
 app/operations/layer-modes/Makefile.am             |    4 +-
 .../gimpoperationoverlay.c}                        |   66 ++++++++++----------
 app/operations/layer-modes/gimpoperationoverlay.h  |   62 ++++++++++++++++++
 8 files changed, 106 insertions(+), 103 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index 4e370f5..3330537 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -260,7 +260,7 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
       break;
 
     case GIMP_LAYER_MODE_OVERLAY:
-      operation = "gimp:overlay-mode";
+      operation = "gimp:overlay";
       break;
 
     case GIMP_LAYER_MODE_LCH_HUE:
@@ -280,7 +280,8 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
       break;
 
     case GIMP_LAYER_MODE_ERASE:
-      operation = "gimp:erase-mode"; break;
+      operation = "gimp:erase-mode";
+      break;
 
     case GIMP_LAYER_MODE_REPLACE:
       operation = "gimp:replace-mode";
@@ -289,6 +290,7 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
     case GIMP_LAYER_MODE_ANTI_ERASE:
       operation = "gimp:anti-erase-mode";
       break;
+
     default:
       break;
     }
diff --git a/app/operations/Makefile.am b/app/operations/Makefile.am
index e76b21c..e85dd75 100644
--- a/app/operations/Makefile.am
+++ b/app/operations/Makefile.am
@@ -101,8 +101,6 @@ libappoperations_a_SOURCES = \
        gimpoperationdissolvemode.h             \
        gimpoperationbehindmode.c               \
        gimpoperationbehindmode.h               \
-       gimpoperationoverlaymode.c              \
-       gimpoperationoverlaymode.h              \
        gimpoperationadditionmode.c             \
        gimpoperationadditionmode.h             \
        gimpoperationsubtractmode.c             \
diff --git a/app/operations/gimp-operations.c b/app/operations/gimp-operations.c
index 37f6c0c..766a61d 100644
--- a/app/operations/gimp-operations.c
+++ b/app/operations/gimp-operations.c
@@ -73,7 +73,7 @@
 #include "layer-modes-legacy/gimpoperationmultiplylegacy.h"
 #include "layer-modes/gimpoperationscreen.h"
 #include "layer-modes-legacy/gimpoperationscreenlegacy.h"
-#include "gimpoperationoverlaymode.h"
+#include "layer-modes/gimpoperationoverlay.h"
 #include "gimpoperationdifferencemode.h"
 #include "gimpoperationadditionmode.h"
 #include "gimpoperationsubtractmode.h"
@@ -139,7 +139,7 @@ gimp_operations_init (void)
   g_type_class_ref (GIMP_TYPE_OPERATION_MULTIPLY);
   g_type_class_ref (GIMP_TYPE_OPERATION_MULTIPLY_LEGACY);
   g_type_class_ref (GIMP_TYPE_OPERATION_SCREEN_MODE);
-  g_type_class_ref (GIMP_TYPE_OPERATION_OVERLAY_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_OVERLAY);
   g_type_class_ref (GIMP_TYPE_OPERATION_DIFFERENCE_MODE);
   g_type_class_ref (GIMP_TYPE_OPERATION_ADDITION_MODE);
   g_type_class_ref (GIMP_TYPE_OPERATION_SUBTRACT_MODE);
diff --git a/app/operations/gimplayermodefunctions.c b/app/operations/gimplayermodefunctions.c
index 545c86b..90be814 100644
--- a/app/operations/gimplayermodefunctions.c
+++ b/app/operations/gimplayermodefunctions.c
@@ -33,7 +33,7 @@
 #include "layer-modes-legacy/gimpoperationmultiplylegacy.h"
 #include "layer-modes/gimpoperationscreen.h"
 #include "layer-modes-legacy/gimpoperationscreenlegacy.h"
-#include "gimpoperationoverlaymode.h"
+#include "layer-modes/gimpoperationoverlay.h"
 #include "gimpoperationdifferencemode.h"
 #include "gimpoperationadditionmode.h"
 #include "gimpoperationsubtractmode.h"
@@ -174,7 +174,7 @@ get_layer_mode_function (GimpLayerMode  paint_mode,
       break;
 
     case GIMP_LAYER_MODE_OVERLAY:
-      func = gimp_operation_overlay_mode_process_pixels;
+      func = gimp_operation_overlay_process_pixels;
       break;
 
     case GIMP_LAYER_MODE_LCH_HUE:
diff --git a/app/operations/layer-modes/Makefile.am b/app/operations/layer-modes/Makefile.am
index e1cbcd1..01ed1be 100644
--- a/app/operations/layer-modes/Makefile.am
+++ b/app/operations/layer-modes/Makefile.am
@@ -23,7 +23,9 @@ libapplayermodes_generic_a_sources = \
        gimpoperationdodge.c            \
        gimpoperationdodge.h            \
        gimpoperationmultiply.c         \
-       gimpoperationmultiply.h         \
+       gimpoperationmultiply.h         \
+       gimpoperationoverlay.c          \
+       gimpoperationoverlay.h          \
        gimpoperationscreen.c           \
        gimpoperationscreen.h           \
        gimpoperationdifference.c       \
diff --git a/app/operations/gimpoperationoverlaymode.c b/app/operations/layer-modes/gimpoperationoverlay.c
similarity index 51%
rename from app/operations/gimpoperationoverlaymode.c
rename to app/operations/layer-modes/gimpoperationoverlay.c
index e808e2e..ca67587 100644
--- a/app/operations/gimpoperationoverlaymode.c
+++ b/app/operations/layer-modes/gimpoperationoverlay.c
@@ -1,7 +1,7 @@
 /* GIMP - The GNU Image Manipulation Program
  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  *
- * gimpoperationoverlaymode.c
+ * gimpoperationoverlay.c
  * Copyright (C) 2008 Michael Natterer <mitch gimp org>
  *               2012 Ville Sokk <ville sokk gmail com>
  *
@@ -23,27 +23,27 @@
 
 #include <gegl-plugin.h>
 
-#include "operations-types.h"
+#include "../operations-types.h"
 
-#include "gimpoperationoverlaymode.h"
+#include "gimpoperationoverlay.h"
 
 
-static gboolean gimp_operation_overlay_mode_process (GeglOperation       *operation,
-                                                     void                *in_buf,
-                                                     void                *aux_buf,
-                                                     void                *aux2_buf,
-                                                     void                *out_buf,
-                                                     glong                samples,
-                                                     const GeglRectangle *roi,
-                                                     gint                 level);
+static gboolean gimp_operation_overlay_process (GeglOperation       *operation,
+                                                void                *in_buf,
+                                                void                *aux_buf,
+                                                void                *aux2_buf,
+                                                void                *out_buf,
+                                                glong                samples,
+                                                const GeglRectangle *roi,
+                                                gint                 level);
 
 
-G_DEFINE_TYPE (GimpOperationOverlayMode, gimp_operation_overlay_mode,
+G_DEFINE_TYPE (GimpOperationOverlay, gimp_operation_overlay,
                GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
 
 
 static void
-gimp_operation_overlay_mode_class_init (GimpOperationOverlayModeClass *klass)
+gimp_operation_overlay_class_init (GimpOperationOverlayClass *klass)
 {
   GeglOperationClass               *operation_class;
   GeglOperationPointComposer3Class *point_class;
@@ -52,42 +52,42 @@ gimp_operation_overlay_mode_class_init (GimpOperationOverlayModeClass *klass)
   point_class     = GEGL_OPERATION_POINT_COMPOSER3_CLASS (klass);
 
   gegl_operation_class_set_keys (operation_class,
-                                 "name",        "gimp:overlay-mode",
+                                 "name",        "gimp:overlay",
                                  "description", "GIMP overlay mode operation",
                                  NULL);
 
-  point_class->process = gimp_operation_overlay_mode_process;
+  point_class->process = gimp_operation_overlay_process;
 }
 
 static void
-gimp_operation_overlay_mode_init (GimpOperationOverlayMode *self)
+gimp_operation_overlay_init (GimpOperationOverlay *self)
 {
 }
 
 static gboolean
-gimp_operation_overlay_mode_process (GeglOperation       *operation,
-                                     void                *in_buf,
-                                     void                *aux_buf,
-                                     void                *aux2_buf,
-                                     void                *out_buf,
-                                     glong                samples,
-                                     const GeglRectangle *roi,
-                                     gint                 level)
+gimp_operation_overlay_process (GeglOperation       *operation,
+                                void                *in_buf,
+                                void                *aux_buf,
+                                void                *aux2_buf,
+                                void                *out_buf,
+                                glong                samples,
+                                const GeglRectangle *roi,
+                                gint                 level)
 {
   gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
 
-  return gimp_operation_overlay_mode_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, 
roi, level);
+  return gimp_operation_overlay_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, 
level);
 }
 
 gboolean
-gimp_operation_overlay_mode_process_pixels (gfloat              *in,
-                                            gfloat              *layer,
-                                            gfloat              *mask,
-                                            gfloat              *out,
-                                            gfloat               opacity,
-                                            glong                samples,
-                                            const GeglRectangle *roi,
-                                            gint                 level)
+gimp_operation_overlay_process_pixels (gfloat              *in,
+                                       gfloat              *layer,
+                                       gfloat              *mask,
+                                       gfloat              *out,
+                                       gfloat               opacity,
+                                       glong                samples,
+                                       const GeglRectangle *roi,
+                                       gint                 level)
 {
   const gboolean has_mask = mask != NULL;
 
diff --git a/app/operations/layer-modes/gimpoperationoverlay.h 
b/app/operations/layer-modes/gimpoperationoverlay.h
new file mode 100644
index 0000000..8dc8413
--- /dev/null
+++ b/app/operations/layer-modes/gimpoperationoverlay.h
@@ -0,0 +1,62 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationoverlay.h
+ * Copyright (C) 2008 Michael Natterer <mitch gimp org>
+ *
+ * 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_OPERATION_OVERLAY_H__
+#define __GIMP_OPERATION_OVERLAY_H__
+
+
+#include "../gimpoperationpointlayermode.h"
+
+
+#define GIMP_TYPE_OPERATION_OVERLAY            (gimp_operation_overlay_get_type ())
+#define GIMP_OPERATION_OVERLAY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GIMP_TYPE_OPERATION_OVERLAY, GimpOperationOverlay))
+#define GIMP_OPERATION_OVERLAY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  
GIMP_TYPE_OPERATION_OVERLAY, GimpOperationOverlayClass))
+#define GIMP_IS_OPERATION_OVERLAY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GIMP_TYPE_OPERATION_OVERLAY))
+#define GIMP_IS_OPERATION_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  
GIMP_TYPE_OPERATION_OVERLAY))
+#define GIMP_OPERATION_OVERLAY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  
GIMP_TYPE_OPERATION_OVERLAY, GimpOperationOverlayClass))
+
+
+typedef struct _GimpOperationOverlay      GimpOperationOverlay;
+typedef struct _GimpOperationOverlayClass GimpOperationOverlayClass;
+
+struct _GimpOperationOverlay
+{
+  GimpOperationPointLayerMode  parent_instance;
+};
+
+struct _GimpOperationOverlayClass
+{
+  GimpOperationPointLayerModeClass  parent_class;
+};
+
+
+GType    gimp_operation_overlay_get_type       (void) G_GNUC_CONST;
+
+gboolean gimp_operation_overlay_process_pixels (gfloat              *in,
+                                                gfloat              *layer,
+                                                gfloat              *mask,
+                                                gfloat              *out,
+                                                gfloat               opacity,
+                                                glong                samples,
+                                                const GeglRectangle *roi,
+                                                gint                 level);
+
+
+#endif /* __GIMP_OPERATION_OVERLAY_H__ */


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