[gimp-perl] update all GIMP constants to 2.10 versions



commit 17bb499da1f346e5d289c85dbca775ab82a3e93d
Author: Ed J <mohawk2 users noreply github com>
Date:   Sat Apr 17 15:41:12 2021 +0100

    update all GIMP constants to 2.10 versions

 README                     |  8 ++++----
 examples/billboard         |  2 +-
 examples/blended2          | 14 +++++++-------
 examples/blowinout         |  2 +-
 examples/bricks            |  2 +-
 examples/ditherize         |  4 ++--
 examples/dots              |  4 ++--
 examples/dust              |  6 +++---
 examples/example-fu        |  4 ++--
 examples/example-net       |  4 ++--
 examples/example-no-fu     |  4 ++--
 examples/fade-alpha        |  4 ++--
 examples/gallery           |  2 +-
 examples/gimp-make-img-map | 34 +++++++++++++++++-----------------
 examples/glowing_steel     | 14 +++++++-------
 examples/goldenmean        |  4 ++--
 examples/iland             |  4 ++--
 examples/image_tile        |  2 +-
 examples/innerbevel        |  6 +++---
 examples/pixelmap          |  2 +-
 examples/prep4gif          |  4 ++--
 examples/randomart1        |  8 ++++----
 examples/randomblends      |  6 +++---
 examples/scratches         |  4 ++--
 examples/sethspin          |  4 ++--
 examples/stampify          |  6 +++---
 examples/stamps            |  6 +++---
 examples/tex-to-float      |  4 ++--
 examples/translogo         | 18 +++++++++---------
 examples/windify           |  2 +-
 examples/xachlego          |  4 ++--
 examples/xachshadow        |  6 +++---
 examples/xachvision        |  6 +++---
 examples/yinyang           |  2 +-
 lib/Gimp.pm                |  6 +++---
 lib/Gimp/Fu.pm             |  2 +-
 lib/Gimp/PixelRgn.pod      |  2 +-
 lib/Gimp/Util.pm           |  8 ++++----
 t/examples-api.pl          |  2 +-
 t/load.t                   |  6 +++---
 t/pdl.t                    |  6 +++---
 t/perlplugin.t             |  2 +-
 t/run.t                    |  2 +-
 utils/scm2perl             | 12 ++++++------
 44 files changed, 127 insertions(+), 127 deletions(-)
---
diff --git a/README b/README
index e56204bd..1ba2c7ff 100644
--- a/README
+++ b/README
@@ -10,10 +10,10 @@ SYNOPSIS
            # your code
           my $image = new Gimp::Image (600, 300, RGB);
           my $bg = $image->layer_new(
-            600,300,RGB_IMAGE,"Background",100,NORMAL_MODE
+            600,300,RGB_IMAGE,"Background",100,LAYER_MODE_NORMAL_LEGACY
           );
           $image->insert_layer($bg, 1, 0);
-          $image->edit_fill($bg, FOREGROUND_FILL);
+          $image->edit_fill($bg, FILL_FOREGROUND);
           Gimp::Display->new($image);
           $image;
          };
@@ -107,12 +107,12 @@ podregister {
   my $img = Gimp::Image->new($width, $height, RGB);
   $img->undo_group_start; # so all actions can be undone in one step
   # the __ before the string will translate it if available
-  my $l = Gimp::Layer->new($img, $width, $height, RGB, __"Background", 100, NORMAL_MODE);
+  my $l = Gimp::Layer->new($img, $width, $height, RGB, __"Background", 100, LAYER_MODE_NORMAL_LEGACY);
   $l->insert_layer(0, 0); # required!
   # now a few syntax examples
   Gimp::Context->set_foreground($text_colour) unless $ignore_cols;
   Gimp::Context->set_background($bg_colour) unless $ignore_cols;
-  fill $l BACKGROUND_FILL;
+  fill $l FILL_BACKGROUND;
   my $text_layer = $img->text_fontname(-1, 10, 10, $text, 5, 1, 10, PIXELS, $font);
   Gimp::Context->set_foreground("green");
   $img->undo_group_end; # close the undo group
diff --git a/examples/billboard b/examples/billboard
index 9099b77a..9e125d06 100755
--- a/examples/billboard
+++ b/examples/billboard
@@ -128,7 +128,7 @@ EOF
   # indexed conversion wants a display for some reason
   if ($convert_indexed) {
     $img->convert_indexed(1,            # dither type = fs
-      MAKE_PALETTE, # palette type
+      CONVERT_PALETTE_GENERATE, # palette type
       255,          # number of colors
       0,            # don't dither transparency
       1,            # (ignored)
diff --git a/examples/blended2 b/examples/blended2
index 1e6e4279..579c0c93 100755
--- a/examples/blended2
+++ b/examples/blended2
@@ -14,14 +14,14 @@ podregister {
   $drawable->edit_copy;
   $image->selection_none;
   if ($transparency == 0) {
-    my $bg_layer=$new_image->layer_new($drawable->width,$drawable->height,$image->layertype(1), 
"Background", 100, NORMAL_MODE);
+    my $bg_layer=$new_image->layer_new($drawable->width,$drawable->height,$image->layertype(1), 
"Background", 100, LAYER_MODE_NORMAL_LEGACY);
     Gimp::Context->set_background ($bg_col);
-    $bg_layer->drawable_fill(BACKGROUND_FILL);
+    $bg_layer->drawable_fill(FILL_BACKGROUND);
     $new_image->insert_layer($bg_layer,0,0);
   }
   my $text1_lay = $new_image->layer_new(
     $drawable->width,$drawable->height,
-    $image->layertype(1), "Text -1-", 100, NORMAL_MODE
+    $image->layertype(1), "Text -1-", 100, LAYER_MODE_NORMAL_LEGACY
   );
   $new_image->insert_layer($text1_lay,0,-1);
   $text1_lay->edit_clear;
@@ -32,8 +32,8 @@ podregister {
   my @start = ($text1_lay->width / 2 - 5, 0);
   my @end = ($text1_lay->width / 2 + 5, $text1_lay->height);
   $text1_lay->edit_blend(
-                  FG_BG_RGB_MODE,
-                  NORMAL_MODE,
+                  BLEND_FG_BG_RGB,
+                  LAYER_MODE_NORMAL_LEGACY,
                   GRADIENT_LINEAR,
                   100,
                   FALSE,
@@ -48,7 +48,7 @@ podregister {
   $text2_lay->add_alpha;
   $new_image->insert_layer($text2_lay, 0, -1);
   Gimp::Context->set_background ([255, 255, 255]);
-  $text2_lay->edit_fill(BACKGROUND_FILL);
+  $text2_lay->edit_fill(FILL_BACKGROUND);
   $text1_lay->set_lock_alpha(0);
   $text2_lay->set_lock_alpha(0);
   $text2_lay->gauss_rle( 6, 1, 1);
@@ -59,7 +59,7 @@ podregister {
   $text2_lay->set_opacity(75);
   $new_image->flatten;
   if ($transparency == 1) {
-    $new_image->convert_indexed(0, MAKE_PALETTE, 256, 0, 0, "");
+    $new_image->convert_indexed(0, CONVERT_PALETTE_GENERATE, 256, 0, 0, "");
     my $new_layer = $new_image->get_active_layer;
     $new_layer->add_alpha;
     Gimp::Context->set_sample_threshold(0.55);
diff --git a/examples/blowinout b/examples/blowinout
index 0fee0aef..b6fe9871 100755
--- a/examples/blowinout
+++ b/examples/blowinout
@@ -21,7 +21,7 @@ podregister {
   my $dm = Gimp::Image->new($xsize, $ysize, 1);
   # It needs to have 2 layers
   my $dmlayer = Gimp::Layer->new($dm, $xsize, $ysize, GRAY_IMAGE, "newlayer",
-    100, NORMAL_MODE);
+    100, LAYER_MODE_NORMAL_LEGACY);
   $dm->insert_layer($dmlayer, 0, 0);
 
   # Create the layers, one-by-one
diff --git a/examples/bricks b/examples/bricks
index 2197755a..5c9fcf95 100755
--- a/examples/bricks
+++ b/examples/bricks
@@ -76,7 +76,7 @@ podregister {
   }
   $image->undo_group_end;
   Gimp::Context->set_background ($color);
-  my $layerb = $image->image_add_new_layer(1,BACKGROUND_FILL,0);
+  my $layerb = $image->image_add_new_layer(1,FILL_BACKGROUND,0);
   $image->selection_all;
   if ($borderpatuse) {
     Gimp::Context->set_pattern($borderpattern);
diff --git a/examples/ditherize b/examples/ditherize
index 53fbc42d..01e861a6 100755
--- a/examples/ditherize
+++ b/examples/ditherize
@@ -28,11 +28,11 @@ podregister {
   my $draw = new Gimp::Layer(
     $copy, $w, $h,
     $imagetype2layertype{$image->base_type},
-    "temporary layer", 100, NORMAL_MODE
+    "temporary layer", 100, LAYER_MODE_NORMAL_LEGACY
   );
   $copy->insert_layer ($draw, 0, 1);
   $draw->edit_paste(0)->anchor;
-  $copy->convert_indexed ($dither_type, MAKE_PALETTE, $colours, 1, 1, "");
+  $copy->convert_indexed ($dither_type, CONVERT_PALETTE_GENERATE, $colours, 1, 1, "");
   $draw->edit_copy;
   $drawable->edit_paste(1)->anchor;
   $copy->delete;
diff --git a/examples/dots b/examples/dots
index 6ab53a50..91368798 100755
--- a/examples/dots
+++ b/examples/dots
@@ -33,13 +33,13 @@ podregister {
   my $opc = Gimp::Channel->new($image,$image->width,$image->height,"OPC", 50, [0,0,0]);
   $image->insert_channel($opc,0,0);
   Gimp::Context->set_foreground([($opacity/100.0)x3]);
-  $opc->fill(FOREGROUND_FILL);
+  $opc->fill(FILL_FOREGROUND);
   $image->select_item(CHANNEL_OP_INTERSECT, $opc);
 # And mask off with original selection
   $image->select_item(CHANNEL_OP_INTERSECT, $selchannel);
 # Make the dots
   Gimp::Context->set_foreground($dotcolor);
-  $drawable->edit_fill(FOREGROUND_FILL);
+  $drawable->edit_fill(FILL_FOREGROUND);
 # Cleanup to state before plugin was called
   if ($has_noselection) {
     $image->selection_none;
diff --git a/examples/dust b/examples/dust
index c8929cba..07eab18e 100755
--- a/examples/dust
+++ b/examples/dust
@@ -62,9 +62,9 @@ podregister {
   Gimp::Context->set_brush($brush);
   Gimp::Brushes->set_spacing($brush, 100);
   Gimp::Context->set_opacity(50);
-  Gimp::Context->set_paint_mode(NORMAL_MODE);
-  $drawable = $image->add_new_layer (0, TRANSPARENT_FILL, 1);
-  $drawable->set_mode (DIFFERENCE_MODE);
+  Gimp::Context->set_paint_mode(LAYER_MODE_NORMAL_LEGACY);
+  $drawable = $image->add_new_layer (0, FILL_TRANSPARENT, 1);
+  $drawable->set_mode (LAYER_MODE_DIFFERENCE_LEGACY);
   for (1..($w*$h*$density)) {
     my ($x, $y) = (rand $w, rand $h);
     my $l = int($length + rand $length);
diff --git a/examples/example-fu b/examples/example-fu
index 23ec4ac8..f8589b02 100755
--- a/examples/example-fu
+++ b/examples/example-fu
@@ -12,12 +12,12 @@ podregister {
   my $img = Gimp::Image->new($width, $height, RGB);
   $img->undo_group_start; # so all actions can be undone in one step
   # the __ before the string will translate it if available
-  my $l = Gimp::Layer->new($img, $width, $height, RGB, __"Background", 100, NORMAL_MODE);
+  my $l = Gimp::Layer->new($img, $width, $height, RGB, __"Background", 100, LAYER_MODE_NORMAL_LEGACY);
   $l->insert_layer(0, 0); # required!
   # now a few syntax examples
   Gimp::Context->set_foreground($text_colour) unless $ignore_cols;
   Gimp::Context->set_background($bg_colour) unless $ignore_cols;
-  fill $l BACKGROUND_FILL;
+  fill $l FILL_BACKGROUND;
   my $text_layer = $img->text_fontname(-1, 10, 10, $text, 5, 1, 10, PIXELS, $font);
   Gimp::Context->set_foreground("green");
   $img->undo_group_end; # close the undo group
diff --git a/examples/example-net b/examples/example-net
index ba3230a6..9b6c7c40 100755
--- a/examples/example-net
+++ b/examples/example-net
@@ -12,14 +12,14 @@ Gimp::on_lib {
 # spawning a GIMP without an interface to run on.
 Gimp::on_net {
   my $img=Gimp::Image->new(600,300,RGB);
-  my $bg=$img->layer_new(30,20,RGB_IMAGE,"Background",100,NORMAL_MODE);
+  my $bg=$img->layer_new(30,20,RGB_IMAGE,"Background",100,LAYER_MODE_NORMAL_LEGACY);
   $img->insert_layer($bg,0,1); # you have to add a layer after you create it
   eval { Gimp::Display->new($img); }; # Show it (this slows things down)
 # do a bunch of operations just as a speed test, flushing in between
   Gimp::Context->push;
   for $i (0..255) {
      Gimp::Context->set_background([$i,255-$i,$i]);
-     $bg->edit_fill(BACKGROUND_FILL);
+     $bg->edit_fill(FILL_BACKGROUND);
      Gimp::Display->displays_flush();
   }
   Gimp::Context->pop;
diff --git a/examples/example-no-fu b/examples/example-no-fu
index 27563d22..f29bf1fa 100755
--- a/examples/example-no-fu
+++ b/examples/example-no-fu
@@ -795,7 +795,7 @@ sub do_fade {
 
   my $mask;
   unless ($mask = $drawable->get_mask) {
-    $mask = $drawable->create_mask(ADD_ALPHA_MASK);
+    $mask = $drawable->create_mask(ADD_MASK_ALPHA);
     $drawable->add_mask($mask);
   }
 
@@ -811,7 +811,7 @@ sub do_fade {
   # (1,2) (3,2)
   # (1,4) (3,4)
   my @blend_args = (
-    FG_BG_RGB_MODE, NORMAL_MODE,
+    BLEND_FG_BG_RGB, LAYER_MODE_NORMAL_LEGACY,
     ($direction == 4 ? GRADIENT_RADIAL : GRADIENT_LINEAR),
     100.0,       # opacity
     0.0,         # offset
diff --git a/examples/fade-alpha b/examples/fade-alpha
index 89a92e08..52e9d940 100755
--- a/examples/fade-alpha
+++ b/examples/fade-alpha
@@ -778,7 +778,7 @@ podregister {
   $drawable->add_alpha unless $drawable->has_alpha;
   my $mask;
   unless ($mask = $drawable->get_mask) {
-    $mask = $drawable->create_mask(ADD_ALPHA_MASK);
+    $mask = $drawable->create_mask(ADD_MASK_ALPHA);
     $drawable->add_mask($mask);
   }
   Gimp::Context->push;
@@ -792,7 +792,7 @@ podregister {
   # (1,2) (3,2)
   # (1,4) (3,4)
   my @blend_args = (
-    FG_BG_RGB_MODE, NORMAL_MODE,
+    BLEND_FG_BG_RGB, LAYER_MODE_NORMAL_LEGACY,
     ($direction == 4 ? GRADIENT_RADIAL : GRADIENT_LINEAR),
     100.0,       # opacity
     0.0,         # offset
diff --git a/examples/gallery b/examples/gallery
index 02b1da5f..338b5f7f 100755
--- a/examples/gallery
+++ b/examples/gallery
@@ -66,7 +66,7 @@ podregister {
     $clayer->brightness_contrast($bright, $contrast)
       if $bright != 0 or $contrast != 0;
     if ($label ne "") {
-      my $newlayer = $img->layer_new(200, 100, RGB_IMAGE, "newlayer", 100, NORMAL_MODE);
+      my $newlayer = $img->layer_new(200, 100, RGB_IMAGE, "newlayer", 100, LAYER_MODE_NORMAL_LEGACY);
       Gimp::Context->set_foreground($labelcolor);
       my $txtlayer = $img->text_fontname(-1, 1, 1, $label, 0, 0, 16, 0, $font);
       if ($twidthEval == 0) {
diff --git a/examples/gimp-make-img-map b/examples/gimp-make-img-map
index 298a6538..4e676707 100755
--- a/examples/gimp-make-img-map
+++ b/examples/gimp-make-img-map
@@ -155,11 +155,11 @@ sub decoration_drop_shadow {
     # Put them on a row
     $tiled_img = gimp_image_new($total_width, $total_height, RGB);
     $tiled_drw = gimp_layer_new($tiled_img, $total_width, $total_height,
-                               RGB_IMAGE, "Tiled", 100, NORMAL_MODE);
+                               RGB_IMAGE, "Tiled", 100, LAYER_MODE_NORMAL_LEGACY);
     $tiled_shadow = gimp_layer_new($tiled_img, $total_width, $total_height,
-                                  RGB_IMAGE, "Shadow", 50, NORMAL_MODE);
+                                  RGB_IMAGE, "Shadow", 50, LAYER_MODE_NORMAL_LEGACY);
     $tiled_background = gimp_layer_new($tiled_img, $total_width, $total_height,
-                                      RGB_IMAGE, "Background", 100, NORMAL_MODE);
+                                      RGB_IMAGE, "Background", 100, LAYER_MODE_NORMAL_LEGACY);
 
     # Create masks
     $tiled_drw_msk = $tiled_drw->create_mask(1);
@@ -175,18 +175,18 @@ sub decoration_drop_shadow {
 
     # Fill all the layers with some contents
     gimp_context_set_background([128,128,128]);
-    $tiled_drw->edit_fill(BACKGROUND_FILL);
+    $tiled_drw->edit_fill(FILL_BACKGROUND);
 
     gimp_context_set_background($bgcolor);
-    $tiled_background->edit_fill(BACKGROUND_FILL);
+    $tiled_background->edit_fill(FILL_BACKGROUND);
     if ($bgpattern) {
        print "Setting pattern\n";
        gimp_context_set_pattern($bgpattern);
-       $tiled_background->edit_bucket_fill(PATTERN_BUCKET_FILL,
+       $tiled_background->edit_bucket_fill(FILL_PATTERN,
                                       NORMAL, 100, 0, FALSE, 0,0);
     }
     gimp_context_set_background([0, 0, 0]);  # Shadow color
-    $tiled_shadow->edit_fill(BACKGROUND_FILL);
+    $tiled_shadow->edit_fill(FILL_BACKGROUND);
 
     # Add all the layers to the image
     $tiled_img->insert_layer($tiled_background,0,-1);
@@ -211,12 +211,12 @@ sub decoration_drop_shadow {
 
        # why is the selection cleared?
        $tiled_img->select_rectangle(0, $xpos, $ypos, $w, $h);
-       $tiled_drw_msk->edit_fill(BACKGROUND_FILL);
+       $tiled_drw_msk->edit_fill(FILL_BACKGROUND);
 
        # why is the selection cleared?
        $tiled_img->select_rectangle(0, $xpos+$shadow_xoffs,
                                $ypos+$shadow_yoffs, $w, $h);
-       $tiled_shadow_msk->edit_fill(BACKGROUND_FILL);
+       $tiled_shadow_msk->edit_fill(FILL_BACKGROUND);
 
        $tiled_img->selection_none();
 
@@ -238,11 +238,11 @@ sub decoration_sunken_windows {
     # Create needed image and layers
     $tiled_img = gimp_image_new($total_width, $total_height, RGB);
     $tiled_drw = gimp_layer_new($tiled_img, $total_width, $total_height,
-                               RGB_IMAGE, "Tiled", 100, NORMAL_MODE);
+                               RGB_IMAGE, "Tiled", 100, LAYER_MODE_NORMAL_LEGACY);
     $tiled_punch_layer = gimp_layer_new($tiled_img, $total_width, $total_height,
-                               RGB_IMAGE, "Punched", 100, NORMAL_MODE);
+                               RGB_IMAGE, "Punched", 100, LAYER_MODE_NORMAL_LEGACY);
     $tiled_punch_stencil = gimp_layer_new($tiled_img, $total_width, $total_height,
-                               RGB_IMAGE, "Punch mask", 100, NORMAL_MODE);
+                               RGB_IMAGE, "Punch mask", 100, LAYER_MODE_NORMAL_LEGACY);
     # Create masks
     $tiled_punch_mask = $tiled_punch_layer->create_mask(0);
 
@@ -254,18 +254,18 @@ sub decoration_sunken_windows {
 
     # Fill all the layers with some contents
     gimp_context_set_background([128,128,128]);
-    $tiled_drw->edit_fill(BACKGROUND_FILL);
+    $tiled_drw->edit_fill(FILL_BACKGROUND);
 
     gimp_context_set_background($bgcolor);
-    $tiled_punch_layer->edit_fill(BACKGROUND_FILL);
+    $tiled_punch_layer->edit_fill(FILL_BACKGROUND);
     if ($bgpattern) {
        print "Setting pattern\n";
        gimp_context_set_pattern($bgpattern);
-       $tiled_punch_layer->edit_bucket_fill(PATTERN_BUCKET_FILL,
+       $tiled_punch_layer->edit_bucket_fill(FILL_PATTERN,
                                NORMAL, 100, 0, FALSE, 0,0);
     }
     gimp_context_set_background([255, 255, 255]);  # Punch stencil
-    $tiled_punch_stencil->edit_fill(BACKGROUND_FILL);
+    $tiled_punch_stencil->edit_fill(FILL_BACKGROUND);
 
     # Add all the layers to the image
     $tiled_img->insert_layer($tiled_punch_stencil,0,-1);
@@ -292,7 +292,7 @@ sub decoration_sunken_windows {
        $bw = 3;
        $tiled_img->select_rectangle(0, $xpos-$bw,
                                $ypos-$bw, $w+2*$bw, $h+2*$bw);
-       $tiled_punch_stencil->edit_fill(BACKGROUND_FILL);
+       $tiled_punch_stencil->edit_fill(FILL_BACKGROUND);
 
        # why is the selection cleared?
        $tiled_img->selection_none();
diff --git a/examples/glowing_steel b/examples/glowing_steel
index ac8e50ec..84fcd405 100755
--- a/examples/glowing_steel
+++ b/examples/glowing_steel
@@ -30,7 +30,7 @@ sub perl_fu_glowing_steel {
   my $height = $textlayer->height+$radius*4;
   $image->resize($width, $height, 0, 0);
   my $backlayer = $image->layer_new($width, $height, RGBA_IMAGE,
-                                "Background", 100, NORMAL_MODE);
+                                "Background", 100, LAYER_MODE_NORMAL_LEGACY);
   $image->insert_layer($backlayer, 0, 1);
 
   $textlayer->set_lock_alpha(1);
@@ -49,7 +49,7 @@ sub perl_fu_glowing_steel {
   # Fill the background
   $image->selection_all;
   Gimp::Context->set_foreground($background);
-  $backlayer->edit_bucket_fill(FG_BUCKET_FILL, NORMAL_MODE, 100, 0, 1, 0, 0);
+  $backlayer->edit_bucket_fill(BUCKET_FILL_FG, LAYER_MODE_NORMAL_LEGACY, 100, 0, 1, 0, 0);
 
   # Make the glow:
   perl_fu_add_glow($image, $textlayer, $glow, $radius);
@@ -84,7 +84,7 @@ sub perl_fu_add_glow {
 
   my $type = $drawable->type;
   my $glow = $image->layer_new(
-    $image->width, $image->height, $type, "Glow layer", 100, NORMAL_MODE
+    $image->width, $image->height, $type, "Glow layer", 100, LAYER_MODE_NORMAL_LEGACY
   );
   my $lnum = $image->get_item_position($drawable);
   $image->insert_layer($glow, 0, $lnum);
@@ -100,7 +100,7 @@ sub perl_fu_add_glow {
   $image->select_item(CHANNEL_OP_REPLACE, $drawable);
   $image->selection_grow($radius);
   $image->selection_feather($radius*1.5);
-  $glow->edit_bucket_fill(FG_BUCKET_FILL, NORMAL_MODE, 100, 255, 0, 0, 0);
+  $glow->edit_bucket_fill(BUCKET_FILL_FG, LAYER_MODE_NORMAL_LEGACY, 100, 255, 0, 0, 0);
   $image->select_item(CHANNEL_OP_REPLACE, $drawable);
   $glow->edit_clear;
   $image->select_item(CHANNEL_OP_REPLACE, $old_sel);
@@ -140,7 +140,7 @@ sub perl_fu_brushed_metal {
   my $width = abs($x2-$x1);
   my $height = abs($y2-$y1);
   my $templ = $image->layer_new($width, $height, RGBA_IMAGE, "Temp",
-                            100, NORMAL_MODE);
+                            100, LAYER_MODE_NORMAL_LEGACY);
   $image->insert_layer($templ, 0, 0);
   $templ->set_offsets($x1+$length, $y1+$length);
   my $target_select = $image->selection_save;
@@ -199,9 +199,9 @@ sub perl_fu_highlight_edges {
   Gimp::Context->push();
 
   Gimp::Context->set_foreground([255,255,255]);
-  $white->edit_bucket_fill(FG_BUCKET_FILL, NORMAL_MODE, 100, 255, 0, 0, 0);
+  $white->edit_bucket_fill(BUCKET_FILL_FG, LAYER_MODE_NORMAL_LEGACY, 100, 255, 0, 0, 0);
   Gimp::Context->set_foreground([0,0,0]);
-  $black->edit_bucket_fill(FG_BUCKET_FILL, NORMAL_MODE, 100, 255, 0, 0, 0);
+  $black->edit_bucket_fill(BUCKET_FILL_FG, LAYER_MODE_NORMAL_LEGACY, 100, 255, 0, 0, 0);
   $white->translate(-1*$pixels, -1*$pixels);
   $black->translate(1*$pixels, 1*$pixels);
   $white = $image->merge_down($white, EXPAND_AS_NECESSARY);
diff --git a/examples/goldenmean b/examples/goldenmean
index 0c612982..f507d64a 100755
--- a/examples/goldenmean
+++ b/examples/goldenmean
@@ -14,10 +14,10 @@ podregister {
     $height = $short;
   }
   my $img = Gimp::Image->new($width, $height, RGB_IMAGE);
-  my $layer = $img->layer_new($width, $height, RGB_IMAGE, "Layer 1", 100, NORMAL_MODE);
+  my $layer = $img->layer_new($width, $height, RGB_IMAGE, "Layer 1", 100, LAYER_MODE_NORMAL_LEGACY);
   $img->insert_layer($layer, 0, -1);
   Gimp::Context->push();
-  $layer->edit_fill(BACKGROUND_FILL);
+  $layer->edit_fill(FILL_BACKGROUND);
   Gimp::Context->pop();
   eval { Gimp::Display->new($img); };
   return $img;
diff --git a/examples/iland b/examples/iland
index f08a2f1a..124b182d 100755
--- a/examples/iland
+++ b/examples/iland
@@ -24,7 +24,7 @@ podregister {
   my $layer = $newimage->layer_new(
     $width, $height,
     $alpha ? RGBA_IMAGE : RGB_IMAGE,
-    "L1", 100, NORMAL_MODE
+    "L1", 100, LAYER_MODE_NORMAL_LEGACY
   );
   $newimage->insert_layer($layer, 0, -1);
   my $newdrawable = $newimage->get_active_drawable;
@@ -33,7 +33,7 @@ podregister {
   my $destdata = $srcdata->zeroes;
   Gimp::Progress->init("Rendering...");
   my $relord = $width / 255;
-  $newdrawable->fill(FOREGROUND_FILL);
+  $newdrawable->fill(FILL_FOREGROUND);
   $delta = 1 if $delta < 1;
   for (my $y = 0; $y < $height; $y++){
     my $row = $srcdata->slice('', '', "($y)");
diff --git a/examples/image_tile b/examples/image_tile
index 1fc378c7..22ea8a52 100755
--- a/examples/image_tile
+++ b/examples/image_tile
@@ -113,7 +113,7 @@ podregister {
   # Now store color info for target image
   my $dup = Gimp::Image->new($imgwidth,$imgheight,RGB_IMAGE);
   $drawable->edit_copy;
-  my $back = $dup->layer_new($imgwidth, $imgheight, RGB_IMAGE, "Target", 100, NORMAL_MODE);
+  my $back = $dup->layer_new($imgwidth, $imgheight, RGB_IMAGE, "Target", 100, LAYER_MODE_NORMAL_LEGACY);
   $dup->insert_layer($back, 0, 0);
   $back->edit_paste(FALSE)->floating_sel_anchor;
   my $oimage = get_image_cells($dup, $xtiles*$xcells, $ytiles*$ycells, $imgwidth/$imgheight, 40, 60);
diff --git a/examples/innerbevel b/examples/innerbevel
index 72d5a8fd..504f81f8 100755
--- a/examples/innerbevel
+++ b/examples/innerbevel
@@ -20,7 +20,7 @@ podregister {
   # i.e. create a text layer on transparent only...
 
   # -- step 2 --
-  $img->add_new_layer(0,TRANSPARENT_FILL);
+  $img->add_new_layer(0,FILL_TRANSPARENT);
   $img->text_fontname(-1, 10, 10, $text, 0, 1, $fontsize, PIXELS, $font);
   eval { Gimp::Display->new($img); }; # display the image early
   my $layer = $img->merge_visible_layers(EXPAND_AS_NECESSARY);
@@ -28,7 +28,7 @@ podregister {
   my @pt2 = ($layer->width * 0.5 +1, $layer->height);
   # -- step 3 --
   $layer->set_lock_alpha(1);
-  $layer->edit_blend(FG_BG_RGB_MODE, NORMAL_MODE, GRADIENT_LINEAR, 100, 0, REPEAT_NONE, 0, 0, 0, 3, 0.20, 
@pt1, @pt2);
+  $layer->edit_blend(BLEND_FG_BG_RGB, LAYER_MODE_NORMAL_LEGACY, GRADIENT_LINEAR, 100, 0, REPEAT_NONE, 0, 0, 
0, 3, 0.20, @pt1, @pt2);
   # -- step 4 --
   my $layer2 = $layer->copy(0);     # Can you override these to have a default? (would be nice)
   $img->insert_layer($layer2, 0, 0);
@@ -36,7 +36,7 @@ podregister {
   $layer2->set_lock_alpha(1);
   $img->selection_all;
   Gimp::Context->set_background([1.0,1.0,1.0]);
-  $layer2->edit_fill(BACKGROUND_FILL);
+  $layer2->edit_fill(FILL_BACKGROUND);
   # -- step 6 --
   $layer2->set_lock_alpha(0);
   $layer2->gauss_rle(6,1,1);
diff --git a/examples/pixelmap b/examples/pixelmap
index 8d811379..2e250f25 100755
--- a/examples/pixelmap
+++ b/examples/pixelmap
@@ -81,7 +81,7 @@ register "pixelgen",
    my $image = new Gimp::Image $w, $h, Gimp->layer2imagetype($type);
    my $layername = $expr;
    $layername =~ s/\n//g;
-   my $layer = new Gimp::Layer $image, $w, $h, $type, $layername, 100, NORMAL_MODE;
+   my $layer = new Gimp::Layer $image, $w, $h, $type, $layername, 100, LAYER_MODE_NORMAL_LEGACY;
    $image->insert_layer($layer, 0, 0);
    eval { pixelmap($image, $layer, $expr) };
    if ($@) {
diff --git a/examples/prep4gif b/examples/prep4gif
index 36d150e2..b1a61714 100755
--- a/examples/prep4gif
+++ b/examples/prep4gif
@@ -23,7 +23,7 @@ podregister {
     $foreground = $layers[0];
   }
 
-  my $layer_mask = $foreground->create_mask(ADD_ALPHA_MASK);
+  my $layer_mask = $foreground->create_mask(ADD_MASK_ALPHA);
   $foreground->add_mask ($layer_mask);
   $layer_mask->threshold($threshold, 255);
 
@@ -42,7 +42,7 @@ podregister {
   my $outlayer = $out->merge_visible_layers(EXPAND_AS_NECESSARY);
 
 # Convert to indexed
-  $out->convert_indexed(FS_DITHER, MAKE_PALETTE, $colors, $dither, TRUE, "")
+  $out->convert_indexed(CONVERT_DITHER_FS, CONVERT_PALETTE_GENERATE, $colors, $dither, TRUE, "")
     if $index;
   ();
 };
diff --git a/examples/randomart1 b/examples/randomart1
index cfe78efb..10985280 100755
--- a/examples/randomart1
+++ b/examples/randomart1
@@ -17,7 +17,7 @@ podregister {
 
    # Erzeuge die erste Ebene f�r das Bild
    my $layer = $image->layer_new($width,$height,RGB_IMAGE,
-                  "Random Art #1",100,NORMAL_MODE);
+                  "Random Art #1",100,LAYER_MODE_NORMAL_LEGACY);
 
    # F�ge sie in das Bild ein
    $image->insert_layer($layer,0,0);
@@ -26,7 +26,7 @@ podregister {
    Gimp::Context->set_background('white');
 
    # ...und l�sche die Ebene damit
-   $layer->fill(BACKGROUND_FILL);
+   $layer->fill(FILL_BACKGROUND);
 
    # Jetzt wurde ein neues, leeres Bild erzeugt, und
    # das Zeichnen kann beginnen.
@@ -51,8 +51,8 @@ podregister {
       Gimp::Context->set_background([rand(256)/256.0,rand(256)/256.0,rand(256)/256.0]);
 
       # Und erzeuge einen Farbverlauf �ber das Bild
-      $layer->edit_blend (FG_BG_HSV_MODE,
-                    DIFFERENCE_MODE,
+      $layer->edit_blend (BLEND_FG_BG_HSV,
+                    LAYER_MODE_DIFFERENCE_LEGACY,
                     GRADIENT_LINEAR,         # gradient type
                     100,                     # opacity
                     0,                       # offset
diff --git a/examples/randomblends b/examples/randomblends
index 20174370..9d93db54 100755
--- a/examples/randomblends
+++ b/examples/randomblends
@@ -20,8 +20,8 @@ podregister {
     Gimp::Progress->init("Random blends...");
     for (my $i=0; $i<$numgradients; $i++) {
         Gimp::Context->set_gradient(@gradientlist[randint($#gradientlist)]);
-       $drawable->edit_blend(CUSTOM_MODE,
-                       DIFFERENCE_MODE,
+       $drawable->edit_blend(BLEND_CUSTOM,
+                       LAYER_MODE_DIFFERENCE_LEGACY,
                        randint(10),      # gradient type
                        randint(100),     # opacity
                        0,                # offset
@@ -55,7 +55,7 @@ random_blends - Perform N random blends
 
 =head1 DESCRIPTION
 
-A random approach to art, using the blend tool with DIFFERENCE_MODE.
+A random approach to art, using the blend tool with LAYER_MODE_DIFFERENCE_LEGACY.
 Alpha is not affected; best used on opaque background.
 Just try it. It might be good.
 
diff --git a/examples/scratches b/examples/scratches
index e2d3a8ec..ca1b1746 100755
--- a/examples/scratches
+++ b/examples/scratches
@@ -14,9 +14,9 @@ sub new_scratchlayer {
     my ($image,$drawable,$length,$gamma,$angle) = @_;
     my $type = $image->layertype(0);
     my $layer = $image->layer_new ($drawable->width, $drawable->height, $image->layertype(0),
-                                  "displace layer ($angle)", 100, NORMAL_MODE);
+                                  "displace layer ($angle)", 100, LAYER_MODE_NORMAL_LEGACY);
     $layer->insert_layer(0, -1);
-    $layer->fill (WHITE_FILL);
+    $layer->fill (FILL_WHITE);
     $layer->noisify (0, 1, 1, 1, 0);
     $layer->mblur (0, $length, $angle, 0, 0);
     $layer->levels (HISTOGRAM_VALUE, 120, 255, 0.3, 0, 255);
diff --git a/examples/sethspin b/examples/sethspin
index d10e60b9..cbf42c27 100755
--- a/examples/sethspin
+++ b/examples/sethspin
@@ -48,7 +48,7 @@ sub spin_layer { # the function for actually spinning the layer
       $x[1]-$saw_prp_width,$y3,
       $x[3]+$saw_prp_width,$y3,
     );
-    $framelay->fill(BACKGROUND_FILL);
+    $framelay->fill(FILL_BACKGROUND);
     # merge the two layers together before we continue
     $img->set_visible($floater, $framelay); # all others invis
     $framelay = $img->merge_visible_layers(EXPAND_AS_NECESSARY);
@@ -93,7 +93,7 @@ podregister {
   my @all_layers = $img->get_layers;
   $all_layers[$frames/2-1]->set_name(__"Spin Layer DEST (250ms)") if $spinback;
   $all_layers[$frames-1]->set_name(__"Spin Layer SRC (250ms)");
-  $img->convert_indexed(1,MAKE_PALETTE,255,0,1,"buffy") if $indexed;
+  $img->convert_indexed(1,CONVERT_PALETTE_GENERATE,255,0,1,"buffy") if $indexed;
   Gimp::Context->pop;
   return $img;
 };
diff --git a/examples/stampify b/examples/stampify
index df5567cc..3316b619 100755
--- a/examples/stampify
+++ b/examples/stampify
@@ -9,11 +9,11 @@ podregister {
   my $nw = int($image->width + 2 * $marg + $diameter);
   my $nh = int($image->height + 2 * $marg + $diameter);
   my $img2 = Gimp::Image->new($nw, $nh, RGB);
-  my $layer1 = $img2->layer_new($nw, $nh, RGBA_IMAGE, "Layer 1", 100, NORMAL_MODE);
+  my $layer1 = $img2->layer_new($nw, $nh, RGBA_IMAGE, "Layer 1", 100, LAYER_MODE_NORMAL_LEGACY);
   $img2->insert_layer($layer1, 0, 0);
   $img2->set_active_layer($layer1);
   Gimp::Context->set_background($paper);
-  $layer1->edit_fill(BACKGROUND_FILL);
+  $layer1->edit_fill(FILL_BACKGROUND);
 # create horisontal holes
   $img2->selection_none;
   my $nholes = int (($nw + $gap) / ($diameter + $gap) + 0.5);
@@ -32,7 +32,7 @@ podregister {
     $pos = $pos + $diameter + $gap;
   }
   Gimp::Context->set_background($hole);
-  $layer1->edit_fill(BACKGROUND_FILL);
+  $layer1->edit_fill(FILL_BACKGROUND);
   $img2->selection_none;
 # here comes the clever part! :-)
 # offset horis and vert holes by half the diameter
diff --git a/examples/stamps b/examples/stamps
index 18fb20a1..eb75eafb 100755
--- a/examples/stamps
+++ b/examples/stamps
@@ -10,10 +10,10 @@ N_"/Xtns/Render"; # dummy translation for i18n bugs
 podregister {
   Gimp::Context->set_background($paper);
   my $img = Gimp::Image->new($size, $size, RGB);
-  my $layer = $img->layer_new($size, $size, RGB_IMAGE, "Layer 1", 100, NORMAL_MODE);
+  my $layer = $img->layer_new($size, $size, RGB_IMAGE, "Layer 1", 100, LAYER_MODE_NORMAL_LEGACY);
   $img->insert_layer($layer, 0, -1);
   Gimp::Context->set_background($hole);
-  $layer->edit_fill(BACKGROUND_FILL);
+  $layer->edit_fill(FILL_BACKGROUND);
   $img->selection_none;
   my $ncircles = int(($size + $gap) / ($diameter + $gap));
   my $x = 0;
@@ -23,7 +23,7 @@ podregister {
     $x += $diameter + $gap;
   }
   Gimp::Context->set_background($paper);
-  $layer->edit_fill(BACKGROUND_FILL);
+  $layer->edit_fill(FILL_BACKGROUND);
   $img->selection_none;
 # here, at last, comes the clever part! :-)
   $layer->offset(1, 0, -($diameter / 2), -($diameter / 2));
diff --git a/examples/tex-to-float b/examples/tex-to-float
index 1c3d9eb0..92eddfc4 100755
--- a/examples/tex-to-float
+++ b/examples/tex-to-float
@@ -112,14 +112,14 @@ sub grey_file_to_float {
   gimp_floating_sel_anchor($floating_layer);
   gimp_invert($mask);
   gimp_context_set_background(gimp_context_get_foreground());
-  gimp_edit_fill($grey_layer, BACKGROUND_FILL);
+  gimp_edit_fill($grey_layer, FILL_BACKGROUND);
   gimp_layer_remove_mask($grey_layer, 0);
 
   # Now copy this layer to $img 1
   gimp_edit_copy($grey_layer);
   $floating_layer = gimp_edit_paste($drawable, 0);
   gimp_layer_set_lock_alpha($floating_layer, 1);
-  gimp_edit_fill($floating_layer, BACKGROUND_FILL);
+  gimp_edit_fill($floating_layer, FILL_BACKGROUND);
 
   cleanup();
 
diff --git a/examples/translogo b/examples/translogo
index 3e283b52..421d6a99 100755
--- a/examples/translogo
+++ b/examples/translogo
@@ -18,30 +18,30 @@ podregister {
   $drawable->get_image->selection_all;
   $drawable->edit_copy;
   $image->selection_none;
-  my $layer = $img->layer_new($drawable->width,$drawable->height,$image->layertype(1), __"Text", 100, 
NORMAL_MODE);
-  $layer->drawable_fill(TRANSPARENT_FILL);
+  my $layer = $img->layer_new($drawable->width,$drawable->height,$image->layertype(1), __"Text", 100, 
LAYER_MODE_NORMAL_LEGACY);
+  $layer->drawable_fill(FILL_TRANSPARENT);
   $img->insert_layer($layer,0,0);
   $layer->edit_paste(0)->floating_sel_anchor;
   $img->resize($drawable->width,$drawable->height, 0, 0);
   $img->select_item(CHANNEL_OP_REPLACE, $layer);
   $img->selection_invert;
   Gimp::Context->set_background ([255, 255, 255]);
-  $layer->edit_fill(BACKGROUND_FILL);
+  $layer->edit_fill(FILL_BACKGROUND);
   $img->selection_none;
   $layer->invert;
   $layer->gauss_rle(2.0, 1, 1);
-  my $bump_lay = $img->layer_new($img->width,$img->height, RGBA_IMAGE, __"Bumpmap", 100, NORMAL_MODE);
-  $bump_lay->drawable_fill(BACKGROUND_FILL);
+  my $bump_lay = $img->layer_new($img->width,$img->height, RGBA_IMAGE, __"Bumpmap", 100, 
LAYER_MODE_NORMAL_LEGACY);
+  $bump_lay->drawable_fill(FILL_BACKGROUND);
   $img->insert_layer($bump_lay,0,0);
   if ($color_or_pattern == 1) {
     Gimp::Context->set_pattern ($pattern);
-    $bump_lay->edit_bucket_fill(PATTERN_BUCKET_FILL, NORMAL_MODE, 100, 0, 0, 0, 0);
+    $bump_lay->edit_bucket_fill(FILL_PATTERN, LAYER_MODE_NORMAL_LEGACY, 100, 0, 0, 0, 0);
   } else {
     Gimp::Context->set_background ($txt_col);
-    $bump_lay->edit_fill(BACKGROUND_FILL);
+    $bump_lay->edit_fill(FILL_BACKGROUND);
   }
   $bump_lay->bump_map($layer, 110.0, 45.0, 4, 0, 0, 0, 0, 1, 0, 0);
-  my $pattern_mask = $bump_lay->create_mask(ADD_ALPHA_MASK);
+  my $pattern_mask = $bump_lay->create_mask(ADD_MASK_ALPHA);
   $bump_lay->add_mask($pattern_mask);
   $img->selection_all;
   $layer->edit_copy;
@@ -50,7 +50,7 @@ podregister {
   $bump_lay->remove_mask(MASK_APPLY);
   $layer->invert;
   $img->flatten;
-  $img->convert_indexed(0, MAKE_PALETTE, 256, 0, 0, "");
+  $img->convert_indexed(0, CONVERT_PALETTE_GENERATE, 256, 0, 0, "");
   my $new = $img->get_active_layer;
   $new->add_alpha;
   $img->select_color(CHANNEL_OP_ADD, $new, [255, 255, 255]);
diff --git a/examples/windify b/examples/windify
index 709368ac..132e0d41 100755
--- a/examples/windify
+++ b/examples/windify
@@ -11,7 +11,7 @@ podregister {
   my $ysize = $drawable->height;
   my $out = Gimp::Image->new($xsize,$ysize,0);
   Gimp::Context->set_background([128,128,128]);
-  my $windlayer = $out->layer_new($xsize,$ysize,RGB_IMAGE,"Windlayer",100,NORMAL_MODE);
+  my $windlayer = $out->layer_new($xsize,$ysize,RGB_IMAGE,"Windlayer",100,LAYER_MODE_NORMAL_LEGACY);
   $windlayer->fill(0);
   $out->insert_layer($windlayer,0,0);
   my $windlayercopy = $windlayer->copy(1);
diff --git a/examples/xachlego b/examples/xachlego
index 2654f860..2409f3b1 100755
--- a/examples/xachlego
+++ b/examples/xachlego
@@ -28,7 +28,7 @@ podregister {
   $image->selection_all;
   $gridlayer->edit_clear;
   Gimp::Context->set_background([255,255,255]);
-  $gridlayer->edit_fill(BACKGROUND_FILL);
+  $gridlayer->edit_fill(FILL_BACKGROUND);
   $gridlayer->grid(1, $blocksize, 0, [0,0,0], 255, 1, $blocksize, 0, [0,0,0], 255, 0, 0, 0, [0,0,0], 0);
   $gridlayer->gauss_iir(0.7*$blocksize, 1, 1);
 
@@ -50,7 +50,7 @@ podregister {
   my $cleangrid = $image->layer_new($image->width, $image->height,
                           RGBA_IMAGE, "Grid 2", 100, 0);
   $image->insert_layer($cleangrid,0,0);
-  $cleangrid->edit_fill(BACKGROUND_FILL);
+  $cleangrid->edit_fill(FILL_BACKGROUND);
   $cleangrid->grid(1, $blocksize, 0, [0,0,0], 255, 1, $blocksize, 0, [0,0,0], 255, 0, 0, 0, [0,0,0], 0);
   $image->select_item(CHANNEL_OP_REPLACE, $selection);
   $drawable->bump_map($cleangrid, 135, 45, 3, 0, 0, 0, 0, 1, 0, 0);
diff --git a/examples/xachshadow b/examples/xachshadow
index acbea606..c55756e3 100755
--- a/examples/xachshadow
+++ b/examples/xachshadow
@@ -17,14 +17,14 @@ podregister {
   $drawable->pixelize($blocksize);
   my $shadowlayer = $drawable->copy(FALSE);
   $image->insert_layer($shadowlayer,0,0);
-  my $checkmask = $shadowlayer->create_mask(ADD_WHITE_MASK);
+  my $checkmask = $shadowlayer->create_mask(ADD_MASK_WHITE);
   $shadowlayer->add_mask($checkmask);
   $image->checkerboard($checkmask, 0, $blocksize);
 
   my $frontlayer = $shadowlayer->copy(0);
   $image->insert_layer($frontlayer,0,0);
   Gimp::Context->set_background([0,0,0]);
-  $shadowlayer->fill(BACKGROUND_FILL);
+  $shadowlayer->fill(FILL_BACKGROUND);
   $checkmask->gauss_iir(0.3*$blocksize, 1, 1);
   $checkmask->offset (1, 0, 0.2*$blocksize, 0.2*$blocksize);
 
@@ -33,7 +33,7 @@ podregister {
   $image->selection_all;
   $gridlayer->edit_clear;
   Gimp::Context->set_background([255,255,255]);
-  $gridlayer->edit_fill(BACKGROUND_FILL);
+  $gridlayer->edit_fill(FILL_BACKGROUND);
   $gridlayer->grid((1, $blocksize, 0, [0,0,0], 255) x 3);
 
   $gridlayer->set_mode(3);
diff --git a/examples/xachvision b/examples/xachvision
index 64aa166a..b0ec4480 100755
--- a/examples/xachvision
+++ b/examples/xachvision
@@ -14,10 +14,10 @@ podregister {
   my $toplayer = $drawable->copy(TRUE);
   $image->insert_layer($toplayer, 0, 0);
   Gimp::Context->set_background($color);
-  $toplayer->edit_fill(BACKGROUND_FILL);
-  $toplayer->set_mode(COLOR_MODE);
+  $toplayer->edit_fill(FILL_BACKGROUND);
+  $toplayer->set_mode(LAYER_MODE_HSL_COLOR_LEGACY);
   Gimp::Context->set_background([0,0,0]);
-  $drawable->edit_fill(BACKGROUND_FILL);
+  $drawable->edit_fill(FILL_BACKGROUND);
   $amt /= 255;
   $midlayer->noisify(1,$amt, $amt, $amt, $amt);
   my $midmask = $midlayer->create_mask(0);
diff --git a/examples/yinyang b/examples/yinyang
index 24cc3f7d..955114a9 100755
--- a/examples/yinyang
+++ b/examples/yinyang
@@ -6,7 +6,7 @@ use strict;
 use warnings;
 #$Gimp::verbose = 1;
 
-my @BUCKET_ARGS = (FG_BUCKET_FILL,NORMAL_MODE,100,0,0,0,0);
+my @BUCKET_ARGS = (BUCKET_FILL_FG,LAYER_MODE_NORMAL_LEGACY,100,0,0,0,0);
 
 podregister {
   # Create new image
diff --git a/lib/Gimp.pm b/lib/Gimp.pm
index 76faa1d2..7824158b 100644
--- a/lib/Gimp.pm
+++ b/lib/Gimp.pm
@@ -451,10 +451,10 @@ Gimp - Write GIMP extensions/plug-ins/load- and save-handlers in Perl
     # your code
     my $image = new Gimp::Image (600, 300, RGB);
     my $bg = $image->layer_new(
-      600,300,RGB_IMAGE,"Background",100,NORMAL_MODE
+      600,300,RGB_IMAGE,"Background",100,LAYER_MODE_NORMAL_LEGACY
     );
     $image->insert_layer($bg, 1, 0);
-    $image->edit_fill($bg, FOREGROUND_FILL);
+    $image->edit_fill($bg, FILL_FOREGROUND);
     eval { Gimp::Display->new($image); };
     $image;
   };
@@ -544,7 +544,7 @@ available to your plug-in.
 =head2 :consts
 
 All constants found by querying GIMP (BG_IMAGE_FILL, RUN_NONINTERACTIVE,
-NORMAL_MODE, PDB_INT32 etc.).
+LAYER_MODE_NORMAL_LEGACY, PDB_INT32 etc.).
 
 =head2 :param
 
diff --git a/lib/Gimp/Fu.pm b/lib/Gimp/Fu.pm
index 67500e27..30c43372 100644
--- a/lib/Gimp/Fu.pm
+++ b/lib/Gimp/Fu.pm
@@ -431,7 +431,7 @@ sub save_image($$) {
       );
    } elsif ($type eq "GIF") {
       unless ($layer->is_indexed) {
-         $img->convert_indexed(2, Gimp::MAKE_PALETTE, 256, 1, 1, "");
+         $img->convert_indexed(2, Gimp::CONVERT_PALETTE_GENERATE, 256, 1, 1, "");
       }
       $layer->file_gif_save($path,$path,$interlace,$loop,$delay,$dispose);
    } elsif ($type eq "PNG") {
diff --git a/lib/Gimp/PixelRgn.pod b/lib/Gimp/PixelRgn.pod
index 5ba1e767..2966737c 100644
--- a/lib/Gimp/PixelRgn.pod
+++ b/lib/Gimp/PixelRgn.pod
@@ -7,7 +7,7 @@ Gimp::PixelRgn - Operate on raw pixels in powerful, efficient way.
   use Gimp;
   use PDL; # to do sensible things with the pixels
   my $i = Gimp::Image->new(10,10,RGB);
-  my $l = $i->layer_new(10,10,RGBA_IMAGE,"new layer",100,VALUE_MODE);
+  my $l = $i->layer_new(10,10,RGBA_IMAGE,"new layer",100,LAYER_MODE_HSV_VALUE_LEGACY);
   $i->insert_layer($l,0,0);
   my $gd = $l->get;
   my $region = $gd->pixel_rgn(0,0,10,10,0,0);
diff --git a/lib/Gimp/Util.pm b/lib/Gimp/Util.pm
index 1e25c16a..9b70a20c 100644
--- a/lib/Gimp/Util.pm
+++ b/lib/Gimp/Util.pm
@@ -44,10 +44,10 @@ sub layer_create {
   # create a colored layer
   $layer = Gimp::Layer->new ($image,Gimp->image_width($image),
                            Gimp->image_height($image),
-                           &RGB_IMAGE,$name,100,&NORMAL_MODE);
+                           &RGB_IMAGE,$name,100,&LAYER_MODE_NORMAL_LEGACY);
   $tcol = Gimp->palette_get_background ();
   Gimp->palette_set_background ($color);
-  Gimp->drawable_fill ($layer,&BACKGROUND_FILL);
+  Gimp->drawable_fill ($layer,&FILL_BACKGROUND);
   Gimp->image_insert_layer($image, $layer, 0, $pos);
   Gimp->palette_set_background ($tcol); # reset
   $layer;
@@ -158,9 +158,9 @@ sub gimp_image_add_new_layer {
       $image, $image->width, $image->height,
       $image->layertype (defined $alpha ? $alpha : 1),
       join(':', map { basename($_) } (caller 2)[1,2]),
-      100, &NORMAL_MODE
+      100, &LAYER_MODE_NORMAL_LEGACY
    );
-   $layer->fill (defined $filltype ? $filltype : &BACKGROUND_FILL);
+   $layer->fill (defined $filltype ? $filltype : &FILL_BACKGROUND);
    $image->insert_layer ($layer, 0, $index*1);
    $layer;
 }
diff --git a/t/examples-api.pl b/t/examples-api.pl
index cd77a133..c96d71ac 100644
--- a/t/examples-api.pl
+++ b/t/examples-api.pl
@@ -2,7 +2,7 @@ sub newimage {
   my $numlayers = shift;
   my $i = Gimp::Image->new(200,200,RGB);
   for my $layernum (1..$numlayers) {
-    my $l0 = $i->layer_new(200,200,RGBA_IMAGE,"layer $layernum",100,VALUE_MODE);
+    my $l0 = $i->layer_new(200,200,RGBA_IMAGE,"layer $layernum",100,LAYER_MODE_HSV_VALUE_LEGACY);
     $i->insert_layer($l0,0,0);
   }
   $i;
diff --git a/t/load.t b/t/load.t
index 731647f2..7f9c3e52 100644
--- a/t/load.t
+++ b/t/load.t
@@ -14,17 +14,17 @@ my %CONST_DATA = (
   'FG_TRANSPARENT_MODE' => 2,
   'BRUSH_SOFT' => 1,
   'BRUSH_GENERATED_SQUARE' => 1,
-  'PATTERN_BUCKET_FILL' => 2,
+  'FILL_PATTERN' => 2,
   'CHANNEL_OP_REPLACE' => 2,
   'GRAY_CHANNEL' => 3,
   'PATTERN_CLONE' => 1,
-  'FS_DITHER' => 1,
+  'CONVERT_DITHER_FS' => 1,
   'CUSTOM_PALETTE' => 4,
   'ABSOLUTE_CONVOL' => 1,
   'SHARPEN_CONVOLVE' => 1,
   'DESATURATE_LUMINOSITY' => 1,
   'DODGE' => 0,
-  'TRANSPARENT_FILL' => 3,
+  'FILL_TRANSPARENT' => 3,
   'FOREGROUND_EXTRACT_SIOX' => 0,
   'GRADIENT_SEGMENT_HSV_CCW' => 1,
   'GRADIENT_SEGMENT_SINE' => 2,
diff --git a/t/pdl.t b/t/pdl.t
index f35120ba..39a6dd19 100644
--- a/t/pdl.t
+++ b/t/pdl.t
@@ -107,7 +107,7 @@ use Gimp qw(:DEFAULT net_init=spawn/);
 
 ok((my $i = Gimp::Image->new(10,10,RGB)), 'new image');
 ok(
-  (my $l = $i->layer_new(10,10,RGB_IMAGE,"new layer",100,VALUE_MODE)),
+  (my $l = $i->layer_new(10,10,RGB_IMAGE,"new layer",100,LAYER_MODE_HSV_VALUE_LEGACY)),
   'make layer',
 );
 ok(!$i->insert_layer($l,0,0), 'insert layer');
@@ -118,7 +118,7 @@ my $setcolour = [ 16, 16, 16 ];
 Gimp::Context->push;
 Gimp::Context->set_foreground($fgcolour);
 
-$l->fill(FOREGROUND_FILL);
+$l->fill(FILL_FOREGROUND);
 ok(
   cmp_colour(
     [ @{$l->test_pdl_getpixel(@setcoords)}[0..2] ],
@@ -151,7 +151,7 @@ ok(
 );
 
 eval $pdl_operations;
-$l->fill(FOREGROUND_FILL);
+$l->fill(FILL_FOREGROUND);
 ok(
   cmp_colour(
     Gimp::canonicalize_color(getpixel($i, $l, @setcoords)),
diff --git a/t/perlplugin.t b/t/perlplugin.t
index b70d8dee..8396498f 100644
--- a/t/perlplugin.t
+++ b/t/perlplugin.t
@@ -147,7 +147,7 @@ use Gimp qw(:DEFAULT net_init=spawn/);
 
 ok((my $i = Gimp::Image->new(10,10,RGB)), 'new image');
 ok(
-  (my $l0 = $i->layer_new(10,10,RGBA_IMAGE,"new layer",100,VALUE_MODE)),
+  (my $l0 = $i->layer_new(10,10,RGBA_IMAGE,"new layer",100,LAYER_MODE_HSV_VALUE_LEGACY)),
   'make layer',
 );
 ok(!$i->insert_layer($l0,0,0), 'insert layer');
diff --git a/t/run.t b/t/run.t
index 9463f4a2..609ae072 100644
--- a/t/run.t
+++ b/t/run.t
@@ -11,7 +11,7 @@ use Gimp qw(:DEFAULT net_init=spawn/);
 
 ok((my $i = new Gimp::Image(10,10,RGB)), 'OO Syntax for new image');
 ok(
-  (my $l = $i->layer_new(10,10,RGBA_IMAGE,"new layer",100,VALUE_MODE)),
+  (my $l = $i->layer_new(10,10,RGBA_IMAGE,"new layer",100,LAYER_MODE_HSV_VALUE_LEGACY)),
   'Different OO syntax for creating a layer',
 );
 ok(!Gimp->image_insert_layer($l,0,0), 'Yet another OO syntax');
diff --git a/utils/scm2perl b/utils/scm2perl
index 074ba34c..a00ac01f 100755
--- a/utils/scm2perl
+++ b/utils/scm2perl
@@ -103,25 +103,25 @@ $parser = new Parse::RecDescent <<'EOA';
 
       LINEAR           LINEAR_INTERPOLATION
 
-      NORMAL           NORMAL_MODE
+      NORMAL           LAYER_MODE_NORMAL_LEGACY
       ADDITION         ADDITION_MODE
       MULTIPLY         MULTIPLY_MODE
-      DIFFERENCE       DIFFERENCE_MODE
+      DIFFERENCE       LAYER_MODE_DIFFERENCE_LEGACY
       DARKEN_ONLY      DARKEN_ONLY_MODE
       LIGHTEN_ONLY     LIGHTEN_ONLY_MODE
       BEHIND           BEHIND_MODE
-      COLOR            COLOR_MODE
+      COLOR            LAYER_MODE_HSL_COLOR_LEGACY
       DISSOLVE         DISSOLVE_MODE
       HUE              HUE_MODE
       OVERLAY          OVERLAY_MODE
       SATURATION       SATURATION_MODE
       SCREEN           SCREEN_MODE
       SUBTRACT         SUBTRACT_MODE
-      VALUE            VALUE_MODE
+      VALUE            LAYER_MODE_HSV_VALUE_LEGACY
 
-      ALPHA_MASK       ADD_ALPHA_MASK
+      ALPHA_MASK       ADD_MASK_ALPHA
       BLACK_MASK       ADD_BLACK_MASK
-      WHITE_MASK       ADD_WHITE_MASK
+      WHITE_MASK       ADD_MASK_WHITE
 
       *pi*             3.14159265
    );


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