diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-02-09 11:38:27 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2021-02-09 11:38:27 +0000 |
commit | c7a9861d9cd165f7e2db78811c111b78ca8d6add (patch) | |
tree | 4ce9d2725dae029dc8109ba90d1d863fdcfa12e6 /girepository/giobjectinfo.c | |
parent | 5ed5b1ed30938dbe70e50feffa56ee5ee47696d2 (diff) | |
download | gobject-introspection-c7a9861d9cd165f7e2db78811c111b78ca8d6add.tar.gz |
Add "final" class attributeebassi/final-type
A "final" class is a leaf node in a derivable type hierarchy, and cannot
be derived any further.
This matches the changes in libgobject that introduced G_TYPE_FLAG_FINAL
to the type flags.
Diffstat (limited to 'girepository/giobjectinfo.c')
-rw-r--r-- | girepository/giobjectinfo.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/girepository/giobjectinfo.c b/girepository/giobjectinfo.c index 13cfdaa8..15a518c1 100644 --- a/girepository/giobjectinfo.c +++ b/girepository/giobjectinfo.c @@ -134,6 +134,29 @@ g_object_info_get_abstract (GIObjectInfo *info) } /** + * g_object_info_get_final: + * @info: a #GIObjectInfo + * + * Checks whether the object type is a final type, i.e. if it cannot + * be derived + * + * Returns: %TRUYE if the object type is final + */ +gboolean +g_object_info_get_final (GIObjectInfo *info) +{ + GIRealInfo *rinfo = (GIRealInfo *) info; + ObjectBlob *blob; + + g_return_val_if_fail (info != NULL, FALSE); + g_return_val_if_fail (GI_IS_OBJECT_INFO (info), FALSE); + + blob = (ObjectBlob *) &rinfo->typelib->data[rinfo->offset]; + + return blob->final_ != 0; +} + +/** * g_object_info_get_fundamental: * @info: a #GIObjectInfo * |