From 836f653025803ca8e26b2069f9b665debbd7c5eb Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 28 Oct 2010 04:01:06 +0300 Subject: [PATCH] scangobj: figure out additional root types Discover root types besides GObject and GInterface. --- gtkdoc-scangobj.in | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in index 7947f8d..789072e 100644 --- a/gtkdoc-scangobj.in +++ b/gtkdoc-scangobj.in @@ -521,7 +521,9 @@ static void output_object_hierarchy (void) { FILE *fp; - gint i; + gint i,j; + GType root, type; + GType root_types[$ntypes] = { G_TYPE_INVALID, }; fp = fopen (hierarchy_filename, "w"); if (fp == NULL) @@ -533,18 +535,27 @@ output_object_hierarchy (void) output_hierarchy (fp, G_TYPE_INTERFACE, 0); for (i=0; object_types[i]; i++) { - if (!g_type_parent (object_types[i]) && - (object_types[i] != G_TYPE_OBJECT) && - (object_types[i] != G_TYPE_INTERFACE) - ) { - output_hierarchy (fp, object_types[i], 0); + root = object_types[i]; + while ((type = g_type_parent (root))) { + root = type; + } + if ((root != G_TYPE_OBJECT) && (root != G_TYPE_INTERFACE)) { + for (j=0; root_types[j]; j++) { + if (root == root_types[j]) { + root = G_TYPE_INVALID; break; + } + } + if(root) { + root_types[j] = root; + output_hierarchy (fp, root, 0); + } } } fclose (fp); } -/* This is called recursively to output the hierarchy of a widget. */ +/* This is called recursively to output the hierarchy of a object. */ static void output_hierarchy (FILE *fp, GType type, -- 2.11.4.GIT