diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-02-09 11:38:27 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2021-08-05 16:24:23 +0000 |
commit | 661ca094e8d2279709258169a9e67ff7dc10f3a7 (patch) | |
tree | a1d4596787ec3c7bf51372748a76c634c51b2b3e /girepository/giobjectinfo.c | |
parent | ffb165a58d360d1453f6ced227ae645951bfb8b6 (diff) | |
download | gobject-introspection-661ca094e8d2279709258169a9e67ff7dc10f3a7.tar.gz |
Add "final" class attribute
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 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/girepository/giobjectinfo.c b/girepository/giobjectinfo.c index 13cfdaa8..2042793a 100644 --- a/girepository/giobjectinfo.c +++ b/girepository/giobjectinfo.c @@ -134,6 +134,31 @@ 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: %TRUE if the object type is final + * + * Since: 1.70 + */ +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 * |