Made all the functions defined in the file local instead of global to

2007-09-28  Kevin Cozens  <kcozens@cvs.gnome.org>

	* plug-ins/script-fu/scripts/addborder.scm: Made all the functions
	defined in the file local instead of global to avoid possible
	conflicts with other scripts.

svn path=/trunk/; revision=23684
This commit is contained in:
Kevin Cozens 2007-09-28 16:13:58 +00:00 committed by Kevin Cozens
parent 4d77d9a2d1
commit 14eb770a4c
2 changed files with 79 additions and 72 deletions

View File

@ -1,3 +1,9 @@
2007-09-28 Kevin Cozens <kcozens@cvs.gnome.org>
* plug-ins/script-fu/scripts/addborder.scm: Made all the functions
defined in the file local instead of global to avoid possible
conflicts with other scripts.
2007-09-28 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scheme-wrapper.c: plugged memory leaks.

View File

@ -24,79 +24,80 @@
; If > 255 set to 255
; Return the new value
(define (deltacolour col delta)
(let* ((newcol (+ col delta)))
(if (< newcol 0) (set! newcol 0))
(if (> newcol 255) (set! newcol 255))
newcol
)
)
(define (adjcolour col delta)
(mapcar (lambda (x) (deltacolour x delta)) col)
)
(define (gen_top_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 0 )
(aset n_array 1 0 )
(aset n_array 2 xsize)
(aset n_array 3 ysize)
(aset n_array 4 (+ xsize owidth))
(aset n_array 5 ysize)
(aset n_array 6 width)
(aset n_array 7 0 )
(aset n_array 8 0 )
(aset n_array 9 0 )
n_array)
)
(define (gen_left_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 0 )
(aset n_array 1 0 )
(aset n_array 2 xsize)
(aset n_array 3 ysize)
(aset n_array 4 xsize)
(aset n_array 5 (+ ysize oheight))
(aset n_array 6 0 )
(aset n_array 7 height )
(aset n_array 8 0 )
(aset n_array 9 0 )
n_array)
)
(define (gen_right_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 width )
(aset n_array 1 0 )
(aset n_array 2 (+ xsize owidth))
(aset n_array 3 ysize)
(aset n_array 4 (+ xsize owidth))
(aset n_array 5 (+ ysize oheight))
(aset n_array 6 width)
(aset n_array 7 height)
(aset n_array 8 width )
(aset n_array 9 0 )
n_array)
)
(define (gen_bottom_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 0 )
(aset n_array 1 height)
(aset n_array 2 xsize)
(aset n_array 3 (+ ysize oheight))
(aset n_array 4 (+ xsize owidth))
(aset n_array 5 (+ ysize oheight))
(aset n_array 6 width)
(aset n_array 7 height)
(aset n_array 8 0 )
(aset n_array 9 height)
n_array)
)
(define (script-fu-addborder aimg adraw xsize ysize colour dvalue)
(define (deltacolour col delta)
(let* ((newcol (+ col delta)))
(if (< newcol 0) (set! newcol 0))
(if (> newcol 255) (set! newcol 255))
newcol
)
)
(define (adjcolour col delta)
(mapcar (lambda (x) (deltacolour x delta)) col)
)
(define (gen_top_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 0 )
(aset n_array 1 0 )
(aset n_array 2 xsize)
(aset n_array 3 ysize)
(aset n_array 4 (+ xsize owidth))
(aset n_array 5 ysize)
(aset n_array 6 width)
(aset n_array 7 0 )
(aset n_array 8 0 )
(aset n_array 9 0 )
n_array)
)
(define (gen_left_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 0 )
(aset n_array 1 0 )
(aset n_array 2 xsize)
(aset n_array 3 ysize)
(aset n_array 4 xsize)
(aset n_array 5 (+ ysize oheight))
(aset n_array 6 0 )
(aset n_array 7 height )
(aset n_array 8 0 )
(aset n_array 9 0 )
n_array)
)
(define (gen_right_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 width )
(aset n_array 1 0 )
(aset n_array 2 (+ xsize owidth))
(aset n_array 3 ysize)
(aset n_array 4 (+ xsize owidth))
(aset n_array 5 (+ ysize oheight))
(aset n_array 6 width)
(aset n_array 7 height)
(aset n_array 8 width )
(aset n_array 9 0 )
n_array)
)
(define (gen_bottom_array xsize ysize owidth oheight width height)
(let* ((n_array (cons-array 10 'double)))
(aset n_array 0 0 )
(aset n_array 1 height)
(aset n_array 2 xsize)
(aset n_array 3 (+ ysize oheight))
(aset n_array 4 (+ xsize owidth))
(aset n_array 5 (+ ysize oheight))
(aset n_array 6 width)
(aset n_array 7 height)
(aset n_array 8 0 )
(aset n_array 9 height)
n_array)
)
(let* ((img (car (gimp-drawable-get-image adraw)))
(owidth (car (gimp-image-width img)))
(oheight (car (gimp-image-height img)))