diff options
author | Stefan Kost <ensonic@users.sf.net> | 2010-10-28 04:01:06 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2010-12-15 10:19:44 +0200 |
commit | 836f653025803ca8e26b2069f9b665debbd7c5eb (patch) | |
tree | fd7b37b1996d53447c11da7f3557e470d9f0d51a /gtkdoc-scangobj.in | |
parent | 2a9498decafe070c6512af36e9589b6c05442d23 (diff) | |
download | gtk-doc-836f653025803ca8e26b2069f9b665debbd7c5eb.tar.gz |
scangobj: figure out additional root types
Discover root types besides GObject and GInterface.
Diffstat (limited to 'gtkdoc-scangobj.in')
-rw-r--r-- | gtkdoc-scangobj.in | 25 |
1 files 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, |