Sun May 16, 2021 11:48 am
Sun May 16, 2021 12:50 pm
Sun May 16, 2021 1:05 pm
Wed May 19, 2021 11:59 am
Wed May 19, 2021 12:41 pm
Wed May 19, 2021 1:16 pm
Wed May 19, 2021 3:45 pm
Thu May 20, 2021 12:22 pm
Mon May 31, 2021 4:16 am
Mon May 31, 2021 4:59 am
Mon May 31, 2021 5:00 am
Mon May 31, 2021 1:29 pm
Mon May 31, 2021 6:12 pm
Mon May 31, 2021 9:08 pm
Tue Jun 01, 2021 2:11 am
Tue Nov 16, 2021 6:00 pm
Nidhogg wrote:File > Create >AquaPro2
(define (deprecated? strFnc)
(let* ( (pdb (gimp-procedural-db-query ".*" ".*Deprecated.*"
".*Deprecated.*" ".*" ".*" ".*" ".*")
)
(nbrDeprec (car pdb))
(lstPdbDeprec (cadr pdb))
)
(and (member strFnc lstPdbDeprec) #t)
) )
(deprecated? "gimp-version")
(deprecated? "gimp-image-add-layer")
(deprecated? "unknown")
(deprecated-list script-fu-aqua-button2)
Tue Nov 16, 2021 9:31 pm
Wed Nov 17, 2021 1:58 am
AlSchemist wrote:Hello Nidhogg
The historical comment in Japanese about strbreakup highlighted in yellow
"Making it easier to split strings, so improve them" has been kept as an encouragement.
Introducing iccii-aquabou v2.10.28 22 KB Aqua style pill buttons
Firstly, AlSchemist added you in the credits.
Nidhogg wrote:File > Create >AquaPro2
Caution: there are not any new features. It is a version forwho does not hate Scheme.
This version includes shortcuts, separated menu registration, some optimizations about constants "(* 512 2)" => "1024",
new pretty-print with aligned parenthesis and longer lines of Scheme beyond 80 char per line in full screen Notepad++.
AlSchemist removed deprecated API and (- 867 333) => 534 lines of Scheme.![]()
This main subject of this article is:
1. How to find deprecated API in Gimp Script-Fu?
Gimp menu "Filters" > "Script-Fu" > "Console":
Copy and paste the following function in the input area of the console then validate by ENTER:
- Code:
(define (deprecated? strFnc)
(let* ( (pdb (gimp-procedural-db-query ".*" ".*Deprecated.*"
".*Deprecated.*" ".*" ".*" ".*" ".*")
)
(nbrDeprec (car pdb))
(lstPdbDeprec (cadr pdb))
)
(and (member strFnc lstPdbDeprec) #t)
) )
;-> Script-Fu replies by the name of the function deprecated? meaning that the Scheme code is OK.
Ask Script-Fu:
After the name of the function, enter as parameter directly the name of any function such as gimp-version between double quote as a string:
- Code:
(deprecated? "gimp-version")
;-> #f
gimp-version is not deprecated.
On the other hand:
- Code:
(deprecated? "gimp-image-add-layer")
;-> #t
If you try unknown name of function, deprecated? will fail to preserve the future:
- Code:
(deprecated? "unknown")
;-> #f
However parsing a function from iccii-aquabou.scm is out of the scope of this post.
Send a Private Message to AlSchemist if you are interested in the code in Scheme of deprecated-list.
In short, hereafter enclosed is the result for the first big function of the Aqua style button:
- Code:
(deprecated-list script-fu-aqua-button2)
;-> ("gimp-blend" "gimp-drawable-set-visible" "gimp-ellipse-select" "gimp-gradients-get-gradient" "gimp-gradients-set-gradient" "gimp-image-add-layer" "gimp-palette-get-background" "gimp-palette-get-foreground" "gimp-palette-set-background" "gimp-palette-set-foreground" "gimp-patterns-get-pattern" "gimp-patterns-set-pattern" "gimp-perspective" "gimp-rect-select" "gimp-selection-layer-alpha")
We can classify the deprecated API in three families from easy to difficult:
- Change of API name only: the list of parameters is unchanged
![]()
- Change of order of the parameters. Some extra parameters could be removed.
- Add new parameters
![]()
Stay tuned to sweeten the pill!
Error: Procedure execution of plug-in-gauss-rle2 failed on invalid input arguments: Procedure 'plug-in-gauss-rle2' has been called with value '860.504202' for argument 'horizontal' (#4, type gdouble). This value is out of range.
SF-ADJUSTMENT _"Font Size (pixels)" '(75 2 2048 1 1 0 1)
//by
SF-ADJUSTMENT _"Font Size (pixels)" '(75 2 2048 1 1 0 0)
//Note the 1 to 0 on the last parameter
Wed Nov 17, 2021 9:46 am
Wed Nov 17, 2021 4:40 pm
PixLab wrote:SF-ADJUSTMENT _"Font Size (pixels)" '(75 2 2048 1 1 0 0)
(define (proc-arg-search proc token) ; search token in all arguments of PDB functions matching proc
(let loopApi ((lstApi (cadr (gimp-procedural-db-query (string-append ".*" proc ".*") ".*" ".*" ".*" ".*" ".*" ".*"))))
(if (not (pair? lstApi)) (string->symbol "") ; return nothing
(let* ( (procedure-name (car lstApi))
(nbrPrm (car (last (butlast (gimp-procedural-db-proc-info procedure-name)))))
)
(let loopPrm ((arg-num 0))
(if (= arg-num nbrPrm) (loopApi (cdr lstApi))
(let* ( (lstInfo (gimp-procedural-db-proc-arg procedure-name arg-num))
(arg-name (cadr lstInfo))
(arg-descr (caddr lstInfo))
(lstToken (strbreakup (car (strbreakup (car (strbreakup arg-descr "-")) ")")) " "))
(strInfo (string-append procedure-name ": " arg-name ": " arg-descr))
)
(if (and (member token lstToken) #t) (displayln strInfo))
(loopPrm (+ arg-num 1))
) ) ) ) ) ) )
(proc-arg-search "gauss" "500")
(define (gauss run-mode image drawable horizontal vertical)
(plug-in-gauss-rle2 run-mode image drawable (min horizontal 500) (min vertical 500))
)