Commit 3b363108 authored by Jan Schmidt's avatar Jan Schmidt

gstdoc-scangobj: Add a mechanism for adding 'implicitly created' GTypes into...

gstdoc-scangobj: Add a mechanism for adding 'implicitly created' GTypes into the scan, allowing for documenting plugi...

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.
parent 0823ac6b
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:
......
......@@ -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.
*/
......
......@@ -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 ...; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment