From 0254ae930ed0ad2840d49613aa5fd22130fe681d Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sun, 19 Dec 1999 17:19:51 +0000 Subject: [PATCH] Reordered the Script-Fu menus a bit. Feel free to come up with a better menu structure! Also made sure that all scripts do reset the fg/bg colors and the active brush, pattern and gradient when they are done. --Sven --- ChangeLog | 25 +++++++++++++++++++ app/gui/menus.c | 1 - app/menus.c | 1 - app/menus/menus.c | 1 - app/widgets/gimpitemfactory.c | 1 - plug-ins/script-fu/scripts/3dTruchet.scm | 2 ++ plug-ins/script-fu/scripts/addborder.scm | 2 +- plug-ins/script-fu/scripts/chip-away.scm | 5 ++-- plug-ins/script-fu/scripts/circuit.scm | 6 +---- plug-ins/script-fu/scripts/coffee.scm | 2 ++ plug-ins/script-fu/scripts/comic-logo.scm | 2 ++ plug-ins/script-fu/scripts/lava.scm | 4 +-- plug-ins/script-fu/scripts/predator.scm | 20 ++++++--------- plug-ins/script-fu/scripts/rendermap.scm | 6 +++++ plug-ins/script-fu/scripts/ripply-anim.scm | 4 ++- .../script-fu/scripts/select-to-image.scm | 14 +++++------ .../script-fu/scripts/select_to_image.scm | 14 +++++------ plug-ins/script-fu/scripts/test-sphere.scm | 4 +++ plug-ins/script-fu/scripts/textured-logo.scm | 4 ++- plug-ins/script-fu/scripts/trochoid.scm | 4 ++- plug-ins/script-fu/scripts/truchet.scm | 3 ++- plug-ins/script-fu/scripts/xach-effect.scm | 2 +- 22 files changed, 82 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9217178a3b..2e64a808d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +Sun Dec 19 17:42:32 CET 1999 Sven Neumann + + * app/menus.c + * plug-ins/script-fu/scripts/3dTruchet.scm + * plug-ins/script-fu/scripts/addborder.scm + * plug-ins/script-fu/scripts/chip-away.scm + * plug-ins/script-fu/scripts/circuit.scm + * plug-ins/script-fu/scripts/coffee.scm + * plug-ins/script-fu/scripts/comic-logo.scm + * plug-ins/script-fu/scripts/lava.scm + * plug-ins/script-fu/scripts/predator.scm + * plug-ins/script-fu/scripts/rendermap.scm + * plug-ins/script-fu/scripts/ripply-anim.scm + * plug-ins/script-fu/scripts/select_to_image.scm + * plug-ins/script-fu/scripts/test-sphere.scm + * plug-ins/script-fu/scripts/textured-logo.scm + * plug-ins/script-fu/scripts/trochoid.scm + * plug-ins/script-fu/scripts/truchet.scm + * plug-ins/script-fu/scripts/xach-effect.scm + + Reordered the Script-Fu menus a bit. Feel free to come up with a + better menu structure! Also made sure that all scripts do reset the + fg/bg colors and the active brush, pattern and gradient when they are + done. + 1999-12-19 Michael Natterer * gimprc.in diff --git a/app/gui/menus.c b/app/gui/menus.c index ca513b52bc..541df7099e 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -105,7 +105,6 @@ static gchar G_GNUC_UNUSED *dummy_entries[] = N_("/Filters/Render/Pattern"), N_("/Filters/Misc"), N_("/Script-Fu/Decor"), - N_("/Script-Fu/Modify"), N_("/Script-Fu/Utils"), N_("/Script-Fu/Animators"), N_("/Script-Fu/Stencil Ops"), diff --git a/app/menus.c b/app/menus.c index ca513b52bc..541df7099e 100644 --- a/app/menus.c +++ b/app/menus.c @@ -105,7 +105,6 @@ static gchar G_GNUC_UNUSED *dummy_entries[] = N_("/Filters/Render/Pattern"), N_("/Filters/Misc"), N_("/Script-Fu/Decor"), - N_("/Script-Fu/Modify"), N_("/Script-Fu/Utils"), N_("/Script-Fu/Animators"), N_("/Script-Fu/Stencil Ops"), diff --git a/app/menus/menus.c b/app/menus/menus.c index ca513b52bc..541df7099e 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -105,7 +105,6 @@ static gchar G_GNUC_UNUSED *dummy_entries[] = N_("/Filters/Render/Pattern"), N_("/Filters/Misc"), N_("/Script-Fu/Decor"), - N_("/Script-Fu/Modify"), N_("/Script-Fu/Utils"), N_("/Script-Fu/Animators"), N_("/Script-Fu/Stencil Ops"), diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index ca513b52bc..541df7099e 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -105,7 +105,6 @@ static gchar G_GNUC_UNUSED *dummy_entries[] = N_("/Filters/Render/Pattern"), N_("/Filters/Misc"), N_("/Script-Fu/Decor"), - N_("/Script-Fu/Modify"), N_("/Script-Fu/Utils"), N_("/Script-Fu/Animators"), N_("/Script-Fu/Stencil Ops"), diff --git a/plug-ins/script-fu/scripts/3dTruchet.scm b/plug-ins/script-fu/scripts/3dTruchet.scm index aecb3a24df..6ddbbb5c40 100644 --- a/plug-ins/script-fu/scripts/3dTruchet.scm +++ b/plug-ins/script-fu/scripts/3dTruchet.scm @@ -116,6 +116,7 @@ (tiledraw2 (car (gimp-layer-new tile size size RGB "Cooper" 100 NORMAL))) (Xindex 0) (Yindex 0) + (old-bg (car (gimp-palette-get-background))) ) (gimp-image-undo-disable img) @@ -149,6 +150,7 @@ (gimp-image-delete tile) + (gimp-palette-set-background old-bg) (gimp-image-undo-enable img) (gimp-display-new img) ) diff --git a/plug-ins/script-fu/scripts/addborder.scm b/plug-ins/script-fu/scripts/addborder.scm index 408c220445..c7ec563293 100644 --- a/plug-ins/script-fu/scripts/addborder.scm +++ b/plug-ins/script-fu/scripts/addborder.scm @@ -162,7 +162,7 @@ (script-fu-register "script-fu-addborder" - "/Script-Fu/Modify/Add Border..." + "/Script-Fu/Decor/Add Border..." "Add a border around an image" "Andy Thomas " "Andy Thomas" diff --git a/plug-ins/script-fu/scripts/chip-away.scm b/plug-ins/script-fu/scripts/chip-away.scm index 94f58447dc..f290e3c5d8 100644 --- a/plug-ins/script-fu/scripts/chip-away.scm +++ b/plug-ins/script-fu/scripts/chip-away.scm @@ -45,8 +45,8 @@ (bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL))) (bump-layer (car (gimp-layer-new img width height RGBA_IMAGE "Bump Layer" 100 NORMAL))) (old-fg (car (gimp-palette-get-foreground))) - (old-bg (car (gimp-palette-get-background)))) - + (old-bg (car (gimp-palette-get-background))) + (old-pattern (car (gimp-patterns-get-pattern)))) (gimp-image-undo-disable img) (gimp-image-resize img width height 0 0) (gimp-image-add-layer img bg-layer 1) @@ -103,6 +103,7 @@ (if (= keep-back FALSE) (gimp-image-remove-layer img bg-layer)) + (gimp-patterns-set-pattern old-pattern) (gimp-palette-set-foreground old-fg) (gimp-palette-set-background old-bg) (gimp-image-undo-enable img) diff --git a/plug-ins/script-fu/scripts/circuit.scm b/plug-ins/script-fu/scripts/circuit.scm index da81b75dc0..10bff88aa5 100644 --- a/plug-ins/script-fu/scripts/circuit.scm +++ b/plug-ins/script-fu/scripts/circuit.scm @@ -40,9 +40,7 @@ (type (car (gimp-drawable-type-with-alpha drawable))) (image-width (car (gimp-image-width image))) (image-height (car (gimp-image-height image))) - (old-gradient (car (gimp-gradients-get-active))) (old-fg (car (gimp-palette-get-foreground))) - (old-bg (car (gimp-palette-get-background)))) (gimp-image-undo-disable image) (gimp-layer-add-alpha drawable) @@ -112,8 +110,6 @@ FALSE) (gimp-edit-clear active-layer)))) - (gimp-gradients-set-active old-gradient) - (gimp-palette-set-background old-bg) (gimp-palette-set-foreground old-fg) (if (= keep-selection FALSE) @@ -125,7 +121,7 @@ (gimp-displays-flush))) (script-fu-register "script-fu-circuit" - "/Script-Fu/Decor/Circuit..." + "/Script-Fu/Render/Circuit..." "Fills the current selection with something that looks vaguely like a circuit board." "Adrian Likins " diff --git a/plug-ins/script-fu/scripts/coffee.scm b/plug-ins/script-fu/scripts/coffee.scm index be8640c89a..9523abd5bd 100644 --- a/plug-ins/script-fu/scripts/coffee.scm +++ b/plug-ins/script-fu/scripts/coffee.scm @@ -21,6 +21,7 @@ (define (script-fu-coffee-stain inImage inLayer inNumber inDark) + (set! old-gradient (car (gimp-gradients-get-active))) (set! theImage inImage) (set! theHeight (car (gimp-image-height theImage))) (set! theWidth (car (gimp-image-width theImage))) @@ -49,6 +50,7 @@ (gimp-layer-set-offsets theStain (- (rand theWidth) (/ theSize 2)) (- (rand theHeight) (/ theSize 2)) theSize) ) (gimp-selection-none theImage) + (gimp-gradients-set-active old-gradient) (gimp-displays-flush) ) diff --git a/plug-ins/script-fu/scripts/comic-logo.scm b/plug-ins/script-fu/scripts/comic-logo.scm index bee7eb2fe7..de28800199 100644 --- a/plug-ins/script-fu/scripts/comic-logo.scm +++ b/plug-ins/script-fu/scripts/comic-logo.scm @@ -28,6 +28,7 @@ (bg-layer (car (gimp-layer-new img width height RGBA_IMAGE "Background" 100 NORMAL))) (white-layer (car (gimp-layer-copy text-layer 1))) (black-layer (car (gimp-layer-copy text-layer 1))) + (old-gradient (car (gimp-gradients-get-active))) (old-fg (car (gimp-palette-get-foreground))) (old-bg (car (gimp-palette-get-background)))) (gimp-image-undo-disable img) @@ -72,6 +73,7 @@ (plug-in-threshold-alpha 1 img text-layer 60) (gimp-layer-set-name text-layer text) (gimp-image-set-active-layer img text-layer) + (gimp-gradients-set-active old-gradient) (gimp-palette-set-background old-bg) (gimp-palette-set-foreground old-fg) (gimp-image-undo-enable img) diff --git a/plug-ins/script-fu/scripts/lava.scm b/plug-ins/script-fu/scripts/lava.scm index 781e576e2f..2b4541a11e 100644 --- a/plug-ins/script-fu/scripts/lava.scm +++ b/plug-ins/script-fu/scripts/lava.scm @@ -6,7 +6,7 @@ ; aklikins@eos.ncsu.edu ; ; based on a idea by Sven Riedel -; tweaked a little by Sven Neumann +; tweaked a bit by Sven Neumann ; ; 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 @@ -99,7 +99,7 @@ (gimp-displays-flush))) (script-fu-register "script-fu-lava" - "/Script-Fu/Decor/Lava..." + "/Script-Fu/Render/Lava..." "Fills the current selection with lava." "Adrian Likins " "Adrian Likins" diff --git a/plug-ins/script-fu/scripts/predator.scm b/plug-ins/script-fu/scripts/predator.scm index f3d3396b95..fa7a7de2c9 100644 --- a/plug-ins/script-fu/scripts/predator.scm +++ b/plug-ins/script-fu/scripts/predator.scm @@ -25,18 +25,16 @@ (define (script-fu-predator image - drawable - edge-amount - pixelize - pixel-size - keep-selection - seperate-layer) + drawable + edge-amount + pixelize + pixel-size + keep-selection + seperate-layer) (let* ( (type (car (gimp-drawable-type-with-alpha drawable))) (image-width (car (gimp-image-width image))) - (image-height (car (gimp-image-height image))) - (old-gradient (car (gimp-gradients-get-active))) - (old-bg (car (gimp-palette-get-background)))) + (image-height (car (gimp-image-height image)))) (gimp-image-undo-disable image) (gimp-layer-add-alpha drawable) @@ -88,8 +86,6 @@ ; clean up the selection copy (gimp-selection-load active-selection) - (gimp-gradients-set-active old-gradient) - (gimp-palette-set-background old-bg) (if (= keep-selection FALSE) (gimp-selection-none image)) @@ -100,7 +96,7 @@ (gimp-displays-flush))) (script-fu-register "script-fu-predator" - "/Script-Fu/Decor/Predator..." + "/Script-Fu/Alchemy/Predator..." "Fills the current selection with test" "Adrian Likins " "Adrian Likins" diff --git a/plug-ins/script-fu/scripts/rendermap.scm b/plug-ins/script-fu/scripts/rendermap.scm index 8d93fab719..87f3d062ba 100644 --- a/plug-ins/script-fu/scripts/rendermap.scm +++ b/plug-ins/script-fu/scripts/rendermap.scm @@ -21,6 +21,9 @@ (define (script-fu-render-map inSize inGrain inGrad inWiden) + (set! old-gradient (car (gimp-gradients-get-active))) + (set! old-fg (car (gimp-palette-get-foreground))) + (set! old-bg (car (gimp-palette-get-background))) (set! theWidth inSize) (set! theHeight inSize) @@ -51,6 +54,9 @@ (gimp-selection-none theImage) (gimp-gradients-set-active inGrad) (plug-in-gradmap TRUE theImage theLayer) + (gimp-gradients-set-active old-gradient) + (gimp-palette-set-background old-bg) + (gimp-palette-set-foreground old-fg) (gimp-display-new theImage) ) diff --git a/plug-ins/script-fu/scripts/ripply-anim.scm b/plug-ins/script-fu/scripts/ripply-anim.scm index 129fec4750..60bfedf233 100644 --- a/plug-ins/script-fu/scripts/ripply-anim.scm +++ b/plug-ins/script-fu/scripts/ripply-anim.scm @@ -17,7 +17,8 @@ (gimp-floating-sel-anchor floating-sel))) (define (script-fu-ripply-anim img drawable displacement num-frames) - (let* ((width (car (gimp-drawable-width drawable))) + (let* ((old-bg (car (gimp-palette-get-background))) + (width (car (gimp-drawable-width drawable))) (height (car (gimp-drawable-height drawable))) (ripple-image (car (gimp-image-new width height GRAY))) (ripple-layer (car (gimp-layer-new ripple-image width height GRAY_IMAGE "Ripple Texture" 100 NORMAL)))) @@ -86,6 +87,7 @@ (gimp-image-undo-enable rippletiled-image) (gimp-image-delete rippletiled-image) + (gimp-palette-set-background old-bg) (gimp-image-undo-enable out-imagestack) (gimp-display-new out-imagestack)))) diff --git a/plug-ins/script-fu/scripts/select-to-image.scm b/plug-ins/script-fu/scripts/select-to-image.scm index 66614aee4b..8785f5d56e 100644 --- a/plug-ins/script-fu/scripts/select-to-image.scm +++ b/plug-ins/script-fu/scripts/select-to-image.scm @@ -48,21 +48,21 @@ (gimp-edit-copy drawable) - (set! brush-image (car (gimp-image-new selection-width selection-height image-type))) - (set! brush-draw (car (gimp-layer-new brush-image selection-width selection-height draw-type "Sloth" 100 NORMAL))) - (gimp-image-add-layer brush-image brush-draw 0) - (gimp-drawable-fill brush-draw BG-IMAGE-FILL) + (set! new-image (car (gimp-image-new selection-width selection-height image-type))) + (set! new-draw (car (gimp-layer-new new-image selection-width selection-height draw-type "Selection" 100 NORMAL))) + (gimp-image-add-layer new-image new-draw 0) + (gimp-drawable-fill new-draw BG-IMAGE-FILL) - (let ((floating-sel (car (gimp-edit-paste brush-draw FALSE)))) + (let ((floating-sel (car (gimp-edit-paste new-draw FALSE)))) (gimp-floating-sel-anchor floating-sel) ) (gimp-palette-set-background old-bg) (gimp-image-undo-enable image) (gimp-image-set-active-layer image drawable) - (gimp-display-new brush-image) + (gimp-display-new new-image) (gimp-displays-flush) - (script-fu-export-file 1 img drawable RGB 255 FALSE 2 "-export" "png") +; (script-fu-export-file 1 img drawable RGB 255 FALSE 2 "-export" "png") )) diff --git a/plug-ins/script-fu/scripts/select_to_image.scm b/plug-ins/script-fu/scripts/select_to_image.scm index 66614aee4b..8785f5d56e 100644 --- a/plug-ins/script-fu/scripts/select_to_image.scm +++ b/plug-ins/script-fu/scripts/select_to_image.scm @@ -48,21 +48,21 @@ (gimp-edit-copy drawable) - (set! brush-image (car (gimp-image-new selection-width selection-height image-type))) - (set! brush-draw (car (gimp-layer-new brush-image selection-width selection-height draw-type "Sloth" 100 NORMAL))) - (gimp-image-add-layer brush-image brush-draw 0) - (gimp-drawable-fill brush-draw BG-IMAGE-FILL) + (set! new-image (car (gimp-image-new selection-width selection-height image-type))) + (set! new-draw (car (gimp-layer-new new-image selection-width selection-height draw-type "Selection" 100 NORMAL))) + (gimp-image-add-layer new-image new-draw 0) + (gimp-drawable-fill new-draw BG-IMAGE-FILL) - (let ((floating-sel (car (gimp-edit-paste brush-draw FALSE)))) + (let ((floating-sel (car (gimp-edit-paste new-draw FALSE)))) (gimp-floating-sel-anchor floating-sel) ) (gimp-palette-set-background old-bg) (gimp-image-undo-enable image) (gimp-image-set-active-layer image drawable) - (gimp-display-new brush-image) + (gimp-display-new new-image) (gimp-displays-flush) - (script-fu-export-file 1 img drawable RGB 255 FALSE 2 "-export" "png") +; (script-fu-export-file 1 img drawable RGB 255 FALSE 2 "-export" "png") )) diff --git a/plug-ins/script-fu/scripts/test-sphere.scm b/plug-ins/script-fu/scripts/test-sphere.scm index 3a1c592d89..17e858b276 100644 --- a/plug-ins/script-fu/scripts/test-sphere.scm +++ b/plug-ins/script-fu/scripts/test-sphere.scm @@ -108,6 +108,8 @@ (text-extents (gimp-text-get-extents-fontname text size PIXELS font)) (x-position (- cx (/ (car text-extents) 2))) (y-position (- cy (/ (cadr text-extents) 2))) + (old-pattern (car (gimp-patterns-get-pattern))) + (old-gradient (car (gimp-gradients-get-active))) (old-fg (car (gimp-palette-get-foreground))) (old-bg (car (gimp-palette-get-background)))) (gimp-image-undo-disable img) @@ -148,6 +150,8 @@ size PIXELS font))) + (gimp-gradients-set-active old-gradient) + (gimp-patterns-set-pattern old-pattern) (gimp-palette-set-background old-bg) (gimp-palette-set-foreground old-fg) (gimp-image-undo-enable img) diff --git a/plug-ins/script-fu/scripts/textured-logo.scm b/plug-ins/script-fu/scripts/textured-logo.scm index fb28329be1..400d12e679 100644 --- a/plug-ins/script-fu/scripts/textured-logo.scm +++ b/plug-ins/script-fu/scripts/textured-logo.scm @@ -24,7 +24,8 @@ (drop-shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Drop Shadow" 100 MULTIPLY))) (dsl-layer-mask (car (gimp-layer-create-mask drop-shadow-layer BLACK-MASK))) (old-fg (car (gimp-palette-get-foreground))) - (old-bg (car (gimp-palette-get-background)))) + (old-bg (car (gimp-palette-get-background))) + (old-pattern (car (gimp-patterns-get-pattern)))) (gimp-image-undo-disable img) (gimp-image-resize img width height 0 0) (gimp-image-add-layer img shadow-layer 1) @@ -70,6 +71,7 @@ (gimp-image-remove-layer-mask img drop-shadow-layer APPLY) (gimp-selection-none img) (gimp-layer-set-name text-layer text) + (gimp-patterns-set-pattern old-pattern) (gimp-palette-set-foreground old-fg) (gimp-palette-set-background old-bg) (gimp-image-undo-enable img) diff --git a/plug-ins/script-fu/scripts/trochoid.scm b/plug-ins/script-fu/scripts/trochoid.scm index 5d5d040da8..ae80c4ead8 100644 --- a/plug-ins/script-fu/scripts/trochoid.scm +++ b/plug-ins/script-fu/scripts/trochoid.scm @@ -331,7 +331,6 @@ background-color stroke-overwrite brush-opacity paint-mode)))) ;; start of script-fu-trochoid - (gimp-brushes-set-brush (car brush-details)) (let* ((base-radius (floor (abs base-radius-f))) ; to int (wheel-radius (floor wheel-radius-f)) ; to int (total-step-num (if (or (= 0 base-radius) (= 0 wheel-radius)) @@ -350,7 +349,9 @@ (layer-paint-mode 0) (the-layer #f) (old-paint-mode (car (gimp-brushes-get-paint-mode))) + (old-brush (car (gimp-brushes-get-brush))) (old-rgb (car (gimp-palette-get-foreground)))) + (gimp-brushes-set-brush (car brush-details)) (gimp-image-undo-disable img) (gimp-image-add-layer img BG-layer 0) (gimp-edit-fill BG-layer) @@ -377,6 +378,7 @@ base-radius wheel-radius pen-pos hue-rate layer-paint-mode (= 0 erase-before-draw) brush-details)) (gimp-palette-set-foreground old-rgb) + (gimp-brushes-set-brush old-brush) (gimp-brushes-set-paint-mode old-paint-mode) (gimp-image-undo-enable img) (gimp-displays-flush))) diff --git a/plug-ins/script-fu/scripts/truchet.scm b/plug-ins/script-fu/scripts/truchet.scm index 4d54371c0c..0f20babfd4 100644 --- a/plug-ins/script-fu/scripts/truchet.scm +++ b/plug-ins/script-fu/scripts/truchet.scm @@ -1,4 +1,3 @@ - ; The GIMP -- an image manipulation program ; Copyright (C) 1995 Spencer Kimball and Peter Mattis ; @@ -104,6 +103,7 @@ (tiledraw2 (car (gimp-layer-new tile size size RGB "Cooper" 100 NORMAL))) (Xindex 0) (Yindex 0) + (old-bg (car (gimp-palette-get-background))) ) (gimp-image-undo-disable img) @@ -137,6 +137,7 @@ (gimp-image-delete tile) + (gimp-palette-set-background old-bg) (gimp-image-undo-enable img) (gimp-display-new img) ) diff --git a/plug-ins/script-fu/scripts/xach-effect.scm b/plug-ins/script-fu/scripts/xach-effect.scm index 5ba6e95b6e..7c1fd1e97a 100644 --- a/plug-ins/script-fu/scripts/xach-effect.scm +++ b/plug-ins/script-fu/scripts/xach-effect.scm @@ -111,7 +111,7 @@ (gimp-displays-flush))) (script-fu-register "script-fu-xach-effect" - "/Script-Fu/Decor/Xach-Effect..." + "/Script-Fu/Shadow/Xach-Effect..." "Add a subtle translucent 3-d effect to the current selection or alpha channel" "Adrian Likins " "Adrian Likins"