Gimp/plug-ins/script-fu/libscriptfu
bootchk 98bf051e7a Fix #10044 more natural binding of PDB return values
Allow (script-fu-use-v3) in script, or in SF Console.

Definitive description is in script-fu/docs/using-v3-binding.md

Makes SF interpret v3 of SF dialect.
  - marshals single return value from PDB without wrapping in list
  - marshals boolean return value from PDB as #t #f instead of integers
  - marshals boolean to PDB from #t and #f or TRUE and FALSE
  - marshals void return from PDB as () instead of (#t), but that is moot.

The version of SF dialect is distinct from the version of the PDB API.

Dialect v3 is opt-in: the initial dialect of all SF tools remains v2.

Commit also allows #t,#f for defaults of SF-TOGGLE instead of TRUE, FALSE
but that is an independent enhancement (but closely related.)

Affects interpreter state of the current process.
Not an attribute per se of a plugin.
While in this state, a plugin should not call PDB procedures
which are themselves v2 script plugins,
or a few utility scripts in script-fu-util.scm,
but that is rarely needed.

Does not remove symbols TRUE and FALSE from dialect.

A script can also call (script-fu-use-v2) to revert.
That is also discouraged but useful e.g. for testing.
2024-03-09 07:21:50 -05:00
..
ftx Remove autotools 2023-05-27 00:03:52 +02:00
tinyscheme tinyscheme: enhance: rearrange error msg so error kind is stable prefix 2023-09-06 06:37:29 -04:00
meson.build Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
README
scheme-marshal-return.c Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
scheme-marshal-return.h ScriptFu: extract function marshall_pdb_return 2023-09-12 15:02:15 +00:00
scheme-marshal.c ScriptFu: fix #11010 unhandled return type GimpColorArray 2024-03-06 14:48:41 -05:00
scheme-marshal.h ScriptFu: fix #11010 unhandled return type GimpColorArray 2024-03-06 14:48:41 -05:00
scheme-wrapper.c Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
scheme-wrapper.h ScriptFu: script-fu-register-filter for GimpImageProcedure. 2022-08-02 07:45:35 +00:00
script-fu-arg.c Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
script-fu-arg.h Fix 10170 2023-10-19 16:37:05 +00:00
script-fu-color.c ScriptFu: fix #11001 2024-03-06 09:55:38 -05:00
script-fu-color.h 2.99 ScriptFu: refactor, extract methods of color and resource 2024-03-06 08:07:11 -05:00
script-fu-command.c libgimp, plug-ins: gimp_procedure_config_[gs]et_values() not public anymore. 2023-10-15 22:10:38 +02:00
script-fu-command.h plug-ins: port script-fu-script.c to gimp_image_procedure_new2(). 2023-10-01 21:02:33 +02:00
script-fu-compat.c plug-ins: gimp-plug-in-domain-register PDB procedure doesn't exist… 2022-07-06 16:14:03 +02:00
script-fu-compat.h
script-fu-dialog.c ScriptFu fix #10982 broken build, and spurious CRITICAL 2024-03-04 17:21:17 +00:00
script-fu-dialog.h plug-ins: port script-fu-script.c to gimp_image_procedure_new2(). 2023-10-01 21:02:33 +02:00
script-fu-enums.h ScriptFu: script-fu-register-filter for GimpImageProcedure. 2022-08-02 07:45:35 +00:00
script-fu-errors.c Fix for 2.99 only #6157 2023-09-28 13:26:23 +00:00
script-fu-errors.h Fix for 2.99 only #6157 2023-09-28 13:26:23 +00:00
script-fu-interface.c 2.99 ScriptFu: refactor, extract methods of color and resource 2024-03-06 08:07:11 -05:00
script-fu-interface.h
script-fu-intl.h
script-fu-lib.c Issue #8744: refactor overdependence on gimpui.h 2022-10-15 15:17:08 +00:00
script-fu-lib.h ScriptFu: Add script-fu-interpreter akin to other interpreters 2022-06-30 13:39:45 +00:00
script-fu-proc-factory.c Issue #8744: refactor overdependence on gimpui.h 2022-10-15 15:17:08 +00:00
script-fu-proc-factory.h ScriptFu: Add script-fu-interpreter akin to other interpreters 2022-06-30 13:39:45 +00:00
script-fu-regex.c
script-fu-regex.h
script-fu-register.c Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
script-fu-register.h ScriptFu: script-fu-register-filter for GimpImageProcedure. 2022-08-02 07:45:35 +00:00
script-fu-resource.c 2.99 ScriptFu: refactor, extract methods of color and resource 2024-03-06 08:07:11 -05:00
script-fu-resource.h 2.99 ScriptFu: refactor, extract methods of color and resource 2024-03-06 08:07:11 -05:00
script-fu-run-func.c Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
script-fu-run-func.h plug-ins: port script-fu-script.c to gimp_image_procedure_new2(). 2023-10-01 21:02:33 +02:00
script-fu-script.c Fix #10511 ScriptFu CRITICAL on scripts with no dialog, e.g. Reverse Layers 2023-12-22 09:43:01 -05:00
script-fu-script.h libgimp, plug-ins: gimp_procedure_config_[gs]et_values() not public anymore. 2023-10-15 22:10:38 +02:00
script-fu-scripts.c Issue #9994: do not call g_file_info_get_is_hidden() (and others) directly. 2023-09-19 15:34:48 +02:00
script-fu-scripts.h ScriptFu: script-fu-register-filter for GimpImageProcedure. 2022-08-02 07:45:35 +00:00
script-fu-types.h ScriptFu: fix #11001 2024-03-06 09:55:38 -05:00
script-fu-utils.c
script-fu-utils.h
script-fu-version.c Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
script-fu-version.h Fix #10044 more natural binding of PDB return values 2024-03-09 07:21:50 -05:00
script-fu-widgets-custom.c 2.99 ScriptFu: add custom widgets to GimpProcedureDialog 2024-02-03 15:27:16 +00:00
script-fu-widgets-custom.h 2.99 ScriptFu: add custom widgets to GimpProcedureDialog 2024-02-03 15:27:16 +00:00
script-fu.def ScriptFu: Add script-fu-interpreter akin to other interpreters 2022-06-30 13:39:45 +00:00

About libscriptfu

libscriptfu is part of GIMP.
It is not generally useful except by GIMP.

The libscriptfu library is used by plugin executables,
and the PDB procedures they create,
all part of the "ScriptFu" machinery.

The libscriptfu library is not intended for third-party developers,
only for core GIMP developers.
Headers for libscriptfu might not be installed.

This directory contains three libraries: libscriptfu, tinyscheme, and ftx.
The tinyscheme library contains a TinyScheme interpreter.
The ftx library extends the TinyScheme interpreter,
adding file functions to the Scheme language.
The libscriptfu library contains both the tinyscheme and ftx libraries.
The libscriptfu library wraps the TinyScheme interpreter,
specializing it for GIMP.
The script-fu executable uses the libscriptfu library,
to interpret Scheme scripts that GIMP users refer to as "plug-ins."

These libraries depend on other libraries, e.g. math, libgimp, glib, etc.

Coupling between the executables and the libraries should be in one direction:
source for the inner libs should not include headers from the outer executables.
This lets you more easily update the inner libraries
(which originated elsewhere and might be maintained elsewhere),
and change the outer executables
(which are subject to change by GIMP developers.)

Example (which may change):
The script-fu executable is a plugin file that implements PDB procedures:
extension-script-fu, script-fu-console, script-fu-text-console, script-fu-eval,
and script-fu-server.
Each of those PDB procedures runs as a separate process.
Each of those processes uses libscriptfu.
The main PDB procedure is extension-script-fu, which is a long-lived process.
It is a PDB procedure of PDBProcedureType EXTENSION.
It interprets the Scheme scripts that user's call "plug-ins."

Rarely two of the PDB procedure processes run concurrently.
When they do, and libscriptfu is built as a shared library,
the read-only, code portion of the library is only loaded in memory once.