[gimp] script-fu: port all scripts to the new gimp-drawable-edit functions



commit 233ac80de16c89ddef4397fe1a09907354b45b92
Author: Michael Natterer <mitch gimp org>
Date:   Mon Apr 16 20:12:12 2018 +0200

    script-fu: port all scripts to the new gimp-drawable-edit functions

 plug-ins/script-fu/scripts/add-bevel.scm          |    6 +--
 plug-ins/script-fu/scripts/addborder.scm          |   10 ++--
 plug-ins/script-fu/scripts/burn-in-anim.scm       |   61 +++++++++++----------
 plug-ins/script-fu/scripts/carve-it.scm           |   14 +++---
 plug-ins/script-fu/scripts/chrome-it.scm          |   20 ++++----
 plug-ins/script-fu/scripts/circuit.scm            |    4 +-
 plug-ins/script-fu/scripts/clothify.scm           |    3 +-
 plug-ins/script-fu/scripts/coffee.scm             |   21 ++++----
 plug-ins/script-fu/scripts/distress-selection.scm |    4 +-
 plug-ins/script-fu/scripts/drop-shadow.scm        |    6 +-
 plug-ins/script-fu/scripts/erase-rows.scm         |    6 ++-
 plug-ins/script-fu/scripts/font-map.scm           |    4 +-
 plug-ins/script-fu/scripts/fuzzyborder.scm        |   10 ++--
 plug-ins/script-fu/scripts/gradient-example.scm   |   14 ++++--
 plug-ins/script-fu/scripts/grid-system.scm        |    2 +-
 plug-ins/script-fu/scripts/lava.scm               |    2 +-
 plug-ins/script-fu/scripts/line-nova.scm          |    2 +-
 plug-ins/script-fu/scripts/mkbrush.scm            |   10 ++--
 plug-ins/script-fu/scripts/old-photo.scm          |    2 +-
 plug-ins/script-fu/scripts/perspective-shadow.scm |    4 +-
 plug-ins/script-fu/scripts/predator.scm           |    2 +-
 plug-ins/script-fu/scripts/ripply-anim.scm        |    4 +-
 plug-ins/script-fu/scripts/round-corners.scm      |    2 +-
 plug-ins/script-fu/scripts/slide.scm              |    4 +-
 plug-ins/script-fu/scripts/test-sphere.scm        |   29 ++++++----
 plug-ins/script-fu/scripts/weave.scm              |   31 +++++++----
 plug-ins/script-fu/scripts/xach-effect.scm        |   14 +++---
 27 files changed, 162 insertions(+), 129 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/add-bevel.scm b/plug-ins/script-fu/scripts/add-bevel.scm
index 7b8742e..d4a1450 100644
--- a/plug-ins/script-fu/scripts/add-bevel.scm
+++ b/plug-ins/script-fu/scripts/add-bevel.scm
@@ -121,15 +121,13 @@
            (set! greyness (/ (* index 255) thickness))
            (gimp-context-set-background (list greyness greyness greyness))
            ;(gimp-selection-feather image 1) ;Stop the slopey jaggies?
-           (gimp-edit-bucket-fill bump-layer BUCKET-FILL-BG LAYER-MODE-NORMAL
-                                  100 0 FALSE 0 0)
+           (gimp-drawable-edit-fill bump-layer FILL-BACKGROUND)
            (gimp-selection-shrink image 1)
            (set! index (+ index 1))
     )
     ; Now the white interior
     (gimp-context-set-background '(255 255 255))
-    (gimp-edit-bucket-fill bump-layer BUCKET-FILL-BG LAYER-MODE-NORMAL
-                           100 0 FALSE 0 0)
+    (gimp-drawable-edit-fill bump-layer FILL-BACKGROUND)
 
     ;------------------------------------------------------------
     ;
diff --git a/plug-ins/script-fu/scripts/addborder.scm b/plug-ins/script-fu/scripts/addborder.scm
index fd1f2ee..c0e6ccb 100644
--- a/plug-ins/script-fu/scripts/addborder.scm
+++ b/plug-ins/script-fu/scripts/addborder.scm
@@ -108,6 +108,8 @@
                                      _"Border Layer" 100 LAYER-MODE-NORMAL))))
 
     (gimp-context-push)
+    (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
+    (gimp-context-set-opacity 100.0)
     (gimp-context-set-antialias FALSE)
     (gimp-context-set-feather FALSE)
 
@@ -127,27 +129,27 @@
                                CHANNEL-OP-REPLACE
                                10
                                (gen_top_array xsize ysize owidth oheight width height))
-    (gimp-edit-fill layer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer FILL-BACKGROUND)
     (gimp-context-set-background (adjcolor color (/ dvalue 2)))
     (gimp-image-select-polygon img
                                CHANNEL-OP-REPLACE
                                10
                                (gen_left_array xsize ysize owidth oheight width height))
-    (gimp-edit-fill layer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer FILL-BACKGROUND)
     (gimp-context-set-background (adjcolor color (- 0 (/ dvalue 2))))
     (gimp-image-select-polygon img
                                CHANNEL-OP-REPLACE
                                10
                                (gen_right_array xsize ysize owidth oheight width height))
 
-    (gimp-edit-fill layer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer FILL-BACKGROUND)
     (gimp-context-set-background (adjcolor color (- 0 dvalue)))
     (gimp-image-select-polygon img
                                CHANNEL-OP-REPLACE
                                10
                                (gen_bottom_array xsize ysize owidth oheight width height))
 
-    (gimp-edit-fill layer FILL-BACKGROUND)
+    (gimp-drawableedit-fill layer FILL-BACKGROUND)
     (gimp-selection-none img)
     (gimp-image-undo-group-end img)
     (gimp-displays-flush)
diff --git a/plug-ins/script-fu/scripts/burn-in-anim.scm b/plug-ins/script-fu/scripts/burn-in-anim.scm
index e38efa2..a1bdcd0 100644
--- a/plug-ins/script-fu/scripts/burn-in-anim.scm
+++ b/plug-ins/script-fu/scripts/burn-in-anim.scm
@@ -115,18 +115,20 @@
               (if (= fadeout TRUE)
                   (begin
                     ; blend with 20% offset to get less transparency in the front
-                    (gimp-edit-blend bl-mask BLEND-FG-BG-RGB LAYER-MODE-NORMAL
-                                     GRADIENT-LINEAR 100 20 REPEAT-NONE FALSE
-                                     FALSE 0 0 TRUE
-                                     (+ bl-x-off bl-width) 0 bl-x-off 0)
+                   (gimp-context-set-gradient-fg-bg-rgb)
+                    (gimp-drawable_edit-gradient-fill bl-mask
+                                                     GRADIENT-LINEAR 20
+                                                     FALSE 0 0
+                                                     TRUE
+                                                     (+ bl-x-off bl-width) 0
+                                                     bl-x-off 0)
                   )
               )
 
               (if (= fadeout FALSE)
                   (begin
                     (gimp-context-set-foreground '(255 255 255))
-                    (gimp-edit-bucket-fill bl-mask BUCKET-FILL-FG LAYER-MODE-NORMAL
-                                           100 255 0 0 0)
+                    (gimp-drawable-edit-fill bl-mask FILL-FOREGROUND)
                   )
               )
 
@@ -140,28 +142,31 @@
                         (gimp-drawable-brightness-contrast bl-layer 0.787 0)
                     )
 
-          ;--- blend glow color inside the letters
-          (gimp-context-set-foreground glow-color)
-          (gimp-edit-blend bl-layer BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
-                   GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
-                   FALSE 0 0 TRUE
-                   (+ bl-x-off bl-width) 0
-                   (- (+ bl-x-off bl-width) after-glow) 0)
-
-          ;--- add corona effect
-          (gimp-image-select-item img CHANNEL-OP-REPLACE bl-layer)
-          (gimp-selection-sharpen img)
-          (gimp-selection-grow img corona-width)
-          (gimp-layer-set-lock-alpha bl-layer FALSE)
-          (gimp-selection-feather img corona-width)
-          (gimp-context-set-foreground glow-color)
-          (gimp-edit-blend bl-layer BLEND-FG-TRANSPARENT LAYER-MODE-NORMAL
-                   GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE
-                   FALSE 0 0 TRUE
-                   (- (+ bl-x-off bl-width) corona-width) 0
-                   (- (+ bl-x-off bl-width) after-glow) 0)
-                  )
-              )
+                   ;--- blend glow color inside the letters
+                   (gimp-context-set-foreground glow-color)
+                   (gimp-context-set-gradient-fg-transparent)
+                   (gimp-drawable-edit-gradient-fill bl-layer
+                                                     GRADIENT-LINEAR 0
+                                                     FALSE 0 0
+                                                     TRUE
+                                                     (+ bl-x-off bl-width) 0
+                                                     (- (+ bl-x-off bl-width) after-glow) 0)
+
+                    ;--- add corona effect
+                   (gimp-image-select-item img CHANNEL-OP-REPLACE bl-layer)
+                   (gimp-selection-sharpen img)
+                   (gimp-selection-grow img corona-width)
+                   (gimp-layer-set-lock-alpha bl-layer FALSE)
+                   (gimp-selection-feather img corona-width)
+                   (gimp-context-set-foreground glow-color)
+                   (gimp-drawable-edit-gradient-fill bl-layer
+                                                     GRADIENT-LINEAR 0
+                                                     FALSE 0 0
+                                                     TRUE
+                                                     (- (+ bl-x-off bl-width) corona-width) 0
+                                                     (- (+ bl-x-off bl-width) after-glow) 0)
+                   )
+                 )
 
               ;--- merge with bg layer
               (set! bg-layer (car (gimp-layer-copy bg-source-layer FALSE)))
diff --git a/plug-ins/script-fu/scripts/carve-it.scm b/plug-ins/script-fu/scripts/carve-it.scm
index 5aa5fa9..cdcb529 100644
--- a/plug-ins/script-fu/scripts/carve-it.scm
+++ b/plug-ins/script-fu/scripts/carve-it.scm
@@ -31,7 +31,7 @@
 
 (define (copy-layer-carve-it dest-image dest-drawable source-image source-drawable)
   (gimp-selection-all dest-image)
-  (gimp-edit-clear dest-drawable)
+  (gimp-drawable-edit-clear dest-drawable)
   (gimp-selection-none dest-image)
   (gimp-selection-all source-image)
   (gimp-edit-copy source-drawable)
@@ -84,7 +84,7 @@
     (gimp-image-insert-layer img layer1 0 0)
 
     (gimp-selection-all img)
-    (gimp-edit-clear layer1)
+    (gimp-drawable-edit-clear layer1)
     (gimp-selection-none img)
     (copy-layer-carve-it img layer1 bg-image bg-layer)
 
@@ -102,7 +102,7 @@
     (gimp-image-select-item img CHANNEL-OP-REPLACE mask-fat)
     (gimp-context-set-brush (carve-brush brush-size))
     (gimp-context-set-foreground '(255 255 255))
-    (gimp-edit-stroke mask-fat)
+    (gimp-drawable-edit-stroke-selection mask-fat)
     (gimp-selection-none img)
 
     (set! mask-emboss (car (gimp-channel-copy mask-fat)))
@@ -113,9 +113,9 @@
     (gimp-context-set-background '(180 180 180))
     (gimp-image-select-item img CHANNEL-OP-REPLACE mask-fat)
     (gimp-selection-invert img)
-    (gimp-edit-fill mask-emboss FILL-BACKGROUND)
+    (gimp-drawable-edit-fill mask-emboss FILL-BACKGROUND)
     (gimp-image-select-item img CHANNEL-OP-REPLACE mask)
-    (gimp-edit-fill mask-emboss FILL-BACKGROUND)
+    (gimp-drawable-edit-fill mask-emboss FILL-BACKGROUND)
     (gimp-selection-none img)
 
     (set! mask-highlight (car (gimp-channel-copy mask-emboss)))
@@ -147,7 +147,7 @@
     (gimp-layer-add-mask cast-shadow-layer csl-mask)
     (gimp-image-select-item img CHANNEL-OP-REPLACE mask)
     (gimp-context-set-background '(255 255 255))
-    (gimp-edit-fill csl-mask FILL-BACKGROUND)
+    (gimp-drawable-edit-fill csl-mask FILL-BACKGROUND)
 
     (set! inset-layer (car (gimp-layer-copy layer1 TRUE)))
     (gimp-image-insert-layer img inset-layer 0 1)
@@ -156,7 +156,7 @@
     (gimp-layer-add-mask inset-layer il-mask)
     (gimp-image-select-item img CHANNEL-OP-REPLACE mask)
     (gimp-context-set-background '(255 255 255))
-    (gimp-edit-fill il-mask FILL-BACKGROUND)
+    (gimp-drawable-edit-fill il-mask FILL-BACKGROUND)
     (gimp-selection-none img)
     (gimp-selection-none bg-image)
     (gimp-levels inset-layer 0 0 255 inset-gamma 0 255)
diff --git a/plug-ins/script-fu/scripts/chrome-it.scm b/plug-ins/script-fu/scripts/chrome-it.scm
index 527f5c2..2c08d18 100644
--- a/plug-ins/script-fu/scripts/chrome-it.scm
+++ b/plug-ins/script-fu/scripts/chrome-it.scm
@@ -72,7 +72,7 @@
 
   (define (copy-layer-chrome-it dest-image dest-drawable source-image source-drawable)
     (gimp-selection-all dest-image)
-    (gimp-edit-clear dest-drawable)
+    (gimp-drawable-edit-clear dest-drawable)
     (gimp-selection-none dest-image)
     (gimp-selection-all source-image)
     (gimp-edit-copy source-drawable)
@@ -129,9 +129,9 @@
 
     (gimp-context-set-background '(255 255 255))
     (gimp-selection-none img)
-    (gimp-edit-fill layer2 FILL-BACKGROUND)
-    (gimp-edit-fill layer3 FILL-BACKGROUND)
-    (gimp-edit-clear shadow)
+    (gimp-drawable-edit-fill layer2 FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer3 FILL-BACKGROUND)
+    (gimp-drawable-edit-clear shadow)
 
     (gimp-item-set-visible bg-layer FALSE)
     (gimp-item-set-visible shadow FALSE)
@@ -140,9 +140,9 @@
     (gimp-context-set-background '(0 0 0))
     (gimp-selection-translate img offx1 offy1)
     (gimp-selection-feather img feather)
-    (gimp-edit-fill layer2 FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer2 FILL-BACKGROUND)
     (gimp-selection-translate img (* 2 offx2) (* 2 offy2))
-    (gimp-edit-fill layer3 FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer3 FILL-BACKGROUND)
     (gimp-selection-none img)
     (set! layer2 (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))
     (gimp-drawable-invert layer2 FALSE)
@@ -160,22 +160,22 @@
     (gimp-layer-add-mask layer1 layer-mask)
     (gimp-image-select-item img CHANNEL-OP-REPLACE mask)
     (gimp-context-set-background '(255 255 255))
-    (gimp-edit-fill layer-mask FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer-mask FILL-BACKGROUND)
 
     (set! layer2 (car (gimp-layer-copy layer1 TRUE)))
     (gimp-image-insert-layer img layer2 0 0)
     (gimp-context-set-brush (brush brush-size))
     (gimp-context-set-foreground '(255 255 255))
-    (gimp-edit-stroke layer-mask)
+    (gimp-drawable-edit-stroke-selection layer-mask)
 
     (gimp-context-set-background '(0 0 0))
     (gimp-selection-feather img (* feather 1.5))
     (gimp-selection-translate img (* 2.5 offx1) (* 2.5 offy1))
-    (gimp-edit-fill shadow FILL-BACKGROUND)
+    (gimp-drawable-edit-fill shadow FILL-BACKGROUND)
 
     (gimp-selection-all img)
     (gimp-context-set-pattern "Marble #1")
-    (gimp-edit-bucket-fill bg-layer BUCKET-FILL-PATTERN LAYER-MODE-NORMAL 100 0 FALSE 0 0)
+    (gimp-drawable-edit-fill bg-layer FILL-PATTERN)
     (gimp-selection-none img)
 
     (gimp-image-convert-rgb img)
diff --git a/plug-ins/script-fu/scripts/circuit.scm b/plug-ins/script-fu/scripts/circuit.scm
index 92480b0..3196299 100644
--- a/plug-ins/script-fu/scripts/circuit.scm
+++ b/plug-ins/script-fu/scripts/circuit.scm
@@ -78,7 +78,7 @@
           (gimp-image-insert-layer image effect-layer 0 -1)
           (gimp-layer-set-offsets effect-layer select-offset-x select-offset-y)
           (gimp-selection-none image)
-          (gimp-edit-clear effect-layer)
+          (gimp-drawable-edit-clear effect-layer)
           (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
           (gimp-edit-copy drawable)
 
@@ -107,7 +107,7 @@
          (= separate-layer TRUE))
         (begin
           (gimp-image-select-color image CHANNEL-OP-REPLACE active-layer '(0 0 0))
-          (gimp-edit-clear active-layer)))
+          (gimp-drawable-edit-clear active-layer)))
 
     (if (= keep-selection FALSE)
         (gimp-selection-none image))
diff --git a/plug-ins/script-fu/scripts/clothify.scm b/plug-ins/script-fu/scripts/clothify.scm
index ecf7c4e..7b6f101 100644
--- a/plug-ins/script-fu/scripts/clothify.scm
+++ b/plug-ins/script-fu/scripts/clothify.scm
@@ -16,13 +16,14 @@
         )
 
     (gimp-context-push)
+    (gimp-context-set-defaults)
 
     (gimp-image-undo-disable img)
 
     (gimp-image-insert-layer img layer-one 0 0)
 
     (gimp-context-set-background '(255 255 255))
-    (gimp-edit-fill layer-one FILL-BACKGROUND)
+    (gimp-drawable-edit-fill layer-one FILL-BACKGROUND)
 
     (plug-in-noisify RUN-NONINTERACTIVE img layer-one FALSE 0.7 0.7 0.7 0.7)
 
diff --git a/plug-ins/script-fu/scripts/coffee.scm b/plug-ins/script-fu/scripts/coffee.scm
index 10e0cc7..3d45312 100644
--- a/plug-ins/script-fu/scripts/coffee.scm
+++ b/plug-ins/script-fu/scripts/coffee.scm
@@ -39,26 +39,27 @@
 
       (gimp-image-insert-layer theImage theStain 0 0)
       (gimp-selection-all theImage)
-      (gimp-edit-clear theStain)
+      (gimp-drawable-edit-clear theStain)
 
       (let ((blobSize (/ (rand (- theSize 40)) (+ (rand 3) 1))))
         (gimp-image-select-ellipse theImage
-                             CHANNEL-OP-REPLACE
-                             (/ (- theSize blobSize) 2)
-                             (/ (- theSize blobSize) 2)
-                             blobSize blobSize)
+                                  CHANNEL-OP-REPLACE
+                                  (/ (- theSize blobSize) 2)
+                                  (/ (- theSize blobSize) 2)
+                                  blobSize blobSize)
       )
 
       (script-fu-distress-selection theImage theStain
-                                    (* (+ (rand 15) 1) (+ (rand 15) 1))
+                                    (- (* (+ (rand 15) 1) (+ (rand 15) 1)) 1)
                                     (/ theSize 25) 4 2 TRUE TRUE)
 
       (gimp-context-set-gradient "Coffee")
 
-      (gimp-edit-blend theStain BLEND-CUSTOM LAYER-MODE-NORMAL
-                       GRADIENT-SHAPEBURST-DIMPLED 100 0 REPEAT-NONE FALSE
-                       FALSE 0 0 TRUE
-                       0 0 0 0)
+      (gimp-drawable-edit-gradient-fill theStain
+                                       GRADIENT-SHAPEBURST-DIMPLED 0
+                                       FALSE 0 0
+                                       TRUE
+                                       0 0 0 0)
 
       (gimp-layer-set-offsets theStain
                               (- (rand theWidth) (/ theSize 2))
diff --git a/plug-ins/script-fu/scripts/distress-selection.scm 
b/plug-ins/script-fu/scripts/distress-selection.scm
index 70dcef7..c809460 100644
--- a/plug-ins/script-fu/scripts/distress-selection.scm
+++ b/plug-ins/script-fu/scripts/distress-selection.scm
@@ -57,13 +57,13 @@
     (gimp-image-insert-layer theImage theLayer 0 0)
 
     (if (= FALSE (car (gimp-selection-is-empty theImage)))
-        (gimp-edit-fill theLayer FILL-BACKGROUND)
+        (gimp-drawable-edit-fill theLayer FILL-BACKGROUND)
     )
 
     (gimp-selection-invert theImage)
 
     (if (= FALSE (car (gimp-selection-is-empty theImage)))
-        (gimp-edit-clear theLayer)
+        (gimp-drawable-edit-clear theLayer)
     )
 
     (gimp-selection-invert theImage)
diff --git a/plug-ins/script-fu/scripts/drop-shadow.scm b/plug-ins/script-fu/scripts/drop-shadow.scm
index 38574f9..76435fe 100644
--- a/plug-ins/script-fu/scripts/drop-shadow.scm
+++ b/plug-ins/script-fu/scripts/drop-shadow.scm
@@ -21,7 +21,7 @@
 ; 1.00 - initial release
 ; 1.01 - fixed the problem with a remaining copy of the selection
 ; 1.02 - some code cleanup, no real changes
-; 1.03 - can't call gimp-edit-fill until layer is added to image!
+; 1.03 - can't call gimp-drawable-edit-fill until layer is added to image!
 ; 1.04
 ; 1.05 - replaced deprecated function calls with new ones for 2.8
 ;
@@ -136,7 +136,7 @@
 
   (gimp-drawable-fill shadow-layer FILL-TRANSPARENT)
   (gimp-context-set-background shadow-color)
-  (gimp-edit-fill shadow-layer FILL-BACKGROUND)
+  (gimp-drawable-edit-fill shadow-layer FILL-BACKGROUND)
   (gimp-selection-none image)
   (gimp-layer-set-lock-alpha shadow-layer FALSE)
   (if (>= shadow-blur 1.0) (plug-in-gauss-rle RUN-NONINTERACTIVE
@@ -150,7 +150,7 @@
   (if (= from-selection TRUE)
       (begin
         (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
-        (gimp-edit-clear shadow-layer)
+        (gimp-drawable-edit-clear shadow-layer)
         (gimp-image-remove-channel image active-selection)))
 
   (if (and
diff --git a/plug-ins/script-fu/scripts/erase-rows.scm b/plug-ins/script-fu/scripts/erase-rows.scm
index 99934d6..32ae591 100644
--- a/plug-ins/script-fu/scripts/erase-rows.scm
+++ b/plug-ins/script-fu/scripts/erase-rows.scm
@@ -7,6 +7,8 @@
         )
 
     (gimp-context-push)
+    (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
+    (gimp-context-set-opacity 100.0)
     (gimp-context-set-feather FALSE)
 
     (gimp-image-undo-group-start img)
@@ -17,8 +19,8 @@
                                (gimp-image-select-rectangle img CHANNEL-OP-REPLACE position-x (+ i 
position-y) width 1)
                                (gimp-image-select-rectangle img CHANNEL-OP-REPLACE (+ i position-x) 
position-y 1 height))
                            (if (= type 0)
-                               (gimp-edit-clear drawable)
-                               (gimp-edit-fill drawable FILL-BACKGROUND))
+                               (gimp-drawable-edit-clear drawable)
+                               (gimp-drawable-edit-fill drawable FILL-BACKGROUND))
                            (loop (+ i 2) max))))))
       (loop (if (= which 0)
                 0
diff --git a/plug-ins/script-fu/scripts/font-map.scm b/plug-ins/script-fu/scripts/font-map.scm
index ff2cdde..7481d28 100644
--- a/plug-ins/script-fu/scripts/font-map.scm
+++ b/plug-ins/script-fu/scripts/font-map.scm
@@ -94,7 +94,7 @@
           (gimp-context-set-foreground '(0 0 0))))
 
     (gimp-image-insert-layer img drawable 0 0)
-    (gimp-edit-clear drawable)
+    (gimp-drawable-edit-clear drawable)
 
     (if (= labels TRUE)
         (begin
@@ -103,7 +103,7 @@
                                                   GRAYA-IMAGE RGBA-IMAGE)
                                               "Labels" 100 LAYER-MODE-NORMAL)))
           (gimp-image-insert-layer img drawable 0 -1)))
-          (gimp-edit-clear drawable)
+          (gimp-drawable-edit-clear drawable)
 
     (while (< count num-fonts)
       (set! font (car font-list))
diff --git a/plug-ins/script-fu/scripts/fuzzyborder.scm b/plug-ins/script-fu/scripts/fuzzyborder.scm
index 45a0f23..9dbad0a 100644
--- a/plug-ins/script-fu/scripts/fuzzyborder.scm
+++ b/plug-ins/script-fu/scripts/fuzzyborder.scm
@@ -39,7 +39,7 @@
     (gimp-selection-shrink inImage inSize)
     (gimp-selection-invert inImage)
     (gimp-context-set-background inColor)
-    (gimp-edit-fill inLayer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill inLayer FILL-BACKGROUND)
     (gimp-selection-none inImage)
   )
 
@@ -74,7 +74,7 @@
     (gimp-image-insert-layer theImage theLayer 0 0)
 
 
-    (gimp-edit-clear theLayer)
+    (gimp-drawable-edit-clear theLayer)
     (chris-color-edge theImage theLayer inColor inSize)
 
     (gimp-layer-scale theLayer
@@ -92,11 +92,11 @@
 
     (gimp-image-select-item theImage CHANNEL-OP-REPLACE theLayer)
     (gimp-selection-invert theImage)
-    (gimp-edit-clear theLayer)
+    (gimp-drawable-edit-clear theLayer)
     (gimp-selection-invert theImage)
-    (gimp-edit-clear theLayer)
+    (gimp-drawable-edit-clear theLayer)
     (gimp-context-set-background inColor)
-    (gimp-edit-fill theLayer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill theLayer FILL-BACKGROUND)
     (gimp-selection-none inImage)
     (chris-color-edge theImage theLayer inColor 1)
 
diff --git a/plug-ins/script-fu/scripts/gradient-example.scm b/plug-ins/script-fu/scripts/gradient-example.scm
index 1f36ef1..134f350 100644
--- a/plug-ins/script-fu/scripts/gradient-example.scm
+++ b/plug-ins/script-fu/scripts/gradient-example.scm
@@ -47,10 +47,16 @@
 
     ; Render gradient
 
-    (gimp-edit-blend drawable BLEND-CUSTOM LAYER-MODE-NORMAL
-                     GRADIENT-LINEAR 100 0 REPEAT-NONE gradient-reverse
-                     FALSE 0 0 TRUE
-                     0 0 (- width 1) 0)
+    (gimp-context-push)
+
+    (gimp-context-set-gradient-reverse gradient-reverse)
+    (gimp-drawable-edit-gradient-fill drawable
+                                     GRADIENT-LINEAR 0
+                                     FALSE 0 0
+                                     TRUE
+                                     0 0 (- width 1) 0)
+
+    (gimp-context-pop)
 
     ; Terminate
 
diff --git a/plug-ins/script-fu/scripts/grid-system.scm b/plug-ins/script-fu/scripts/grid-system.scm
index c3f5f37..6607a3e 100644
--- a/plug-ins/script-fu/scripts/grid-system.scm
+++ b/plug-ins/script-fu/scripts/grid-system.scm
@@ -53,7 +53,7 @@
 
     (set! grid-layer (car (gimp-layer-copy drw TRUE)))
     (gimp-image-insert-layer img grid-layer 0 0)
-    (gimp-edit-clear grid-layer)
+    (gimp-drawable-edit-clear grid-layer)
     (gimp-item-set-name grid-layer "Grid Layer")
 
     (while (not (null? (cdr x-divides)))
diff --git a/plug-ins/script-fu/scripts/lava.scm b/plug-ins/script-fu/scripts/lava.scm
index d848c51..96bc359 100644
--- a/plug-ins/script-fu/scripts/lava.scm
+++ b/plug-ins/script-fu/scripts/lava.scm
@@ -79,7 +79,7 @@
           (gimp-image-insert-layer image lava-layer 0 -1)
           (gimp-layer-set-offsets lava-layer select-offset-x select-offset-y)
           (gimp-selection-none image)
-          (gimp-edit-clear lava-layer)
+          (gimp-drawable-edit-clear lava-layer)
 
           (gimp-image-select-item image CHANNEL-OP-REPLACE drawable)
           (gimp-image-set-active-layer image lava-layer)
diff --git a/plug-ins/script-fu/scripts/line-nova.scm b/plug-ins/script-fu/scripts/line-nova.scm
index ad16ffd..8c5c35b 100644
--- a/plug-ins/script-fu/scripts/line-nova.scm
+++ b/plug-ins/script-fu/scripts/line-nova.scm
@@ -87,7 +87,7 @@
       )
       (set! index (+ index 1))
     )
-    (gimp-edit-bucket-fill drw BUCKET-FILL-FG LAYER-MODE-NORMAL 100 0 FALSE 0 0)
+    (gimp-drawable-edit-fill drw FILL-FOREGROUND)
 
     (if old-selection
       (begin
diff --git a/plug-ins/script-fu/scripts/mkbrush.scm b/plug-ins/script-fu/scripts/mkbrush.scm
index 2717988..51db4a1 100644
--- a/plug-ins/script-fu/scripts/mkbrush.scm
+++ b/plug-ins/script-fu/scripts/mkbrush.scm
@@ -47,7 +47,7 @@
     (gimp-image-select-rectangle img CHANNEL-OP-REPLACE 0 0 width height)
 
     (gimp-context-set-background '(0 0 0))
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
     (file-gbr-save 1 img drawable filename "" spacing name)
     (gimp-image-delete img)
@@ -96,6 +96,8 @@
         )
 
     (gimp-context-push)
+    (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
+    (gimp-context-set-opacity 100.0)
 
     (gimp-image-undo-disable img)
     (gimp-image-insert-layer img drawable 0 0)
@@ -115,7 +117,7 @@
     )
 
     (gimp-context-set-background '(0 0 0))
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
     (file-gbr-save 1 img drawable filename "" spacing name)
     (gimp-image-delete img)
@@ -171,7 +173,7 @@
     (gimp-context-set-background '(0 0 0))
     (gimp-image-select-ellipse img CHANNEL-OP-REPLACE 0 0 width height)
 
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
     (file-gbr-save 1 img drawable filename "" spacing name)
     (gimp-image-delete img)
@@ -240,7 +242,7 @@
         (gimp-image-select-ellipse img CHANNEL-OP-REPLACE 0 0 width height)))
 
     (gimp-context-set-background '(0 0 0))
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
     (file-gbr-save 1 img drawable filename "" spacing name)
     (gimp-image-delete img)
diff --git a/plug-ins/script-fu/scripts/old-photo.scm b/plug-ins/script-fu/scripts/old-photo.scm
index aafda6e..183f14d 100644
--- a/plug-ins/script-fu/scripts/old-photo.scm
+++ b/plug-ins/script-fu/scripts/old-photo.scm
@@ -64,7 +64,7 @@
 
              (gimp-image-insert-layer theImage mLayer 0 0)
              (gimp-selection-all theImage)
-             (gimp-edit-clear mLayer)
+             (gimp-drawable-edit-clear mLayer)
              (gimp-selection-none theImage)
              (plug-in-noisify RUN-NONINTERACTIVE theImage mLayer TRUE 0 0 0 0.5)
              (plug-in-gauss-rle RUN-NONINTERACTIVE theImage mLayer 5 TRUE TRUE)
diff --git a/plug-ins/script-fu/scripts/perspective-shadow.scm 
b/plug-ins/script-fu/scripts/perspective-shadow.scm
index 785b4b0..3fe394b 100644
--- a/plug-ins/script-fu/scripts/perspective-shadow.scm
+++ b/plug-ins/script-fu/scripts/perspective-shadow.scm
@@ -107,7 +107,7 @@
       (gimp-layer-set-offsets shadow-layer select-offset-x select-offset-y)
       (gimp-drawable-fill shadow-layer FILL-TRANSPARENT)
       (gimp-context-set-background shadow-color)
-      (gimp-edit-fill shadow-layer FILL-BACKGROUND)
+      (gimp-drawable-edit-fill shadow-layer FILL-BACKGROUND)
       (gimp-selection-none image)
 
       (if (= allow-resize TRUE)
@@ -178,7 +178,7 @@
     (if (= from-selection TRUE)
         (begin
           (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
-          (gimp-edit-clear shadow-layer)
+          (gimp-drawable-edit-clear shadow-layer)
           (gimp-image-remove-channel image active-selection)))
 
     (if (and
diff --git a/plug-ins/script-fu/scripts/predator.scm b/plug-ins/script-fu/scripts/predator.scm
index ac3dc29..544d691 100644
--- a/plug-ins/script-fu/scripts/predator.scm
+++ b/plug-ins/script-fu/scripts/predator.scm
@@ -82,7 +82,7 @@
           (gimp-layer-set-offsets effect-layer select-offset-x select-offset-y)
           (gimp-image-insert-layer image effect-layer 0 -1)
           (gimp-selection-none image)
-          (gimp-edit-clear effect-layer)
+          (gimp-drawable-edit-clear effect-layer)
 
           (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
           (gimp-edit-copy drawable)
diff --git a/plug-ins/script-fu/scripts/ripply-anim.scm b/plug-ins/script-fu/scripts/ripply-anim.scm
index a97da21..3a01fa7 100644
--- a/plug-ins/script-fu/scripts/ripply-anim.scm
+++ b/plug-ins/script-fu/scripts/ripply-anim.scm
@@ -22,12 +22,14 @@
                                          100
                                          LAYER-MODE-NORMAL))))
     (gimp-context-push)
+    (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
+    (gimp-context-set-opacity 100.0)
     (gimp-image-undo-disable work-image)
 
     ; Create a tile-able displacement map in the first layer
     (gimp-context-set-background '(127 127 127))
     (gimp-image-insert-layer work-image map-layer 0 0)
-    (gimp-edit-fill map-layer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill map-layer FILL-BACKGROUND)
     (plug-in-noisify RUN-NONINTERACTIVE work-image map-layer FALSE 1.0 1.0 1.0 0.0)
     (plug-in-tile RUN-NONINTERACTIVE work-image map-layer (* width 3) (* height 3) FALSE)
     (plug-in-gauss-iir RUN-NONINTERACTIVE work-image map-layer 35 TRUE TRUE)
diff --git a/plug-ins/script-fu/scripts/round-corners.scm b/plug-ins/script-fu/scripts/round-corners.scm
index 039bc8a..d919251 100644
--- a/plug-ins/script-fu/scripts/round-corners.scm
+++ b/plug-ins/script-fu/scripts/round-corners.scm
@@ -81,7 +81,7 @@
                     radius radius)
   (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT (- width diam) (- height diam)
                        diam diam)
-  (gimp-edit-clear pic-layer)
+  (gimp-drawable-edit-clear pic-layer)
   (gimp-selection-none image)
 
   ; optionally add a shadow
diff --git a/plug-ins/script-fu/scripts/slide.scm b/plug-ins/script-fu/scripts/slide.scm
index 900cd0e..d42ee13 100644
--- a/plug-ins/script-fu/scripts/slide.scm
+++ b/plug-ins/script-fu/scripts/slide.scm
@@ -96,6 +96,8 @@
         )
 
   (gimp-context-push)
+  (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
+  (gimp-context-set-opacity 100.0)
   (gimp-context-set-feather FALSE)
 
   (gimp-image-undo-disable image)
@@ -202,7 +204,7 @@
     )
 
     (gimp-context-set-foreground '(0 0 0))
-    (gimp-edit-fill film-mask FILL-BACKGROUND)
+    (gimp-drawable-edit-fill film-mask FILL-BACKGROUND)
     (gimp-selection-none image)
     (plug-in-gauss-rle RUN-NONINTERACTIVE image film-mask hole-radius TRUE TRUE)
     (gimp-threshold film-mask 127 255)
diff --git a/plug-ins/script-fu/scripts/test-sphere.scm b/plug-ins/script-fu/scripts/test-sphere.scm
index 72c9d85..6b7b9cc 100644
--- a/plug-ins/script-fu/scripts/test-sphere.scm
+++ b/plug-ins/script-fu/scripts/test-sphere.scm
@@ -205,7 +205,7 @@
     (gimp-image-insert-layer img drawable 0 0)
     (gimp-context-set-foreground sphere-color)
     (gimp-context-set-background bg-color)
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
     (gimp-context-set-background '(20 20 20))
 
     (if (and
@@ -224,27 +224,32 @@
           (gimp-context-set-feather-radius 7.5 7.5)
           (gimp-image-select-ellipse img CHANNEL-OP-REPLACE shadow-x shadow-y shadow-w shadow-h)
           (gimp-context-set-pattern pattern)
-          (gimp-edit-bucket-fill drawable BUCKET-FILL-PATTERN LAYER-MODE-MULTIPLY
-                                 100 0 FALSE 0 0)))
+          (gimp-drawable-edit-fill drawable FILL-PATTERN)))
 
     (gimp-context-set-feather FALSE)
     (gimp-image-select-ellipse img CHANNEL-OP-REPLACE (- cx radius) (- cy radius)
                                (* 2 radius) (* 2 radius))
 
-    (gimp-edit-blend drawable BLEND-FG-BG-RGB LAYER-MODE-NORMAL
-                     GRADIENT-RADIAL 100 offset REPEAT-NONE FALSE
-                     FALSE 0 0 TRUE
-                     light-x light-y light-end-x light-end-y)
+    (gimp-context-set-gradient-fg-bg-rgb)
+    (gimp-drawable-edit-gradient-fill drawable
+                                     GRADIENT-RADIAL offset
+                                     FALSE 0 0
+                                     TRUE
+                                     light-x light-y
+                                     light-end-x light-end-y)
 
     (gimp-selection-none img)
 
-    (gimp-context-set-gradient gradient)
     (gimp-image-select-ellipse img CHANNEL-OP-REPLACE 10 10 50 50)
 
-    (gimp-edit-blend drawable BLEND-CUSTOM LAYER-MODE-NORMAL
-                     GRADIENT-LINEAR 100 offset REPEAT-NONE gradient-reverse
-                     FALSE 0 0 TRUE
-                     10 10 30 60)
+    (gimp-context-set-gradient gradient)
+    (gimp-context-set-gradient-reverse gradient-reverse)
+    (gimp-drawable-edit-gradient-fill drawable
+                                     GRADIENT-LINEAR offset
+                                     FALSE 0 0
+                                     TRUE
+                                     10 10
+                                     30 60)
 
     (gimp-selection-none img)
 
diff --git a/plug-ins/script-fu/scripts/weave.scm b/plug-ins/script-fu/scripts/weave.scm
index e80b4ea..edf5778 100644
--- a/plug-ins/script-fu/scripts/weave.scm
+++ b/plug-ins/script-fu/scripts/weave.scm
@@ -52,7 +52,7 @@
     (gimp-image-insert-layer img drawable 0 0)
 
     (gimp-context-set-background '(0 0 0))
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
     ; Create main horizontal ribbon
 
@@ -66,10 +66,13 @@
                                  (+ (* 2 ribbon-spacing) ribbon-width)
                                  ribbon-width)
 
-    (gimp-edit-blend drawable BLEND-FG-BG-RGB LAYER-MODE-NORMAL
-                     GRADIENT-BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
-                     FALSE 0 0 TRUE
-                     (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0 0)
+    (gimp-context-set-gradient-fg-bg-rgb)
+    (gimp-drawable-edit-gradient-fill drawable
+                                     GRADIENT-BILINEAR (- 100 shadow-depth)
+                                     FALSE 0 0
+                                     TRUE
+                                     (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0
+                                     0 0)
 
     ; Create main vertical ribbon
 
@@ -80,10 +83,12 @@
                                  ribbon-width
                                  (+ (* 2 ribbon-spacing) ribbon-width))
 
-    (gimp-edit-blend drawable BLEND-FG-BG-RGB LAYER-MODE-NORMAL
-                     GRADIENT-BILINEAR 100 (- 100 shadow-depth) REPEAT-NONE FALSE
-                     FALSE 0 0 TRUE
-                     0 (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 0)
+    (gimp-drawable-edit-gradient-fill drawable
+                                     GRADIENT-BILINEAR (- 100 shadow-depth)
+                                     FALSE 0 0
+                                     TRUE
+                                     0 (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2)
+                                     0 0)
 
     ; Create the secondary horizontal ribbon
 
@@ -170,14 +175,14 @@
     (gimp-image-insert-layer img drawable 0 0)
 
     (gimp-context-set-background '(0 0 0))
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
 
     (gimp-image-select-rectangle img CHANNEL-OP-REPLACE r1-x1 r1-y1 r1-width r1-height)
     (gimp-image-select-rectangle img CHANNEL-OP-ADD r2-x1 r2-y1 r2-width r2-height)
     (gimp-image-select-rectangle img CHANNEL-OP-ADD r3-x1 r3-y1 r3-width r3-height)
 
     (gimp-context-set-background '(255 255 255))
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
     (gimp-selection-none img)
 
     (gimp-image-undo-enable img)
@@ -272,7 +277,7 @@
          (dense (/ density 100.0)))
     (gimp-image-insert-layer img drawable 0 -1)
     (gimp-context-set-background '(255 255 255))
-    (gimp-edit-fill drawable FILL-BACKGROUND)
+    (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
     (plug-in-noisify RUN-NONINTERACTIVE img drawable FALSE dense dense dense dense)
     (plug-in-c-astretch RUN-NONINTERACTIVE img drawable)
     (cond ((eq? orientation 'horizontal)
@@ -366,6 +371,8 @@
         )
 
     (gimp-context-push)
+    (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
+    (gimp-context-set-opacity 100.0)
     (gimp-context-set-feather FALSE)
 
     (gimp-selection-all w-img)
diff --git a/plug-ins/script-fu/scripts/xach-effect.scm b/plug-ins/script-fu/scripts/xach-effect.scm
index 496ff36..25422d8 100644
--- a/plug-ins/script-fu/scripts/xach-effect.scm
+++ b/plug-ins/script-fu/scripts/xach-effect.scm
@@ -69,13 +69,13 @@
     (gimp-image-insert-layer image hl-layer 0 -1)
 
     (gimp-selection-none image)
-    (gimp-edit-clear hl-layer)
+    (gimp-drawable-edit-clear hl-layer)
     (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
 
     (gimp-context-set-background hl-color)
-    (gimp-edit-fill hl-layer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill hl-layer FILL-BACKGROUND)
     (gimp-selection-translate image hl-offset-x hl-offset-y)
-    (gimp-edit-fill hl-layer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill hl-layer FILL-BACKGROUND)
     (gimp-selection-none image)
     (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
 
@@ -83,7 +83,7 @@
     (gimp-layer-add-mask hl-layer mask)
 
     (gimp-context-set-background hl-opacity)
-    (gimp-edit-fill mask FILL-BACKGROUND)
+    (gimp-drawable-edit-fill mask FILL-BACKGROUND)
 
     (set! shadow-layer (car (gimp-layer-new image
                                             image-width
@@ -94,15 +94,15 @@
                                             LAYER-MODE-NORMAL)))
     (gimp-image-insert-layer image shadow-layer 0 -1)
     (gimp-selection-none image)
-    (gimp-edit-clear shadow-layer)
+    (gimp-drawable-edit-clear shadow-layer)
     (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
     (gimp-selection-translate image ds-offset-x ds-offset-y)
     (gimp-context-set-background ds-color)
-    (gimp-edit-fill shadow-layer FILL-BACKGROUND)
+    (gimp-drawable-edit-fill shadow-layer FILL-BACKGROUND)
     (gimp-selection-none image)
     (plug-in-gauss-rle RUN-NONINTERACTIVE image shadow-layer ds-blur TRUE TRUE)
     (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection)
-    (gimp-edit-clear shadow-layer)
+    (gimp-drawable-edit-clear shadow-layer)
     (gimp-image-lower-item image shadow-layer)
 
     (if (= keep-selection FALSE)



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