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.
This commit is contained in:
Jehan 2026-02-25 14:45:23 +01:00
parent 664729a55c
commit b602a63778

View file

@ -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_"))