[gimp] Porting scripts to new API, marking layer names for translation
- From: Alexandre Prokoudine <aprokoudine src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Porting scripts to new API, marking layer names for translation
- Date: Sat, 9 Oct 2010 23:41:53 +0000 (UTC)
commit e062acbc642cf0cfa601595ddb0524be11354dd9
Author: Alexandre Prokoudine <alexandre prokoudine gmail com>
Date: Sun Oct 10 03:40:59 2010 +0400
Porting scripts to new API, marking layer names for translation
plug-ins/script-fu/scripts/add-bevel.scm | 8 ++++----
plug-ins/script-fu/scripts/addborder.scm | 4 ++--
plug-ins/script-fu/scripts/alien-glow-arrow.scm | 12 ++++++------
plug-ins/script-fu/scripts/alien-glow-bar.scm | 12 ++++++------
plug-ins/script-fu/scripts/alien-glow-bullet.scm | 12 ++++++------
plug-ins/script-fu/scripts/alien-glow-button.scm | 12 ++++++------
plug-ins/script-fu/scripts/blend-anim.scm | 15 ++++++++-------
7 files changed, 38 insertions(+), 37 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/add-bevel.scm b/plug-ins/script-fu/scripts/add-bevel.scm
index 3bb00cf..5a33c8f 100644
--- a/plug-ins/script-fu/scripts/add-bevel.scm
+++ b/plug-ins/script-fu/scripts/add-bevel.scm
@@ -73,7 +73,7 @@
(+ width 2)
(+ height 2)
RGB-IMAGE
- "Bumpmap"
+ _"Bumpmap"
100
NORMAL-MODE)))
@@ -89,7 +89,7 @@
(gimp-image-undo-group-start image)
)
- (gimp-image-add-layer image bump-layer 1)
+ (gimp-image-insert-layer image bump-layer -1 1)
; If the layer we're bevelling is offset from the image's origin, we
; have to do the same to the bumpmap
@@ -101,7 +101,7 @@
; Set the selection to the area we want to bevel.
;
(if (= selection-exists 0)
- (gimp-selection-layer-alpha pic-layer)
+ (gimp-item-to-selection pic-layer 2)
)
; Store it for later.
@@ -151,7 +151,7 @@
;
(if (= selection-exists 0)
(gimp-selection-none image) ; No selection to start with
- (gimp-selection-load selection)
+ (gimp-item-to-selection selection 2)
)
; If they started with a selection, they can Select->Invert then
; Edit->Clear for a cutout.
diff --git a/plug-ins/script-fu/scripts/addborder.scm b/plug-ins/script-fu/scripts/addborder.scm
index 632b5d0..3849b47 100644
--- a/plug-ins/script-fu/scripts/addborder.scm
+++ b/plug-ins/script-fu/scripts/addborder.scm
@@ -105,7 +105,7 @@
(layer (car (gimp-layer-new img
width height
(car (gimp-drawable-type-with-alpha adraw))
- "Border-Layer" 100 NORMAL-MODE))))
+ _"Border Layer" 100 NORMAL-MODE))))
(gimp-context-push)
@@ -117,7 +117,7 @@
xsize
ysize)
- (gimp-image-add-layer img layer 0)
+ (gimp-image-insert-layer img layer -1 0)
(gimp-drawable-fill layer TRANSPARENT-FILL)
(gimp-context-set-background (adjcolour colour dvalue))
diff --git a/plug-ins/script-fu/scripts/alien-glow-arrow.scm b/plug-ins/script-fu/scripts/alien-glow-arrow.scm
index 9bb65bb..4362ca2 100644
--- a/plug-ins/script-fu/scripts/alien-glow-arrow.scm
+++ b/plug-ins/script-fu/scripts/alien-glow-arrow.scm
@@ -115,13 +115,13 @@
(offset (/ size 6))
(ruler-layer (car (gimp-layer-new img
size size RGBA-IMAGE
- "Ruler" 100 NORMAL-MODE)))
+ _"Arrow" 100 NORMAL-MODE)))
(glow-layer (car (gimp-layer-new img
size size RGBA-IMAGE
- "Alien Glow" 100 NORMAL-MODE)))
+ _"Alien Glow" 100 NORMAL-MODE)))
(bg-layer (car (gimp-layer-new img
size size RGB-IMAGE
- "Background" 100 NORMAL-MODE)))
+ _"Background" 100 NORMAL-MODE)))
(big-arrow (point-list->double-array
(rotate-points (make-arrow size offset)
size orientation)))
@@ -131,9 +131,9 @@
(gimp-image-undo-disable img)
;(gimp-image-resize img (+ length height) (+ height height) 0 0)
- (gimp-image-add-layer img bg-layer 1)
- (gimp-image-add-layer img glow-layer -1)
- (gimp-image-add-layer img ruler-layer -1)
+ (gimp-image-insert-layer img bg-layer -1 1)
+ (gimp-image-insert-layer img glow-layer -1 -1)
+ (gimp-image-insert-layer img ruler-layer -1 -1)
(gimp-edit-clear glow-layer)
(gimp-edit-clear ruler-layer)
diff --git a/plug-ins/script-fu/scripts/alien-glow-bar.scm b/plug-ins/script-fu/scripts/alien-glow-bar.scm
index 165b059..e62f62e 100644
--- a/plug-ins/script-fu/scripts/alien-glow-bar.scm
+++ b/plug-ins/script-fu/scripts/alien-glow-bar.scm
@@ -29,22 +29,22 @@
(border (/ height 4))
(ruler-layer (car (gimp-layer-new img
(+ length height) (+ height height)
- RGBA-IMAGE "Ruler" 100 NORMAL-MODE)))
+ RGBA-IMAGE _"Bar" 100 NORMAL-MODE)))
(glow-layer (car (gimp-layer-new img
(+ length height) (+ height height)
- RGBA-IMAGE "Alien Glow" 100 NORMAL-MODE)))
+ RGBA-IMAGE _"Alien Glow" 100 NORMAL-MODE)))
(bg-layer (car (gimp-layer-new img
(+ length height) (+ height height)
- RGB-IMAGE "Background" 100 NORMAL-MODE)))
+ RGB-IMAGE _"Background" 100 NORMAL-MODE)))
)
(gimp-context-push)
(gimp-image-undo-disable img)
(gimp-image-resize img (+ length height) (+ height height) 0 0)
- (gimp-image-add-layer img bg-layer 1)
- (gimp-image-add-layer img glow-layer -1)
- (gimp-image-add-layer img ruler-layer -1)
+ (gimp-image-insert-layer img bg-layer -1 1)
+ (gimp-image-insert-layer img glow-layer -1 -1)
+ (gimp-image-insert-layer img ruler-layer -1 -1)
; (gimp-layer-set-lock-alpha ruler-layer TRUE)
(gimp-context-set-background bg-color)
diff --git a/plug-ins/script-fu/scripts/alien-glow-bullet.scm b/plug-ins/script-fu/scripts/alien-glow-bullet.scm
index ca74fbb..75c6a1d 100644
--- a/plug-ins/script-fu/scripts/alien-glow-bullet.scm
+++ b/plug-ins/script-fu/scripts/alien-glow-bullet.scm
@@ -37,20 +37,20 @@
(blend-start (+ half-radius (/ half-radius 2)))
(bullet-layer (car (gimp-layer-new img
diameter diameter RGBA-IMAGE
- "Ruler" 100 NORMAL-MODE)))
+ _"Bullet" 100 NORMAL-MODE)))
(glow-layer (car (gimp-layer-new img diameter diameter RGBA-IMAGE
- "ALien Glow" 100 NORMAL-MODE)))
+ _"Alien Glow" 100 NORMAL-MODE)))
(bg-layer (car (gimp-layer-new img diameter diameter RGB-IMAGE
- "Background" 100 NORMAL-MODE)))
+ _"Background" 100 NORMAL-MODE)))
)
(gimp-context-push)
(gimp-image-undo-disable img)
(gimp-image-resize img diameter diameter 0 0)
- (gimp-image-add-layer img bg-layer 1)
- (gimp-image-add-layer img glow-layer -1)
- (gimp-image-add-layer img bullet-layer -1)
+ (gimp-image-insert-layer img bg-layer -1 1)
+ (gimp-image-insert-layer img glow-layer -1 -1)
+ (gimp-image-insert-layer img bullet-layer -1 -1)
; (gimp-layer-set-lock-alpha ruler-layer TRUE)
(gimp-context-set-background bg-color)
diff --git a/plug-ins/script-fu/scripts/alien-glow-button.scm b/plug-ins/script-fu/scripts/alien-glow-button.scm
index f576850..124db89 100644
--- a/plug-ins/script-fu/scripts/alien-glow-button.scm
+++ b/plug-ins/script-fu/scripts/alien-glow-button.scm
@@ -75,13 +75,13 @@
(img (car (gimp-image-new img-width img-height RGB)))
(bg-layer (car (gimp-layer-new img
img-width img-height RGBA-IMAGE
- "Background" 100 NORMAL-MODE)))
+ _"Background" 100 NORMAL-MODE)))
(glow-layer (car (gimp-layer-new img
img-width img-height RGBA-IMAGE
- "Glow" 100 NORMAL-MODE)))
+ _"Glow" 100 NORMAL-MODE)))
(button-layer (car (gimp-layer-new img
layer-width layer-height RGBA-IMAGE
- "Button" 100 NORMAL-MODE)))
+ _"Button" 100 NORMAL-MODE)))
)
(gimp-context-push)
@@ -90,15 +90,15 @@
; Create bumpmap layer
- (gimp-image-add-layer img bg-layer -1)
+ (gimp-image-insert-layer img bg-layer -1 -1)
(gimp-context-set-foreground '(0 0 0))
(gimp-context-set-background bg-color)
(gimp-edit-fill bg-layer BACKGROUND-FILL)
- (gimp-image-add-layer img glow-layer -1)
+ (gimp-image-insert-layer img glow-layer -1 -1)
; Create text layer
- (gimp-image-add-layer img button-layer -1)
+ (gimp-image-insert-layer img button-layer -1 -1)
(gimp-layer-set-offsets button-layer (/ glow-radius 2) (/ glow-radius 2))
(gimp-selection-none img)
(gimp-rect-select img 0 0 img-width img-height CHANNEL-OP-REPLACE FALSE 0)
diff --git a/plug-ins/script-fu/scripts/blend-anim.scm b/plug-ins/script-fu/scripts/blend-anim.scm
index 51b4849..ed67994 100644
--- a/plug-ins/script-fu/scripts/blend-anim.scm
+++ b/plug-ins/script-fu/scripts/blend-anim.scm
@@ -38,7 +38,7 @@
(define (multi-raise-layer image layer times)
(while (> times 0)
- (gimp-image-raise-layer image layer)
+ (gimp-image-raise-item image layer)
(set! times (- times 1))
)
)
@@ -68,7 +68,7 @@
; add a copy of the lowest blend layer on top
(let* ((copy (car (gimp-layer-copy
(aref layer-array (- num-layers 2)) TRUE))))
- (gimp-image-add-layer image copy 0)
+ (gimp-image-insert-layer image copy -1 0)
(set! layers (gimp-image-get-layers image))
(set! num-layers (car layers))
(set! layer-array (cadr layers))
@@ -113,9 +113,9 @@
(upper-copy (car (gimp-layer-copy upper-layer TRUE)))
(lower-copy (car (gimp-layer-copy lower-layer TRUE)))
(bg-copy (car (gimp-layer-copy bg-layer TRUE))))
- (gimp-image-add-layer image bg-copy 0)
- (gimp-image-add-layer image lower-copy 0)
- (gimp-image-add-layer image upper-copy 0)
+ (gimp-image-insert-layer image bg-copy -1 0)
+ (gimp-image-insert-layer image lower-copy -1 0)
+ (gimp-image-insert-layer image upper-copy -1 0)
(gimp-item-set-visible upper-copy TRUE)
(gimp-item-set-visible lower-copy TRUE)
(gimp-item-set-visible bg-copy TRUE)
@@ -171,8 +171,9 @@
(while (< layer-count slots)
(let* ((orig-layer (aref layer-array layer-count))
(bg-copy (car (gimp-layer-copy bg-layer TRUE))))
- (gimp-image-add-layer image
+ (gimp-image-insert-layer image
bg-copy
+ -1
(* layer-count (+ frames 1)))
(multi-raise-layer image
orig-layer
@@ -202,7 +203,7 @@
(layer-count (- num-result-layers 1)))
(while (> layer-count -1)
(let* ((layer (aref result-layer-array layer-count))
- (name (string-append "Frame "
+ (name (string-append _"Frame "
(number->string
(- num-result-layers layer-count) 10))))
(gimp-item-set-visible layer TRUE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]