From fee17f87127c95c06ef07f586c19e7e3585e162f Mon Sep 17 00:00:00 2001 From: Alexandre Prokoudine Date: Sun, 10 Oct 2010 21:04:08 +0400 Subject: [PATCH] Cleanup of recent changes in porting scripts to new API. Marked layer names in carved-logo.scm for translation while at that --- plug-ins/script-fu/scripts/add-bevel.scm | 4 ++-- .../scripts/beveled-pattern-heading.scm | 6 +++--- plug-ins/script-fu/scripts/burn-in-anim.scm | 4 ++-- plug-ins/script-fu/scripts/carve-it.scm | 10 +++++----- plug-ins/script-fu/scripts/carved-logo.scm | 20 +++++++++---------- plug-ins/script-fu/scripts/chrome-it.scm | 4 ++-- plug-ins/script-fu/scripts/circuit.scm | 6 +++--- .../script-fu/scripts/distress-selection.scm | 2 +- plug-ins/script-fu/scripts/drop-shadow.scm | 2 +- .../script-fu/scripts/perspective-shadow.scm | 2 +- plug-ins/script-fu/scripts/xach-effect.scm | 8 ++++---- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/plug-ins/script-fu/scripts/add-bevel.scm b/plug-ins/script-fu/scripts/add-bevel.scm index 5a33c8f592..192ea188a4 100644 --- a/plug-ins/script-fu/scripts/add-bevel.scm +++ b/plug-ins/script-fu/scripts/add-bevel.scm @@ -101,7 +101,7 @@ ; Set the selection to the area we want to bevel. ; (if (= selection-exists 0) - (gimp-item-to-selection pic-layer 2) + (gimp-item-to-selection pic-layer CHANNEL-OP-REPLACE) ) ; Store it for later. @@ -151,7 +151,7 @@ ; (if (= selection-exists 0) (gimp-selection-none image) ; No selection to start with - (gimp-item-to-selection selection 2) + (gimp-item-to-selection selection CHANNEL-OP-REPLACE) ) ; If they started with a selection, they can Select->Invert then ; Edit->Clear for a cutout. diff --git a/plug-ins/script-fu/scripts/beveled-pattern-heading.scm b/plug-ins/script-fu/scripts/beveled-pattern-heading.scm index e15bdf10bf..f9a7f48af3 100644 --- a/plug-ins/script-fu/scripts/beveled-pattern-heading.scm +++ b/plug-ins/script-fu/scripts/beveled-pattern-heading.scm @@ -64,12 +64,12 @@ (gimp-edit-fill bumpmap BACKGROUND-FILL) (gimp-context-set-background '(127 127 127)) - (gimp-item-to-selection textl 2) + (gimp-item-to-selection textl CHANNEL-OP-REPLACE) (gimp-selection-shrink img 1) (gimp-edit-fill bumpmap BACKGROUND-FILL) (gimp-context-set-background '(255 255 255)) - (gimp-item-to-selection textl 2) + (gimp-item-to-selection textl CHANNEL-OP-REPLACE) (gimp-selection-shrink img 2) (gimp-edit-fill bumpmap BACKGROUND-FILL) @@ -82,7 +82,7 @@ ; Clean up (gimp-context-set-background '(0 0 0)) - (gimp-item-to-selection textl 2) + (gimp-item-to-selection textl CHANNEL-OP-REPLACE) (gimp-selection-invert img) (gimp-edit-clear background) (gimp-selection-none img) diff --git a/plug-ins/script-fu/scripts/burn-in-anim.scm b/plug-ins/script-fu/scripts/burn-in-anim.scm index cff13e6a12..64a1d5b69b 100644 --- a/plug-ins/script-fu/scripts/burn-in-anim.scm +++ b/plug-ins/script-fu/scripts/burn-in-anim.scm @@ -81,7 +81,7 @@ (gimp-layer-add-alpha bl-layer) ;--- add an alpha mask for blending and select it - (gimp-item-to-selection bl-layer 2) + (gimp-item-to-selection bl-layer CHANNEL-OP-REPLACE) (set! bl-mask (car (gimp-layer-create-mask bl-layer ADD-BLACK-MASK))) (gimp-layer-add-mask bl-layer bl-mask) @@ -148,7 +148,7 @@ (- (+ bl-x-off bl-width) after-glow) 0) ;--- add corona effect - (gimp-item-to-selection bl-layer 2) + (gimp-item-to-selection bl-layer CHANNEL-OP-REPLACE) (gimp-selection-sharpen img) (gimp-selection-grow img corona-width) (gimp-layer-set-lock-alpha bl-layer FALSE) diff --git a/plug-ins/script-fu/scripts/carve-it.scm b/plug-ins/script-fu/scripts/carve-it.scm index 2894fa40f7..4127a13a5e 100644 --- a/plug-ins/script-fu/scripts/carve-it.scm +++ b/plug-ins/script-fu/scripts/carve-it.scm @@ -98,7 +98,7 @@ (set! mask-fat (car (gimp-channel-copy mask))) (gimp-image-insert-channel img mask-fat -1 0) - (gimp-item-to-selection mask-fat 2) + (gimp-item-to-selection mask-fat CHANNEL-OP-REPLACE) (gimp-context-set-brush (carve-brush brush-size)) (gimp-context-set-foreground '(255 255 255)) (gimp-edit-stroke mask-fat) @@ -110,10 +110,10 @@ (plug-in-emboss RUN-NONINTERACTIVE img mask-emboss 315.0 45.0 7 TRUE) (gimp-context-set-background '(180 180 180)) - (gimp-item-to-selection mask-fat 2) + (gimp-item-to-selection mask-fat CHANNEL-OP-REPLACE) (gimp-selection-invert img) (gimp-edit-fill mask-emboss BACKGROUND-FILL) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-edit-fill mask-emboss BACKGROUND-FILL) (gimp-selection-none img) @@ -144,7 +144,7 @@ (set! csl-mask (car (gimp-layer-create-mask cast-shadow-layer ADD-BLACK-MASK))) (gimp-layer-add-mask cast-shadow-layer csl-mask) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-context-set-background '(255 255 255)) (gimp-edit-fill csl-mask BACKGROUND-FILL) @@ -153,7 +153,7 @@ (set! il-mask (car (gimp-layer-create-mask inset-layer ADD-BLACK-MASK))) (gimp-layer-add-mask inset-layer il-mask) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-context-set-background '(255 255 255)) (gimp-edit-fill il-mask BACKGROUND-FILL) (gimp-selection-none img) diff --git a/plug-ins/script-fu/scripts/carved-logo.scm b/plug-ins/script-fu/scripts/carved-logo.scm index 0bd96362ac..c79f788223 100644 --- a/plug-ins/script-fu/scripts/carved-logo.scm +++ b/plug-ins/script-fu/scripts/carved-logo.scm @@ -77,7 +77,7 @@ (set! mask-fat (car (gimp-channel-copy mask))) (gimp-image-insert-channel img mask-fat -1 0) - (gimp-item-to-selection mask-fat 2) + (gimp-item-to-selection mask-fat CHANNEL-OP-REPLACE) (gimp-context-set-brush (carve-brush brush-size)) (gimp-context-set-foreground '(255 255 255)) (gimp-edit-stroke mask-fat) @@ -89,10 +89,10 @@ (plug-in-emboss RUN-NONINTERACTIVE img mask-emboss 315.0 45.0 7 TRUE) (gimp-context-set-background '(180 180 180)) - (gimp-item-to-selection mask-fat 2) + (gimp-item-to-selection mask-fat CHANNEL-OP-REPLACE) (gimp-selection-invert img) (gimp-edit-fill mask-emboss BACKGROUND-FILL) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-edit-fill mask-emboss BACKGROUND-FILL) (gimp-selection-none img) @@ -123,7 +123,7 @@ (set! csl-mask (car (gimp-layer-create-mask cast-shadow-layer ADD-BLACK-MASK))) (gimp-layer-add-mask cast-shadow-layer csl-mask) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-context-set-background '(255 255 255)) (gimp-edit-fill csl-mask BACKGROUND-FILL) @@ -132,7 +132,7 @@ (set! il-mask (car (gimp-layer-create-mask inset-layer ADD-BLACK-MASK))) (gimp-layer-add-mask inset-layer il-mask) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-context-set-background '(255 255 255)) (gimp-edit-fill il-mask BACKGROUND-FILL) (gimp-selection-none img) @@ -144,11 +144,11 @@ (gimp-image-remove-channel img mask-highlight) (gimp-image-remove-channel img mask-shadow) - (gimp-item-set-name layer1 "Carved Surface") - (gimp-item-set-name shadow-layer "Bevel Shadow") - (gimp-item-set-name highlight-layer "Bevel Highlight") - (gimp-item-set-name cast-shadow-layer "Cast Shadow") - (gimp-item-set-name inset-layer "Inset") + (gimp-item-set-name layer1 _"Carved Surface") + (gimp-item-set-name shadow-layer _"Bevel Shadow") + (gimp-item-set-name highlight-layer _"Bevel Highlight") + (gimp-item-set-name cast-shadow-layer _"Cast Shadow") + (gimp-item-set-name inset-layer _"Inset") (gimp-display-new img) (gimp-image-undo-enable img) diff --git a/plug-ins/script-fu/scripts/chrome-it.scm b/plug-ins/script-fu/scripts/chrome-it.scm index 98fd81db25..9130e55771 100644 --- a/plug-ins/script-fu/scripts/chrome-it.scm +++ b/plug-ins/script-fu/scripts/chrome-it.scm @@ -135,7 +135,7 @@ (gimp-item-set-visible bg-layer FALSE) (gimp-item-set-visible shadow FALSE) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-context-set-background '(0 0 0)) (gimp-selection-translate img offx1 offy1) (gimp-selection-feather img feather) @@ -157,7 +157,7 @@ (set! layer-mask (car (gimp-layer-create-mask layer1 ADD-BLACK-MASK))) (gimp-layer-add-mask layer1 layer-mask) - (gimp-item-to-selection mask 2) + (gimp-item-to-selection mask CHANNEL-OP-REPLACE) (gimp-context-set-background '(255 255 255)) (gimp-edit-fill layer-mask BACKGROUND-FILL) diff --git a/plug-ins/script-fu/scripts/circuit.scm b/plug-ins/script-fu/scripts/circuit.scm index 3b840cb20b..7d99934e75 100644 --- a/plug-ins/script-fu/scripts/circuit.scm +++ b/plug-ins/script-fu/scripts/circuit.scm @@ -58,7 +58,7 @@ (if (= (car (gimp-selection-is-empty image)) TRUE) (begin - (gimp-item-to-selection drawable 2) + (gimp-item-to-selection drawable CHANNEL-OP-REPLACE) (set! active-selection (car (gimp-selection-save image))) (set! from-selection FALSE)) (begin @@ -85,7 +85,7 @@ (gimp-layer-set-offsets effect-layer select-offset-x select-offset-y) (gimp-selection-none image) (gimp-edit-clear effect-layer) - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (gimp-edit-copy drawable) (let ((floating-sel (car (gimp-edit-paste effect-layer FALSE)))) @@ -101,7 +101,7 @@ (gimp-context-set-foreground '(14 14 14)) ) - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (plug-in-maze RUN-NONINTERACTIVE image active-layer 5 5 TRUE 0 seed 57 1) (plug-in-oilify RUN-NONINTERACTIVE image active-layer mask-size 0) (plug-in-edge RUN-NONINTERACTIVE image active-layer 2 1 0) diff --git a/plug-ins/script-fu/scripts/distress-selection.scm b/plug-ins/script-fu/scripts/distress-selection.scm index ae809666bd..6861754d56 100644 --- a/plug-ins/script-fu/scripts/distress-selection.scm +++ b/plug-ins/script-fu/scripts/distress-selection.scm @@ -81,7 +81,7 @@ (gimp-layer-scale theLayer theWidth theHeight TRUE) (plug-in-threshold-alpha RUN-NONINTERACTIVE theImage theLayer inThreshold) (plug-in-gauss-iir RUN-NONINTERACTIVE theImage theLayer 1 TRUE TRUE) - (gimp-item-to-selection theLayer 2) + (gimp-item-to-selection theLayer CHANNEL-OP-REPLACE) (gimp-image-remove-layer theImage theLayer) (if (and (= (car (gimp-item-is-channel inDrawable)) TRUE) (= (car (gimp-item-is-layer-mask inDrawable)) FALSE)) diff --git a/plug-ins/script-fu/scripts/drop-shadow.scm b/plug-ins/script-fu/scripts/drop-shadow.scm index 2d23bd4ae4..8123fa8493 100644 --- a/plug-ins/script-fu/scripts/drop-shadow.scm +++ b/plug-ins/script-fu/scripts/drop-shadow.scm @@ -146,7 +146,7 @@ (if (= from-selection TRUE) (begin - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (gimp-edit-clear shadow-layer) (gimp-image-remove-channel image active-selection))) diff --git a/plug-ins/script-fu/scripts/perspective-shadow.scm b/plug-ins/script-fu/scripts/perspective-shadow.scm index a6dd1408cf..1452f94893 100644 --- a/plug-ins/script-fu/scripts/perspective-shadow.scm +++ b/plug-ins/script-fu/scripts/perspective-shadow.scm @@ -174,7 +174,7 @@ (if (= from-selection TRUE) (begin - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (gimp-edit-clear shadow-layer) (gimp-image-remove-channel image active-selection))) diff --git a/plug-ins/script-fu/scripts/xach-effect.scm b/plug-ins/script-fu/scripts/xach-effect.scm index f59d0037f5..99f79db13c 100644 --- a/plug-ins/script-fu/scripts/xach-effect.scm +++ b/plug-ins/script-fu/scripts/xach-effect.scm @@ -69,14 +69,14 @@ (gimp-selection-none image) (gimp-edit-clear hl-layer) - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (gimp-context-set-background hl-color) (gimp-edit-fill hl-layer BACKGROUND-FILL) (gimp-selection-translate image hl-offset-x hl-offset-y) (gimp-edit-fill hl-layer BACKGROUND-FILL) (gimp-selection-none image) - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (set! mask (car (gimp-layer-create-mask hl-layer ADD-WHITE-MASK))) (gimp-layer-add-mask hl-layer mask) @@ -94,13 +94,13 @@ (gimp-image-insert-layer image shadow-layer -1 -1) (gimp-selection-none image) (gimp-edit-clear shadow-layer) - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (gimp-selection-translate image ds-offset-x ds-offset-y) (gimp-context-set-background ds-color) (gimp-edit-fill shadow-layer BACKGROUND-FILL) (gimp-selection-none image) (plug-in-gauss-rle RUN-NONINTERACTIVE image shadow-layer ds-blur TRUE TRUE) - (gimp-item-to-selection active-selection 2) + (gimp-item-to-selection active-selection CHANNEL-OP-REPLACE) (gimp-edit-clear shadow-layer) (gimp-image-lower-item image shadow-layer)