[gimp] app: make erase mode an ordinary layer/paint mode



commit dfb3ddc4d9db2c41569fc5a300a5fed412cbb6c2
Author: Ell <ell_se yahoo com>
Date:   Fri Mar 10 14:35:46 2017 -0500

    app: make erase mode an ordinary layer/paint mode
    
    Include erase mode in the menu for layers and general paint tools.
    This makes the eraser tool somewhat unnecessary, but allows for
    interesting use cases (e.g., airbrush eraser, etc.)

 app/core/gimpimage.c                          |    2 +-
 app/operations/layer-modes/gimp-layer-modes.c |    2 +-
 app/operations/operations-enums.h             |    2 +-
 libgimp/gimpenums.h                           |    3 ++-
 tools/pdbgen/enums.pl                         |    5 +++--
 5 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 14517a0..f936b8d 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -2463,11 +2463,11 @@ gimp_image_get_xcf_version (GimpImage    *image,
         case GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY:
         case GIMP_LAYER_MODE_LUMINANCE:
         case GIMP_LAYER_MODE_COLOR_ERASE:
+        case GIMP_LAYER_MODE_ERASE:
           version = MAX (10, version);
           break;
 
           /*  Just here instead of default so we get compiler warnings  */
-        case GIMP_LAYER_MODE_ERASE:
         case GIMP_LAYER_MODE_REPLACE:
         case GIMP_LAYER_MODE_ANTI_ERASE:
         case GIMP_LAYER_MODE_SEPARATOR:
diff --git a/app/operations/layer-modes/gimp-layer-modes.c b/app/operations/layer-modes/gimp-layer-modes.c
index 56ecb4d..27d21d2 100644
--- a/app/operations/layer-modes/gimp-layer-modes.c
+++ b/app/operations/layer-modes/gimp-layer-modes.c
@@ -821,7 +821,7 @@ static const GimpLayerModeInfo layer_mode_infos[] =
     .function             = gimp_operation_erase_process,
     .flags                = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
                             GIMP_LAYER_MODE_FLAG_SUBTRACTIVE,
-    .context              = GIMP_LAYER_MODE_CONTEXT_FADE,
+    .context              = GIMP_LAYER_MODE_CONTEXT_ALL,
     .paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
     .composite_mode       = GIMP_LAYER_COMPOSITE_SRC_ATOP,
     .composite_space      = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
diff --git a/app/operations/operations-enums.h b/app/operations/operations-enums.h
index e8d9ae3..2a80ce8 100644
--- a/app/operations/operations-enums.h
+++ b/app/operations/operations-enums.h
@@ -117,9 +117,9 @@ typedef enum
   GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,  /*< desc="Luma/Luminance lighten only" >*/
   GIMP_LAYER_MODE_LUMINANCE,             /*< desc="Luminance"                >*/
   GIMP_LAYER_MODE_COLOR_ERASE,           /*< desc="Color erase"              >*/
+  GIMP_LAYER_MODE_ERASE,                 /*< desc="Erase"                    >*/
 
   /*  Internal modes, not available to the PDB, must be kept at the end  */
-  GIMP_LAYER_MODE_ERASE,                 /*< pdb-skip, desc="Erase"          >*/
   GIMP_LAYER_MODE_REPLACE,               /*< pdb-skip, desc="Replace"        >*/
   GIMP_LAYER_MODE_ANTI_ERASE,            /*< pdb-skip, desc="Anti erase"     >*/
 
diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h
index b80395b..85e4f11 100644
--- a/libgimp/gimpenums.h
+++ b/libgimp/gimpenums.h
@@ -152,7 +152,8 @@ typedef enum
   GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
   GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
   GIMP_LAYER_MODE_LUMINANCE,
-  GIMP_LAYER_MODE_COLOR_ERASE
+  GIMP_LAYER_MODE_COLOR_ERASE,
+  GIMP_LAYER_MODE_ERASE
 } GimpLayerMode;
 
 
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index 4edf222..dfb3618 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -747,7 +747,7 @@ package Gimp::CodeGen::enums;
                          GIMP_LAYER_MODE_LUMA_DARKEN_ONLY
                          GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY
                          GIMP_LAYER_MODE_LUMINANCE
-                         GIMP_LAYER_MODE_COLOR_ERASE) ],
+                         GIMP_LAYER_MODE_COLOR_ERASE GIMP_LAYER_MODE_ERASE) ],
          mapping => { GIMP_LAYER_MODE_NORMAL_LEGACY => '0',
                       GIMP_LAYER_MODE_DISSOLVE => '1',
                       GIMP_LAYER_MODE_BEHIND_LEGACY => '2',
@@ -805,7 +805,8 @@ package Gimp::CodeGen::enums;
                       GIMP_LAYER_MODE_LUMA_DARKEN_ONLY => '54',
                       GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY => '55',
                       GIMP_LAYER_MODE_LUMINANCE => '56',
-                      GIMP_LAYER_MODE_COLOR_ERASE => '57' }
+                      GIMP_LAYER_MODE_COLOR_ERASE => '57',
+                      GIMP_LAYER_MODE_ERASE => '58' }
        },
     GimpConvertDitherType =>
        { contig => 1,


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