From 55c0774e392b1861ea9e12cacb866d8b86effa7b Mon Sep 17 00:00:00 2001 From: lloyd konneker Date: Mon, 21 Oct 2024 03:37:15 -0400 Subject: [PATCH] ScriptFu: remove ScriptFu's aliasing of deprecated PDB procedures Leaves the mechanism in place, but erases all rows of the alias map data. Update devel-doc to say ScriptFu has its own mechanism for aliasing. For major release 3.0 --- .../PDB-compatability.md | 7 ++++++ .../script-fu/libscriptfu/script-fu-compat.c | 24 ++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/devel-docs/GIMP3-plug-in-porting-guide/PDB-compatability.md b/devel-docs/GIMP3-plug-in-porting-guide/PDB-compatability.md index b316a83ddd..193e97a2bd 100644 --- a/devel-docs/GIMP3-plug-in-porting-guide/PDB-compatability.md +++ b/devel-docs/GIMP3-plug-in-porting-guide/PDB-compatability.md @@ -92,10 +92,17 @@ or obsolete a deprecated procedure. ### Aliased deprecated procedures +The GIMP core implementation of the PDB has an aliasing mechanism. Declared in app/pdb/gimp-pdb-compat.c. The code enters an alias name in the hash table of PDB procedure names, pointing to the same procedure as another name. The name usually starts with "gimp-". +ScriptFu has its own aliasing mechanism. +ScriptFu has its own mechanism so its can deprecate even after +the core PDB has obsoleted a name. +Declared in plug-ins/script-fu/libscriptfu/script-fu-compat.c. +The name usually starts with "gimp-". + ### True deprecated procedures Defined in in pdb/groups/foo.pdb using the "std_pdb_deprecated" tag. diff --git a/plug-ins/script-fu/libscriptfu/script-fu-compat.c b/plug-ins/script-fu/libscriptfu/script-fu-compat.c index b41ce00c8b..ee728d2fc0 100644 --- a/plug-ins/script-fu/libscriptfu/script-fu-compat.c +++ b/plug-ins/script-fu/libscriptfu/script-fu-compat.c @@ -34,9 +34,11 @@ static const struct const gchar *old_name; const gchar *new_name; } -compat_procs[] = -{ - /* + + + /* Keep this until we get the porting doc complete for 3.0, + * as something to cross-check against. + * deprecations since 2.99 * * With respect to ScriptFu, @@ -49,7 +51,7 @@ compat_procs[] = * I.E. Gimp.Image.is_valid() exists but takes a GObject *, not an int ID. * * Original data was constructed more or less by hand, partially automated. - */ + { "gimp-brightness-contrast" , "gimp-drawable-brightness-contrast" }, { "gimp-brushes-get-brush" , "gimp-context-get-brush" }, { "gimp-drawable-is-channel" , "gimp-item-id-is-channel" }, @@ -82,8 +84,8 @@ compat_procs[] = { "gimp-item-is-valid" , "gimp-item-id-is-valid" }, { "gimp-item-is-vectors" , "gimp-item-id-is-path" }, { "gimp-item-id-is-vectors" , "gimp-item-id-is-path" }, - /* TODO more -vectors- => -path- or -paths- */ - /* TODO more layer-group => group-layer */ + TODO more -vectors- => -path- or -paths- + TODO more layer-group => group-layer { "gimp-layer-group-new" , "gimp-group-layer-new" }, { "gimp-procedural-db-dump" , "gimp-pdb-dump" }, { "gimp-procedural-db-get-data" , "gimp-pdb-get-data" }, @@ -109,6 +111,16 @@ compat_procs[] = { "file-gtm-save" , "file-html-table-export" }, { "python-fu-histogram-export" , "histogram-export" }, { "python-fu-gradient-save-as-css" , "gradient-save-as-css" } + */ + +compat_procs[] = +{ + /* deprecations since 3.0 */ + /* Intended to be empty, for major release. */ + + /* Template: + { "gimp-brightness-contrast" , "gimp-drawable-brightness-contrast" }, + */ }; static gchar *empty_string = "";