; This file is part of the Skin Generator, Copyright (c) 2004 Alexander R. Pruss
;
; This program is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation; either version 2
; of the License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


(define (script-fu-set-visible-list img name-list)
    (let* ((layers (gimp-image-get-layers img))
	 (num-of-layers (car layers))
	 (layers-array (cadr layers))
      )
	 (set! i 0)
	 (while (< i num-of-layers)
	    (set! layer (aref layers-array i))
        (set! j 0)
        (set! layer-name (car (gimp-drawable-get-name layer)))
        (set! names name-list)
        (gimp-drawable-set-visible layer FALSE)
        (while (< 0 (length names))
          (if (equal? (car names) layer-name)
            (gimp-drawable-set-visible layer TRUE) )
          (set! names (cdr names))
         )
	    (set! i (+ i 1))
        )
       ))

(define (script-fu-dump img filename name-list)
       (set! img2 (car (gimp-image-duplicate img)))
       (script-fu-set-visible-list img2 name-list)
       (gimp-image-flatten img2)
       (set! layers2 (gimp-image-get-layers img2))
       (file-bmp-save 1 img2 (aref (cadr layers2) 0) filename "Autogenerated")
       (gimp-image-delete img2)
)

(define (script-fu-save-geek img drawable)
        (script-fu-dump img "c:/palmBMX/quickconv/GeekA1.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Buttons" "Down arrow disabled" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB1.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Buttons" "Down arrow disabled" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC1.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Buttons" "Down arrow disabled" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD1.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Buttons" "Down arrow disabled" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekE1.bmp"
                '("Graphic" "Background"
                  "Buttons" "Down arrow disabled" "Speaker crossout"))

        (script-fu-dump img "c:/palmBMX/quickconv/GeekA2.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Buttons" "Up arrow disabled, charging" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB2.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Buttons" "Up arrow disabled, charging" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC2.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Buttons" "Up arrow disabled, charging" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD2.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Buttons" "Up arrow disabled, charging" "Speaker crossout"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekE2.bmp"
                '("Graphic" "Background"
                  "Buttons" "Up arrow disabled, charging" "Speaker crossout"))

        (script-fu-dump img "c:/palmBMX/quickconv/GeekA3.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Buttons" "Down arrow, empty battery"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB3.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Buttons" "Down arrow, empty battery"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC3.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Buttons" "Down arrow, empty battery"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD3.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Buttons" "Down arrow, empty battery"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekE3.bmp"
                '("Graphic" "Background"
                  "Buttons" "Down arrow, empty battery"))

        (script-fu-dump img "c:/palmBMX/quickconv/GeekA4.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Buttons" "Up arrow, full battery" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB4.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Buttons" "Up arrow, full battery" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC4.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Buttons" "Up arrow, full battery" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD4.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Buttons" "Up arrow, full battery" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekE4.bmp"
                '("Graphic" "Background"
                  "Buttons" "Up arrow, full battery" ))

        (script-fu-dump img "c:/palmBMX/quickconv/GeekA5.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Selected buttons" "Selected down arrow" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB5.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Selected buttons" "Selected down arrow" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC5.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Selected buttons" "Selected down arrow" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD5.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Selected buttons" "Selected down arrow" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekE5.bmp"
                '("Graphic" "Background"
                  "Selected buttons" "Selected down arrow" ))

        (script-fu-dump img "c:/palmBMX/quickconv/GeekA6.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Selected buttons" "Selected up arrow" "Speaker crossout" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB6.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Selected buttons" "Selected up arrow" "Speaker crossout" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC6.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Selected buttons" "Selected up arrow" "Speaker crossout" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD6.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Selected buttons" "Selected up arrow" "Speaker crossout" ))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekE6.bmp"
                '("Graphic" "Background"
                  "Selected buttons" "Selected up arrow" "Speaker crossout" ))

        (script-fu-dump img "c:/palmBMX/quickconv/GeekA1-Cap.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Buttons" "Down arrow disabled" "Speaker crossout" "Capitalizer"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB1-Cap.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Buttons" "Down arrow disabled" "Speaker crossout" "Capitalizer"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC1-Cap.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Buttons" "Down arrow disabled" "Speaker crossout" "Capitalizer"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD1-Cap.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Buttons" "Down arrow disabled" "Speaker crossout" "Capitalizer"))

        (script-fu-dump img "c:/palmBMX/quickconv/GeekA6-Cap.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Code" "Selected buttons" "Selected up arrow" "Speaker crossout"  "Capitalizer"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekB6-Cap.bmp"
                '("Graphic" "Background" "Horizontal stripes"
                  "Selected buttons" "Selected up arrow" "Speaker crossout"  "Capitalizer"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekC6-Cap.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Code" "Selected buttons" "Selected up arrow" "Speaker crossout"  "Capitalizer"))
        (script-fu-dump img "c:/palmBMX/quickconv/GeekD6-Cap.bmp"
                '("Graphic" "Background" "Vertical stripes"
                  "Selected buttons" "Selected up arrow" "Speaker crossout"  "Capitalizer"))



)

(script-fu-register "script-fu-save-geek"
		    _"<Image>/Script-Fu/Skins/Save Geek Skins"
		    "Save Geek"
		    "Alex Pruss"
		    "Alex Pruss"
		    "August, 2004"
		    "RGB* INDEXED* GRAY*"
		    SF-IMAGE    "Image"    0
            SF-DRAWABLE "Drawable"    0)
