gstdoc-scangobj: Add a mechanism for adding 'implicitly created' GTypes into the...
authorJan Schmidt <thaytan@mad.scientist.com>
Fri, 16 May 2008 14:52:29 +0000 (14:52 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Fri, 16 May 2008 14:52:29 +0000 (14:52 +0000)
Original commit message from CVS:
* gstdoc-scangobj:
Add a mechanism for adding 'implicitly created' GTypes into the
scan, allowing for documenting plugin-private base classes that
provide signals or properties for public elements.
* gtk-doc-plugins.mak:
Use $(builddir) instead of $(top_builddir) in a few places - there's
no need to hard code 'docs/plugins' as the only useable path.

ChangeLog
gstdoc-scangobj
gtk-doc-plugins.mak

index ed2f2c3..99888c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-05-16  Jan Schmidt  <jan.schmidt@sun.com>
+
+       * gstdoc-scangobj:
+       Add a mechanism for adding 'implicitly created' GTypes into the
+       scan, allowing for documenting plugin-private base classes that
+       provide signals or properties for public elements.
+
+       * gtk-doc-plugins.mak:
+       Use $(builddir) instead of $(top_builddir) in a few places - there's
+       no need to hard code 'docs/plugins' as the only useable path.
+
 2008-05-14  Peter Kjellerstedt  <pkj@axis.com>
 
        * m4/gst-feature.m4:
index 90ba889..1d46dc9 100755 (executable)
@@ -81,8 +81,7 @@ if ($PRINT_HELP) {
 
 $OUTPUT_DIR = $OUTPUT_DIR ? $OUTPUT_DIR : ".";
 
-# THOMAS: dynamic types; only use types file for headers
- $TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$OUTPUT_DIR/$MODULE.types";
+$TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$OUTPUT_DIR/$MODULE.types";
 
 open (TYPES, $TYPES_FILE) || die "Cannot open $TYPES_FILE: $!\n";
 open (OUTPUT, ">$MODULE-scan.c") || die "Cannot open $MODULE-scan.c: $!\n";
@@ -101,22 +100,27 @@ my $new_args_filename = "$OUTPUT_DIR/$MODULE.args.new";
 # write a C program to scan the types
 
 $includes = "";
-#@types = ();
+@types = ();
+@impl_types = ();
 
 for (<TYPES>) {
     if (/^#include/) {
        $includes .= $_;
-#    } elsif (/^%/) {
-#      next;
-#    } elsif (/^\s*$/) {
-#      next;
-#    } else {
-#      chomp;
-#      push @types, $_;
+    } elsif (/^%/) {
+       next;
+    } elsif (/^\s*$/) {
+       next;
+    } elsif (/^type:(.*)$/) {
+       $t = $1;
+        chomp $t;
+       push @impl_types, $t;
+    } else {
+       chomp;
+       push @types, $_;
     }
 }
 
-#$ntypes = @types + 1;
+$ntypes = @types + @impl_types;
 
 print OUTPUT <<EOT;
 #include <string.h>
@@ -125,6 +129,7 @@ print OUTPUT <<EOT;
 #include <errno.h>
 
 $includes
+
 #ifdef GTK_IS_WIDGET_CLASS
 #include <gtk/gtkversion.h>
 #endif
@@ -180,7 +185,7 @@ get_object_types (void)
     g_message ("number of element factories: %d", g_list_length (factories));
 
     /* allocate the object_types array to hold them */
-    object_types = g_new0 (GType, g_list_length (factories)+1);
+    object_types = g_new0 (GType, g_list_length (factories)+$ntypes+1);
 
     l = factories;
     i = 0;
@@ -191,15 +196,26 @@ get_object_types (void)
       factory = GST_ELEMENT_FACTORY (l->data);
       type = gst_element_factory_get_element_type (factory);
       g_message ("adding type %p for factory %s", (void *) type, gst_element_factory_get_longname (factory));
-      object_types[i] = type;
-      i++;
+      object_types[i++] = type;
       l = g_list_next (l);
     }
-    object_types[i] = 0;
+
 EOT
 
+# get_type functions:
+for (@types) {
+    print OUTPUT "    object_types[i++] = $_ ();\n";
+}
+
+# Implicit types retrieved from GLib:
+for (@impl_types) {
+    print OUTPUT "    object_types[i++] = g_type_from_name (\"$_\");\n";
+}
+
 print OUTPUT <<EOT;
 
+    object_types[i] = 0;
+
     /* Need to make sure all the types are loaded in and initialize
      * their signals and properties.
      */
index 71f60ba..e96d619 100644 (file)
@@ -132,10 +132,10 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(SCANOBJ_FILES_O): scan-build.stamp
 ### inspect GStreamer plug-ins; done by documentation maintainer ###
 
 # only look at the plugins in this module when building inspect .xml stuff
-INSPECT_REGISTRY=$(top_builddir)/docs/plugins/inspect-registry.xml
+INSPECT_REGISTRY=$(builddir)/inspect-registry.xml
 INSPECT_ENVIRONMENT=\
         GST_PLUGIN_SYSTEM_PATH= \
-        GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src \
+        GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/sys:$(top_builddir)/ext:$(top_builddir)/plugins:$(top_builddir)/src:$(top_builddir)/gnl \
         GST_REGISTRY=$(INSPECT_REGISTRY)
 
 # update the element and plugin XML descriptions; store in inspect/
@@ -351,7 +351,7 @@ check-hierarchy: $(DOC_MODULE).hierarchy
 check: check-hierarchy
 
 # wildcard is apparently not portable to other makes, hence the use of find
-inspect_files = $(shell find $(top_srcdir)/docs/plugins/inspect -name '*.xml')
+inspect_files = $(shell find $(srcdir)/inspect -name '*.xml')
 
 check-inspected-versions:
        @echo Checking plugin versions of inspected plugin data ...; \