summaryrefslogtreecommitdiff
path: root/gtkdoc-scangobj.in
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2010-10-28 04:01:06 +0300
committerStefan Kost <ensonic@users.sf.net>2010-12-15 10:19:44 +0200
commit836f653025803ca8e26b2069f9b665debbd7c5eb (patch)
treefd7b37b1996d53447c11da7f3557e470d9f0d51a /gtkdoc-scangobj.in
parent2a9498decafe070c6512af36e9589b6c05442d23 (diff)
downloadgtk-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.in25
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,