Is a dynamically loaded type visible using PyGObject?
The context is GIMP. A Python plugin in GIMP uses PyGObject to bind to libgimp.
Suppose libgimp dynamically loads at runtime a type using GTypeModule. Say a subtype of GEnum, call it "FooEnum". We want the plugin to refer to "FooEnum.BarEnumValue"
Is that possible? My intuition is that PyGObject only looks at the gir and gets only statically defined enums from libgimp.
Supposing that is not possible, is it possible to get a type object using the known name? Something like this in Python:
type = GType.get_type_by_name("FooEnum")
value = type.BarEnumValue
More context: plugins themselves declare the dynamic enums. A second plugin may want to refer to a dynamic enum defined by a first plugin. We have a way to convey a declaration of an enum from a plugin to libgimp. Libgimp keeps a db of all declared dynamic enums, and dynamically load them when libgimp runs. But can a second plugin refer to a dynamically defined enum that libgimp has loaded, on behalf of the first plugin?
The way it works now, an interpreted plugin declares a "mock enum". It sorta appears like an enum, in a GUI dialog, having a combo box pulldown. But other plugins can't refer to the enum values symbolically, they must use integer literals "1" to pass values where an enum value is required. We want plugins to be able to refer symbolically to enum values that other plugins have declared.