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:
parent
664729a55c
commit
b602a63778
1 changed files with 10 additions and 1 deletions
|
|
@ -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_"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue