diff options
author | Milan Crha <mcrha@redhat.com> | 2018-11-06 16:30:37 +0100 |
---|---|---|
committer | Corentin Noël <corentin.noel@collabora.com> | 2018-11-06 16:30:37 +0100 |
commit | 05e3e0c9e20bb734a821faa6847a126ce0fa06f1 (patch) | |
tree | a09d6e100f9626ec3bb5a2cdaf671f4e668b108a | |
parent | c9941b0a4699f684fc819f91f5de8d2bdd4a9ae3 (diff) | |
download | gtk-doc-wip/mcrha/scangobj-none-sentinel.tar.gz |
gtkdoc-scangobj: change the sentinel to G_TYPE_NONE to export as many objects as possiblewip/mcrha/scangobj-none-sentinel
https://gitlab.gnome.org/GNOME/gtk-doc/issues/62
-rw-r--r-- | gtkdoc/scangobj.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gtkdoc/scangobj.py b/gtkdoc/scangobj.py index 73c23b0..39a5e2a 100644 --- a/gtkdoc/scangobj.py +++ b/gtkdoc/scangobj.py @@ -68,7 +68,7 @@ get_object_types (void) gint i = 0; ${get_types} - object_types[i] = G_TYPE_INVALID; + object_types[i] = G_TYPE_NONE; /* reference the GObjectClass to initialize the param spec pool * potentially needed by interfaces. See http://bugs.gnome.org/571820 */ @@ -77,7 +77,9 @@ ${get_types} /* Need to make sure all the types are loaded in and initialize * their signals and properties. */ - for (i=0; object_types[i]; i++) { + for (i=0; object_types[i] != G_TYPE_NONE; i++) { + if (object_types[i] == G_TYPE_INVALID) + continue; if (G_TYPE_IS_CLASSED (object_types[i])) g_type_class_ref (object_types[i]); if (G_TYPE_IS_INTERFACE (object_types[i])) @@ -153,8 +155,10 @@ output_signals (void) return; } - for (i = 0; object_types[i]; i++) - output_object_signals (fp, object_types[i]); + for (i = 0; object_types[i] != G_TYPE_NONE; i++) { + if (object_types[i] != G_TYPE_INVALID) + output_object_signals (fp, object_types[i]); + } fclose (fp); } @@ -423,7 +427,9 @@ output_object_hierarchy (void) output_hierarchy (fp, G_TYPE_OBJECT, 0); output_hierarchy (fp, G_TYPE_INTERFACE, 0); - for (i=0; object_types[i]; i++) { + for (i=0; object_types[i] != G_TYPE_NONE; i++) { + if (object_types[i] == G_TYPE_INVALID) + continue; root = object_types[i]; while ((type = g_type_parent (root))) { root = type; @@ -481,7 +487,9 @@ static void output_object_interfaces (void) } output_interfaces (fp, G_TYPE_OBJECT); - for (i = 0; object_types[i]; i++) { + for (i = 0; object_types[i] != G_TYPE_NONE; i++) { + if (object_types[i] == G_TYPE_INVALID) + continue; if (!g_type_parent (object_types[i]) && (object_types[i] != G_TYPE_OBJECT) && G_TYPE_IS_INSTANTIATABLE (object_types[i])) { @@ -576,8 +584,9 @@ output_args (void) return; } - for (i = 0; object_types[i]; i++) { - output_object_args (fp, object_types[i]); + for (i = 0; object_types[i] != G_TYPE_NONE; i++) { + if (object_types[i] != G_TYPE_INVALID) + output_object_args (fp, object_types[i]); } fclose (fp); |