Show signals/actions of parent classes
authorDavid Schleef <ds@schleef.org>
Mon, 18 Aug 2003 07:34:17 +0000 (07:34 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 18 Aug 2003 07:34:17 +0000 (07:34 +0000)
Original commit message from CVS:
Show signals/actions of parent classes

tools/gst-inspect.c

index 3fc09ae0f1e7af293559e199359996bb01f9e8d9..2f3970b1f61dfe6234f712265c03c3ec23d4fb22 100644 (file)
@@ -732,8 +732,8 @@ print_element_info (GstElementFactory *factory)
     guint nsignals;
     gint i, k;
     GSignalQuery *query;
+    GType type;
 
-    signals = g_signal_list_ids (G_OBJECT_TYPE (element), &nsignals);
     for (k = 0; k < 2; k++) {
       gint counted = 0;
 
@@ -742,37 +742,41 @@ print_element_info (GstElementFactory *factory)
       else
         g_print ("\nElement Actions:\n");
 
-      for (i = 0; i < nsignals; i++) {
-        gint n_params;
-        GType return_type;
-        const GType *param_types;
-        gint j;
-
-        query = g_new0 (GSignalQuery,1);
-        g_signal_query (signals[i], query);
-
-        if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
-            (k == 1 &&  (query->signal_flags & G_SIGNAL_ACTION))) {
-          n_params = query->n_params;
-          return_type = query->return_type;
-          param_types = query->param_types;
-
-          g_print ("  \"%s\" :\t %s user_function (%s* object",
-                  query->signal_name, g_type_name (return_type),
-                  g_type_name (G_OBJECT_TYPE (element)));
-
-          for (j = 0; j < n_params; j++) {
-            g_print (",\n    \t\t\t\t%s arg%d", g_type_name(param_types[j]), j);
-          }
-          if (k == 0)
-            g_print (",\n    \t\t\t\tgpointer user_data);\n");
-          else
-            g_print (");\n");
-
-          counted++;
-        }
-
-        g_free (query);
+      for(type = G_OBJECT_TYPE(element); type; type = g_type_parent(type)){
+        signals = g_signal_list_ids (type, &nsignals);
+
+       for (i = 0; i < nsignals; i++) {
+         gint n_params;
+         GType return_type;
+         const GType *param_types;
+         gint j;
+
+         query = g_new0 (GSignalQuery,1);
+         g_signal_query (signals[i], query);
+
+         if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
+             (k == 1 &&  (query->signal_flags & G_SIGNAL_ACTION))) {
+           n_params = query->n_params;
+           return_type = query->return_type;
+           param_types = query->param_types;
+
+           g_print ("  \"%s\" :\t %s user_function (%s* object",
+                   query->signal_name, g_type_name (return_type),
+                   g_type_name (type));
+
+           for (j = 0; j < n_params; j++) {
+             g_print (",\n    \t\t\t\t%s arg%d", g_type_name(param_types[j]), j);
+           }
+           if (k == 0)
+             g_print (",\n    \t\t\t\tgpointer user_data);\n");
+           else
+             g_print (");\n");
+
+           counted++;
+         }
+
+         g_free (query);
+       }
       }
       if (counted == 0) g_print ("  none\n");
     }