From b602a63778ca4793f0aba7470e9bca9e22262f82 Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 25 Feb 2026 14:45:23 +0100 Subject: [PATCH] plug-ins: also introspect libgimpui enum values into Script-Fu. Since libgimpui also use GIMP_ as prefix in C, we won't ever have name clashing with libgimp, so I also remove this prefix in Script-Fu. E.g. GIMP_ASPECT_SQUARE is ASPECT-SQUARE in Script-Fu. --- plug-ins/script-fu/libscriptfu/scheme-wrapper.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plug-ins/script-fu/libscriptfu/scheme-wrapper.c b/plug-ins/script-fu/libscriptfu/scheme-wrapper.c index b34f7e62a4..e2a9b2efa2 100644 --- a/plug-ins/script-fu/libscriptfu/scheme-wrapper.c +++ b/plug-ins/script-fu/libscriptfu/scheme-wrapper.c @@ -251,6 +251,13 @@ tinyscheme_init (GList *path, /* Fetch the typelib */ repo = g_irepository_get_default (); typelib = g_irepository_require (repo, "Gimp", NULL, 0, &error); + if (!typelib) + { + g_warning ("%s", error->message); + g_clear_error (&error); + return; + } + typelib = g_irepository_require (repo, "GimpUi", NULL, 0, &error); if (!typelib) { g_warning ("%s", error->message); @@ -414,6 +421,7 @@ ts_init_constants (scheme *sc, } ts_init_enums (sc, repo, "Gimp"); + ts_init_enums (sc, repo, "GimpUi"); ts_init_enums (sc, repo, "Gegl"); /* Constants used in the register block of scripts e.g. SF-ADJUSTMENT */ @@ -463,7 +471,8 @@ ts_init_enum (scheme *sc, } /* Scheme-ify the name */ - if (g_strcmp0 (namespace, "Gimp") == 0) + if (g_strcmp0 (namespace, "Gimp") == 0 || + g_strcmp0 (namespace, "GimpUi") == 0) { /* Skip the GIMP prefix for GIMP enums */ if (g_str_has_prefix (c_identifier, "GIMP_"))