~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/reverse-layers.scm

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;; reverse-layers.scm: Reverse the order of layers in the current image.
 
2
;; Copyright (C) 2006 by Akkana Peck.
 
3
;;
 
4
;; This program is free software; you can redistribute it and/or modify
 
5
;; it under the terms of the GNU General Public License.
 
6
 
 
7
(define (script-fu-reverse-layers img drawable)
 
8
  (let* (
 
9
        (layers (gimp-image-get-layers img))
 
10
        (num-layers (car layers))
 
11
        (layer-array (cadr layers))
 
12
        (i (- num-layers 1))
 
13
        )
 
14
 
 
15
    (gimp-image-undo-group-start img)
 
16
 
 
17
    (while (>= i 0)
 
18
           (let ((layer (aref layer-array i)))
 
19
             (if (= (car (gimp-layer-is-floating-sel layer)) FALSE)
 
20
                 (gimp-image-lower-layer-to-bottom img layer))
 
21
           )
 
22
 
 
23
           (set! i (- i 1))
 
24
    )
 
25
 
 
26
    (gimp-image-undo-group-end img)
 
27
    (gimp-displays-flush)
 
28
  )
 
29
)
 
30
 
 
31
(script-fu-register "script-fu-reverse-layers"
 
32
  _"Reverse Layer Order"
 
33
  _"Reverse the order of layers in the image"
 
34
  "Akkana Peck"
 
35
  "Akkana Peck"
 
36
  "August 2006"
 
37
  "*"
 
38
  SF-IMAGE    "Image"    0
 
39
  SF-DRAWABLE "Drawable" 0
 
40
)
 
41
 
 
42
(script-fu-menu-register "script-fu-reverse-layers"
 
43
                         "<Image>/Layer/Stack")