ScriptFu: plugins: port to script-fu-register-regular
Ported all supported/shipped Scheme plugins in the repo that formerly called script-fu-register. No test plugins were ported. The plugins now use the new dialog, GimpProcedureDialog. These are the plugins that are not filters i.e. not GimpImageProcedure, which were ported earlier to script-fu-register-filter. The test plugin Demo>Sphere demonstrates that while script-fu-register is now deprecated, it still works, showing the old dialog. Misc bug fix to prior commits. Misc porting of same plugins to v3 binding of PDB return values. Misc fixes: invalid default font names, and deprecated PDB calls.
This commit is contained in:

committed by
Lloyd Konneker

parent
d0a6c4c758
commit
96e02122b8
@ -134,6 +134,11 @@ script_fu_run_image_procedure (GimpProcedure *procedure, /* GimpImageProc
|
||||
return result;
|
||||
}
|
||||
|
||||
/* The number of pspecs in a config's pspecs to skip, for a regular GimpProcedure.
|
||||
* Skip procedure-name and run-mode.
|
||||
*/
|
||||
#define SF_ARGS_SKIPPED_REGULAR 2
|
||||
|
||||
/* run_func for a GimpProcedure
|
||||
*
|
||||
* Type is GimpRunFunc.
|
||||
@ -177,14 +182,14 @@ script_fu_run_regular_procedure (GimpProcedure *procedure,
|
||||
guint n_specs;
|
||||
|
||||
g_free (g_object_class_list_properties (G_OBJECT_GET_CLASS (config), &n_specs));
|
||||
if (n_specs > 1)
|
||||
if (n_specs > SF_ARGS_SKIPPED_REGULAR)
|
||||
{
|
||||
/* Let user choose "other" args in a dialog, then interpret. Maintain a config. */
|
||||
/* Let user choose non-skipped args in a dialog, then interpret. Maintain a config. */
|
||||
result = script_fu_dialog_run_regular_proc (procedure, script, config);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No "other" args for user to choose. No config to maintain. */
|
||||
/* No args for user to choose. No config to maintain. */
|
||||
result = script_fu_interpret_regular_proc (procedure, script, config);
|
||||
}
|
||||
break;
|
||||
|
@ -59,116 +59,98 @@
|
||||
|
||||
|
||||
; shortcuts to help topics
|
||||
(script-fu-register "gimp-help-concepts-paths"
|
||||
(script-fu-register-regular "gimp-help-concepts-paths"
|
||||
_"_Using Paths"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-concepts-paths"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
|
||||
(script-fu-register "gimp-help-using-web"
|
||||
(script-fu-register-regular "gimp-help-using-web"
|
||||
_"_Preparing your Images for the Web"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-using-web"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
|
||||
(script-fu-register "gimp-help-using-photography"
|
||||
(script-fu-register-regular "gimp-help-using-photography"
|
||||
_"_Working with Digital Camera Photos"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-using-photography"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
|
||||
(script-fu-register "gimp-help-using-fileformats"
|
||||
(script-fu-register-regular "gimp-help-using-fileformats"
|
||||
_"Create, Open and Save _Files"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-using-fileformats"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
|
||||
(script-fu-register "gimp-help-concepts-usage"
|
||||
(script-fu-register-regular "gimp-help-concepts-usage"
|
||||
_"_Basic Concepts"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-concepts-usage"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
|
||||
(script-fu-register "gimp-help-using-docks"
|
||||
(script-fu-register-regular "gimp-help-using-docks"
|
||||
_"How to Use _Dialogs"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-using-docks"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
|
||||
(script-fu-register "gimp-help-using-simpleobjects"
|
||||
(script-fu-register-regular "gimp-help-using-simpleobjects"
|
||||
_"Drawing _Simple Objects"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-using-simpleobjects"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
|
||||
(script-fu-register "gimp-help-using-selections"
|
||||
(script-fu-register-regular "gimp-help-using-selections"
|
||||
_"_Create and Use Selections"
|
||||
_"Bookmark to the user manual"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-using-selections"
|
||||
"<Image>/Help/User Manual")
|
||||
|
||||
(script-fu-register "gimp-help-main"
|
||||
(script-fu-register-regular "gimp-help-main"
|
||||
_"_Table of Contents"
|
||||
_"Bookmark to the user manual"
|
||||
"Alx Sa"
|
||||
"Alx Sa"
|
||||
"2023"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-help-main"
|
||||
@ -198,78 +180,66 @@
|
||||
; )
|
||||
|
||||
|
||||
(script-fu-register "gimp-online-main-web-site"
|
||||
(script-fu-register-regular "gimp-online-main-web-site"
|
||||
_"_Main Web Site"
|
||||
_"Bookmark to the GIMP web site"
|
||||
"Henrik Brix Andersen <brix@gimp.org>"
|
||||
"Henrik Brix Andersen <brix@gimp.org>"
|
||||
"2003"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-online-main-web-site"
|
||||
"<Image>/Help/GIMP Online")
|
||||
|
||||
|
||||
(script-fu-register "gimp-online-developer-web-site"
|
||||
(script-fu-register-regular "gimp-online-developer-web-site"
|
||||
_"_Developer Web Site"
|
||||
_"Bookmark to the GIMP web site"
|
||||
"Henrik Brix Andersen <brix@gimp.org>"
|
||||
"Henrik Brix Andersen <brix@gimp.org>"
|
||||
"2003"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-online-developer-web-site"
|
||||
"<Image>/Help/GIMP Online")
|
||||
|
||||
|
||||
(script-fu-register "gimp-online-roadmap"
|
||||
(script-fu-register-regular "gimp-online-roadmap"
|
||||
_"_Roadmaps"
|
||||
_"Bookmark to the roadmaps of GIMP"
|
||||
"Alexandre Prokoudine <alexandre.prokoudine@gmail.com>"
|
||||
"Alexandre Prokoudine <alexandre.prokoudine@gmail.com>"
|
||||
"2018"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-online-roadmap"
|
||||
"<Image>/Help/GIMP Online")
|
||||
|
||||
|
||||
(script-fu-register "gimp-online-bugs-features"
|
||||
(script-fu-register-regular "gimp-online-bugs-features"
|
||||
_"_Bug Reports and Feature Requests"
|
||||
_"Bookmark to the bug tracker of GIMP"
|
||||
"Alexandre Prokoudine <alexandre.prokoudine@gmail.com>"
|
||||
"Alexandre Prokoudine <alexandre.prokoudine@gmail.com>"
|
||||
"2018"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-online-bugs-features"
|
||||
"<Image>/Help/GIMP Online")
|
||||
|
||||
|
||||
(script-fu-register "gimp-online-docs-web-site"
|
||||
(script-fu-register-regular "gimp-online-docs-web-site"
|
||||
_"_User Manual Web Site"
|
||||
_"Bookmark to the GIMP web site"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"Roman Joost <romanofski@gimp.org>"
|
||||
"2006"
|
||||
""
|
||||
)
|
||||
|
||||
(script-fu-menu-register "gimp-online-docs-web-site"
|
||||
"<Image>/Help/GIMP Online")
|
||||
|
||||
|
||||
; (script-fu-register "gimp-online-plug-in-web-site"
|
||||
; (script-fu-register-regular "gimp-online-plug-in-web-site"
|
||||
; _"Plug-in _Registry"
|
||||
; _"Bookmark to the GIMP web site"
|
||||
; "Henrik Brix Andersen <brix@gimp.org>"
|
||||
; "Henrik Brix Andersen <brix@gimp.org>"
|
||||
; "2003"
|
||||
; ""
|
||||
; )
|
||||
|
||||
; (script-fu-menu-register "gimp-online-plug-in-web-site"
|
||||
|
@ -65,13 +65,11 @@
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-gradient-example"
|
||||
(script-fu-register-regular "script-fu-gradient-example"
|
||||
_"Custom _Gradient..."
|
||||
_"Create an image filled with an example of the current gradient"
|
||||
"Federico Mena Quintero"
|
||||
"Federico Mena Quintero"
|
||||
"June 1997"
|
||||
""
|
||||
SF-ADJUSTMENT _"Width" '(400 1 2000 1 10 0 1)
|
||||
SF-ADJUSTMENT _"Height" '(30 1 2000 1 10 0 1)
|
||||
SF-TOGGLE _"Gradient reverse" FALSE
|
||||
|
@ -60,13 +60,11 @@
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-make-brush-rectangular"
|
||||
(script-fu-register-regular "script-fu-make-brush-rectangular"
|
||||
_"_Rectangular..."
|
||||
_"Create a rectangular brush"
|
||||
"Seth Burgess <sjburges@ou.edu>"
|
||||
"Seth Burgess"
|
||||
"1997"
|
||||
""
|
||||
SF-STRING _"Name" "Rectangle"
|
||||
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
|
||||
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
|
||||
@ -130,13 +128,11 @@
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-make-brush-rectangular-feathered"
|
||||
(script-fu-register-regular "script-fu-make-brush-rectangular-feathered"
|
||||
_"Re_ctangular, Feathered..."
|
||||
_"Create a rectangular brush with feathered edges"
|
||||
"Seth Burgess <sjburges@ou.edu>"
|
||||
"Seth Burgess"
|
||||
"1997"
|
||||
""
|
||||
SF-STRING _"Name" "Rectangle"
|
||||
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
|
||||
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
|
||||
@ -186,13 +182,11 @@
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-make-brush-elliptical"
|
||||
(script-fu-register-regular "script-fu-make-brush-elliptical"
|
||||
_"_Elliptical..."
|
||||
_"Create an elliptical brush"
|
||||
"Seth Burgess <sjburges@ou.edu>"
|
||||
"Seth Burgess"
|
||||
"1997"
|
||||
""
|
||||
SF-STRING _"Name" "Ellipse"
|
||||
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
|
||||
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
|
||||
@ -255,13 +249,11 @@
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-make-brush-elliptical-feathered"
|
||||
(script-fu-register-regular "script-fu-make-brush-elliptical-feathered"
|
||||
_"Elli_ptical, Feathered..."
|
||||
_"Create an elliptical brush with feathered edges"
|
||||
"Seth Burgess <sjburges@ou.edu>"
|
||||
"Seth Burgess"
|
||||
"1997"
|
||||
""
|
||||
SF-STRING _"Name" "Ellipse"
|
||||
SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1)
|
||||
SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1)
|
||||
|
@ -279,13 +279,11 @@
|
||||
|
||||
(define (register-palette-exporter
|
||||
export-type export-name file-type description author copyright date)
|
||||
(script-fu-register (string-append "gimp-palette-export-" export-type)
|
||||
(script-fu-register-regular (string-append "gimp-palette-export-" export-type)
|
||||
export-name
|
||||
description
|
||||
author
|
||||
copyright
|
||||
date
|
||||
""
|
||||
SF-DIRNAME _"Folder for the output file" ""
|
||||
SF-STRING _"The name of the file to create (if a file with this name already exist, it will be replaced)"
|
||||
(string-append "palette." file-type)
|
||||
|
@ -20,15 +20,16 @@
|
||||
|
||||
(define (script-fu-paste-as-brush name filename spacing)
|
||||
|
||||
(let* ((brush-image (car (gimp-edit-paste-as-new-image)))
|
||||
(script-fu-use-v3)
|
||||
(let* ((brush-image (gimp-edit-paste-as-new-image))
|
||||
(brush-draw 0)
|
||||
(type 0)
|
||||
(path 0))
|
||||
|
||||
(if (= TRUE (car (gimp-image-is-valid brush-image)))
|
||||
(if (gimp-image-id-is-valid brush-image)
|
||||
(begin
|
||||
(set! brush-draw (aref (cadr (gimp-image-get-selected-drawables brush-image)) 0))
|
||||
(set! type (car (gimp-drawable-type brush-draw)))
|
||||
(set! type (gimp-drawable-type brush-draw))
|
||||
(set! path (string-append gimp-directory
|
||||
"/brushes/"
|
||||
filename
|
||||
@ -39,7 +40,7 @@
|
||||
(begin
|
||||
(gimp-context-push)
|
||||
(gimp-context-set-background '(255 255 255))
|
||||
(set! brush-draw (car (gimp-image-flatten brush-image)))
|
||||
(set! brush-draw (gimp-image-flatten brush-image))
|
||||
(gimp-context-pop)
|
||||
)
|
||||
)
|
||||
@ -53,20 +54,18 @@
|
||||
(gimp-image-delete brush-image)
|
||||
|
||||
(gimp-brushes-refresh)
|
||||
(gimp-context-set-brush (car (gimp-brush-get-by-name name)))
|
||||
(gimp-context-set-brush (gimp-brush-get-by-name name))
|
||||
)
|
||||
(gimp-message _"There is no image data in the clipboard to paste.")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-paste-as-brush"
|
||||
(script-fu-register-regular "script-fu-paste-as-brush"
|
||||
_"Paste as New _Brush..."
|
||||
_"Paste the clipboard contents into a new brush"
|
||||
"Michael Natterer <mitch@gimp.org>"
|
||||
"Michael Natterer"
|
||||
"2005-09-25"
|
||||
""
|
||||
SF-STRING _"_Brush name" _"My Brush"
|
||||
SF-STRING _"_File name" _"mybrush"
|
||||
SF-ADJUSTMENT _"_Spacing" '(25 0 1000 1 2 1 0)
|
||||
|
@ -19,10 +19,11 @@
|
||||
|
||||
|
||||
(define (script-fu-paste-as-pattern name filename)
|
||||
(let* ((pattern-image (car (gimp-edit-paste-as-new-image)))
|
||||
(script-fu-use-v3)
|
||||
(let* ((pattern-image (gimp-edit-paste-as-new-image))
|
||||
(path 0))
|
||||
|
||||
(if (= TRUE (car (gimp-image-id-is-valid pattern-image)))
|
||||
(if (gimp-image-id-is-valid pattern-image)
|
||||
(begin
|
||||
(set! path (string-append gimp-directory
|
||||
"/patterns/"
|
||||
@ -39,20 +40,18 @@
|
||||
(gimp-image-delete pattern-image)
|
||||
|
||||
(gimp-patterns-refresh)
|
||||
(gimp-context-set-pattern (car (gimp-pattern-get-by-name name)))
|
||||
(gimp-context-set-pattern (gimp-pattern-get-by-name name))
|
||||
)
|
||||
(gimp-message _"There is no image data in the clipboard to paste.")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-paste-as-pattern"
|
||||
(script-fu-register-regular "script-fu-paste-as-pattern"
|
||||
_"Paste as New _Pattern..."
|
||||
_"Paste the clipboard contents into a new pattern"
|
||||
"Michael Natterer <mitch@gimp.org>"
|
||||
"Michael Natterer"
|
||||
"2005-09-25"
|
||||
""
|
||||
SF-STRING _"_Pattern name" _"My Pattern"
|
||||
SF-STRING _"_File name" _"mypattern"
|
||||
)
|
||||
|
@ -26,10 +26,11 @@
|
||||
; Tiny-Fu first successfully ran this script at 2:07am on March 6, 2004.
|
||||
|
||||
(define (script-fu-helloworld text font size color)
|
||||
(script-fu-use-v3)
|
||||
(let* (
|
||||
(width 10)
|
||||
(height 10)
|
||||
(img (car (gimp-image-new width height RGB)))
|
||||
(img (gimp-image-new width height RGB))
|
||||
(text-layer)
|
||||
)
|
||||
|
||||
@ -38,9 +39,9 @@
|
||||
(gimp-image-undo-disable img)
|
||||
(gimp-context-set-foreground color)
|
||||
|
||||
(set! text-layer (car (gimp-text-font img -1 0 0 text 10 TRUE size font)))
|
||||
(set! width (car (gimp-drawable-get-width text-layer)))
|
||||
(set! height (car (gimp-drawable-get-height text-layer)))
|
||||
(set! text-layer (gimp-text-font img -1 0 0 text 10 TRUE size font))
|
||||
(set! width (gimp-drawable-get-width text-layer))
|
||||
(set! height (gimp-drawable-get-height text-layer))
|
||||
(gimp-image-resize img width height 0 0)
|
||||
|
||||
(gimp-image-undo-enable img)
|
||||
@ -50,15 +51,13 @@
|
||||
)
|
||||
)
|
||||
|
||||
(script-fu-register "script-fu-helloworld"
|
||||
(script-fu-register-regular "script-fu-helloworld"
|
||||
"_Hello World..."
|
||||
"Creates an image of a text string."
|
||||
"Kevin Cozens <kcozens@interlog.com>"
|
||||
"Kevin Cozens"
|
||||
"February 29, 2004"
|
||||
""
|
||||
SF-STRING "Text string" "Hello, World!"
|
||||
SF-FONT "Font" "Sans"
|
||||
SF-FONT "Font" "Sans-serif"
|
||||
SF-ADJUSTMENT "Font size (pixels)" '(100 2 1000 1 10 0 1)
|
||||
SF-COLOR "Color" '(0 0 0)
|
||||
)
|
||||
|
Reference in New Issue
Block a user