[gimp] app: split addition and subract in legacy and new



commit 5a7fd54d3486ff4919fb7087c9e84f8130e8ef31
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jan 10 01:37:26 2017 +0100

    app: split addition and subract in legacy and new

 app/core/core-enums.c                         |    8 +-
 app/core/core-enums.h                         |    6 +-
 app/gegl/gimp-gegl-nodes.c                    |   14 ++-
 app/operations/Makefile.am                    |    4 -
 app/operations/gimp-operations.c              |   12 ++-
 app/operations/gimplayermodefunctions.c       |   18 +++-
 app/operations/gimpoperationadditionmode.c    |  138 -------------------------
 app/operations/gimpoperationadditionmode.h    |   61 -----------
 app/operations/gimpoperationsubtractmode.c    |  137 ------------------------
 app/operations/gimpoperationsubtractmode.h    |   61 -----------
 app/operations/layer-modes-legacy/Makefile.am |    6 +-
 app/operations/layer-modes/Makefile.am        |    6 +-
 app/widgets/gimpwidgets-constructors.c        |    4 +-
 libgimp/gimpenums.h                           |    5 +-
 tools/pdbgen/enums.pl                         |    7 +-
 15 files changed, 66 insertions(+), 421 deletions(-)
---
diff --git a/app/core/core-enums.c b/app/core/core-enums.c
index 06a153e..7076335 100644
--- a/app/core/core-enums.c
+++ b/app/core/core-enums.c
@@ -323,6 +323,8 @@ gimp_layer_mode_get_type (void)
     { GIMP_LAYER_MODE_DODGE, "GIMP_LAYER_MODE_DODGE", "dodge" },
     { GIMP_LAYER_MODE_SCREEN, "GIMP_LAYER_MODE_SCREEN", "screen" },
     { GIMP_LAYER_MODE_DIFFERENCE, "GIMP_LAYER_MODE_DIFFERENCE", "difference" },
+    { GIMP_LAYER_MODE_ADDITION, "GIMP_LAYER_MODE_ADDITION", "addition" },
+    { GIMP_LAYER_MODE_SUBTRACT, "GIMP_LAYER_MODE_SUBTRACT", "subtract" },
     { GIMP_LAYER_MODE_ERASE, "GIMP_LAYER_MODE_ERASE", "erase" },
     { GIMP_LAYER_MODE_REPLACE, "GIMP_LAYER_MODE_REPLACE", "replace" },
     { GIMP_LAYER_MODE_ANTI_ERASE, "GIMP_LAYER_MODE_ANTI_ERASE", "anti-erase" },
@@ -338,8 +340,8 @@ gimp_layer_mode_get_type (void)
     { GIMP_LAYER_MODE_SCREEN_LEGACY, NC_("layer-mode", "Screen (legacy)"), NULL },
     { GIMP_LAYER_MODE_OVERLAY_LEGACY, NC_("layer-mode", "Old broken Overlay"), NULL },
     { GIMP_LAYER_MODE_DIFFERENCE_LEGACY, NC_("layer-mode", "Difference (legacy)"), NULL },
-    { GIMP_LAYER_MODE_ADDITION_LEGACY, NC_("layer-mode", "Addition"), NULL },
-    { GIMP_LAYER_MODE_SUBTRACT_LEGACY, NC_("layer-mode", "Subtract"), NULL },
+    { GIMP_LAYER_MODE_ADDITION_LEGACY, NC_("layer-mode", "Addition (legacy)"), NULL },
+    { GIMP_LAYER_MODE_SUBTRACT_LEGACY, NC_("layer-mode", "Subtract (legacy)"), NULL },
     { GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY, NC_("layer-mode", "Darken only"), NULL },
     { GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY, NC_("layer-mode", "Lighten only"), NULL },
     { GIMP_LAYER_MODE_HSV_HUE_LEGACY, NC_("layer-mode", "Hue (HSV)"), NULL },
@@ -365,6 +367,8 @@ gimp_layer_mode_get_type (void)
     { GIMP_LAYER_MODE_DODGE, NC_("layer-mode", "Dodge"), NULL },
     { GIMP_LAYER_MODE_SCREEN, NC_("layer-mode", "Screen"), NULL },
     { GIMP_LAYER_MODE_DIFFERENCE, NC_("layer-mode", "Difference"), NULL },
+    { GIMP_LAYER_MODE_ADDITION, NC_("layer-mode", "Addition"), NULL },
+    { GIMP_LAYER_MODE_SUBTRACT, NC_("layer-mode", "Subtract"), NULL },
     { GIMP_LAYER_MODE_ERASE, NC_("layer-mode", "Erase"), NULL },
     { GIMP_LAYER_MODE_REPLACE, NC_("layer-mode", "Replace"), NULL },
     { GIMP_LAYER_MODE_ANTI_ERASE, NC_("layer-mode", "Anti erase"), NULL },
diff --git a/app/core/core-enums.h b/app/core/core-enums.h
index ef1395d..26555b6 100644
--- a/app/core/core-enums.h
+++ b/app/core/core-enums.h
@@ -161,8 +161,8 @@ typedef enum
   GIMP_LAYER_MODE_SCREEN_LEGACY,          /*< desc="Screen (legacy)"      >*/
   GIMP_LAYER_MODE_OVERLAY_LEGACY,         /*< desc="Old broken Overlay"   >*/
   GIMP_LAYER_MODE_DIFFERENCE_LEGACY,      /*< desc="Difference (legacy)"  >*/
-  GIMP_LAYER_MODE_ADDITION_LEGACY,        /*< desc="Addition"             >*/
-  GIMP_LAYER_MODE_SUBTRACT_LEGACY,        /*< desc="Subtract"             >*/
+  GIMP_LAYER_MODE_ADDITION_LEGACY,        /*< desc="Addition (legacy)"    >*/
+  GIMP_LAYER_MODE_SUBTRACT_LEGACY,        /*< desc="Subtract (legacy)"    >*/
   GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY,     /*< desc="Darken only"          >*/
   GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY,    /*< desc="Lighten only"         >*/
   GIMP_LAYER_MODE_HSV_HUE_LEGACY,         /*< desc="Hue (HSV)"            >*/
@@ -188,6 +188,8 @@ typedef enum
   GIMP_LAYER_MODE_DODGE,                  /*< desc="Dodge"                >*/
   GIMP_LAYER_MODE_SCREEN,                 /*< desc="Screen"               >*/
   GIMP_LAYER_MODE_DIFFERENCE,             /*< desc="Difference"           >*/
+  GIMP_LAYER_MODE_ADDITION,               /*< desc="Addition"             >*/
+  GIMP_LAYER_MODE_SUBTRACT,               /*< desc="Subtract"             >*/
 
   /* internal modes, not available to the PDB */
   GIMP_LAYER_MODE_ERASE      = 1000, /*< pdb-skip, desc="Erase"      >*/
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index 4a7a31e..55aa38f 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -191,12 +191,20 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
       operation = "gimp:difference-legacyy";
       break;
 
+    case GIMP_LAYER_MODE_ADDITION:
+      operation = "gimp:addition";
+      break;
+
     case GIMP_LAYER_MODE_ADDITION_LEGACY:
-      operation = "gimp:addition-mode";
+      operation = "gimp:addition-legacy";
+      break;
+
+    case GIMP_LAYER_MODE_SUBTRACT:
+      operation = "gimp:subtract";
       break;
 
     case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
-      operation = "gimp:subtract-mode";
+      operation = "gimp:subtract-legacy";
       break;
 
     case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
@@ -322,6 +330,8 @@ gimp_gegl_mode_node_set_mode (GeglNode      *node,
     case GIMP_LAYER_MODE_MULTIPLY_LEGACY:
     case GIMP_LAYER_MODE_SCREEN:
     case GIMP_LAYER_MODE_SCREEN_LEGACY:
+    case GIMP_LAYER_MODE_ADDITION:
+    case GIMP_LAYER_MODE_SUBTRACT:
     case GIMP_LAYER_MODE_ADDITION_LEGACY:
     case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
     case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
diff --git a/app/operations/Makefile.am b/app/operations/Makefile.am
index c025994..bc9ed4c 100644
--- a/app/operations/Makefile.am
+++ b/app/operations/Makefile.am
@@ -101,10 +101,6 @@ libappoperations_a_SOURCES = \
        gimpoperationdissolvemode.h             \
        gimpoperationbehindmode.c               \
        gimpoperationbehindmode.h               \
-       gimpoperationadditionmode.c             \
-       gimpoperationadditionmode.h             \
-       gimpoperationsubtractmode.c             \
-       gimpoperationsubtractmode.h             \
        gimpoperationdarkenonlymode.c           \
        gimpoperationdarkenonlymode.h           \
        gimpoperationlightenonlymode.c          \
diff --git a/app/operations/gimp-operations.c b/app/operations/gimp-operations.c
index 4a1e8dd..09010d2 100644
--- a/app/operations/gimp-operations.c
+++ b/app/operations/gimp-operations.c
@@ -76,8 +76,10 @@
 #include "layer-modes/gimpoperationoverlay.h"
 #include "layer-modes/gimpoperationdifference.h"
 #include "layer-modes-legacy/gimpoperationdifferencelegacy.h"
-#include "gimpoperationadditionmode.h"
-#include "gimpoperationsubtractmode.h"
+#include "layer-modes/gimpoperationaddition.h"
+#include "layer-modes-legacy/gimpoperationadditionlegacy.h"
+#include "layer-modes/gimpoperationsubtract.h"
+#include "layer-modes-legacy/gimpoperationsubtractlegacy.h"
 #include "gimpoperationdarkenonlymode.h"
 #include "gimpoperationlightenonlymode.h"
 #include "gimpoperationhuemode.h"
@@ -144,8 +146,10 @@ gimp_operations_init (void)
   g_type_class_ref (GIMP_TYPE_OPERATION_OVERLAY);
   g_type_class_ref (GIMP_TYPE_OPERATION_DIFFERENCE);
   g_type_class_ref (GIMP_TYPE_OPERATION_DIFFERENCE_LEGACY);
-  g_type_class_ref (GIMP_TYPE_OPERATION_ADDITION_MODE);
-  g_type_class_ref (GIMP_TYPE_OPERATION_SUBTRACT_MODE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_ADDITION);
+  g_type_class_ref (GIMP_TYPE_OPERATION_ADDITION_LEGACY);
+  g_type_class_ref (GIMP_TYPE_OPERATION_SUBTRACT);
+  g_type_class_ref (GIMP_TYPE_OPERATION_SUBTRACT_LEGACY);
   g_type_class_ref (GIMP_TYPE_OPERATION_DARKEN_ONLY_MODE);
   g_type_class_ref (GIMP_TYPE_OPERATION_LIGHTEN_ONLY_MODE);
   g_type_class_ref (GIMP_TYPE_OPERATION_HUE_MODE);
diff --git a/app/operations/gimplayermodefunctions.c b/app/operations/gimplayermodefunctions.c
index 2c214ad..5549906 100644
--- a/app/operations/gimplayermodefunctions.c
+++ b/app/operations/gimplayermodefunctions.c
@@ -36,8 +36,10 @@
 #include "layer-modes/gimpoperationoverlay.h"
 #include "layer-modes/gimpoperationdifference.h"
 #include "layer-modes-legacy/gimpoperationdifferencelegacy.h"
-#include "gimpoperationadditionmode.h"
-#include "gimpoperationsubtractmode.h"
+#include "layer-modes/gimpoperationaddition.h"
+#include "layer-modes/gimpoperationsubtract.h"
+#include "layer-modes-legacy/gimpoperationadditionlegacy.h"
+#include "layer-modes-legacy/gimpoperationsubtractlegacy.h"
 #include "gimpoperationdarkenonlymode.h"
 #include "gimpoperationlightenonlymode.h"
 #include "gimpoperationhuemode.h"
@@ -110,12 +112,20 @@ get_layer_mode_function (GimpLayerMode  paint_mode,
       func = gimp_operation_difference_process_pixels;
       break;
 
+    case GIMP_LAYER_MODE_ADDITION:
+      func = gimp_operation_addition_process_pixels;
+      break;
+
     case GIMP_LAYER_MODE_ADDITION_LEGACY:
-      func = gimp_operation_addition_mode_process_pixels;
+      func = gimp_operation_addition_legacy_process_pixels;
+      break;
+
+    case GIMP_LAYER_MODE_SUBTRACT:
+      func = gimp_operation_subtract_process_pixels;
       break;
 
     case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
-      func = gimp_operation_subtract_mode_process_pixels;
+      func = gimp_operation_subtract_legacy_process_pixels;
       break;
 
     case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
diff --git a/app/operations/layer-modes-legacy/Makefile.am b/app/operations/layer-modes-legacy/Makefile.am
index e3e2d7a..df2350c 100644
--- a/app/operations/layer-modes-legacy/Makefile.am
+++ b/app/operations/layer-modes-legacy/Makefile.am
@@ -22,4 +22,8 @@ libapplayermodeslegacy_a_SOURCES = \
        gimpoperationscreenlegacy.c     \
        gimpoperationscreenlegacy.h     \
        gimpoperationdifferencelegacy.c \
-       gimpoperationdifferencelegacy.h
+       gimpoperationdifferencelegacy.h \
+       gimpoperationadditionlegacy.c   \
+       gimpoperationadditionlegacy.h   \
+       gimpoperationsubtractlegacy.c   \
+       gimpoperationsubtractlegacy.h
diff --git a/app/operations/layer-modes/Makefile.am b/app/operations/layer-modes/Makefile.am
index 09e2f71..f1a5cdb 100644
--- a/app/operations/layer-modes/Makefile.am
+++ b/app/operations/layer-modes/Makefile.am
@@ -37,7 +37,11 @@ libapplayermodes_generic_a_sources = \
        gimpoperationlchcolor.c         \
        gimpoperationlchcolor.h         \
        gimpoperationlchlightness.c     \
-       gimpoperationlchlightness.h
+       gimpoperationlchlightness.h     \
+       gimpoperationaddition.c         \
+       gimpoperationaddition.h         \
+       gimpoperationsubtract.c         \
+       gimpoperationsubtract.h
 
 libapplayermodes_sse2_a_sources = \
        gimpoperationnormal-sse2.c
diff --git a/app/widgets/gimpwidgets-constructors.c b/app/widgets/gimpwidgets-constructors.c
index 77f8b14..c89a833 100644
--- a/app/widgets/gimpwidgets-constructors.c
+++ b/app/widgets/gimpwidgets-constructors.c
@@ -104,7 +104,7 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
   GtkWidget    *combo;
 
   store = gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_MODE,
-                                           31,
+                                           33,
                                            GIMP_LAYER_MODE_NORMAL,
                                            GIMP_LAYER_MODE_NORMAL_NON_LINEAR,
                                            GIMP_LAYER_MODE_DISSOLVE,
@@ -114,6 +114,7 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
                                            GIMP_LAYER_MODE_SCREEN_LEGACY,
                                            GIMP_LAYER_MODE_DODGE,
                                            GIMP_LAYER_MODE_DODGE_LEGACY,
+                                           GIMP_LAYER_MODE_ADDITION,
                                            GIMP_LAYER_MODE_ADDITION_LEGACY,
 
                                            GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY,
@@ -128,6 +129,7 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
 
                                            GIMP_LAYER_MODE_DIFFERENCE,
                                            GIMP_LAYER_MODE_DIFFERENCE_LEGACY,
+                                           GIMP_LAYER_MODE_SUBTRACT,
                                            GIMP_LAYER_MODE_SUBTRACT_LEGACY,
                                            GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
                                            GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h
index 12e9f66..7efc409 100644
--- a/libgimp/gimpenums.h
+++ b/libgimp/gimpenums.h
@@ -101,7 +101,10 @@ typedef enum
   GIMP_LAYER_MODE_MULTIPLY,
   GIMP_LAYER_MODE_MULTIPLY_LINEAR,
   GIMP_LAYER_MODE_DODGE,
-  GIMP_LAYER_MODE_SCREEN
+  GIMP_LAYER_MODE_SCREEN,
+  GIMP_LAYER_MODE_DIFFERENCE,
+  GIMP_LAYER_MODE_ADDITION,
+  GIMP_LAYER_MODE_SUBTRACT
 } GimpLayerMode;
 
 
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index 6bac81b..d065bf0 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -724,7 +724,8 @@ package Gimp::CodeGen::enums;
                          GIMP_LAYER_MODE_NORMAL GIMP_LAYER_MODE_MULTIPLY
                          GIMP_LAYER_MODE_MULTIPLY_LINEAR
                          GIMP_LAYER_MODE_DODGE GIMP_LAYER_MODE_SCREEN
-                         GIMP_LAYER_MODE_DIFFERENCE) ],
+                         GIMP_LAYER_MODE_DIFFERENCE
+                         GIMP_LAYER_MODE_ADDITION GIMP_LAYER_MODE_SUBTRACT) ],
          mapping => { GIMP_LAYER_MODE_NORMAL_NON_LINEAR => '0',
                       GIMP_LAYER_MODE_DISSOLVE => '1',
                       GIMP_LAYER_MODE_BEHIND => '2',
@@ -758,7 +759,9 @@ package Gimp::CodeGen::enums;
                       GIMP_LAYER_MODE_MULTIPLY_LINEAR => '30',
                       GIMP_LAYER_MODE_DODGE => '31',
                       GIMP_LAYER_MODE_SCREEN => '32',
-                      GIMP_LAYER_MODE_DIFFERENCE => '33' }
+                      GIMP_LAYER_MODE_DIFFERENCE => '33',
+                      GIMP_LAYER_MODE_ADDITION => '34',
+                      GIMP_LAYER_MODE_SUBTRACT => '35' }
        },
     GimpBrushApplicationMode =>
        { contig => 1,


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