From 9bae9d4b91cd2dbc16f3dad7775c55f1e3c74c1f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 25 Oct 2000 19:09:53 +0000 Subject: [PATCH] More Docs updates. Original commit message from CVS: More Docs updates. Added plugin documentation. I fear we need a gstdoc implementation that loads plugins and does introspection on them. I think we should automatically create the docs for the pads and mime types the plugins provide. Does anyone have enough perl knowledge to add these features? I allready changed the C code to output the pad definitions but my perl knowledge is too limited, for now, to implement the rest of the needed functionality... --- configure.in | 3 + docs/plugins/Makefile.am | 96 + docs/plugins/gstdoc-mkdb | 2273 +++++ docs/plugins/gstdoc-mktmpl | 1346 +++ docs/plugins/gstdoc-scanobj | 872 ++ docs/plugins/gstreamer-plugins-docs.sgml | 120 + docs/plugins/gstreamer-plugins-sections.txt | 333 + docs/plugins/tmpl/ac3dec.sgml | 16 + docs/plugins/tmpl/ac3parse.sgml | 21 + docs/plugins/tmpl/audioscale.sgml | 21 + docs/plugins/tmpl/cobin.sgml | 16 + docs/plugins/tmpl/dvdsrc.sgml | 16 + docs/plugins/tmpl/example.sgml | 16 + docs/plugins/tmpl/gstaviencoder.sgml | 26 + docs/plugins/tmpl/gstjpeg.sgml | 16 + docs/plugins/tmpl/gstjpegdec.sgml | 16 + docs/plugins/tmpl/gstjpegenc.sgml | 16 + docs/plugins/tmpl/gstmpeg1encoder.sgml | 16 + docs/plugins/tmpl/gstmpeg2enc.sgml | 21 + docs/plugins/tmpl/gstmpeg2play.sgml | 21 + docs/plugins/tmpl/gstmpeg_play.sgml | 24 + docs/plugins/tmpl/gstmpegaudio.sgml | 16 + docs/plugins/tmpl/gstmpg123.sgml | 16 + docs/plugins/tmpl/gstparseau.sgml | 16 + docs/plugins/tmpl/gstparseavi.sgml | 16 + docs/plugins/tmpl/gstparsewav.sgml | 16 + .../tmpl/gstreamer-plugins-unused.sgml | 7999 +++++++++++++++++ docs/plugins/tmpl/gstspectrum.sgml | 21 + docs/plugins/tmpl/gstv4lsrc.sgml | 86 + docs/plugins/tmpl/gstwincodec.sgml | 16 + docs/plugins/tmpl/gstwindec.sgml | 26 + docs/plugins/tmpl/gstwinenc.sgml | 49 + docs/plugins/tmpl/gstxa.sgml | 16 + docs/plugins/tmpl/gstxing.sgml | 16 + docs/plugins/tmpl/median.sgml | 26 + docs/plugins/tmpl/mp1videoparse.sgml | 16 + docs/plugins/tmpl/mp2videoparse.sgml | 16 + docs/plugins/tmpl/mp3parse.sgml | 21 + docs/plugins/tmpl/mpeg1parse.sgml | 21 + docs/plugins/tmpl/mpeg2parse.sgml | 21 + docs/plugins/tmpl/mpeg2subt.sgml | 21 + docs/plugins/tmpl/rtjpegdec.sgml | 16 + docs/plugins/tmpl/rtjpegenc.sgml | 16 + docs/plugins/tmpl/smooth.sgml | 31 + docs/plugins/tmpl/smoothwave.sgml | 31 + docs/plugins/tmpl/spindentity.sgml | 16 + docs/plugins/tmpl/stereo.sgml | 26 + docs/plugins/tmpl/synaesthesia.sgml | 31 + docs/plugins/tmpl/system_encode.sgml | 26 + docs/plugins/tmpl/vcdsrc.sgml | 16 + docs/plugins/tmpl/videoscale.sgml | 26 + docs/plugins/tmpl/videosink.sgml | 55 + docs/plugins/tmpl/volume.sgml | 26 + docs/plugins/tmpl/vorbisdec.sgml | 16 + docs/plugins/tmpl/vorbisenc.sgml | 16 + docs/plugins/tmpl/vumeter.sgml | 46 + gst/elements/gstasyncdisksrc.c | 12 +- gst/elements/gstaudiosink.c | 3 +- gst/gstbufferpool.c | 39 + gst/gstconnection.c | 6 + gst/gstcpu.c | 2 +- gst/gstcpu.h | 8 +- gst/gstelement.c | 2 + gst/gstelement.h | 2 +- gst/gstelementfactory.c | 2 +- gst/gstmeta.c | 30 + gst/gstmeta.h | 4 +- gst/gstpad.c | 142 +- gst/gstplugin.c | 37 +- gst/gstthread.c | 3 +- gst/gstthread.h | 3 - gst/gstutils.c | 71 + gst/gstxml.c | 2 +- libs/colorspace/gstcolorspace.h | 24 +- libs/idct/gstidct.h | 12 +- libs/riff/gstriff.h | 35 +- plugins/elements/gstasyncdisksrc.c | 12 +- plugins/elements/gstaudiosink.c | 3 +- test/ac3play.c | 2 +- test/qtest.c | 2 +- 80 files changed, 14539 insertions(+), 69 deletions(-) create mode 100644 docs/plugins/Makefile.am create mode 100755 docs/plugins/gstdoc-mkdb create mode 100755 docs/plugins/gstdoc-mktmpl create mode 100755 docs/plugins/gstdoc-scanobj create mode 100644 docs/plugins/gstreamer-plugins-docs.sgml create mode 100644 docs/plugins/gstreamer-plugins-sections.txt create mode 100644 docs/plugins/tmpl/ac3dec.sgml create mode 100644 docs/plugins/tmpl/ac3parse.sgml create mode 100644 docs/plugins/tmpl/audioscale.sgml create mode 100644 docs/plugins/tmpl/cobin.sgml create mode 100644 docs/plugins/tmpl/dvdsrc.sgml create mode 100644 docs/plugins/tmpl/example.sgml create mode 100644 docs/plugins/tmpl/gstaviencoder.sgml create mode 100644 docs/plugins/tmpl/gstjpeg.sgml create mode 100644 docs/plugins/tmpl/gstjpegdec.sgml create mode 100644 docs/plugins/tmpl/gstjpegenc.sgml create mode 100644 docs/plugins/tmpl/gstmpeg1encoder.sgml create mode 100644 docs/plugins/tmpl/gstmpeg2enc.sgml create mode 100644 docs/plugins/tmpl/gstmpeg2play.sgml create mode 100644 docs/plugins/tmpl/gstmpeg_play.sgml create mode 100644 docs/plugins/tmpl/gstmpegaudio.sgml create mode 100644 docs/plugins/tmpl/gstmpg123.sgml create mode 100644 docs/plugins/tmpl/gstparseau.sgml create mode 100644 docs/plugins/tmpl/gstparseavi.sgml create mode 100644 docs/plugins/tmpl/gstparsewav.sgml create mode 100644 docs/plugins/tmpl/gstreamer-plugins-unused.sgml create mode 100644 docs/plugins/tmpl/gstspectrum.sgml create mode 100644 docs/plugins/tmpl/gstv4lsrc.sgml create mode 100644 docs/plugins/tmpl/gstwincodec.sgml create mode 100644 docs/plugins/tmpl/gstwindec.sgml create mode 100644 docs/plugins/tmpl/gstwinenc.sgml create mode 100644 docs/plugins/tmpl/gstxa.sgml create mode 100644 docs/plugins/tmpl/gstxing.sgml create mode 100644 docs/plugins/tmpl/median.sgml create mode 100644 docs/plugins/tmpl/mp1videoparse.sgml create mode 100644 docs/plugins/tmpl/mp2videoparse.sgml create mode 100644 docs/plugins/tmpl/mp3parse.sgml create mode 100644 docs/plugins/tmpl/mpeg1parse.sgml create mode 100644 docs/plugins/tmpl/mpeg2parse.sgml create mode 100644 docs/plugins/tmpl/mpeg2subt.sgml create mode 100644 docs/plugins/tmpl/rtjpegdec.sgml create mode 100644 docs/plugins/tmpl/rtjpegenc.sgml create mode 100644 docs/plugins/tmpl/smooth.sgml create mode 100644 docs/plugins/tmpl/smoothwave.sgml create mode 100644 docs/plugins/tmpl/spindentity.sgml create mode 100644 docs/plugins/tmpl/stereo.sgml create mode 100644 docs/plugins/tmpl/synaesthesia.sgml create mode 100644 docs/plugins/tmpl/system_encode.sgml create mode 100644 docs/plugins/tmpl/vcdsrc.sgml create mode 100644 docs/plugins/tmpl/videoscale.sgml create mode 100644 docs/plugins/tmpl/videosink.sgml create mode 100644 docs/plugins/tmpl/volume.sgml create mode 100644 docs/plugins/tmpl/vorbisdec.sgml create mode 100644 docs/plugins/tmpl/vorbisenc.sgml create mode 100644 docs/plugins/tmpl/vumeter.sgml diff --git a/configure.in b/configure.in index e65c6dc233..6d76473616 100644 --- a/configure.in +++ b/configure.in @@ -476,6 +476,9 @@ tools/Makefile docs/Makefile docs/gst/Makefile docs/gst/gstreamer.types +docs/libs/Makefile +docs/plugins/Makefile +docs/plugins/gstreamer-plugins.types docs/manual/Makefile docs/manual/images/Makefile stamp.h diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am new file mode 100644 index 0000000000..e5e1277ffa --- /dev/null +++ b/docs/plugins/Makefile.am @@ -0,0 +1,96 @@ +## Process this file with automake to produce Makefile.in + +# The name of the module. +DOC_MODULE=gstreamer-plugins + +# The top-level SGML file. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# The directory containing the source code (if it contains documentation). +DOC_SOURCE_DIR=$(top_srcdir)/plugins + +INCLUDES = $(GLIB_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir) +LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_srcdir)/gst/libgst.la + +CFLAGS = `gstreamer-config --cflags` -Wall -g +LDFLAGS = `gstreamer-config --libs` + +EXTRA_DIST=$(DOC_MODULE).types.in + +HTML_DIR=$(datadir)/$(DOC_MODULE)/html + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +tmpl_sources = \ + tmpl/videoraw.sgml + +gstreamer_docdir = $(HTML_DIR) +gstreamer_doc_DATA = \ + $(DOC_MODULE).html \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).types \ + $(DOC_MODULE)-sections.txt + +SCANOBJS_FILES = \ + $(DOC_MODULE).signals \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).args + +if HAVE_GTK_DOC +$(DOC_MODULE).html: html/book1.html + -cd $(srcdir) && cp html/book1.html $(DOC_MODULE).html +else +$(DOC_MODULE).html: +endif + +html/book1.html: sgml/$(DOC_MODULE)-doc.bottom + $(MAKE) html + +sgml/$(DOC_MODULE)-doc.bottom: $(tmpl_sources) + $(MAKE) sgml + +scanobj: + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./gstdoc-scanobj --module=$(DOC_MODULE) + +tmpl: scanobj + ./gstdoc-mktmpl --module=$(DOC_MODULE) + +sgml: tmpl + ./gstdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) + +html: + if ! test -d html ; then mkdir html ; fi + -cd html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + +clean-local: + rm -f *~ *.bak *.signals *-unused.txt *.args + +maintainer-clean-local: clean + rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR) + (installfiles=`echo $(srcdir)/html/*.html`; \ + if test "$$installfiles" = '$(srcdir)/html/*.html'; \ + then echo '-- Nothing to install' ; \ + else \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(srcdir)/html/index.sgml' ; \ + $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \ + echo '-- Fixing Crossreferences' ; \ + gtkdoc-fixxref --module=$(DOC_MODULE) --html-dir=$(HTML_DIR)|| true; \ + fi) + +dist-hook: + mkdir $(distdir)/html + mkdir $(distdir)/sgml + mkdir $(distdir)/tmpl + -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml + -cp $(srcdir)/sgml/*.bottom $(srcdir)/sgml/*.top $(distdir)/sgml + +.PHONY : html sgml templates diff --git a/docs/plugins/gstdoc-mkdb b/docs/plugins/gstdoc-mkdb new file mode 100755 index 0000000000..b8e4dcd9ed --- /dev/null +++ b/docs/plugins/gstdoc-mkdb @@ -0,0 +1,2273 @@ +#!/usr/bin/perl -w +# +# gtk-doc - GTK DocBook documentation generator. +# Copyright (C) 1998 Damon Chaplin +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +############################################################################# +# Script : gtkdoc-mkdb +# Description : This creates the DocBook files from the edited templates. +# +# NOTE: When creating SGML IDS, we append -CAPS to all +# all-caps identifiers to prevent name clashes. (It basically +# never is the case that mixed-case identifiers would collide.) +# See the CreateValidSGMLID function. +############################################################################# + +use strict; +use Getopt::Long; + +# Options + +# name of documentation module +my $MODULE; +my $TMPL_DIR; +my $SGML_OUTPUT_DIR; +my @SOURCE_DIRS; + +my %optctl = (module => \$MODULE, + 'source-dir' => \@SOURCE_DIRS, + 'output-dir' => \$SGML_OUTPUT_DIR, + 'tmpl-dir' => \$TMPL_DIR); +GetOptions(\%optctl, "module=s", "source-dir:s", "output-dir:s"); + +my $ROOT_DIR = "."; + +# All the files are written in subdirectories beneath here. +$TMPL_DIR = $TMPL_DIR ? $TMPL_DIR : "$ROOT_DIR/tmpl"; + +# This is where we put all the DocBook output. +$SGML_OUTPUT_DIR = $SGML_OUTPUT_DIR ? $SGML_OUTPUT_DIR : "$ROOT_DIR/sgml"; + +# This file contains the object hierarchy. +my $OBJECT_TREE_FILE = "$ROOT_DIR/$MODULE.hierarchy"; + +# This file contains signal arguments and names. +my $SIGNALS_FILE = "$ROOT_DIR/$MODULE.signals"; + +# The file containing Arg information. +my $ARGS_FILE = "$ROOT_DIR/$MODULE.args"; + +# These global arrays store information on signals. Each signal has an entry +# in each of these arrays at the same index, like a multi-dimensional array. +my @SignalObjects; # The GtkObject which emits the signal. +my @SignalNames; # The signal name. +my @SignalReturns; # The return type. +my @SignalPrototypes; # The rest of the prototype of the signal handler. + +# These global arrays store information on Args. Each Arg has an entry +# in each of these arrays at the same index, like a multi-dimensional array. +my @ArgObjects; # The GtkObject which has the Arg. +my @ArgNames; # The Arg name. +my @ArgTypes; # The Arg type - gint, GtkArrowType etc. +my @ArgFlags; # How the Arg can be used - readable/writable etc. + +# These global hashes store declaration info keyed on a symbol name. +my %Declarations; +my %DeclarationTypes; +my %DeclarationConditional; +my %DeclarationOutput; + +# These global hashes store the existing documentation. +my %SymbolDocs; +my %SymbolTypes; +my %SymbolParams; + +# These global hashes store documentation scanned from the source files. +my %SourceSymbolDocs; +my %SourceSymbolParams; + +# These global arrays store GtkObject and subclasses and the hierarchy. +my @Objects; +my @ObjectLevels; + + +# Create the root DocBook output directory if it doens't exist. +if (! -e $SGML_OUTPUT_DIR) { + mkdir ("$SGML_OUTPUT_DIR", 0777) + || die "Can't create directory: $SGML_OUTPUT_DIR"; +} + +# Function and other declaration output settings. +my $RETURN_TYPE_FIELD_WIDTH = 12; +my $SYMBOL_FIELD_WIDTH = 32; +my $SIGNAL_FIELD_WIDTH = 12; + +&ReadSignalsFile ($SIGNALS_FILE); +&ReadArgsFile ($ARGS_FILE); +&ReadObjectHierarchy; + +# FIXME: this is the header file output at the top of the Synopsis. +# We should allow this to be changed in the MODULE-sections.txt file. +# gnome.h includes gtk/gtk.h which includes gdk/gdk.h which includes glib.h +# so what should we output? - alternatives? +my $HEADER_FILE = ""; +if ($MODULE eq 'glib') { + $HEADER_FILE = "glib.h"; +} elsif ($MODULE eq 'gdk') { + $HEADER_FILE = "gtk/gdk.h"; +} elsif ($MODULE eq 'gtk') { + $HEADER_FILE = "gtk/gtk.h"; +} elsif ($MODULE eq 'gnome' || $MODULE eq 'gnomeui') { + $HEADER_FILE = "gnome.h"; +} + +for my $dir (@SOURCE_DIRS) { + &ReadSourceDocumentation ($dir); +} + +&OutputSGML ("$ROOT_DIR/$MODULE-sections.txt"); + + +############################################################################# +# Function : OutputObjectList +# Description : This outputs the alphabetical list of objects, in a columned +# table. FIXME: Currently this also outputs ancestor objects +# which may not actually be in this module. +# Arguments : none +############################################################################# + +sub OutputObjectList { + my $cols = 3; + + open (OUTPUT, ">$SGML_OUTPUT_DIR/object_index.sgml") + || die "Can't create $SGML_OUTPUT_DIR/object_index.sgml"; + print (OUTPUT < + + + + + +EOF + + my $count = 0; + my $object; + foreach $object (sort(@Objects)) { + my $xref = &MakeXRef ($object); + if ($count % $cols == 0) { print (OUTPUT "\n"); } + print (OUTPUT "$xref\n"); + if ($count % $cols == ($cols - 1)) { print (OUTPUT "\n"); } + $count++; + } + + print (OUTPUT < +EOF + close (OUTPUT); +} + + +############################################################################# +# Function : OutputSGML +# Description : This collects the output for each section of the docs, and +# outputs each file when the end of the section is found. +# Arguments : $file - the $MODULE-sections.txt file which contains all of +# the functions/macros/structs etc. being documented, organised +# into sections and subsections. +############################################################################# + +sub OutputSGML { + my ($file) = @_; + + open (INPUT, $file) + || die "Can't open $file"; + my $book_top = ""; + my $book_bottom = ""; + my $includes = ""; + my $section_includes = ""; + my $in_section = 0; + my $title = ""; + my $subsection = ""; + my $synopsis; + my $details; + my $num_symbols; + while () { + if (m/^#/) { + next; + + } elsif (m/^
/) { + $synopsis = ""; + $details = ""; + $num_symbols = 0; + $in_section = 1; + + } elsif (m/^/i) { + $synopsis .= "\n"; + $subsection = $1; + + } elsif (m/^/) { + + } elsif (m/^(.*)<\/TITLE>/) { + $title = $1; +# print "Section: $title\n"; + + # We don't want warnings if object & class structs aren't used. + $DeclarationOutput{$title} = 1; + $DeclarationOutput{"${title}Class"} = 1; + + } elsif (m/^<FILE>(.*)<\/FILE>/) { + $file = $1; + %SymbolDocs = (); + %SymbolTypes = (); + %SymbolParams = (); + &ReadTemplateFile ("$TMPL_DIR/$file.sgml", 1); + &MergeSourceDocumentation; + + } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) { + if ($in_section) { + $section_includes = $1; + } else { + $includes = $1; + } + + } elsif (m/^<\/SECTION>/) { + if ($title eq "") { + $title = $file; + } +# print "End of section: $title\n"; + + $file =~ s/\s/_/g; + $file .= ".sgml"; + + # GtkObjects use their class name as the ID. + my $section_id; + if (&CheckIsObject ($title)) { + $section_id = &CreateValidSGMLID ($title); + } else { + $section_id = &CreateValidSGMLID ("$MODULE-$title"); + } + + if ($num_symbols > 0) { + $book_top .= "<!entity $section_id SYSTEM \"sgml/$file\">\n"; + $book_bottom .= " &$section_id;\n"; + + if ($section_includes eq "") { + $section_includes = $includes; + } + + &OutputSGMLFile ($file, $title, $section_id, $section_includes, + \$synopsis, \$details); + } + $title = ""; + $subsection = ""; + $in_section = 0; + $section_includes = ""; + + } elsif (m/^(\S+)/) { + my $symbol = $1; + #print " Symbol: $symbol\n"; + + my $declaration = $Declarations{$1}; + if (defined ($declaration)) { + # We don't want standard macros/functions of GtkObjects, + # or private declarations. + if ($subsection ne "Standard" && $subsection ne "Private") { + my ($synop, $desc) = &OutputDeclaration ($symbol, + $declaration); + $synopsis .= $synop; + $details .= $desc; + } + + # Note that the declaration has been output. + $DeclarationOutput{$symbol} = 1; + } else { + print "WARNING: No declaration for: $1\n"; + } + $num_symbols++; + } + } + close (INPUT); + + &OutputBook ($book_top, $book_bottom); +} + + +############################################################################# +# Function : OutputDeclaration +# Description : Returns the synopsis and detailed description DocBook +# describing one function/macro etc. +# Arguments : $symbol - the name of the function/macro begin described. +# $declaration - the declaration of the function/macro. +############################################################################# + +sub OutputDeclaration { + my ($symbol, $declaration) = @_; + + my $type = $DeclarationTypes {$symbol}; + if ($type eq 'MACRO') { + return &OutputMacro ($symbol, $declaration); + } elsif ($type eq 'TYPEDEF') { + return &OutputTypedef ($symbol, $declaration); + } elsif ($type eq 'STRUCT') { + return &OutputStruct ($symbol, $declaration); + } elsif ($type eq 'ENUM') { + return &OutputEnum ($symbol, $declaration); + } elsif ($type eq 'UNION') { + return &OutputUnion ($symbol, $declaration); + } elsif ($type eq 'VARIABLE') { + return &OutputVariable ($symbol, $declaration); + + } elsif ($type eq 'FUNCTION') { + return &OutputFunction ($symbol, $declaration, $type); + } elsif ($type eq 'USER_FUNCTION') { + return &OutputFunction ($symbol, $declaration, $type); + } else { + die "Unknown symbol type"; + } +} + + +############################################################################# +# Function : OutputMacro +# Description : Returns the synopsis and detailed description of a macro. +# Arguments : $symbol - the macro. +# $declaration - the declaration of the macro. +############################################################################# + +sub OutputMacro { + my ($symbol, $declaration) = @_; + my $id = &CreateValidSGMLID ($symbol); + my $synop = "#define <link linkend=\"$id\">$symbol</link>"; + my $desc; + my $args = ""; + if ($declaration =~ m/^\s*#\s*define\s+\w+(\([^\)]*\))/) { + $args = $1; + + if (length ($symbol) < $SYMBOL_FIELD_WIDTH) { + $synop .= (' ' x ($SYMBOL_FIELD_WIDTH - length ($symbol))); + } + + $synop .= &CreateValidSGML ($args); + } + $synop .= "\n"; + + if ($args ne "") { + $desc = "<refsect2>\n<title><anchor id=\"$id\">${symbol}()\n"; + } else { + $desc = "\n<anchor id=\"$id\">$symbol\n"; + } + # Don't output the macro definition if is is a conditional macro or it + # looks like a function, i.e. starts with "g_" or "_?gnome_", or it is + # longer than 2 lines, otherwise we get lots of complicated macros like + # g_assert. + if (!defined ($DeclarationConditional{$symbol}) && ($symbol !~ m/^g_/) + && ($symbol !~ m/^_?gnome_/) && (($declaration =~ tr/\n//) < 2)) { + $declaration = &CreateValidSGML ($declaration); + $desc .= "$declaration\n"; + } else { + $desc .= "#define $symbol"; + $desc .= &CreateValidSGML ($args); + $desc .= "\n"; + } + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + $desc .= &OutputParamDescriptions ("MACRO", $symbol); + $desc .= "\n"; + return ($synop, $desc); +} + + +############################################################################# +# Function : OutputTypedef +# Description : Returns the synopsis and detailed description of a typedef. +# Arguments : $symbol - the typedef. +# $declaration - the declaration of the typedef, +# e.g. 'typedef unsigned int guint;' +############################################################################# + +sub OutputTypedef { + my ($symbol, $declaration) = @_; + my $id = &CreateValidSGMLID ($symbol); + my $synop = "typedef $symbol;\n"; + my $desc = "\n<anchor id=\"$id\">$symbol\n"; + if (!defined ($DeclarationConditional{$symbol})) { + $declaration = &CreateValidSGML ($declaration); + $desc .= "$declaration\n"; + } + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + $desc .= "\n"; + return ($synop, $desc); +} + + +############################################################################# +# Function : OutputStruct +# Description : Returns the synopsis and detailed description of a struct. +# We check if it is a widget struct, and if so we only output +# parts of it that are noted as public fields. +# We also use a different SGML ID for widget structs, since the +# original ID is used for the entire RefEntry. +# Arguments : $symbol - the struct. +# $declaration - the declaration of the struct. +############################################################################# + +sub OutputStruct { + my ($symbol, $declaration) = @_; + + my $is_widget_struct = 0; + if (&CheckIsObject ($symbol)) { +# print "Found widget struct: $symbol\n"; + $is_widget_struct = 1; + } + + my $id; + if ($is_widget_struct) { + $id = &CreateValidSGMLID ($symbol . "_struct"); + } else { + $id = &CreateValidSGMLID ($symbol); + } + my $synop = "struct $symbol;\n"; + my $desc = "\n<anchor id=\"$id\">struct $symbol\n"; + + # Form a pretty-printed, private-data-removed form of the declaration + + my $decl_out; + if ($declaration =~ m/^\s*$/) { +# print "Found opaque struct\n"; + $decl_out = "struct $symbol;"; + } elsif ($is_widget_struct) { + my $public = 0; + my $new_declaration = ""; + my $decl_line; + foreach $decl_line (split (/\n/, $declaration)) { +# print "Struct line: $decl_line\n"; + if ($decl_line =~ m%/\*\s*<\s*public\s*>\s*\*/%) { + $public = 1; + } elsif ($decl_line =~ m%/\*\s*<\s*private\s*>\s*\*/%) { + $public = 0; + } elsif ($public) { + $new_declaration .= $decl_line . "\n"; + } + } + if ($new_declaration) { + $decl_out = "struct $symbol {\n" . $new_declaration; + # If we finished with public set, we already have the struct end. + if ($public == 0) { + $decl_out .= "};\n"; + } + } else { + $decl_out = "struct $symbol;"; + } + } else { + $decl_out = $declaration; + } + + $decl_out = &CreateValidSGML ($decl_out); + $desc .= "$decl_out\n"; + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + + # Create a table of fields and descriptions + + # FIXME: Inserting  's into the produced type declarations here would + # improve the output in most situations ... except for function + # members of structs! + my @fields = ParseStructDeclaration($declaration, $is_widget_struct, \&MakeXRef, + sub { + "$_[0]"; + }); + my $params = $SymbolParams{$symbol}; + + # If no parameters are filled in, we don't generate the description + # table, for backwards compatibility + + my $found = 0; + if (defined $params) { + for (my $i = 1; $i <= $#$params; $i += 2) { + if ($params->[$i] =~ /\S/) { + $found = 1; + last; + } + } + } + + if ($found) { + my %field_descrs = @$params; + + $desc .= < + + + + +EOF + while (@fields) { + my $field_name = shift @fields; + my $text = shift @fields; + my $field_descr = $field_descrs{$field_name}; + + $desc .= "\n$text\n"; + if (defined $field_descr) { + $desc .= "".&ExpandAbbreviations($field_descr)."\n"; + } else { + $desc .= "\n"; + } + $desc .= "\n"; + } + + $desc .= ""; + } + $desc .= "\n"; + return ($synop, $desc); +} + + +############################################################################# +# Function : OutputEnum +# Description : Returns the synopsis and detailed description of a enum. +# Arguments : $symbol - the enum. +# $declaration - the declaration of the enum. +############################################################################# + +sub OutputEnum { + my ($symbol, $declaration) = @_; + my $id = &CreateValidSGMLID ($symbol); + my $synop = "enum $symbol;\n"; + my $desc = "\n<anchor id=\"$id\">enum $symbol\n"; + $declaration = &CreateValidSGML ($declaration); + $desc .= "$declaration\n"; + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + + # Create a table of fields and descriptions + + my @members = ParseEnumDeclaration($declaration); + my $params = $SymbolParams{$symbol}; + + # If no parameters are filled in, we don't generate the description + # table, for backwards compatibility + + my $found = 0; + if (defined $params) { + for (my $i = 1; $i <= $#$params; $i += 2) { + if ($params->[$i] =~ /\S/) { + $found = 1; + last; + } + } + } + + if ($found) { + my %member_descrs = @$params; + + $desc .= < + + + + +EOF + for my $member_name (@members) { + my $member_descr = $member_descrs{$member_name}; + + $desc .= "\n$member_name\n"; + if (defined $member_descr) { + $desc .= "".&ExpandAbbreviations($member_descr)."\n"; + } else { + $desc .= "\n"; + } + $desc .= "\n"; + } + + $desc .= ""; + } + + $desc .= "\n"; + return ($synop, $desc); +} + + +############################################################################# +# Function : OutputUnion +# Description : Returns the synopsis and detailed description of a union. +# Arguments : $symbol - the union. +# $declaration - the declaration of the union. +############################################################################# + +sub OutputUnion { + my ($symbol, $declaration) = @_; + my $id = &CreateValidSGMLID ($symbol); + my $synop = "union $symbol;\n"; + my $desc = "\n<anchor id=\"$id\">union $symbol\n"; + $declaration = &CreateValidSGML ($declaration); + $desc .= "$declaration\n"; + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + $desc .= "\n"; + return ($synop, $desc); +} + + +############################################################################# +# Function : OutputVariable +# Description : Returns the synopsis and detailed description of a variable. +# Arguments : $symbol - the extern'ed variable. +# $declaration - the declaration of the variable. +############################################################################# + +sub OutputVariable { + my ($symbol, $declaration) = @_; + my $id = &CreateValidSGMLID ($symbol); + + my $synop; + if ($declaration =~ m/^\s*extern\s+((const\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)(\s*)([A-Za-z]\w*)\s*;/) { + my $mod = defined ($1) ? $1 : ""; + my $ptr = defined ($3) ? $3 : ""; + my $space = defined ($4) ? $4 : ""; + $synop = "extern $mod$ptr$space$symbol;\n"; + + } else { + $synop = "extern $symbol;\n"; + } + + my $desc = "\n<anchor id=\"$id\">$symbol\n"; + $declaration = &CreateValidSGML ($declaration); + $desc .= "$declaration\n"; + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + $desc .= "\n"; + return ($synop, $desc); +} + + +############################################################################# +# Function : OutputFunction +# Description : Returns the synopsis and detailed description of a function. +# Arguments : $symbol - the function. +# $declaration - the declaration of the function. +############################################################################# + +sub OutputFunction { + my ($symbol, $declaration, $symbol_type) = @_; + my $id = &CreateValidSGMLID ($symbol); + + # Take out the return type + $declaration =~ s/\s*(const\s+|unsigned\s+)*(\w+)\s*(\**)\s*<\/RETURNS>\n//; + my $type_modifier = defined($1) ? $1 : ""; + my $type = $2; + my $pointer = $3; + my $xref = &MakeXRef ($type); + my $start = ""; + if ($symbol_type eq 'USER_FUNCTION') { +# $start = "typedef "; + } + + my $ret_type_len = length ($start) + length ($type_modifier) + + length ($pointer) + length ($type); + my $ret_type_output; + my $symbol_len; + if ($ret_type_len < $RETURN_TYPE_FIELD_WIDTH) { + $ret_type_output = "$start$type_modifier$xref$pointer" + . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len)); + $symbol_len = 0; + } else { +# $ret_type_output = "$start$type_modifier$xref$pointer\n" +# . (' ' x $RETURN_TYPE_FIELD_WIDTH); + + $ret_type_output = "$start$type_modifier$xref$pointer "; + $symbol_len = $ret_type_len + 1 - $RETURN_TYPE_FIELD_WIDTH; + } + + $symbol_len += length ($symbol); + my $char1 = my $char2 = my $char3 = ""; + if ($symbol_type eq 'USER_FUNCTION') { + $symbol_len += 3; + $char1 = "("; + $char2 = "*"; + $char3 = ")"; + } + + my ($symbol_output, $symbol_desc_output); + if ($symbol_len < $SYMBOL_FIELD_WIDTH) { + $symbol_output = "$char1$char2$symbol$char3" + . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len)); + $symbol_desc_output = "$char1$char2$symbol$char3" + . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len)); + } else { + $symbol_output = "$char1$char2$symbol$char3\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)); + $symbol_desc_output = "$char1$char2$symbol$char3\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)); + } + + my $synop = $ret_type_output . $symbol_output . '('; + my $desc = "\n<anchor id=\"$id\">${symbol} ()\n"; + $desc .= "${ret_type_output}$symbol_desc_output("; + + my $param_num = 0; + while ($declaration ne "") { + if ($declaration =~ s/^[\s,]+//) { + # skip whitespace and commas + next; + + } elsif ($declaration =~ s/^void\s*[,\n]//) { + $synop .= "void"; + $desc .= "void"; + + } elsif ($declaration =~ s/^...\s*[,\n]//) { + if ($param_num == 0) { + $synop .= "..."; + $desc .= "..."; + } else { + $synop .= ",\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) + . " ..."; + $desc .= ",\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) + . " ..."; + } + + # allow alphanumerics, '_', '[' & ']' in param names + } elsif ($declaration =~ s/^(const\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(const\s+)?(\**)?\s*(\w+)?\s*(\[\d*\])?\s*[,\n]//) { + my $mod1 = defined($1) ? $1 : ""; + if (defined($2)) { $mod1 .= $2; } + my $type = $3; + my $ptr1 = $4; + my $mod2 = defined($5) ? $5 : ""; + my $ptr2 = $6; + my $name = defined($7) ? $7 : ""; + if ($name) { $ptr1 = " " . $ptr1; } + my $array = defined($8) ? $8 : ""; + my $xref = &MakeXRef ($type); + +# print "Type: $mod1$type $ptr1 $mod2 $name $array\n"; + if ($param_num == 0) { + $synop .= "$mod1$xref$ptr1$mod2$ptr2$name$array"; + $desc .= "$mod1$xref$ptr1$mod2$ptr2$name$array"; + } else { + $synop .= ",\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) + . " $mod1$xref$ptr1$mod2$ptr2$name$array"; + $desc .= ",\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) + . " $mod1$xref$ptr1$mod2$ptr2$name$array"; + } + + # Try to match parameters which are functions. + } elsif ($declaration =~ s/^(const\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(const\s+)?\(\s*\*\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) { + my $mod1 = defined($1) ? $1 : ""; + if (defined($2)) { $mod1 .= $2; } + my $type = $3; + my $ptr1 = $4; + my $mod2 = defined($5) ? $5 : ""; + my $name = $6; + my $func_params = $7; + my $xref = &MakeXRef ($type); + +# print "Type: $mod1$type$ptr1$mod2(*$name)($func_params)\n"; + if ($param_num == 0) { + $synop .= "$mod1$xref$ptr1$mod2 (*$name) ($func_params)"; + $desc .= "$mod1$xref$ptr1$mod2 (*$name) ($func_params)"; + } else { + $synop .= ",\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) + . " $mod1$xref$ptr1$mod2 (*$name) ($func_params)"; + $desc .= ",\n" + . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) + . " $mod1$xref$ptr1$mod2 (*$name) ($func_params)"; + } + + } else { + print "###Can't parse args for function $symbol: $declaration\n"; + last; + } + $param_num++; + } + $synop .= ");\n"; + $desc .= ");\n"; + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + + $desc .= &OutputParamDescriptions ("FUNCTION", $symbol); + $desc .= "\n"; + return ($synop, $desc); +} + + +############################################################################# +# Function : OutputParamDescriptions +# Description : Returns the DocBook output describing the parameters of a +# function, macro or signal handler. +# Arguments : $symbol_type - 'FUNCTION', 'MACRO' or 'SIGNAL'. Signal +# handlers have an implicit user_data parameter last. +# $symbol - the name of the function/macro being described. +############################################################################# + +sub OutputParamDescriptions { + my ($symbol_type, $symbol) = @_; + my $output = ""; + + if (defined ($SymbolParams{$symbol})) { + my $returns = ""; + my $params = $SymbolParams{$symbol}; + my $params_desc = ""; + if ($#$params < 0) { + print "WARNING: 0 parameters\n"; + } + my $j; + for ($j = 0; $j <= $#$params; $j += 2) { + my $param_name = $$params[$j]; + my $param = $$params[$j + 1]; + if ($param_name eq "Returns") { + $returns = &ExpandAbbreviations($param); + } else { + if ($param_name eq "Varargs") { + $param_name = "..."; + } + $param = &ExpandAbbreviations($param); + $params_desc .= "$param_name :\n$param\n"; + } + } + + # Signals have an implicit user_data parameter which we describe. + if ($symbol_type eq "SIGNAL") { + $params_desc .= "user_data :\nuser data set when the signal handler was connected.\n"; + } + + # Start a table if we need one. + if ($params_desc || $returns) { + $output .= < + + + + +EOF + + if ($params_desc ne "") { +# $output .= "Parameters:\n"; + $output .= $params_desc; + } + + # Output the returns info last. + if ($returns) { + $output .= "Returns :$returns\n"; + } + + # Finish the table. + $output .= ""; + } + } + return $output; +} + + +############################################################################# +# Function : OutputSGMLFile +# Description : Outputs the final DocBook file for one section. +# Arguments : $file - the name of the file. +# $title - the title from the $MODULE-sections.txt file, which +# will be overriden by the title in the template file. +# $section_id - the SGML id to use for the toplevel tag. +# $includes - comma-separates list of include files added at top +# of synopsis, with '<' '>' around them. +# $synopsis - reference to the DocBook for the Synopsis part. +# $details - reference to the DocBook for the Details part. +############################################################################# + +sub OutputSGMLFile { + my ($file, $title, $section_id, $includes, $synopsis, $details) = @_; + + # Find out if this is a GtkObject or descendant. + my $signals_synop = ""; + my $signals_desc = ""; + my $args_synop = ""; + my $args_desc = ""; + my $hierarchy = ""; + if (&CheckIsObject ($title)) { + ($signals_synop, $signals_desc) = &GetSignals ($title); + ($args_synop, $args_desc) = &GetArgs ($title); + $hierarchy = &GetHierarchy ($title); + } + + # The edited title overrides the one from the sections file. + my $new_title = $SymbolDocs{"$TMPL_DIR/$file:Title"}; + if (defined ($new_title) && $new_title !~ m/^\s*$/) { + $title = $new_title; +# print "Found title: $title\n"; + } + my $short_desc = $SymbolDocs{"$TMPL_DIR/$file:Short_Description"}; + if (!defined ($short_desc) || $short_desc =~ m/^\s*$/) { +# $short_desc = "one line description goes here."; + $short_desc = ""; + } else { + $short_desc = &ExpandAbbreviations($short_desc); +# print "Found short_desc: $short_desc"; + } + my $long_desc = $SymbolDocs{"$TMPL_DIR/$file:Long_Description"}; + if (!defined ($long_desc) || $long_desc =~ m/^\s*$/) { + $long_desc = "\nA longer description goes here.\n\n"; + } else { + $long_desc = &ExpandAbbreviations($long_desc); +# print "Found long_desc: $long_desc"; + } + my $see_also = $SymbolDocs{"$TMPL_DIR/$file:See_Also"}; + if (!defined ($see_also) || $see_also =~ m%^\s*()?\s*()?\s*$%) { + $see_also = ""; + } else { + $see_also = &ExpandAbbreviations($see_also); +# print "Found see_also: $see_also"; + } + if ($see_also) { + $see_also = "\nSee Also\n$see_also\n\n"; + } + + my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = + gmtime (time); + my $month = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[$mon]; + $year += 1900; + + my $include_output = ""; + my $include; + foreach $include (split (/,/, $includes)) { + $include_output .= "#include <${include}>\n"; + } + + open (OUTPUT, ">$SGML_OUTPUT_DIR/$file") + || die "Can't create $SGML_OUTPUT_DIR/$file"; + + # Note: The refname and refpurpose are on the same line to stop + # docbook-to-man 1.08 putting them on separate lines. + print OUTPUT < + +$title +3 +\U$MODULE\E Library + + + +$title$short_desc + + +Synopsis + + +$include_output + +$${synopsis} + + +$hierarchy +$args_synop +$signals_synop + + +Description +$long_desc + + + +Details +$$details + +$args_desc +$signals_desc + +$see_also + +EOF + close (OUTPUT); +} + + +############################################################################# +# Function : OutputBook +# Description : Outputs the SGML entities that need to be included into the +# main SGML file for the module. +# Arguments : $book_top - the declarations of the entities, which are added +# at the top of the main SGML file. +# $book_bottom - the references to the entities, which are +# added in the main SGML file at the desired position. +############################################################################# + +sub OutputBook { + my ($book_top, $book_bottom) = @_; + + open (OUTPUT, ">$SGML_OUTPUT_DIR/$MODULE-doc.top") + || die "Can't create $SGML_OUTPUT_DIR/$MODULE-doc.top"; + print OUTPUT $book_top; + close (OUTPUT); + + open (OUTPUT, ">$SGML_OUTPUT_DIR/$MODULE-doc.bottom") + || die "Can't create $SGML_OUTPUT_DIR/$MODULE-doc.bottom"; + print OUTPUT $book_bottom; + close (OUTPUT); +} + + +############################################################################# +# Function : CreateValidSGMLID +# Description : Creates a valid SGML 'id' from the given string. +# NOTE: SGML ids are case-insensitive, so we have a few special +# cases to avoid clashes of ids. +# Arguments : $id - the string to be converted into a valid SGML id. +############################################################################# + +sub CreateValidSGMLID { + my ($id) = $_[0]; + + # Append -CAPS to all all-caps identifiers + + # Special case, '_' would end up as '' so we use 'gettext-macro' instead. + if ($id eq "_") { return "gettext-macro"; } + + if ($id !~ /[a-z]/) { $id .= "-CAPS" }; + + $id =~ s/[_ ]/-/g; + $id =~ s/[,\.]//g; + $id =~ s/^-*//; + $id =~ s/::/-/g; + + return $id; +} + + +############################################################################# +# Function : CreateValidSGML +# Description : This turns any chars which are used in SGML into entities, +# e.g. '<' into '<' +# Arguments : $text - the text to turn into proper SGML. +############################################################################# + +sub CreateValidSGML { + my ($text) = @_; + $text =~ s/&/&/g; # Do this first, or the others get messed up. + $text =~ s//>/g; + return $text; +} + + +############################################################################# +# Function : ExpandAbbreviations +# Description : This turns the abbreviations function(), macro(), @param, +# %constant, and #symbol into appropriate DocBook markup. +# Arguments : $text - the text to expand. +############################################################################# + +sub ExpandAbbreviations { + my ($text) = @_; + + # Convert 'function()' or 'macro()' + $text =~ s/(\w+)\s*\(\)/&MakeXRef($1) . "()";/eg; + + # Convert '@param' + $text =~ s/\@(\w+)/$1<\/parameter>/g; + + # Convert '%constant'. Also allow negative numbers, e.g. %-1. + $text =~ s/\%(-?\w+)/$1<\/literal>/g; + + # Convert '#symbol' + $text =~ s/#([\w-]+)/&MakeXRef($1);/eg; + + return $text; +} + + +############################################################################# +# Function : MakeXRef +# Description : This returns a cross-reference link to the given symbol. +# Though it doesn't try to do this for a few standard C types +# that it knows won't be in the documentation. +# Arguments : $symbol - the symbol to try to create a XRef to. +############################################################################# + +sub MakeXRef { + my ($symbol) = $_[0]; +# print "Getting type link for $symbol\n"; + + # Don't create a link for some standard C types and functions, to cut + # down on the number of warnings output by jade. + if ($symbol eq "void" || $symbol eq "va_list" || $symbol eq "int" + || $symbol eq "char" || $symbol eq "printf" || $symbol eq "sprintf") { + return $symbol; + } + + my $symbol_id = &CreateValidSGMLID ($symbol); + # Get rid of special '-struct' suffix. + $symbol =~ s/-struct$//; + return "$symbol"; +} + + +############################################################################# +# Function : GetHierarchy +# Description : Returns the DocBook output describing the ancestors of a +# GtkObject subclass. It uses the global @Objects and +# @ObjectLevels arrays to walk up the tree. +# Arguments : $object - the GtkObject subclass. +############################################################################# + +sub GetHierarchy { + my ($object) = @_; + + # Find object in the objects array. + my $found = 0; + my $i; + for ($i = 0; $i < @Objects; $i++) { + if ($Objects[$i] eq $object) { + $found = 1; + last; + } + } + if (!$found) { + return ""; + } + + # Walk up the hierarchy, pushing ancestors onto the ancestors array. + my @ancestors = (); + push (@ancestors, $object); + my $level = $ObjectLevels[$i]; +# print "Level: $level\n"; + while ($level > 1) { + $i--; + if ($ObjectLevels[$i] < $level) { + push (@ancestors, $Objects[$i]); + $level = $ObjectLevels[$i]; +# print "Level: $level\n"; + } + } + + # Output the ancestors list, indented and with links. + my $hierarchy = "\n\n"; + $level = 0; + for ($i = $#ancestors; $i >= 0; $i--) { + my $link_text; + # Don't add a link to the current widget, i.e. when i == 0. + if ($i > 0) { + my $ancestor_id = &CreateValidSGMLID ($ancestors[$i]); + $link_text = "$ancestors[$i]"; + } else { + $link_text = "$ancestors[$i]"; + } + if ($level == 0) { + $hierarchy .= " $link_text\n"; + } else { +# $hierarchy .= ' ' x ($level * 6 - 3) . "|\n"; + $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n"; + } + $level++; + } + $hierarchy .= "\n"; + + return < +Object Hierarchy +$hierarchy + +EOF +} + + +############################################################################# +# Function : GetSignals +# Description : Returns the synopsis and detailed description DocBook output +# for the signal handlers of a given GtkObject subclass. +# Arguments : $object - the GtkObject subclass, e.g. 'GtkButton'. +############################################################################# + +sub GetSignals { + my ($object) = @_; + my $synop = ""; + my $desc = ""; + + my $i; + for ($i = 0; $i <= $#SignalObjects; $i++) { + if ($SignalObjects[$i] eq $object) { +# print "Found signal: $SignalNames[$i]\n"; + my $name = $SignalNames[$i]; + my $symbol = "${object}::${name}"; + my $id = &CreateValidSGMLID ("$object-$name"); + + my $name_len = length ($name) + 2; + if ($name_len < $SIGNAL_FIELD_WIDTH) { + $synop .= ""$name"" + . (' ' x ($SIGNAL_FIELD_WIDTH - $name_len)); + } else { + $synop .= ""$name"\n" + . (' ' x $SIGNAL_FIELD_WIDTH); + } + + $desc .= "<anchor id=\"$id\">The "$name" signal\n"; + $desc .= ""; + + $SignalReturns[$i] =~ m/\s*(const\s*)?(\w+)\s*(\**)/; + my $type_modifier = defined($1) ? $1 : ""; + my $type = $2; + my $pointer = $3; + my $xref = &MakeXRef ($type); + + my $ret_type_len = length ($type_modifier) + length ($pointer) + + length ($type); + my $ret_type_output = "$type_modifier$xref$pointer" + . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len)); + + $synop .= "${ret_type_output}user_function ("; + $desc .= "${ret_type_output}user_function ("; + + my @params = split ("\n", $SignalPrototypes[$i]); + my $j; + for ($j = 0; $j <= $#params; $j++) { + # allow alphanumerics, '_', '[' & ']' in param names + if ($params[$j] =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)\s*$/) { + $type = $1; + $pointer = $2; + $name = $3; + $xref = &MakeXRef ($type); + $synop .= "$xref $pointer$name,\n"; + $synop .= (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)); + $desc .= "$xref $pointer$name,\n"; + $desc .= (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)); + } else { + print "###Can't parse arg: $params[$j]\nArgs:$SignalPrototypes[$i]\n"; + } + } + $xref = &MakeXRef ("gpointer"); + $synop .= "$xref user_data);\n"; + $desc .= "$xref user_data);\n"; + + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } + + $desc .= &OutputParamDescriptions ("SIGNAL", $symbol); + $desc .= ""; + } + } + if ($synop ne '') { + $synop = < +Signal Prototypes + + +${synop} + +EOF + $desc = < +Signals +$desc + +EOF + } + return ($synop, $desc); +} + + +############################################################################# +# Function : GetArgs +# Description : Returns the synopsis and detailed description DocBook output +# for the Args of a given GtkObject subclass. +# Arguments : $object - the GtkObject subclass, e.g. 'GtkButton'. +############################################################################# + +sub GetArgs { + my ($object) = @_; + my $synop = ""; + my $desc = ""; + + my $i; + for ($i = 0; $i <= $#ArgObjects; $i++) { + if ($ArgObjects[$i] eq $object) { +# print "Found arg: $ArgNames[$i]\n"; + my $name = $ArgNames[$i]; + # Remember only one colon so we don't clash with signals. + my $symbol = "${object}:${name}"; + # I've used two dashes here for the same reason. + my $id = &CreateValidSGMLID ("$object--$name"); + + my $type = $ArgTypes[$i]; + my $type_output; + + if ($type eq "GtkSignal") { + $type = "GtkSignalFunc, gpointer"; + $type_output = &MakeXRef ("GtkSignalFunc") . ", " + . &MakeXRef ("gpointer"); + } elsif ($type eq "GtkString") { + $type = "gchar*"; + $type_output = &MakeXRef ("gchar") . "*"; + } else { + $type_output = &MakeXRef ($type); + } + + my $flags = $ArgFlags[$i]; + my $flags_string = ""; + + if ($flags =~ m/r/) { + $flags_string = "Read"; + } + if ($flags =~ m/w/) { + if ($flags_string) { $flags_string .= " / "; } + $flags_string .= "Write"; + } + if ($flags =~ m/x/) { + if ($flags_string) { $flags_string .= " / "; } + $flags_string .= "Construct"; + } + if ($flags =~ m/X/) { + if ($flags_string) { $flags_string .= " / "; } + $flags_string .= "Construct Only"; + } + if ($flags =~ m/c/) { + if ($flags_string) { $flags_string .= " / "; } + $flags_string .= "Child"; + } + + my $pad1 = " " x (20 - length ($name)); + my $pad2 = " " x (20 - length ($type)); + $synop .= " "$name"$pad1 $type_output$pad2 : $flags_string\n"; + + $desc .= ""$name" ($type_output : $flags_string)\n\n"; + + if (defined ($SymbolDocs{$symbol})) { + $desc .= &ExpandAbbreviations($SymbolDocs{$symbol}); + } else { + $desc .= "\n"; + } + + $desc .= "\n"; + } + } + if ($synop ne '') { + $synop = < +Args + + +${synop} + +EOF + $desc = < +Args + +$desc + + +EOF + } + return ($synop, $desc); +} + + +############################################################################# +# Function : ReadSourceDocumentation +# Description : This reads in the documentation embedded in comment blocks +# in the source code (for Gnome). +# +# Parameter descriptions override any in the template files. +# Function descriptions are placed before any description from +# the template files. +# +# It recursively descends the source directory looking for .c +# files and scans them looking for specially-formatted comment +# blocks. +# +# Arguments : $source_dir - the directory to scan. +############################################################################# + +sub ReadSourceDocumentation { + my ($source_dir) = @_; +# print "Scanning source directory: $source_dir\n"; + + # This array holds any subdirectories found. + my (@subdirs) = (); + + opendir (SRCDIR, $source_dir) + || die "Can't open source directory $source_dir: $!"; + my $file; + foreach $file (readdir (SRCDIR)) { + if ($file =~ /^\./) { + next; + } elsif (-d "$source_dir/$file") { + push (@subdirs, $file); + } elsif ($file =~ m/\.c$/) { + &ScanSourceFile ("$source_dir/$file"); + } + } + closedir (SRCDIR); + + # Now recursively scan the subdirectories. + my $dir; + foreach $dir (@subdirs) { + &ReadSourceDocumentation ("$source_dir/$dir"); + } +} + + +############################################################################# +# Function : ScanSourceFile +# Description : Scans one source file looking for specially-formatted comment +# blocks. It calls &MergeSourceDocumentation to merge any +# documentation found with the documentation already read in +# from the template files. +# +# Arguments : $file - the file to scan. +############################################################################# + +sub ScanSourceFile { + my ($file) = @_; + +# print "Scanning source file: $file\n"; + + open (SRCFILE, $file) + || die "Can't open $file: $!"; + my $in_comment_block = 0; + my $symbol; + my ($in_description, $in_return); + my ($description, $return_desc, $return_start); + my $current_param; + my @params; + while () { + # Look for the start of a comment block. + if (!$in_comment_block) { + if (m%^\s*/\*\*\s%) { +# print "Found comment block start\n"; + $in_comment_block = 1; + + # Reset all the symbol data. + $symbol = ""; + $in_description = 0; + $in_return = 0; + $description = ""; + $return_desc = ""; + $current_param = -1; + @params = (); + } + next; + } + + # We're in a comment block. Check if we've found the end of it. + if (m%^\s*\*+/%) { +# print "Found comment block end: $symbol\n"; + if (!$symbol) { + print <\n\n%g) { +# print "Converted blank lines:\n$src_doc\n"; + } + $SymbolDocs{$symbol} = "\n$src_doc\n$tmpl_doc"; + + # The templates contain the definitive parameter names and order, + # so we will not change that. We only override the actual text. + my $tmpl_params = $SymbolParams{$symbol}; + if (!defined ($tmpl_params)) { + next; + } + + my $params = $SourceSymbolParams{$symbol}; + my $j; + for ($j = 0; $j <= $#$tmpl_params; $j += 2) { + my $tmpl_param_name = $$tmpl_params[$j]; + my $tmpl_param_desc = $$tmpl_params[$j + 1]; + + # Try to find the param in the source comment documentation. + my $found = 0; + my $k; + for ($k = 0; $k <= $#$params; $k += 2) { + my $param_name = $$params[$k]; + my $param_desc = $$params[$k + 1]; + + # We accept changed in case, since the Gnome source docs + # contain a lot of these. + if ("\L$param_name" eq "\L$tmpl_param_name") { + $found = 1; + + # Override the description. + $$tmpl_params[$j + 1] = &CreateValidSGML ($param_desc); + + # Set the name to "" to mark it as used. + $$params[$k] = ""; + last; + } + } + + # Output a warning if the parameter is not found. + if (!$found) { + print <) { + if (!$declaration_type) { + if (m/^<([^>]+)>/) { + $declaration_type = $1; + $declaration_name = ""; +# print "Found declaration: $declaration_type\n"; + $declaration = ""; + } + } else { + if (m%^(.*)%) { + $declaration_name = $1; + } elsif (m%^%) { +# print "Found end of declaration: $declaration_name\n"; + # Check that the declaration has a name + if ($declaration_name eq "") { + print "ERROR: $declaration_type has no name $file:$.\n"; + } + + # Check if the symbol is already defined. + if (defined ($Declarations{$declaration_name}) + && $override == 0) { + # Function declarations take precedence. + if ($DeclarationTypes{$declaration_name} eq 'FUNCTION') { + # Ignore it. + } elsif ($declaration_type eq 'FUNCTION') { + $Declarations{$declaration_name} = $declaration; + $DeclarationTypes{$declaration_name} = $declaration_type; + } elsif ($DeclarationTypes{$declaration_name} + eq $declaration_type) { + # If the existing declaration is empty override it. + if ($declaration_type eq 'STRUCT') { + if ($Declarations{$declaration_name} =~ m/^\s*$/) { + $Declarations{$declaration_name} = $declaration; + } elsif ($declaration =~ m/^\s*$/) { + # Ignore an empty declaration. + } else { + print "WARNING: Structure has multiple definitions: $declaration_name\n"; + } + + } else { + # set flag in %DeclarationConditional hash for + # multiply defined macros/typedefs. + $DeclarationConditional{$declaration_name} = 1; + } + } else { + print "ERROR: $declaration_name has multiple definitions\n"; + } + } else { + $Declarations{$declaration_name} = $declaration; + $DeclarationTypes{$declaration_name} = $declaration_type; + } + $declaration_type = ""; + } else { + $declaration .= $_; + } + } + } + close (INPUT); +} + + +############################################################################# +# Function : ReadSignalsFile +# Description : This reads in an existing file which contains information on +# all GTK signals. It creates the arrays @SignalNames and +# @SignalPrototypes containing info on the signals. The first +# line of the SignalPrototype is the return type of the signal +# handler. The remaining lines are the parameters passed to it. +# The last parameter, "gpointer user_data" is always the same +# so is not included. +# Arguments : $file - the file containing the signal handler prototype +# information. +############################################################################# + +sub ReadSignalsFile { + my ($file) = @_; + + my $in_signal = 0; + my $signal_object; + my $signal_name; + my $signal_returns; + my $signal_prototype; + + # Reset the signal info. + @SignalObjects = (); + @SignalNames = (); + @SignalReturns = (); + @SignalPrototypes = (); + + if (! -f $file) { + return; + } + if (!open (INPUT, $file)) { + warn "Can't open $file - skipping signals\n"; + return; + } + while () { + if (!$in_signal) { + if (m/^/) { + $in_signal = 1; + $signal_object = ""; + $signal_name = ""; + $signal_returns = ""; + $signal_prototype = ""; + } + } else { + if (m/^(.*)<\/NAME>/) { + $signal_name = $1; + if ($signal_name =~ m/^(.*)::(.*)$/) { + $signal_object = $1; + $signal_name = $2; +# print "Found signal: $signal_name\n"; + } else { + print "Invalid signal name: $signal_name\n"; + } + } elsif (m/^(.*)<\/RETURNS>/) { + $signal_returns = $1; + } elsif (m%^%) { +# print "Found end of signal: ${signal_object}::${signal_name}\nReturns: ${signal_returns}\n${signal_prototype}"; + push (@SignalObjects, $signal_object); + push (@SignalNames, $signal_name); + push (@SignalReturns, $signal_returns); + push (@SignalPrototypes, $signal_prototype); + $in_signal = 0; + } else { + $signal_prototype .= $_; + } + } + } + close (INPUT); +} + + +############################################################################# +# Function : ReadTemplateFile +# Description : This reads in the manually-edited documentation file +# corresponding to the file currently being created, so we can +# insert the documentation at the appropriate places. +# It outputs %SymbolTypes, %SymbolDocs and %SymbolParams, which +# is a hash of arrays. +# NOTE: This function is duplicated in gtkdoc-mkdb (but +# slightly different). +# Arguments : $docsfile - the template file to read in. +# $skip_unused_params - 1 if the unused parameters should be +# skipped. +############################################################################# + +sub ReadTemplateFile { + my ($docsfile, $skip_unused_params) = @_; + +# print "Reading $docsfile\n"; + if (! -f $docsfile) { + print "File doesn't exist: $docsfile\n"; + return; + } + + my $current_type = ""; # Type of symbol being read. + my $current_symbol = ""; # Name of symbol being read. + my $symbol_doc = ""; # Description of symbol being read. + my @params; # Parameter names and descriptions of current + # function/macro/function typedef. + my $current_param = -1; # Index of parameter currently being read. + # Note that the param array contains pairs + # of param name & description. + my $in_unused_params = 0; # True if we are reading in the unused params. + + open (DOCS, $docsfile) + || die "Can't open file $docsfile: $!"; + while () { + if (m/^/) { + my $type = $1; + my $symbol = $2; + if ($symbol eq "Title" + || $symbol eq "Short_Description" + || $symbol eq "Long_Description" + || $symbol eq "See_Also") { + $symbol = $docsfile . ":" . $symbol; +# print "Found symbol: $symbol\n"; + } + + # Store previous symbol, but remove any trailing blank lines. + if ($current_symbol ne "") { + $symbol_doc =~ s/\s+$//; + $SymbolTypes{$current_symbol} = $current_type; + $SymbolDocs{$current_symbol} = $symbol_doc; + if ($current_param >= 0) { + $SymbolParams{$current_symbol} = [ @params ]; + } else { + # Delete any existing params in case we are overriding a + # previously read template. + delete $SymbolParams{$current_symbol}; + } + } + $current_type = $type; + $current_symbol = $symbol; + $current_param = -1; + $in_unused_params = 0; + $symbol_doc = ""; + @params = (); + + } elsif (m/^/) { +# print "DEBUG: Found unused parameters\n"; + $in_unused_params = 1; + next; + + } elsif ($in_unused_params && $skip_unused_params) { + # When outputting the DocBook we skip unused parameters. +# print "DEBUG: Skipping unused param: $_"; + next; + + } else { + # Check if param found + if (s/^\@(\S+):\s*//) { + my $param_name = $1; + # Allow variations of 'Returns' + if ($param_name =~ m/^[Rr]eturns?$/) { + $param_name = "Returns"; + } +# print "Found param: $param_name\n"; + push (@params, $param_name); + push (@params, $_); + $current_param += 2; + next; + } + + if ($current_param >= 0) { + $params[$current_param] .= $_; + } else { + $symbol_doc .= $_; + } + } + } + + # Remember to finish the current symbol doccs. + if ($current_symbol ne "") { + $symbol_doc =~ s/\s+$//; + $SymbolTypes{$current_symbol} = $current_type; + $SymbolDocs{$current_symbol} = $symbol_doc; + if ($current_param >= 0) { + $SymbolParams{$current_symbol} = [ @params ]; + } else { + delete $SymbolParams{$current_symbol}; + } + } + + close (DOCS); +} + + +############################################################################# +# Function : ReadObjectHierarchy +# Description : This reads in the $MODULE-hierarchy.txt file containing all +# the GtkObject subclasses described in this module (and their +# ancestors). +# It places them in the @Objects array, and places their level +# in the widget hierarchy in the @ObjectLevels array, at the +# same index. GtkObject, the root object, has a level of 1. +# +# FIXME: the version in gtkdoc-mkdb also generates tree_index.sgml +# as it goes along, this should be split out into a separate +# function. +# +# Arguments : none +############################################################################# + +sub ReadObjectHierarchy { + @Objects = (); + @ObjectLevels = (); + + if (! -f $OBJECT_TREE_FILE) { + return; + } + if (!open (INPUT, $OBJECT_TREE_FILE)) { + warn "Can't open $OBJECT_TREE_FILE - skipping object tree\n"; + return; + } + open (OUTPUT, ">$SGML_OUTPUT_DIR/tree_index.sgml") + || die "Can't create $SGML_OUTPUT_DIR/tree_index.sgml"; + print (OUTPUT "\n"); + + while () { + if (m/\S+/) { + my $object = $&; + my $level = (length($`)) / 2 + 1; +# print ("Level: $level Object: $object\n"); + + my $xref = &MakeXRef ($object); + print (OUTPUT ' ' x ($level * 4), "$xref\n"); + push (@Objects, $object); + push (@ObjectLevels, $level); + } + } + print (OUTPUT "\n"); + + close (INPUT); + close (OUTPUT); + + &OutputObjectList; +} + + +############################################################################# +# Function : ReadArgsFile +# Description : This reads in an existing file which contains information on +# all GTK args. It creates the arrays @ArgObjects, @ArgNames, +# @ArgTypes and @ArgFlags containing info on the args. +# Arguments : $file - the file containing the arg information. +############################################################################# + +sub ReadArgsFile { + my ($file) = @_; + + my $in_arg = 0; + my $arg_object; + my $arg_name; + my $arg_type; + my $arg_flags; + + # Reset the signal info. + @ArgObjects = (); + @ArgNames = (); + @ArgTypes = (); + @ArgFlags = (); + + if (! -f $file) { + return; + } + if (!open (INPUT, $file)) { + warn "Can't open $file - skipping args\n"; + return; + } + while () { + if (!$in_arg) { + if (m/^/) { + $in_arg = 1; + $arg_object = ""; + $arg_name = ""; + $arg_type = ""; + $arg_flags = ""; + } + } else { + if (m/^(.*)<\/NAME>/) { + $arg_name = $1; + if ($arg_name =~ m/^(.*)::(.*)$/) { + $arg_object = $1; + $arg_name = $2; +# print "Found arg: $arg_name\n"; + } else { + print "Invalid arg name: $arg_name\n"; + } + } elsif (m/^(.*)<\/TYPE>/) { + $arg_type = $1; + } elsif (m/^(.*)<\/FLAGS>/) { + $arg_flags = $1; + } elsif (m%^%) { +# print "Found end of arg: ${arg_object}::${arg_name}\n${arg_type} : ${arg_flags}\n"; + push (@ArgObjects, $arg_object); + push (@ArgNames, $arg_name); + push (@ArgTypes, $arg_type); + push (@ArgFlags, $arg_flags); + $in_arg = 0; + } + } + } + close (INPUT); +} + + +############################################################################# +# Function : CheckIsObject +# Description : Returns 1 if the given name is a GtkObject or a subclass. +# It uses the global @Objects array. +# Note that the @Objects array only contains classes in the +# current module and their ancestors - not all GTK classes. +# Arguments : $name - the name to check. +############################################################################# + +sub CheckIsObject { + my ($name) = @_; + + my $object; + foreach $object (@Objects) { + if ($object eq $name) { + return 1; + } + } + return 0; +} + + +############################################################################# +# Function : ParseStructDeclaration +# Description : This function takes a structure declaration and +# breaks it into individual type declarations. +# Arguments : $declaration - the declaration to parse +# $is_object - true if this is an object structure +# $typefunc - function reference to apply to type +# $namefunc - function reference to apply to name +############################################################################# + +sub ParseStructDeclaration { + my ($declaration, $is_object, $typefunc, $namefunc) = @_; + + # Remove all private parts of the declaration + + # For objects, assume private + if ($is_object) { + $declaration =~ s!(struct\s+\w*\s*\{) + .*? + (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!$1!msgx; + } + + $declaration =~ s!\n?[ \t]*/\*\s*<\s*private\s*>\s*\*/ + .*? + (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!!msgx; + + # Remove all other comments; + $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g; + + my @result = (); + + if ($declaration =~ /^\s*$/) { + return @result; + } + + # Prime match after "struct {" declaration + if (!scalar($declaration =~ m/struct\s+\w*\s*\{/msg)) { + die "Structure declaration '$declaration' does not begin with struct [NAME] {\n"; + } + + # Treat lines in sequence, allowing singly nested anonymous structs + # and unions. + while ($declaration =~ m/\s*([^{;]+(\{[^\}]*\}[^{;]+)?);/msg) { + my $line = $1; + + last if $line =~ /^\s*\}\s*\w*\s*$/; + + # FIXME: Just ignore nested structs and unions for now + next if $line =~ /{/; + + # FIXME: The regexes here are the same as in OutputFunction; + # this functionality should be separated out. + + if ($line =~ m/^ + (const\s+|unsigned\s+)*(struct\s+)? # mod1 + (\w+)\s* # type + (\**)\s* # ptr1 + (const\s+)? # mod2 + (\**)?\s* # ptr2 + (\w+(?:\s*,\s*\w+)*)\s* # name + (?:((?:\[[^\]]*\]\s*)+) | # array + (:\s*\d+))?\s* # bits + $/x) { + my $mod1 = defined($1) ? $1 : ""; + if (defined($2)) { $mod1 .= $2; } + my $type = $3; + my $ptr1 = $4; + my $mod2 = defined($5) ? $5 : ""; + my $ptr2 = $6; + my $name = $7; + $ptr1 = " " . $ptr1; + my $array = defined($8) ? $8 : ""; + my $bits = defined($9) ? " $9" : ""; + my $ptype = defined $typefunc ? $typefunc->($type) : $type; + + # FIXME: + # As a hack, we allow the "name" to be of the form + # "a, b, c". This isn't the correct C syntax, but + # at least we get "gint16 x, y" right. Such constructs + # should really be completely removed from the source. + # Or we should really try to understand the C syntax + # here... + + my @names = split /\s*,\s*/, $name; + for my $n (@names) { + push @result, $n; + if (defined $namefunc) { + $n = $namefunc->($n); + } + push @result, "$mod1$ptype$ptr1$mod2$ptr2$n$array$bits"; + } + + # Try to match structure members which are functions + } elsif ($line =~ m/^ + (const\s+|unsigned\s+)*(struct\s+)? # mod1 + (\w+)\s* # type + (\**)\s* # ptr1 + (const\s+)? # mod2 + \(\s*\*\s*(\w+)\s*\)\s* # name + \(([^)]*)\)\s* # func_params + $/x) { + + my $mod1 = defined($1) ? $1 : ""; + if (defined($2)) { $mod1 .= $2; } + my $type = $3; + my $ptr1 = $4; + my $mod2 = defined($5) ? $5 : ""; + my $name = $6; + my $func_params = $7; + my $ptype = defined $typefunc ? $typefunc->($type) : $type; + my $pname = defined $namefunc ? $namefunc->($name) : $name; + + push @result, $name; + push @result, "$mod1$ptype$ptr1$mod2 (*$pname) ($func_params)"; + + } else { + warn "Cannot parse structure field $line"; + } + } + + return @result; +} + + +############################################################################# +# Function : ParseEnumDeclaration +# Description : This function takes a enumeration declaration and +# breaks it into individual enum member declarations. +# Arguments : $declaration - the declaration to parse +############################################################################# + +sub ParseEnumDeclaration { + my ($declaration, $is_object) = @_; + + # Remove comments; + $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g; + + my @result = (); + + if ($declaration =~ /^\s*$/) { + return @result; + } + + # Remove parenthesized expressions (in macros like GTK_BLAH = BLAH(1,3)) + # to avoid getting confused by commas they might contain. This + # doesn't handle nested parentheses correctly. + + $declaration =~ s/\([^)]+\)//g; + + # Prime match after "typedef enum {" declaration + if (!scalar($declaration =~ m/typedef\s+enum\s*\{/msg)) { + die "Enum declaration '$declaration' does not begin with typedef enum {\n"; + } + + # Treat lines in sequence. + while ($declaration =~ m/\s*([^,\}]+)([,\}])/msg) { + my $line = $1; + my $terminator = $2; + + if ($line =~ m/^(\w+)\s*(=.*)?$/msg) { + push @result, $1; + + # Special case for GIOCondition, where the values are specified by + # macros which expand to include the equal sign like '=1'. + } elsif ($line =~ m/^(\w+)\s*GLIB_SYSDEF_POLL/msg) { + push @result, $1; + + # Special case include of , just ignore it + } elsif ($line =~ m/^#include/) { + last; + + } else { + warn "Cannot parse enumeration member $line"; + } + + last if $terminator eq '}'; + } + + return @result; +} diff --git a/docs/plugins/gstdoc-mktmpl b/docs/plugins/gstdoc-mktmpl new file mode 100755 index 0000000000..159c30de68 --- /dev/null +++ b/docs/plugins/gstdoc-mktmpl @@ -0,0 +1,1346 @@ +#!/usr/bin/perl -w +# +# gtk-doc - GTK DocBook documentation generator. +# Copyright (C) 1998 Damon Chaplin +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +############################################################################# +# Script : gtkdoc-mktmpl +# Description : This creates or updates the template files which contain the +# manually-edited documentation. (A 'template' is a simple text +# form which is filled in with the description of a function, +# macro, enum, or struct. For functions and macros it also +# contains fields for describing the parameters.) +# +# This script reads in the existing templates, found in +# tmpl/*.sgml, moves these files to tmpl/*.sgml.bak, and then +# recreates the .sgml files according to the structure given in +# the file $MODULE-sections.txt. +# +# Any new templates added, or new function parameters, are +# marked with 'FIXME' so you can do a grep to see which parts +# need updating. +# +# Any templates which are no longer used (i.e. they are remove +# from $MODULE-sections.txt) are placed in the file +# tmpl/$MODULE-unused.txt. If they are included again later +# they are automatically copied back into position. +# If you are certain that these templates will never be used +# again you can delete them from $MODULE-unused.txt. +# +# Any parameters to functions which are no longer used are +# separated from the rest of the parameters with the line +# ''. It may be that the parameter +# name has just been changed, in which case you can copy the +# description to the parameter with the new name. You can delete +# the unused parameter descriptions when no longer needed. +############################################################################# + +use strict; +use Getopt::Long; + +# Options + +# name of documentation module +my $MODULE; +my $TMPL_DIR; +my $FLAG_CHANGES; + +my %optctl = (module => \$MODULE, + 'flag-changes' => \$FLAG_CHANGES, + 'output-dir' => \$TMPL_DIR); +GetOptions(\%optctl, "module=s", "flag-changes!", "output-dir:s"); + +my $ROOT_DIR = "."; + +# The directory containing the template files. +$TMPL_DIR = $TMPL_DIR ? $TMPL_DIR : "$ROOT_DIR/tmpl"; + +# This file contains the object hierarchy. +my $OBJECT_TREE_FILE = "$ROOT_DIR/$MODULE.hierarchy"; + +# The file containing signal handler prototype information. +my $SIGNALS_FILE = "$ROOT_DIR/$MODULE.signals"; + +# The file containing Arg information. +my $ARGS_FILE = "$ROOT_DIR/$MODULE.args"; + +# Set the flag to indicate changes, if requested. +my $CHANGES_FLAG = $FLAG_CHANGES ? "FIXME" : ""; + +# These global arrays store information on signals. Each signal has an entry +# in each of these arrays at the same index, like a multi-dimensional array. +my @SignalObjects; # The GtkObject which emits the signal. +my @SignalNames; # The signal name. +my @SignalReturns; # The return type. +my @SignalPrototypes; # The rest of the prototype of the signal handler. + +# These global arrays store information on Args. Each Arg has an entry +# in each of these arrays at the same index, like a multi-dimensional array. +my @ArgObjects; # The GtkObject which has the Arg. +my @ArgNames; # The Arg name. +my @ArgTypes; # The Arg type - gint, GtkArrowType etc. +my @ArgFlags; # How the Arg can be used - readable/writable etc. + +# These global hashes store declaration info keyed on a symbol name. +my %Declarations; +my %DeclarationTypes; +my %DeclarationConditional; +my %DeclarationOutput; + +# These global hashes store the existing documentation. +my %SymbolDocs; +my %SymbolTypes; +my %SymbolParams; + +# These global arrays store GtkObject and subclasses and the hierarchy. +my @Objects; +my @ObjectLevels; + +&ReadSignalsFile ($SIGNALS_FILE); +&ReadArgsFile ($ARGS_FILE); +&ReadObjectHierarchy; + +&ReadExistingTemplates; +&BackupExistingTemplates; +&UpdateTemplates ("$ROOT_DIR/$MODULE-sections.txt"); +&OutputUnusedTemplates; +&CheckAllDeclarationsOutput; + + +############################################################################# +# Function : ReadExistingTemplates +# Description : This reads in all the existing documentation, into the global +# variables %SymbolDocs, %SymbolTypes, and %SymbolParams (a +# hash of arrays). +# Arguments : none +############################################################################# + +sub ReadExistingTemplates { + %SymbolDocs = (); + %SymbolTypes = (); + %SymbolParams = (); + + # Read the unused docs first, so they get overridden by any real docs. + # (though this shouldn't happen often). + my $unused_doc = "$TMPL_DIR/$MODULE-unused.sgml"; + if (-e $unused_doc) { + &ReadTemplateFile ($unused_doc, 0); + } + + while (<$TMPL_DIR/*.sgml>) { +# print "Reading $_\n"; + if ($_ eq $unused_doc) { +# print "skipping $unused_doc\n"; + } else { + &ReadTemplateFile ($_, 0); + } + } +} + + +############################################################################# +# Function : BackupExistingTemplates +# Description : This moves all existing .sgml to .sgml.bak. +# Arguments : none +############################################################################# + +sub BackupExistingTemplates { + while (<$TMPL_DIR/*.sgml>) { + my $backup_file = $_ . ".bak"; +# print "Backing up $_ to $backup_file\n"; + if (-e $backup_file) { + unlink ($backup_file) + || die "Can't delete old backup file: $backup_file"; + } + rename ($_, $backup_file) + || die "Can't move $_ to $backup_file"; + } +} + + +############################################################################# +# Function : UpdateTemplates +# Description : This collects the output for each section of the docs, and +# outputs each file when the end of the section is found. +# Arguments : $file - the file containing the sections of the docs. +############################################################################# + +sub UpdateTemplates { + my ($file) = @_; +# print "Reading: $file\n"; + + open (INPUT, $file) + || die "Can't open $file"; + + # Create the top output directory if it doesn't exist. + if (! -e $TMPL_DIR) { + mkdir ("$TMPL_DIR", 0777) + || die "Can't create directory: $TMPL_DIR"; + } + + my $title = ""; + my $subsection = ""; + my $output; + while () { + if (m/^#/) { + next; + + } elsif (m/^
/) { + $output = ""; + + } elsif (m/^/i) { + $subsection = $1; + next; + + } elsif (m/^(.*)<\/TITLE>/) { + $title = $1; +# print "Section: $title\n"; + + # We don't want warnings if object & class structs aren't used. +# $DeclarationOutput{$title} = 1; + $DeclarationOutput{"${title}Class"} = 1; + + } elsif (m/^<FILE>(.*)<\/FILE>/) { + $file = $1; + + } elsif (m/^<INCLUDE>(.*)<\/INCLUDE>/) { + next; + + } elsif (m/^<\/SECTION>/) { + if ($title eq "") { + $title = $file; + } +# print "End of section: $title\n"; + + $file =~ s/\s/_/g; + $file .= ".sgml"; + + &OutputTemplateFile ($file, $title, \$output); + + $title = ""; + $subsection = ""; + + } elsif (m/^(\S+)/) { + my $symbol = $1; +# print " Symbol: $symbol\n"; + + my $declaration = $Declarations{$1}; + if (defined ($declaration)) { + # We don't want templates for standard macros/functions of + # GtkObjects or private declarations. + if ($subsection ne "Standard" && $subsection ne "Private") { + $output .= &OutputDeclaration ($DeclarationTypes {$symbol}, + $symbol, $declaration); + } + + # Note that the declaration has been output. + $DeclarationOutput{$symbol} = 1; + + if ($declaration eq '##conditional##') { +# print "Conditional $DeclarationTypes{$symbol}\n"; + } + } else { + print "WARNING: No declaration for: $1\n"; + } + } + } + close (INPUT); +} + + +############################################################################# +# Function : CheckAllDeclarationsOutput +# Description : This steps through all the declarations that were loaded, and +# makes sure that each one has been output, by checking the +# corresponding flag in the %DeclarationOutput hash. It is +# intended to check that any new declarations in new versions +# of GTK/Gnome get added to the $MODULE-sections.txt file. +# Arguments : none +############################################################################# + +sub CheckAllDeclarationsOutput { + my $num_unused = 0; + open (UNUSED, ">$ROOT_DIR/$MODULE-unused.txt") + || die "Can't open $ROOT_DIR/$MODULE-unused.txt"; + my ($symbol); + foreach $symbol (keys (%Declarations)) { + if (!defined ($DeclarationOutput{$symbol})) { + print (UNUSED "$symbol\n"); + $num_unused++; + } + } + close (UNUSED); + if ($num_unused != 0) { + print <<EOF; +============================================================================= +WARNING: $num_unused unused declarations. + These can be found in $MODULE-unused.txt. + They should be added to $MODULE-sections.txt in the appropriate place. +============================================================================= +EOF + } +} + + +############################################################################# +# Function : OutputDeclaration +# Description : This returns the template for one symbol & declaration. +# Note that it uses the global %SymbolDocs and %SymbolParams to +# lookup any existing documentation. +# Arguments : $type - the type of the symbol ('FUNCTION'/'MACRO' etc.) +# $symbol - the symbol name. +# $declaration - the declaration of the symbol. +############################################################################# + +sub OutputDeclaration { + my ($type, $symbol, $declaration) = @_; + my ($output) = ""; + +# print "Outputting $type: $symbol\n"; + + # See if symbol already has a description. + my ($symbol_desc) = $SymbolDocs{$symbol}; + my ($template_exists); + if (defined ($symbol_desc)) { + $template_exists = 1; + $symbol_desc =~ s/\s+$//; + } else { + $template_exists = 0; + $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>"; + } + + $output .= <<EOF; +<!-- ##### $type $symbol ##### --> +$symbol_desc + +EOF + + # For functions, function typedefs and macros, we output the arguments. + # For functions and function typedefs we also output the return value. + if ($type eq "FUNCTION" || $type eq "USER_FUNCTION") { + # Take out the return type + $declaration =~ s/<RETURNS>\s*(const\s+|unsigned\s+)*(\w+)\s*(\**)\s*<\/RETURNS>\n//; + my ($ret_type) = $2; + + my ($param_num) = 0; + my ($name); + while ($declaration ne "") { + if ($declaration =~ s/^[\s,]+//) { + # skip whitespace and commas + next; + + } elsif ($declaration =~ s/^void\s*[,\n]//) { + if ($param_num != 0) { + print "WARNING: void used as parameter in function $symbol\n"; + } + + } elsif ($declaration =~ s/^...\s*[,\n]//) { + $output .= &OutputParam ($symbol, "Varargs", + $template_exists, 1, ""); + + # Try to match a standard parameter. + } elsif ($declaration =~ s/^(const\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(const\s+)?(\**)?\s*(\w+)?\s*(\[\d*\])?\s*[,\n]//) { + if (defined ($7)) { + $name = $7; + } else { + $name = "Param" . ($param_num + 1); + } + $output .= &OutputParam ($symbol, $name, $template_exists, 1, + ""); + + # Try to match parameters which are functions. + } elsif ($declaration =~ s/^(const\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(const\s+)?\(\s*\*\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) { + $name = $6; + $output .= &OutputParam ($symbol, $name, $template_exists, 1, + ""); + + } else { + print "###Can't parse args for function $symbol: $declaration\n"; + last; + } + $param_num++; + } + + + if ($ret_type ne "void") { + $output .= &OutputParam ($symbol, "Returns", $template_exists, 1, + ""); + } + $output .= &OutputOldParams ($symbol); + $output .= "\n"; + } + + if ($type eq "MACRO") { + if ($declaration =~ m/^\s*#\s*define\s+\w+\(([^\)]*)\)/) { + my ($param); + foreach $param (split (/,/, $1)) { + $param =~ s/^\s+//; + $param =~ s/\s*$//; + if ($param =~ m/\S/) { + $output .= &OutputParam ($symbol, $param, $template_exists, + 1, ""); + } + } + } + $output .= &OutputParam ($symbol, "Returns", $template_exists, 0, ""); + $output .= &OutputOldParams ($symbol); + $output .= "\n"; + } + + if ($type eq "STRUCT") { + my $is_object_struct = CheckIsObject ($symbol); + my @fields = ParseStructDeclaration($declaration, $is_object_struct); + + for (my $i = 0; $i <= $#fields; $i += 2) { + my $field_name = $fields[$i]; + $output .= &OutputParam ($symbol, $field_name, $template_exists, 1, ""); + } + } + + if ($type eq "ENUM") { + my @members = ParseEnumDeclaration($declaration); + + for my $member (@members) { + $output .= &OutputParam ($symbol, $member, $template_exists, 1, ""); + } + } + + $output .= "\n"; + + # Remove the used docs from the hashes. + if ($template_exists) { + delete $SymbolDocs{$symbol}; + delete $SymbolParams{$symbol}; + } + + return $output; +} + + +############################################################################# +# Function : OutputParam +# Description : This outputs the part of a template for one parameter. +# It first checks if the parameter is already described, and if +# so it uses that description, and clears it so it isn't output +# as an old param. +# Arguments : $symbol - the symbol (function or macro) name. +# $param_to_output - the parameter to add. +# $template_exists - TRUE if the template already existed in +# template files. If it did, then we will flag any changes +# with 'FIXME'. +# $force_output - TRUE if the parameter should be output even +# if it didn't already exist in the template. (The return +# values of macros are added manually if required, and so we +# never add it here - we only copy it if it already exists.) +# $default_description - the default description of the +# parameter to be used if it doesn't already exist. (Signal +# handlers have a few common parameters.) +############################################################################# + +sub OutputParam { + my ($symbol, $param_to_output, $template_exists, + $force_output, $default_description) = @_; + my ($j); + + my ($params) = $SymbolParams{$symbol}; + if (defined ($params)) { + for ($j = 0; $j <= $#$params; $j += 2) { + my $param_name = $$params[$j]; + my $param_desc = $$params[$j + 1]; + + if ($param_name eq $param_to_output) { + $param_desc =~ s/\s+$//; + $$params[$j] = ""; + $$params[$j + 1] = ""; + return "\@$param_name: $param_desc\n"; + } + } + } + + # If the template was already in a file, flag the new parameter. + # If not, the template itself will be flagged, so we don't need to flag + # all the new parameters as well. + if ($force_output) { + if ($default_description ne "") { + $default_description =~ s/\s+$//; + return "\@$param_to_output: $default_description\n"; + } else { + if ($template_exists) { + return "\@$param_to_output: $CHANGES_FLAG\n"; + } else { + return "\@$param_to_output: \n"; + } + } + } + return ""; +} + + +############################################################################# +# Function : OutputOldParams +# Description : This returns all the existing documentation for parameters of +# the given function/macro/signal symbol which are unused, with +# a comment before them. +# Arguments : $symbol - the symbol (function/macro/signal) name. +############################################################################# + +sub OutputOldParams { + my ($symbol) = @_; + my $output = ""; + + my ($params) = $SymbolParams{$symbol}; + if (defined ($params)) { + my $j; + for ($j = 0; $j <= $#$params; $j += 2) { + my $param_name = $$params[$j]; + my $param_desc = $$params[$j + 1]; + + if ($param_name ne "") { + $param_desc =~ s/\s+$//; + $output .= "\@$param_name: $param_desc\n"; + } + } + } + if ($output) { + $output = "<!-- # Unused Parameters # -->\n" . $output; + } + return $output; +} + + +############################################################################# +# Function : OutputTemplateFile +# Description : This outputs one template file. +# Arguments : $file - the basename of the file to output. +# $title - the title from the $MODULE-sections.txt file. This +# will be overridden by any title given in the template file. +# $output - reference to the templates to output. +############################################################################# + +sub OutputTemplateFile { + my ($file, $title, $output) = @_; + + my ($short_desc, $long_desc, $see_also); + + if (defined ($SymbolDocs{"$TMPL_DIR/$file:Title"})) { + $title = $SymbolDocs{"$TMPL_DIR/$file:Title"}; + delete $SymbolDocs{"$TMPL_DIR/$file:Title"}; + } + if (defined ($SymbolDocs{"$TMPL_DIR/$file:Short_Description"})) { + $short_desc = $SymbolDocs{"$TMPL_DIR/$file:Short_Description"}; + delete $SymbolDocs{"$TMPL_DIR/$file:Short_Description"}; + } else { + $short_desc = ""; + } + if (defined ($SymbolDocs{"$TMPL_DIR/$file:Long_Description"})) { + $long_desc = $SymbolDocs{"$TMPL_DIR/$file:Long_Description"}; + delete $SymbolDocs{"$TMPL_DIR/$file:Long_Description"}; + } else { + $long_desc = "<para>\n\n</para>\n"; + } + if (defined ($SymbolDocs{"$TMPL_DIR/$file:See_Also"})) { + $see_also = $SymbolDocs{"$TMPL_DIR/$file:See_Also"}; + delete $SymbolDocs{"$TMPL_DIR/$file:See_Also"}; + } else { + $see_also = "<para>\n\n</para>\n"; + } + + open (OUTPUT, ">$TMPL_DIR/$file") + || die "Can't create $TMPL_DIR/$file"; + + print (OUTPUT <<EOF); +<!-- ##### SECTION Title ##### --> +$title + +<!-- ##### SECTION Short_Description ##### --> +$short_desc + +<!-- ##### SECTION Long_Description ##### --> +$long_desc + +<!-- ##### SECTION See_Also ##### --> +$see_also + +EOF + + print (OUTPUT $$output); + &OutputSignalTemplates ($title); + &OutputArgTemplates ($title); + close (OUTPUT); +} + + +############################################################################# +# Function : OutputSignalTemplates +# Description : Outputs templates for signal handlers. +# Arguments : $title - the title from the $MODULE-sections.txt file. If the +# file is describing a GtkObject subclass, the title should +# be the name of the class, e.g. 'GtkButton'. +############################################################################# + +sub OutputSignalTemplates { + my ($title) = @_; + + my $output = ""; + my ($i, $template_exists); + for ($i = 0; $i <= $#SignalObjects; $i++) { + if ($SignalObjects[$i] eq $title) { +# print "Found signal: $SignalObjects[$i]\n"; + my ($symbol) = "$SignalObjects[$i]::$SignalNames[$i]"; + + # See if symbol already has a description. + my ($symbol_desc) = $SymbolDocs{$symbol}; + if (defined ($symbol_desc)) { + $template_exists = 1; + $symbol_desc =~ s/\s+$//; + delete $SymbolDocs{$symbol}; + } else { + $template_exists = 0; + $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>"; + } + + $output .= <<EOF; +<!-- ##### SIGNAL $symbol ##### --> +$symbol_desc + +EOF + + my @params = split ("[,\n]", $SignalPrototypes[$i]); + my ($j, $name); + for ($j = 0; $j <= $#params; $j++) { + my $param = $params[$j]; + $param =~ s/^\s+//; + $param =~ s/\s*$//; + if ($param =~ m/^\s*$/) { next; } + if ($param =~ m/^void$/) { next; } + + if ($param =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)?\s*$/) { + if (defined($3)) { + $name = $3; + } else { + $name = "Param" . ($j + 1); + } + if ($j == 0) { + $output .= &OutputParam ($symbol, $name, + $template_exists, 1, + "the object which received the signal."); + } else { + $output .= &OutputParam ($symbol, $name, + $template_exists, 1, ""); + } + } + } + + if ($SignalReturns[$i] ne "void") { + $output .= &OutputParam ($symbol, "Returns", $template_exists, + 1, ""); + } + $output .= &OutputOldParams ($symbol); + $output .= "\n"; + } + } + print (OUTPUT $output); +} + + +############################################################################# +# Function : OutputArgTemplates +# Description : Outputs templates for Args. +# Arguments : $title - the title from the $MODULE-sections.txt file. If the +# file is describing a GtkObject subclass, the title should +# be the name of the class, e.g. 'GtkButton'. +############################################################################# + +sub OutputArgTemplates { + my ($title) = @_; + + my $output = ""; + my $i; + for ($i = 0; $i <= $#ArgObjects; $i++) { + if ($ArgObjects[$i] eq $title) { +# print "Found arg: $ArgObjects[$i]\n"; + # I've only used one colon so we don't clash with signals. + my ($symbol) = "$ArgObjects[$i]:$ArgNames[$i]"; + + # See if symbol already has a description. + my ($symbol_desc) = $SymbolDocs{$symbol}; + if (defined ($symbol_desc)) { + delete $SymbolDocs{$symbol}; + $symbol_desc =~ s/\s+$//; + } else { + $symbol_desc = "<para>\n$CHANGES_FLAG\n</para>"; + } + + $output .= <<EOF; +<!-- ##### ARG $symbol ##### --> +$symbol_desc + +EOF + } + } + print (OUTPUT $output); +} + + +############################################################################# +# Function : OutputUnusedTemplates +# Description : This saves any unused documentation into $MODULE-unused.sgml. +# Arguments : none +############################################################################# + +sub OutputUnusedTemplates { + my ($unused_file) = "$TMPL_DIR/$MODULE-unused.sgml"; + open (UNUSED, ">$unused_file") + || die "Can't open file: $unused_file"; + + my $output = ""; + my ($symbol, $symbol_desc); + while (($symbol, $symbol_desc) = each (%SymbolDocs)) { +# print "Unused: $symbol\n"; + + my $type = $SymbolTypes{$symbol}; + if (!defined ($type)) { + $type = "UNKNOWN"; + print "WARNING: Unused symbol $symbol has unknown type\n"; + } + + $output .= <<EOF; +<!-- ##### $type $symbol ##### --> +$symbol_desc + +EOF + + my ($params) = $SymbolParams{$symbol}; + if (defined ($params)) { + my $j; + for ($j = 0; $j <= $#$params; $j += 2) { + my $param_name = $$params[$j]; + my $param_desc = $$params[$j + 1]; + $param_desc =~ s/\s+$//; + $output .= "\@$param_name: $param_desc\n"; + } + } + $output .= "\n"; + } + + print UNUSED $output; + close (UNUSED); +} + + +############################################################################# +# LIBRARY FUNCTIONS - These functions are used in both gtkdoc-mkdb and +# gtkdoc-mktmpl and should eventually be moved to a +# separate library. +############################################################################# + +############################################################################# +# Function : ReadDeclarationsFile +# Description : This reads in a file containing the function/macro/enum etc. +# declarations. +# +# Note that in some cases there are several declarations with +# the same name, e.g. for conditional macros. In this case we +# set a flag in the %DeclarationConditional hash so the +# declaration is not shown in the docs. +# +# If a macro and a function have the same name, e.g. for +# gtk_object_ref, the function declaration takes precedence. +# +# Some opaque structs are just declared with 'typedef struct +# _name name;' in which case the declaration may be empty. +# The structure may have been found later in the header, so +# that overrides the empty declaration. +# +# Arguments : $file - the declarations file to read +# $override - if declarations in this file should override +# any current declaration. +############################################################################# + +sub ReadDeclarationsFile { + my ($file, $override) = @_; + + if ($override == 0) { + %Declarations = (); + %DeclarationTypes = (); + %DeclarationConditional = (); + %DeclarationOutput = (); + } + + open (INPUT, $file) + || die "Can't open $file"; + my $declaration_type = ""; + my $declaration_name; + my $declaration; + while (<INPUT>) { + if (!$declaration_type) { + if (m/^<([^>]+)>/) { + $declaration_type = $1; + $declaration_name = ""; +# print "Found declaration: $declaration_type\n"; + $declaration = ""; + } + } else { + if (m%^<NAME>(.*)</NAME>%) { + $declaration_name = $1; + } elsif (m%^</$declaration_type>%) { +# print "Found end of declaration: $declaration_name\n"; + # Check that the declaration has a name + if ($declaration_name eq "") { + print "ERROR: $declaration_type has no name $file:$.\n"; + } + + # Check if the symbol is already defined. + if (defined ($Declarations{$declaration_name}) + && $override == 0) { + # Function declarations take precedence. + if ($DeclarationTypes{$declaration_name} eq 'FUNCTION') { + # Ignore it. + } elsif ($declaration_type eq 'FUNCTION') { + $Declarations{$declaration_name} = $declaration; + $DeclarationTypes{$declaration_name} = $declaration_type; + } elsif ($DeclarationTypes{$declaration_name} + eq $declaration_type) { + # If the existing declaration is empty override it. + if ($declaration_type eq 'STRUCT') { + if ($Declarations{$declaration_name} =~ m/^\s*$/) { + $Declarations{$declaration_name} = $declaration; + } elsif ($declaration =~ m/^\s*$/) { + # Ignore an empty declaration. + } else { + print "WARNING: Structure has multiple definitions: $declaration_name\n"; + } + + } else { + # set flag in %DeclarationConditional hash for + # multiply defined macros/typedefs. + $DeclarationConditional{$declaration_name} = 1; + } + } else { + print "WARNING: $declaration_name has multiple definitions\n"; + } + } else { + $Declarations{$declaration_name} = $declaration; + $DeclarationTypes{$declaration_name} = $declaration_type; + } + $declaration_type = ""; + } else { + $declaration .= $_; + } + } + } + close (INPUT); +} + + +############################################################################# +# Function : ReadSignalsFile +# Description : This reads in an existing file which contains information on +# all GTK signals. It creates the arrays @SignalNames and +# @SignalPrototypes containing info on the signals. The first +# line of the SignalPrototype is the return type of the signal +# handler. The remaining lines are the parameters passed to it. +# The last parameter, "gpointer user_data" is always the same +# so is not included. +# Arguments : $file - the file containing the signal handler prototype +# information. +############################################################################# + +sub ReadSignalsFile { + my ($file) = @_; + + my $in_signal = 0; + my $signal_object; + my $signal_name; + my $signal_returns; + my $signal_prototype; + + # Reset the signal info. + @SignalObjects = (); + @SignalNames = (); + @SignalReturns = (); + @SignalPrototypes = (); + + if (! -f $file) { + return; + } + if (!open (INPUT, $file)) { + warn "Can't open $file - skipping signals\n"; + return; + } + while (<INPUT>) { + if (!$in_signal) { + if (m/^<SIGNAL>/) { + $in_signal = 1; + $signal_object = ""; + $signal_name = ""; + $signal_returns = ""; + $signal_prototype = ""; + } + } else { + if (m/^<NAME>(.*)<\/NAME>/) { + $signal_name = $1; + if ($signal_name =~ m/^(.*)::(.*)$/) { + $signal_object = $1; + $signal_name = $2; +# print "Found signal: $signal_name\n"; + } else { + print "Invalid signal name: $signal_name\n"; + } + } elsif (m/^<RETURNS>(.*)<\/RETURNS>/) { + $signal_returns = $1; + } elsif (m%^</SIGNAL>%) { +# print "Found end of signal: ${signal_object}::${signal_name}\nReturns: ${signal_returns}\n${signal_prototype}"; + push (@SignalObjects, $signal_object); + push (@SignalNames, $signal_name); + push (@SignalReturns, $signal_returns); + push (@SignalPrototypes, $signal_prototype); + $in_signal = 0; + } else { + $signal_prototype .= $_; + } + } + } + close (INPUT); +} + + +############################################################################# +# Function : ReadTemplateFile +# Description : This reads in the manually-edited documentation file +# corresponding to the file currently being created, so we can +# insert the documentation at the appropriate places. +# It outputs %SymbolTypes, %SymbolDocs and %SymbolParams, which +# is a hash of arrays. +# NOTE: This function is duplicated in gtkdoc-mkdb (but +# slightly different). +# Arguments : $docsfile - the template file to read in. +# $skip_unused_params - 1 if the unused parameters should be +# skipped. +############################################################################# + +sub ReadTemplateFile { + my ($docsfile, $skip_unused_params) = @_; + +# print "Reading $docsfile\n"; + if (! -f $docsfile) { + print "File doesn't exist: $docsfile\n"; + return; + } + + my $CurrentType = ""; # Type of symbol being read. + my $CurrentSymbol = ""; # Name of symbol being read. + my $SymbolDoc = ""; # Description of symbol being read. + my @Params; # Parameter names and descriptions of current + # function/macro/function typedef. + my $CurrentParam = -1; # Index of parameter currently being read. + # Note that the param array contains pairs + # of param name & description. + my $InUnusedParameters = 0; # True if we are reading in the unused params. + + open (DOCS, $docsfile) + || die "Can't open file $docsfile: $!"; + while (<DOCS>) { + if (m/^<!-- ##### ([A-Z_]+) (\S+) ##### -->/) { + my $type = $1; + my $symbol = $2; + if ($symbol eq "Title" + || $symbol eq "Short_Description" + || $symbol eq "Long_Description" + || $symbol eq "See_Also") { + $symbol = $docsfile . ":" . $symbol; +# print "Found symbol: $symbol\n"; + } + + # Store previous symbol, but remove any trailing blank lines. + if ($CurrentSymbol ne "") { + $SymbolDoc =~ s/\s+$//; + $SymbolTypes{$CurrentSymbol} = $CurrentType; + $SymbolDocs{$CurrentSymbol} = $SymbolDoc; + if ($CurrentParam >= 0) { + $SymbolParams{$CurrentSymbol} = [ @Params ]; + } else { + # Delete any existing params in case we are overriding a + # previously read template. + delete $SymbolParams{$CurrentSymbol}; + } + } + $CurrentType = $type; + $CurrentSymbol = $symbol; + $CurrentParam = -1; + $InUnusedParameters = 0; + $SymbolDoc = ""; + @Params = (); + + } elsif (m/^<!-- # Unused Parameters # -->/) { + $InUnusedParameters = 1; + next; + + } else { + # Check if param found + if (s/^\@(\S+):\s*//) { + my $param_name = $1; + # Allow variations of 'Returns' + if ($param_name =~ m/^[Rr]eturns?$/) { + $param_name = "Returns"; + } +# print "Found param: $param_name\n"; + push (@Params, $param_name); + push (@Params, $_); + $CurrentParam += 2; + next; + } + + # When outputting the DocBook we skip unused parameters. + if (!$InUnusedParameters || !$skip_unused_params) { + if ($CurrentParam >= 0) { + $Params[$CurrentParam] .= $_; + } else { + $SymbolDoc .= $_; + } + } + } + } + + # Remember to finish the current symbol doccs. + if ($CurrentSymbol ne "") { + $SymbolDoc =~ s/\s+$//; + $SymbolTypes{$CurrentSymbol} = $CurrentType; + $SymbolDocs{$CurrentSymbol} = $SymbolDoc; + if ($CurrentParam >= 0) { + $SymbolParams{$CurrentSymbol} = [ @Params ]; + } else { + delete $SymbolParams{$CurrentSymbol}; + } + } + + close (DOCS); +} + + +############################################################################# +# Function : ReadObjectHierarchy +# Description : This reads in the $MODULE-hierarchy.txt file containing all +# the GtkObject subclasses described in this module (and their +# ancestors). +# It places them in the @Objects array, and places their level +# in the widget hierarchy in the @ObjectLevels array, at the +# same index. GtkObject, the root object, has a level of 1. +# +# FIXME: the version in gtkdoc-mkdb also generates tree_index.sgml +# as it goes along, this should be split out into a separate +# function. +# +# Arguments : none +############################################################################# + +sub ReadObjectHierarchy { + @Objects = (); + @ObjectLevels = (); + + if (! -f $OBJECT_TREE_FILE) { + return; + } + if (!open (INPUT, $OBJECT_TREE_FILE)) { + warn "Can't open $OBJECT_TREE_FILE - skipping object tree\n"; + return; + } + while (<INPUT>) { + if (m/\S+/) { + my $object = $&; + my $level = (length($`)) / 2 + 1; +# print ("Level: $level Object: $object\n"); + + push (@Objects, $object); + push (@ObjectLevels, $level); + } + } + + close (INPUT); +} + + +############################################################################# +# Function : ReadArgsFile +# Description : This reads in an existing file which contains information on +# all GTK args. It creates the arrays @ArgObjects, @ArgNames, +# @ArgTypes and @ArgFlags containing info on the args. +# Arguments : $file - the file containing the arg information. +############################################################################# + +sub ReadArgsFile { + my ($file) = @_; + + my $in_arg = 0; + my $arg_object; + my $arg_name; + my $arg_type; + my $arg_flags; + + # Reset the signal info. + @ArgObjects = (); + @ArgNames = (); + @ArgTypes = (); + @ArgFlags = (); + + if (! -f $file) { + return; + } + if (!open (INPUT, $file)) { + warn "Can't open $file - skipping args\n"; + return; + } + while (<INPUT>) { + if (!$in_arg) { + if (m/^<ARG>/) { + $in_arg = 1; + $arg_object = ""; + $arg_name = ""; + $arg_type = ""; + $arg_flags = ""; + } + } else { + if (m/^<NAME>(.*)<\/NAME>/) { + $arg_name = $1; + if ($arg_name =~ m/^(.*)::(.*)$/) { + $arg_object = $1; + $arg_name = $2; +# print "Found arg: $arg_name\n"; + } else { + print "Invalid arg name: $arg_name\n"; + } + } elsif (m/^<TYPE>(.*)<\/TYPE>/) { + $arg_type = $1; + } elsif (m/^<FLAGS>(.*)<\/FLAGS>/) { + $arg_flags = $1; + } elsif (m%^</ARG>%) { +# print "Found end of arg: ${arg_object}::${arg_name}\n${arg_type} : ${arg_flags}\n"; + push (@ArgObjects, $arg_object); + push (@ArgNames, $arg_name); + push (@ArgTypes, $arg_type); + push (@ArgFlags, $arg_flags); + $in_arg = 0; + } + } + } + close (INPUT); +} + + +############################################################################# +# Function : CheckIsObject +# Description : Returns 1 if the given name is a GtkObject or a subclass. +# It uses the global @Objects array. +# Note that the @Objects array only contains classes in the +# current module and their ancestors - not all GTK classes. +# Arguments : $name - the name to check. +############################################################################# + +sub CheckIsObject { + my ($name) = @_; + + my $object; + foreach $object (@Objects) { + if ($object eq $name) { + return 1; + } + } + return 0; +} + + +############################################################################# +# Function : ParseStructDeclaration +# Description : This function takes a structure declaration and +# breaks it into individual type declarations. +# Arguments : $declaration - the declaration to parse +# $is_object - true if this is an object structure +# $typefunc - function reference to apply to type +# $namefunc - function reference to apply to name +############################################################################# + +sub ParseStructDeclaration { + my ($declaration, $is_object, $typefunc, $namefunc) = @_; + + # Remove all private parts of the declaration + + # For objects, assume private + if ($is_object) { + $declaration =~ s!(struct\s+\w*\s*\{) + .*? + (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!$1!msgx; + } + + $declaration =~ s!\n?[ \t]*/\*\s*<\s*private\s*>\s*\*/ + .*? + (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!!msgx; + + # Remove all other comments; + $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g; + + my @result = (); + + if ($declaration =~ /^\s*$/) { + return @result; + } + + # Prime match after "struct {" declaration + if (!scalar($declaration =~ m/struct\s+\w*\s*\{/msg)) { + die "Structure declaration '$declaration' does not begin with struct [NAME] {\n"; + } + + # Treat lines in sequence, allowing singly nested anonymous structs + # and unions. + while ($declaration =~ m/\s*([^{;]+(\{[^\}]*\}[^{;]+)?);/msg) { + my $line = $1; + + last if $line =~ /^\s*\}\s*\w*\s*$/; + + # FIXME: Just ignore nested structs and unions for now + next if $line =~ /{/; + + # FIXME: The regexes here are the same as in OutputFunction; + # this functionality should be separated out. + + if ($line =~ m/^ + (const\s+|unsigned\s+)*(struct\s+)? # mod1 + (\w+)\s* # type + (\**)\s* # ptr1 + (const\s+)? # mod2 + (\**)?\s* # ptr2 + (\w+(?:\s*,\s*\w+)*)\s* # name + (?:((?:\[[^\]]*\]\s*)+) | # array + (:\s*\d+))?\s* # bits + $/x) { + my $mod1 = defined($1) ? $1 : ""; + if (defined($2)) { $mod1 .= $2; } + my $type = $3; + my $ptr1 = $4; + my $mod2 = defined($5) ? $5 : ""; + my $ptr2 = $6; + my $name = $7; + $ptr1 = " " . $ptr1; + my $array = defined($8) ? $8 : ""; + my $bits = defined($9) ? " $9" : ""; + my $ptype = defined $typefunc ? $typefunc->($type) : $type; + + # FIXME: + # As a hack, we allow the "name" to be of the form + # "a, b, c". This isn't the correct C syntax, but + # at least we get "gint16 x, y" right. Such constructs + # should really be completely removed from the source. + # Or we should really try to understand the C syntax + # here... + + my @names = split /\s*,\s*/, $name; + for my $n (@names) { + push @result, $n; + if (defined $namefunc) { + $n = $namefunc->($n); + } + push @result, "$mod1$ptype$ptr1$mod2$ptr2$n$array$bits"; + } + + # Try to match structure members which are functions + } elsif ($line =~ m/^ + (const\s+|unsigned\s+)*(struct\s+)? # mod1 + (\w+)\s* # type + (\**)\s* # ptr1 + (const\s+)? # mod2 + \(\s*\*\s*(\w+)\s*\)\s* # name + \(([^)]*)\)\s* # func_params + $/x) { + + my $mod1 = defined($1) ? $1 : ""; + if (defined($2)) { $mod1 .= $2; } + my $type = $3; + my $ptr1 = $4; + my $mod2 = defined($5) ? $5 : ""; + my $name = $6; + my $func_params = $7; + my $ptype = defined $typefunc ? $typefunc->($type) : $type; + my $pname = defined $namefunc ? $namefunc->($name) : $name; + + push @result, $name; + push @result, "$mod1$ptype$ptr1$mod2 (*$pname) ($func_params)"; + + } else { + warn "Cannot parse structure field $line"; + } + } + + return @result; +} + + +############################################################################# +# Function : ParseEnumDeclaration +# Description : This function takes a enumeration declaration and +# breaks it into individual enum member declarations. +# Arguments : $declaration - the declaration to parse +############################################################################# + +sub ParseEnumDeclaration { + my ($declaration, $is_object) = @_; + + # Remove comments; + $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g; + + my @result = (); + + if ($declaration =~ /^\s*$/) { + return @result; + } + + # Remove parenthesized expressions (in macros like GTK_BLAH = BLAH(1,3)) + # to avoid getting confused by commas they might contain. This + # doesn't handle nested parentheses correctly. + + $declaration =~ s/\([^)]*\)//g; + + # Prime match after "typedef enum {" declaration + if (!scalar($declaration =~ m/typedef\s+enum\s*\{/msg)) { + die "Enum declaration '$declaration' does not begin with typedef enum {\n"; + } + + # Treat lines in sequence. + while ($declaration =~ m/\s*([^,\}]+)([,\}])/msg) { + my $line = $1; + my $terminator = $2; + + if ($line =~ m/^(\w+)\s*(=.*)?$/msg) { + push @result, $1; + + # Special case for GIOCondition, where the values are specified by + # macros which expand to include the equal sign like '=1'. + } elsif ($line =~ m/^(\w+)\s*GLIB_SYSDEF_POLL/msg) { + push @result, $1; + + # Special case include of <gdk/gdkcursors.h>, just ignore it + } elsif ($line =~ m/^#include/) { + last; + + } else { + warn "Cannot parse enumeration member $line"; + } + + last if $terminator eq '}'; + } + + return @result; +} diff --git a/docs/plugins/gstdoc-scanobj b/docs/plugins/gstdoc-scanobj new file mode 100755 index 0000000000..6c058216b4 --- /dev/null +++ b/docs/plugins/gstdoc-scanobj @@ -0,0 +1,872 @@ +#!/usr/bin/perl -w +# +# gtk-doc - GTK DocBook documentation generator. +# Copyright (C) 1998 Damon Chaplin +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# +# This gets information about object heirarchies and signals +# by compiling a small C program. CFLAGS and LDFLAGS must be +# set appropriately before running this script. +# +# NOTE: the lookup_signal_srg_names() function contains the argument names of +# standard GTK signal handlers. This may need to be updated for new +# GTK signals or Gnome widget signals. + +use Getopt::Long; + +# Options + +# name of documentation module +my $MODULE; +my $OUTPUT_DIR; + +%optctl = (module => \$MODULE, + types => \$TYPES_FILE, + nogtkinit => \$NO_GTK_INIT); + +GetOptions(\%optctl, "module=s", "types:s", "nogtkinit"); + +$TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$MODULE.types"; + +open TYPES, $TYPES_FILE || die "Cannot open $TYPES_FILE: $!\n"; +open OUTPUT, ">$MODULE-scan.c" || die "Cannot open $MODULE-scan.c: $!\n"; + +# write a C program to scan the types + +$includes = ""; +@types = (); + +for (<TYPES>) { + if (/^#include/) { + $includes .= $_; + } elsif (/^%/) { + next; + } elsif (/^\s*$/) { + next; + } else { + chomp; + push @types, $_; + } +} + +$ntypes = @types + 1; + +print OUTPUT <<EOT; +#include <string.h> +#include <stdio.h> + +$includes +GtkType object_types[$ntypes]; +GstElement *elements[$ntypes]; + +gint _typenr = 0; + +gboolean +get_plugins () +{ + gint i = 0; +EOT + +for (@types) { + print OUTPUT " gst_plugin_load(\"$_\");\n"; + print OUTPUT " elements[i] = gst_elementfactory_make(\"$_\", \"dummy\");\n"; + print OUTPUT " object_types[i] = GTK_OBJECT_TYPE(GTK_OBJECT(elements[i]));\n"; + print OUTPUT " i++; \n"; +} + print OUTPUT " object_types[i] = 0;\n"; + +print OUTPUT <<EOT; + return TRUE; +} + +/* + * This uses GTK type functions to output signal prototypes and the widget + * hierarchy. + */ + +/* The output files */ +gchar *signals_filename = "$MODULE.signals"; +gchar *hierarchy_filename = "$MODULE.hierarchy"; +gchar *args_filename = "$MODULE.args"; +gchar *pads_filename = "$MODULE.pads"; + + +static void output_signals (); +static void output_widget_signals (FILE *fp, + GtkType object_type); +static void output_widget_signal (FILE *fp, + GtkType object_type, + gchar *object_class_name, + guint signal_id); +static gchar * get_type_name (GtkType type, + gboolean * is_pointer); +static gchar * get_gdk_event (const gchar * signal_name); +static gchar ** lookup_signal_arg_names (gchar * type, + const gchar * signal_name); + +static void output_widget_hierarchy (); +static void output_hierarchy (FILE *fp, + GtkType type, + gint level); + +static void output_args (); +static void output_widget_args (FILE *fp, GtkType object_type); + +static void output_pads (); +static void output_widget_pads (FILE *fp, GstElement *element); + +int +main (int argc, char *argv[]) +{ +EOT + + if ($NO_GTK_INIT) { + print OUTPUT <<EOT; + gtk_type_init (); +EOT + } else { + print OUTPUT <<EOT; + gtk_init (&argc, &argv); +EOT + } + +print OUTPUT <<EOT; + gst_init (&argc, &argv); + get_plugins(); + + output_widget_hierarchy (); + output_signals (); + output_args (); + output_pads (); + + return 0; +} + + +static void +output_signals () +{ + FILE *fp; + gint i; + + fp = fopen (signals_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s", signals_filename); + return; + } + + for (i = 0; object_types[i]; i++) + output_widget_signals (fp, object_types[i]); + + fclose (fp); +} + + +/* This outputs all the signals of one widget. */ +static void +output_widget_signals (FILE *fp, GtkType object_type) +{ + GtkObjectClass *class; + gchar *object_class_name; + guint sig; + + class = gtk_type_class (object_type); + if (!class || class->nsignals == 0) + return; + + object_class_name = gtk_type_name (object_type); + + for (sig = 0; sig < class->nsignals; sig++) + { + if (!class->signals[sig]) + { + /*g_print ("Signal slot [%u] is empty\n", sig);*/ + continue; + } + + output_widget_signal (fp, object_type, object_class_name, + class->signals[sig]); + } +} + + +/* This outputs one signal. */ +static void +output_widget_signal (FILE *fp, + GtkType object_type, + gchar *object_name, + guint signal_id) +{ + GtkSignalQuery *query_info; + gchar *ret_type, *pos, *type_name, *arg_name, *object_arg, *object_arg_start; + gboolean is_pointer; + gchar ret_type_buffer[1024], buffer[1024]; + gint i, param; + gchar **arg_names; + gint param_num, widget_num, event_num, callback_num; + gint *arg_num; + gchar signal_name[128]; + + + /* g_print ("Object: %s Type: %i Signal: %u\n", object_name, object_type, + signal_id);*/ + + param_num = 1; + widget_num = event_num = callback_num = 0; + + query_info = gtk_signal_query (signal_id); + if (query_info == NULL) + { + g_warning ("Couldn't query signal"); + return; + } + + /* Output the return type and function name. */ + ret_type = get_type_name (query_info->return_val, &is_pointer); + sprintf (ret_type_buffer, "%s%s", ret_type, is_pointer ? "*" : ""); + + /* Output the signal object type and the argument name. We assume the + type is a pointer - I think that is OK. We remove "Gtk" or "Gnome" and + convert to lower case for the argument name. */ + pos = buffer; + sprintf (pos, "%s ", object_name); + pos += strlen (pos); + + if (!strncmp (object_name, "Gtk", 3)) + object_arg = object_name + 3; + else if (!strncmp (object_name, "Gnome", 5)) + object_arg = object_name + 5; + else + object_arg = object_name; + + object_arg_start = pos; + sprintf (pos, "*%s\n", object_arg); + pos += strlen (pos); + g_strdown (object_arg_start); + if (!strcmp (object_arg_start, "widget")) + widget_num++; + + /* Convert signal name to use underscores rather than dashes '-'. */ + strcpy (signal_name, query_info->signal_name); + for (i = 0; signal_name[i]; i++) + { + if (signal_name[i] == '-') + signal_name[i] = '_'; + } + + /* Output the signal parameters. */ + arg_names = lookup_signal_arg_names (object_name, signal_name); + + for (param = 0; param < query_info->nparams; param++) + { + if (arg_names) + { + sprintf (pos, "%s\n", arg_names[param]); + pos += strlen (pos); + } + else + { + type_name = get_type_name (query_info->params[param], &is_pointer); + + /* Most arguments to the callback are called "arg1", "arg2", etc. + GdkWidgets are called "widget", "widget2", ... + GdkEvents are called "event", "event2", ... + GtkCallbacks are called "callback", "callback2", ... */ + if (!strcmp (type_name, "GtkWidget")) + { + arg_name = "widget"; + arg_num = &widget_num; + } + else if (!strcmp (type_name, "GdkEvent")) + { + type_name = get_gdk_event (signal_name); + arg_name = "event"; + arg_num = &event_num; + is_pointer = TRUE; + } + else if (!strcmp (type_name, "GtkCallback") + || !strcmp (type_name, "GtkCCallback")) + { + arg_name = "callback"; + arg_num = &callback_num; + } + else + { + arg_name = "arg"; + arg_num = ¶m_num; + } + sprintf (pos, "%s ", type_name); + pos += strlen (pos); + + if (!arg_num || *arg_num == 0) + sprintf (pos, "%s%s\n", is_pointer ? "*" : " ", arg_name); + else + sprintf (pos, "%s%s%i\n", is_pointer ? "*" : " ", arg_name, + *arg_num); + pos += strlen (pos); + + if (arg_num) + *arg_num += 1; + } + } + + fprintf (fp, + "<SIGNAL>\n<NAME>%s::%s</NAME>\n<RETURNS>%s</RETURNS>\n%s</SIGNAL>\n\n", + object_name, query_info->signal_name, ret_type_buffer, buffer); + g_free (query_info); +} + + +static gchar * +get_type_name (GtkType type, gboolean * is_pointer) +{ + static gchar *GbTypeNames[] = + { + "char", "gchar", + "bool", "gboolean", + "int", "gint", + "uint", "guint", + "long", "glong", + "ulong", "gulong", + "float", "gfloat", + "double", "gdouble", + "string", "gchar", + "enum", "gint", + "flags", "gint", + "boxed", "gpointer", + "foreign", "gpointer", + "callback", "GtkCallback", /* ?? */ + "args", "gpointer", + + "pointer", "gpointer", + "signal", "gpointer", + "c_callback", "GtkCallback", /* ?? */ + + NULL + }; + + GtkType parent_type; + gchar *type_name, *parent_type_name; + gint i; + + *is_pointer = FALSE; + type_name = gtk_type_name (type); + for (i = 0; GbTypeNames[i]; i += 2) + { + if (!strcmp (type_name, GbTypeNames[i])) + { + if (!strcmp (type_name, "string")) + *is_pointer = TRUE; + return GbTypeNames[i + 1]; + } + } + + for (;;) + { + parent_type = gtk_type_parent (type); + if (parent_type == 0) + break; + type = parent_type; + } + parent_type_name = gtk_type_name (type); + /*g_print ("Parent type name: %s\n", parent_type_name);*/ + if (!strcmp (parent_type_name, "GtkObject") + || !strcmp (parent_type_name, "boxed") + || !strcmp (parent_type_name, "GtkBoxed")) + *is_pointer = TRUE; + + return type_name; +} + + +static gchar * +get_gdk_event (const gchar * signal_name) +{ + static gchar *GbGDKEvents[] = + { + "button_press_event", "GdkEventButton", + "button_release_event", "GdkEventButton", + "motion_notify_event", "GdkEventMotion", + "delete_event", "GdkEvent", + "destroy_event", "GdkEvent", + "expose_event", "GdkEventExpose", + "key_press_event", "GdkEventKey", + "key_release_event", "GdkEventKey", + "enter_notify_event", "GdkEventCrossing", + "leave_notify_event", "GdkEventCrossing", + "configure_event", "GdkEventConfigure", + "focus_in_event", "GdkEventFocus", + "focus_out_event", "GdkEventFocus", + "map_event", "GdkEvent", + "unmap_event", "GdkEvent", + "property_notify_event", "GdkEventProperty", + "selection_clear_event", "GdkEventSelection", + "selection_request_event", "GdkEventSelection", + "selection_notify_event", "GdkEventSelection", + "proximity_in_event", "GdkEventProximity", + "proximity_out_event", "GdkEventProximity", + "drag_begin_event", "GdkEventDragBegin", + "drag_request_event", "GdkEventDragRequest", + "drag_end_event", "GdkEventDragRequest", + "drop_enter_event", "GdkEventDropEnter", + "drop_leave_event", "GdkEventDropLeave", + "drop_data_available_event", "GdkEventDropDataAvailable", + "other_event", "GdkEventOther", + "client_event", "GdkEventClient", + "no_expose_event", "GdkEventNoExpose", + NULL + }; + + gint i; + + for (i = 0; GbGDKEvents[i]; i += 2) + { + if (!strcmp (signal_name, GbGDKEvents[i])) + return GbGDKEvents[i + 1]; + } + return "GdkEvent"; +} + + +/* This returns argument names to use for some known GTK signals. + It is passed a widget name, e.g. 'GtkCList' and a signal name, e.g. + 'select_row' and it returns a pointer to an array of argument types and + names. */ +static gchar ** +lookup_signal_arg_names (gchar * type, const gchar * signal_name) +{ + /* Each arg array starts with the object type name and the signal name, + and then signal arguments follow. */ + static gchar *GbArgTable[][16] = + { + {"GtkCList", "select_row", + "gint row", + "gint column", + "GdkEventButton *event"}, + {"GtkCList", "unselect_row", + "gint row", + "gint column", + "GdkEventButton *event"}, + {"GtkCList", "click_column", + "gint column"}, + + {"GtkCList", "resize_column", + "gint column", + "gint width"}, + + {"GtkCList", "extend_selection", + "GtkScrollType scroll_type", + "gfloat position", + "gboolean auto_start_selection"}, + {"GtkCList", "scroll_vertical", + "GtkScrollType scroll_type", + "gfloat position"}, + {"GtkCList", "scroll_horizontal", + "GtkScrollType scroll_type", + "gfloat position"}, + {"GtkContainer", "focus", + "GtkDirectionType direction"}, + {"GtkCTree", "tree_select_row", + "GList *node", + "gint column"}, + {"GtkCTree", "tree_unselect_row", + "GList *node", + "gint column"}, + + {"GtkCTree", "tree_expand", + "GList *node"}, + {"GtkCTree", "tree_collapse", + "GList *node"}, + {"GtkCTree", "tree_move", + "GList *node", + "GList *new_parent", + "GList *new_sibling"}, + {"GtkCTree", "change_focus_row_expansion", + "GtkCTreeExpansionType expansion"}, + + {"GtkEditable", "insert_text", + "gchar *new_text", + "gint new_text_length", + "gint *position"}, + {"GtkEditable", "delete_text", + "gint start_pos", + "gint end_pos"}, + {"GtkEditable", "set_editable", + "gboolean is_editable"}, + {"GtkEditable", "move_cursor", + "gint x", + "gint y"}, + {"GtkEditable", "move_word", + "gint num_words"}, + {"GtkEditable", "move_page", + "gint x", + "gint y"}, + {"GtkEditable", "move_to_row", + "gint row"}, + {"GtkEditable", "move_to_column", + "gint column"}, + + {"GtkEditable", "kill_char", + "gint direction"}, + {"GtkEditable", "kill_word", + "gint direction"}, + {"GtkEditable", "kill_line", + "gint direction"}, + + + {"GtkInputDialog", "enable_device", + "gint deviceid"}, + {"GtkInputDialog", "disable_device", + "gint deviceid"}, + + {"GtkListItem", "extend_selection", + "GtkScrollType scroll_type", + "gfloat position", + "gboolean auto_start_selection"}, + {"GtkListItem", "scroll_vertical", + "GtkScrollType scroll_type", + "gfloat position"}, + {"GtkListItem", "scroll_horizontal", + "GtkScrollType scroll_type", + "gfloat position"}, + + {"GtkMenuShell", "move_current", + "GtkMenuDirectionType direction"}, + {"GtkMenuShell", "activate_current", + "gboolean force_hide"}, + + + {"GtkNotebook", "switch_page", + "GtkNotebookPage *page", + "gint page_num"}, + {"GtkStatusbar", "text_pushed", + "guint context_id", + "gchar *text"}, + {"GtkStatusbar", "text_popped", + "guint context_id", + "gchar *text"}, + {"GtkTipsQuery", "widget_entered", + "GtkWidget *widget", + "gchar *tip_text", + "gchar *tip_private"}, + {"GtkTipsQuery", "widget_selected", + "GtkWidget *widget", + "gchar *tip_text", + "gchar *tip_private", + "GdkEventButton *event"}, + {"GtkToolbar", "orientation_changed", + "GtkOrientation orientation"}, + {"GtkToolbar", "style_changed", + "GtkToolbarStyle style"}, + {"GtkWidget", "draw", + "GdkRectangle *area"}, + {"GtkWidget", "size_request", + "GtkRequisition *requisition"}, + {"GtkWidget", "size_allocate", + "GtkAllocation *allocation"}, + {"GtkWidget", "state_changed", + "GtkStateType state"}, + {"GtkWidget", "style_set", + "GtkStyle *previous_style"}, + + {"GtkWidget", "install_accelerator", + "gchar *signal_name", + "gchar key", + "gint modifiers"}, + + {"GtkWidget", "add_accelerator", + "guint accel_signal_id", + "GtkAccelGroup *accel_group", + "guint accel_key", + "GdkModifierType accel_mods", + "GtkAccelFlags accel_flags"}, + + {"GtkWidget", "parent_set", + "GtkObject *old_parent"}, + + {"GtkWidget", "remove_accelerator", + "GtkAccelGroup *accel_group", + "guint accel_key", + "GdkModifierType accel_mods"}, + {"GtkWidget", "debug_msg", + "gchar *message"}, + {"GtkWindow", "move_resize", + "gint *x", + "gint *y", + "gint width", + "gint height"}, + {"GtkWindow", "set_focus", + "GtkWidget *widget"}, + + {"GtkWidget", "selection_get", + "GtkSelectionData *data", + "guint info", + "guint time"}, + {"GtkWidget", "selection_received", + "GtkSelectionData *data", + "guint time"}, + + {"GtkWidget", "drag_begin", + "GdkDragContext *drag_context"}, + {"GtkWidget", "drag_end", + "GdkDragContext *drag_context"}, + {"GtkWidget", "drag_data_delete", + "GdkDragContext *drag_context"}, + {"GtkWidget", "drag_leave", + "GdkDragContext *drag_context", + "guint time"}, + {"GtkWidget", "drag_motion", + "GdkDragContext *drag_context", + "gint x", + "gint y", + "guint time"}, + {"GtkWidget", "drag_drop", + "GdkDragContext *drag_context", + "gint x", + "gint y", + "guint time"}, + {"GtkWidget", "drag_data_get", + "GdkDragContext *drag_context", + "GtkSelectionData *data", + "guint info", + "guint time"}, + {"GtkWidget", "drag_data_received", + "GdkDragContext *drag_context", + "gint x", + "gint y", + "GtkSelectionData *data", + "guint info", + "guint time"}, + + {NULL} + }; + + gint i; + + for (i = 0; GbArgTable[i][0]; i++) + { + if (!strcmp (type, GbArgTable[i][0]) + && !strcmp (signal_name, GbArgTable[i][1])) + return &GbArgTable[i][2]; + } + return NULL; +} + + +/* This outputs the hierarchy of all widgets which have been initialized, + i.e. by calling their XXX_get_type() initialization function. */ +static void +output_widget_hierarchy () +{ + FILE *fp; + + fp = fopen (hierarchy_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s", hierarchy_filename); + return; + } + output_hierarchy (fp, GTK_TYPE_OBJECT, 0); + fclose (fp); +} + + +/* This is called recursively to output the hierarchy of a widget. */ +static void +output_hierarchy (FILE *fp, + GtkType type, + gint level) +{ + GList *list; + guint i; + + if (!type) + return; + + for (i = 0; i < level; i++) + fprintf (fp, " "); + fprintf (fp, gtk_type_name (type)); + fprintf (fp, "\n"); + + list = gtk_type_children_types (type); + + while (list) + { + GtkType child = (GtkType) list->data; + output_hierarchy (fp, child, level + 1); + list = list->next; + } +} + + +static void +output_args () +{ + FILE *fp; + gint i; + + fp = fopen (args_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s", args_filename); + return; + } + + for (i = 0; object_types[i]; i++) + output_widget_args (fp, object_types[i]); + + fclose (fp); +} + + +static void +output_widget_args (FILE *fp, GtkType object_type) +{ + GtkObjectClass *class; + gchar *object_class_name; + GtkArg *args; + guint32 *arg_flags; + guint n_args; + gint arg; + gchar flags[16], *pos; + + class = gtk_type_class (object_type); + if (!class) + return; + + object_class_name = gtk_type_name (object_type); + + args = gtk_object_query_args (class->type, &arg_flags, &n_args); + + for (arg = 0; arg < n_args; arg++) + { + pos = flags; + /* We use one-character flags for simplicity. */ + if (arg_flags[arg] & GTK_ARG_READABLE) + *pos++ = 'r'; + if (arg_flags[arg] & GTK_ARG_WRITABLE) + *pos++ = 'w'; + if (arg_flags[arg] & GTK_ARG_CONSTRUCT) + *pos++ = 'x'; + if (arg_flags[arg] & GTK_ARG_CONSTRUCT_ONLY) + *pos++ = 'X'; + if (arg_flags[arg] & GTK_ARG_CHILD_ARG) + *pos++ = 'c'; + *pos = '\0'; + + fprintf (fp, "<ARG>\n<NAME>%s</NAME>\n<TYPE>%s</TYPE>\n<FLAGS>%s</FLAGS>\n", + args[arg].name, gtk_type_name (args[arg].type), flags); + + if (GTK_FUNDAMENTAL_TYPE(args[arg].type) == GTK_TYPE_ENUM) { + GtkEnumValue *values; + gint i=0; + + values = gtk_type_enum_get_values(args[arg].type); + + while (values[i].value_name) { + fprintf (fp, "<ENUM>\n<VALUE>%d</VALUE>\n<NICK>%s</NICK>\n</ENUM>\n", + values[i].value, values[i].value_nick); + i++; + } + } + + fprintf(fp, "</ARG>\n\n"); + } + + g_free (args); + g_free (arg_flags); +} + + +static void +output_pads () +{ + FILE *fp; + gint i; + + fp = fopen (pads_filename, "w"); + if (fp == NULL) + { + g_warning ("Couldn't open output file: %s", pads_filename); + return; + } + + for (i = 0; elements[i]; i++) + output_widget_pads (fp, elements[i]); + + fclose (fp); +} + +static void +output_widget_pads (FILE *fp, GstElement *element) +{ + GtkObjectClass *class; + GstElementFactory *factory; + GList *pads; + + class = GTK_OBJECT(element)->klass; + if (!class || !GST_IS_ELEMENT_CLASS(class)) + return; + + pads = gst_element_get_pad_list(element); + + factory = GST_ELEMENT_CLASS(class)->elementfactory; + + if (!factory) + return; + + while (pads) { + GstPad *pad = (GstPad *)pads->data; + GstType *type; + + type = gst_type_find_by_id(pad->type); + + fprintf (fp, "<PAD>\n<NAME>%s::%s</NAME>\n", + gtk_type_name(factory->type), pad->name); + + if (type) { + fprintf(fp, "<MIME>%s</MIME>\n", type->mime); + if (type->exts) + fprintf(fp, "<EXTS>%s</EXTS>\n", type->exts); + } + + fprintf(fp, "</PAD>\n\n"); + + pads = g_list_next(pads); + } +} + +EOT + +close OUTPUT; + +# Compile and run our file + +$CC = $ENV{CC} ? $ENV{CC} : "gcc"; +$LD = $ENV{LD} ? $ENV{LD} : $CC; +$CFLAGS = $ENV{CFLAGS} ? $ENV{CFLAGS} : ""; +$LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : ""; + +$command = "$CC $CFLAGS -c -o $MODULE-scan.o $MODULE-scan.c && $LD -o $MODULE-scan $MODULE-scan.o $LDFLAGS"; + +system($command) == 0 or die "Compilation of scanner failed\n"; + +system("./$MODULE-scan") == 0 or die "Scan failed\n"; + +unlink "./$MODULE-scan.c", "./$MODULE-scan", diff --git a/docs/plugins/gstreamer-plugins-docs.sgml b/docs/plugins/gstreamer-plugins-docs.sgml new file mode 100644 index 0000000000..13267f90ca --- /dev/null +++ b/docs/plugins/gstreamer-plugins-docs.sgml @@ -0,0 +1,120 @@ +<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [ + +<!entity GstParseAu SYSTEM "sgml/gstparseau.sgml"> +<!entity Audioscale SYSTEM "sgml/audioscale.sgml"> +<!entity GstAviEncoder SYSTEM "sgml/gstaviencoder.sgml"> +<!entity GstParseAvi SYSTEM "sgml/gstparseavi.sgml"> +<!entity GstWinDec SYSTEM "sgml/gstwindec.sgml"> +<!entity GstWinEnc SYSTEM "sgml/gstwinenc.sgml"> +<!entity GstV4lSrc SYSTEM "sgml/gstv4lsrc.sgml"> +<!entity GstStereo SYSTEM "sgml/stereo.sgml"> +<!entity GstVolume SYSTEM "sgml/volume.sgml"> +<!entity GstMedian SYSTEM "sgml/median.sgml"> +<!entity GstSmooth SYSTEM "sgml/smooth.sgml"> +<!entity GstJpegDec SYSTEM "sgml/gstjpegdec.sgml"> +<!entity GstJpegEnc SYSTEM "sgml/gstjpegenc.sgml"> +<!entity GstMpg123 SYSTEM "sgml/gstmpg123.sgml"> +<!entity Mp3Parse SYSTEM "sgml/mp3parse.sgml"> +<!entity GstMpegplay SYSTEM "sgml/gstmpeg_play.sgml"> +<!entity GstMpegAudio SYSTEM "sgml/gstmpegaudio.sgml"> +<!entity GstMpeg1Parse SYSTEM "sgml/mpeg1parse.sgml"> +<!entity SystemEncode SYSTEM "sgml/system_encode.sgml"> +<!entity Mp1VideoParse SYSTEM "sgml/mp1videoparse.sgml"> +<!entity Ac3Dec SYSTEM "sgml/ac3dec.sgml"> +<!entity Ac3Parse SYSTEM "sgml/ac3parse.sgml"> +<!entity GstMpeg2enc SYSTEM "sgml/gstmpeg2enc.sgml"> +<!entity Mpeg2Parse SYSTEM "sgml/mpeg2parse.sgml"> +<!entity Mpeg2Subt SYSTEM "sgml/mpeg2subt.sgml"> +<!entity Mpeg2Play SYSTEM "sgml/gstmpeg2play.sgml"> +<!entity Mp2VideoParse SYSTEM "sgml/mp2videoparse.sgml"> +<!entity RTJpegDec SYSTEM "sgml/rtjpegdec.sgml"> +<!entity RTJpegEnc SYSTEM "sgml/rtjpegenc.sgml"> +<!entity VCDSrc SYSTEM "sgml/vcdsrc.sgml"> +<!entity Videoscale SYSTEM "sgml/videoscale.sgml"> +<!entity VideoSink SYSTEM "sgml/videosink.sgml"> +<!entity GstSmoothWave SYSTEM "sgml/smoothwave.sgml"> +<!entity GstSpectrum SYSTEM "sgml/gstspectrum.sgml"> +<!entity GstSynaesthesia SYSTEM "sgml/synaesthesia.sgml"> +<!entity GstVuMeter SYSTEM "sgml/vumeter.sgml"> +<!entity VorbisDec SYSTEM "sgml/vorbisdec.sgml"> +<!entity VorbisEnc SYSTEM "sgml/vorbisenc.sgml"> +<!entity GstParseWav SYSTEM "sgml/gstparsewav.sgml"> + +<!entity gstreamer-tree-index SYSTEM "sgml/tree_index.sgml"> +]> + + +<book> + <bookinfo> + <title>GStreamer Library Reference Manual (Plugins) + + + + GStreamer Standard Plugins + + + The following code example shows you how to create a GstDiskSrc element. + + + &GstParseAu; + &Audioscale; + + &GstAviEncoder; + &GstParseAvi; + &GstWinDec; + &GstWinEnc; + &GstParseWav; + + &GstV4lSrc; + + &GstStereo; + &GstVolume; + + &GstMedian; + &GstSmooth; + + &GstJpegDec; + &GstJpegEnc; + + &GstMpg123; + &Mp3Parse; + &GstMpegplay; + &GstMpegAudio; + &GstMpeg1Parse; + &SystemEncode; + &Mp1VideoParse; + + &Ac3Dec; + &Ac3Parse; + &GstMpeg2enc; + &Mpeg2Parse; + &Mpeg2Subt; + &Mpeg2Play; + &Mp2VideoParse; + + &RTJpegDec; + &RTJpegEnc; + + &VCDSrc; + + &Videoscale; + &VideoSink; + + &GstSmoothWave; + &GstSpectrum; + &GstSynaesthesia; + &GstVuMeter; + + &VorbisDec; + &VorbisEnc; + + + + Index + + + Object Hierarchy + &gstreamer-tree-index; + + + diff --git a/docs/plugins/gstreamer-plugins-sections.txt b/docs/plugins/gstreamer-plugins-sections.txt new file mode 100644 index 0000000000..699abdd9c1 --- /dev/null +++ b/docs/plugins/gstreamer-plugins-sections.txt @@ -0,0 +1,333 @@ +
+example +GstExample + +
+ +
+gstparseau +GstParseAu + +GST_TYPE_PARSEAU +
+ +
+gstaviencoder +GstAviEncoder + +GST_TYPE_AVIENCODER +
+ +
+gstparseavi +GstParseAvi + +GST_TYPE_PARSEAVI +
+ +
+gstwindec +GstWinDec + +GST_TYPE_PARSEAU +
+ +
+gstwinenc +GstWinEnc + +GST_TYPE_PARSEAU +
+ +
+gstwincodec +GstWin + +GST_TYPE_PARSEAU +
+ +
+gstv4lsrc +GstV4lSrc + +GST_TYPE_PARSEAU +
+ +
+cobin +GstCoBin + +GST_TYPE_PARSEAU +
+ +
+spindentity +GstSpindentity + +GST_TYPE_PARSEAU +
+ +
+dvdsrc +DVDSrc + +GST_TYPE_PARSEAU +
+ +
+stereo +GstStereo + +GST_TYPE_PARSEAU +
+ +
+volume +GstVolume + +GST_TYPE_PARSEAU +
+ +
+gstjpeg +GstJpeg +
+ +
+gstjpegdec +GstJpegDec + +GST_TYPE_PARSEAU +
+ +
+gstjpegenc +GstJpegEnc + +GST_TYPE_PARSEAU +
+ +
+gstmpg123 +GstMpg123 + +GST_TYPE_PARSEAU +
+ +
+mp3parse +Mp3Parse + +GST_TYPE_PARSEAU +
+ +
+gstxa +GstXa + +GST_TYPE_PARSEAU +
+ +
+gstxing +GstXing + +GST_TYPE_PARSEAU +
+ +
+gstmpeg_play +GstMpeg_play + +GST_TYPE_PARSEAU +
+ +
+mpeg1parse +Mpeg1Parse + +GST_TYPE_PARSEAU +
+ +
+gstmpeg1encoder +GstMpeg1encoder + +GST_TYPE_PARSEAU +
+ +
+system_encode +System_Encode + +GST_TYPE_PARSEAU +
+ +
+gstmpegaudio +GstMpegAudio + +GST_TYPE_PARSEAU +
+ +
+mp1videoparse +Mp1VideoParse + +GST_TYPE_PARSEAU +
+ +
+ac3dec +Ac3Dec + +GST_TYPE_PARSEAU +
+ +
+ac3parse +Ac3Parse + +GST_TYPE_PARSEAU +
+ +
+mpeg2parse +Mpeg2Parse + +GST_TYPE_PARSEAU +
+ +
+gstmpeg2play +GstMpeg2play + +GST_TYPE_PARSEAU +
+ +
+gstmpeg2enc +GstMpeg2enc + +GST_TYPE_PARSEAU +
+ +
+mpeg2subt +Mpeg2Subt + +GST_TYPE_PARSEAU +
+ +
+mp2videoparse +Mp2VideoParse + +GST_TYPE_PARSEAU +
+ +
+rtjpegdec +RTJpegDec + +GST_TYPE_PARSEAU +
+ +
+rtjpegenc +RTJpegEnc + +GST_TYPE_PARSEAU +
+ +
+vcdsrc +VCDSrc + +GST_TYPE_PARSEAU +
+ +
+videosink +GstVideoSink + +GST_TYPE_VIDEOSINK +
+ +
+smoothwave +GstSmoothWave + +GST_TYPE_PARSEAU +
+ +
+gstspectrum +GstSpectrum + +GST_TYPE_PARSEAU +
+ +
+synaesthesia +GstSynaesthesia + +GST_TYPE_PARSEAU +
+ +
+vumeter +GstVuMeter + +GST_TYPE_PARSEAU +
+ +
+gstparsewav +GstParseWav + +GST_TYPE_PARSEAU +
+ +
+smooth +GstSmooth + +GST_TYPE_PARSEAU +
+ +
+median +GstMedian + +GST_TYPE_PARSEAU +
+ +
+videoscale +Videoscale + +GST_TYPE_PARSEAU +
+ +
+audioscale +Audioscale + +GST_TYPE_PARSEAU +
+ +
+vorbisenc +VorbisEnc + +GST_TYPE_PARSEAU +
+ +
+vorbisdec +VorbisDec + +GST_TYPE_PARSEAU +
+ diff --git a/docs/plugins/tmpl/ac3dec.sgml b/docs/plugins/tmpl/ac3dec.sgml new file mode 100644 index 0000000000..e0524e404b --- /dev/null +++ b/docs/plugins/tmpl/ac3dec.sgml @@ -0,0 +1,16 @@ + +Ac3Dec + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/ac3parse.sgml b/docs/plugins/tmpl/ac3parse.sgml new file mode 100644 index 0000000000..9c0b4eb817 --- /dev/null +++ b/docs/plugins/tmpl/ac3parse.sgml @@ -0,0 +1,21 @@ + +Ac3Parse + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/audioscale.sgml b/docs/plugins/tmpl/audioscale.sgml new file mode 100644 index 0000000000..1bdd4a82e9 --- /dev/null +++ b/docs/plugins/tmpl/audioscale.sgml @@ -0,0 +1,21 @@ + +Audioscale + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/cobin.sgml b/docs/plugins/tmpl/cobin.sgml new file mode 100644 index 0000000000..18fbaf137b --- /dev/null +++ b/docs/plugins/tmpl/cobin.sgml @@ -0,0 +1,16 @@ + +GstCoBin + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/dvdsrc.sgml b/docs/plugins/tmpl/dvdsrc.sgml new file mode 100644 index 0000000000..829ef6882d --- /dev/null +++ b/docs/plugins/tmpl/dvdsrc.sgml @@ -0,0 +1,16 @@ + +DVDSrc + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/example.sgml b/docs/plugins/tmpl/example.sgml new file mode 100644 index 0000000000..7bb0d3465c --- /dev/null +++ b/docs/plugins/tmpl/example.sgml @@ -0,0 +1,16 @@ + +GstExample + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstaviencoder.sgml b/docs/plugins/tmpl/gstaviencoder.sgml new file mode 100644 index 0000000000..453ee2ed19 --- /dev/null +++ b/docs/plugins/tmpl/gstaviencoder.sgml @@ -0,0 +1,26 @@ + +GstAviEncoder + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstjpeg.sgml b/docs/plugins/tmpl/gstjpeg.sgml new file mode 100644 index 0000000000..f3877611d3 --- /dev/null +++ b/docs/plugins/tmpl/gstjpeg.sgml @@ -0,0 +1,16 @@ + +GstJpeg + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstjpegdec.sgml b/docs/plugins/tmpl/gstjpegdec.sgml new file mode 100644 index 0000000000..ccbb494a84 --- /dev/null +++ b/docs/plugins/tmpl/gstjpegdec.sgml @@ -0,0 +1,16 @@ + +GstJpegDec + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstjpegenc.sgml b/docs/plugins/tmpl/gstjpegenc.sgml new file mode 100644 index 0000000000..f3b3d0673d --- /dev/null +++ b/docs/plugins/tmpl/gstjpegenc.sgml @@ -0,0 +1,16 @@ + +GstJpegEnc + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstmpeg1encoder.sgml b/docs/plugins/tmpl/gstmpeg1encoder.sgml new file mode 100644 index 0000000000..611897652b --- /dev/null +++ b/docs/plugins/tmpl/gstmpeg1encoder.sgml @@ -0,0 +1,16 @@ + +GstMpeg1encoder + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstmpeg2enc.sgml b/docs/plugins/tmpl/gstmpeg2enc.sgml new file mode 100644 index 0000000000..2ce74351f0 --- /dev/null +++ b/docs/plugins/tmpl/gstmpeg2enc.sgml @@ -0,0 +1,21 @@ + +GstMpeg2enc + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstmpeg2play.sgml b/docs/plugins/tmpl/gstmpeg2play.sgml new file mode 100644 index 0000000000..c279658d0a --- /dev/null +++ b/docs/plugins/tmpl/gstmpeg2play.sgml @@ -0,0 +1,21 @@ + +GstMpeg2play + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstmpeg_play.sgml b/docs/plugins/tmpl/gstmpeg_play.sgml new file mode 100644 index 0000000000..b3b9db6a53 --- /dev/null +++ b/docs/plugins/tmpl/gstmpeg_play.sgml @@ -0,0 +1,24 @@ + +GstMpeg_play + + + + + + + + + + + + + + + + + + + +@gstmpeg_play: the object which received the signal. +@arg1: + diff --git a/docs/plugins/tmpl/gstmpegaudio.sgml b/docs/plugins/tmpl/gstmpegaudio.sgml new file mode 100644 index 0000000000..a86cf22ed3 --- /dev/null +++ b/docs/plugins/tmpl/gstmpegaudio.sgml @@ -0,0 +1,16 @@ + +GstMpegAudio + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstmpg123.sgml b/docs/plugins/tmpl/gstmpg123.sgml new file mode 100644 index 0000000000..fe375f7779 --- /dev/null +++ b/docs/plugins/tmpl/gstmpg123.sgml @@ -0,0 +1,16 @@ + +GstMpg123 + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstparseau.sgml b/docs/plugins/tmpl/gstparseau.sgml new file mode 100644 index 0000000000..d2f22aa869 --- /dev/null +++ b/docs/plugins/tmpl/gstparseau.sgml @@ -0,0 +1,16 @@ + +parseau + + +Parse an .au file into raw audio + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstparseavi.sgml b/docs/plugins/tmpl/gstparseavi.sgml new file mode 100644 index 0000000000..22a8f3ed60 --- /dev/null +++ b/docs/plugins/tmpl/gstparseavi.sgml @@ -0,0 +1,16 @@ + +GstParseAvi + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstparsewav.sgml b/docs/plugins/tmpl/gstparsewav.sgml new file mode 100644 index 0000000000..5b536e2cf6 --- /dev/null +++ b/docs/plugins/tmpl/gstparsewav.sgml @@ -0,0 +1,16 @@ + +GstParseWav + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstreamer-plugins-unused.sgml b/docs/plugins/tmpl/gstreamer-plugins-unused.sgml new file mode 100644 index 0000000000..d59270a898 --- /dev/null +++ b/docs/plugins/tmpl/gstreamer-plugins-unused.sgml @@ -0,0 +1,7999 @@ + + + + + +@packet_length: +@PES_scrambling_control: +@PES_priority: +@data_alignment_indicator: +@copyright: +@original_or_copy: +@PTS_DTS_flags: +@ESCR_flag: +@ES_rate_flag: +@DSM_trick_mode_flag: +@additional_copy_info_flag: +@CRC_flag: +@PES_extension_flag: +@PES_header_data_length: +@PTS: +@DTS: +@ESCR_base: +@ESCR_extension: +@ES_rate: +@trick_mode_control: + + + + + + +@sector: +@pack: +@sys_header: +@packet_size: +@inputbuffer: +@type: +@buffer_scale: +@buffer_size: +@buffers: +@PTS: +@DTS: +@timestamps: +@which_streams: + + + + + + + + + + +@x: +@y: +@mask: +@XIob: + + + + + + +@value: +@m1: + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + +@name: +@Returns: + + + + + + + + + + + + +@cobin: + + + + + + +@matrix: + + +bit_allocate + + + + + + + +@pad: +@buf: + + + + + + + + + + + + +@matrix: +@qptr: +@qfact: + + + + + + + + + + + + + + + + + + +@mp: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + +@sink: +@Returns: + + + + + + + + + + + + +@width: +@height: +@Returns: + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + +@syncinfo: + + + + + + + + + + + + + + + + + + +@riff: +@Returns: + + + + + + +@obj: + + + + pads + + test + + + + + + + + + + + + + + + +@vs: + + + + + + +@s: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + +@Returns: + + + + + + + + + + +@Returns: + + + + + + +@name: +@Returns: + + +globals + + + + + + + +@matrix: +@newmatrix: + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@Returns: + + + + + + +@vid_stream: +@filename: + + + + + + + + + + + + + + +csize + + + +mem + + + + + + + +@dt: +@out0: +@out1: +@samples: + + + + + + + + + + + + + + + + + + + + + + + + +@fd: +@Returns: + + + + + + + + + + + + +@mb: + + +RTjpeg + + + + + + + + + + + + + + + + + + + + + +mpeg2enc + + + + + + + + + + + + + +@val: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@distance: + + + + + + + + + + + + + + + + + + + + + + +@audblk: +@coeffs: + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + +@vid_stream: +@index: +@matrix: + + + + + + + + + + + + + + + + + + +@bsi: +@audblk_t: +@coeffs: +@samples: + + + + + + + + + + + + + + + + + + + + + + +@matrix: +@qptr: +@qfact: + + + + + + +@info: + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + +@m1: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Param1: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@fr: +@bandPtr: +@samples: +@pnt: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@mb: +@buf: + + + + + + + + + + + + + + + + +@type: +@id: +@Returns: + + + + + + + + + + + + +@vid_stream: +@index: +@matrix: + + + + + + + + + + + + +@matrix: + + + + + + +@window: +@gc: +@image: +@xsrc: +@ysrc: +@wsrc: +@hsrc: +@xdest: +@ydest: +@wdest: +@hdest: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + +@codec: +@width: +@height: +@planes: +@bit_cnt: +@Returns: + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + + + + + + + +@named_st: + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + +@vid_stream: +@rx: +@ry: +@rm: +@cx: +@cy: +@cm: +@ox: +@oy: + + + + + + + + + + + + + + + + + + +@Returns: + + +l2tables + + + + + + + + + + + + + +@h: +@framebytes_arg: +@reduction_code: +@transform_code: +@convert_code: +@freq_limit: +@Returns: + + +grab + + + + + + + +@vid_stream: + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@pad: +@buf: + + + + + + +@Q: + + + + + + + + +bitstream + + + + + + + + + +exponent + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + +@widget: +@width: +@height: + + + + + + +@pb: +@len: + + + + + + +@obj: + + + + + + +@vid_stream: +@data: +@size: +@state: +@Returns: + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + +@Param1: + + + + + + + + + + + + + + +encoder + + + + + + + +@Returns: + + + + + + +@vid_stream: + + + + + + +@de: +@inbuf: +@inlen: +@outbuf: +@outlen: +@Returns: + + + + + + + + + + + + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + + + +mpeg2dec + + + + + + + +@buf: +@rgb: + + +param + + + + + + + + + + + + + +@parseavi: +@buf: + + + + + + + + + + + + +@widget: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + +parse + + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + +@gb: +@macro_val: + + + + + + +@buf: +@rgb: + + + + + + + + +stats + + + + + + + + + + + + + +@gb: +@quant: +@motion_fwd: +@motion_bwd: +@pat: +@intra: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gb: +@quant: +@motion_fwd: +@motion_bwd: +@pat: +@intra: + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@gb: +@quant: +@motion_fwd: +@motion_bwd: +@pat: +@intra: + + + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@mp: + + + + + + + + + + + + + + + + + + +@bsi: +@audblk: +@gb: + + + + + + +@buf: +@rgb: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@fnum: +@Returns: + + + + + + +@Returns: + + + + + + +@vid_stream: +@val: +@huff: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@sp: +@bp: + + + + + + + + + + + + + + + + + + +@huff: + + + + + + + + + + + + +@matrix: + + + + + + + + + + + + + + + + + + + + + + + + +@obj: + + + + + + +@vid_stream: + + + + + + + + + + + + +@ptr: +@index: +@value: + + + + + + + + + + +@Returns: + + + + + + + + + + + + + + + + +@enc: +@inbuf: +@outbuf: +@outlen: +@Returns: + + + + + + +@Param1: +@Param2: + + + + + + +@Returns: + + + + + + +@Varargs: + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + +ac3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@bsi: +@samples: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@filename: +@pwidth: +@pheight: +@width: +@height: +@omem: +@Returns: + + + + + + + + + + + + + + + + +@bs: +@Returns: + + +GtkOverlayImage + + + + + + + + + + + + + +@matrix: +@newmatrix: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vs: + + + + + + + + + + + + +@klass: + + + + + + +@pad: +@buf: + + + + + + +@pad: +@buf: + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + +@fr: +@bits: + + + + + + +@var: +@lo: +@hi: +@str: + + + + + + +@de: +@scale: + + + + + + +@audblk: + + + + + + +@fr: +@Returns: + + + + + + +@buf: +@n: +@h: +@br: +@Returns: + + + + + + +@buf: +@n: +@h: +@br: +@searchForward: +@Returns: + + + + + + + + + + + + + + + + +@value: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + + + + + +@filename: +@mem: +@Returns: + + + + + + +@Returns: + + + + + + +@DVDSRC_OPEN: + + + + + + + + + + +@fmt: +@Varargs: + + + + + + + + + + +@Returns: + + + + + + + + + + + + +@huff: + + + + + + + + + + + + + + + + + + + + + + + + +@x: +@y: + + + + + + + + + + +@id: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@b: + + + + + + +@pad: +@buf: + + +decode + + + + + + + + + + + + + + + + + + + + + + + + + +common + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@n: +@b: + + + + + + + + +mhead + + + + + + + + + + + + + +@pb: +@Returns: + + +port + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pack: +@SCR: +@mux_rate: + + + + + + + + + + + + +@pad: +@Returns: + + + + + + +@mb: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + +@vid_stream: +@store: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + +@Varargs: +@Param2: + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + +@wFormatTag: +@wChannels: +@dwSamplesPerSec: +@dwAvgBytesPerSec: +@wBlockAlign: +@wBitsPerSample: + + + + + + + + + + + + + + +dvd_udf + + + + + + + +@gb: +@dct_coeff_tbl: +@run: +@level: + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + +@vid_stream: +@matrix: +@XIob: +@YIob: + + + + + + + + +qtables + + + + + + + +@Returns: + + + + + + + + + + + + +@image: +@val: + + + + + + + + + + + + +@Returns: + + + + + + +@vid_stream: +@matrix: +@XIob: + + +musicin + + + + + + + +@filename: +@width: +@height: +@omem: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@index: + + + + + + + + + + + + + + + + +@bsi: +@gb: + + + + + + + + + + + + +@x: +@y: + + + + + + + + + + + + +@info: + + + + + + +@matrix: +@qptr: +@qfact: + + + + + + + + + + + + + + + + + + + + + + + + +@fr: +@Param2: + + + + + + + + + + + + + + + + + + +@gb: +@val: + + + + + + + + + + + + + + + + + + +@riff: +@buf: +@off: +@Returns: + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@fr: +@header: +@Returns: + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + +@vid_stream: +@distance: + + + + + + + + + + + + +@table: + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + +@GST_V4LSRC_OPEN: + + + + + + +@Returns: + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + +@image: +@x_shm_info: +@im_adaptor: +@im_port: +@im_format: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Varargs: +@Varargs: +@Returns: + + + + + + + + + + + + +@fr: +@bandPtr: +@channel: +@out: +@nb_blocks: +@Returns: + + + + + + +@vid_stream: +@inbuf: +@size: +@encoder_state: +@Returns: + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vs: +@o: +@i: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@h: +@framebytes_arg: +@reduction_code: +@transform_code: +@convert_code: +@freq_limit: +@Returns: + + + + + + +@vid_stream: +@fs: +@index: + + + + + + +@imatrix: +@omatrix: + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + +@VCDSRC_OPEN: + + + + + + +@vid_stream: +@store: + + + + + + + + + + + + +@bsi: + + + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + +@bs: +@pcmbuf: +@Returns: + + + + + + +@vid_stream: +@Returns: + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@fr: +@Returns: + + + + + + + + + + + + +@fr: +@Returns: + + + + + + +@m1: +@m2: + + + + + + + + + + + + +@fr: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + +@vid_stream: +@fs: + + + + + + +@Returns: + + + + + + + + + + + + +@bandPtr: +@channel: +@out: +@Returns: + + + + + + + + + + + + +@pb: +@val: +@n: + + + + + + +@Returns: + + + + + + + + + + + + +@sp: +@bp: +@Returns: + + + + + + +@vid_stream: +@inbuf: +@inlen: +@first: +@Returns: + + + + + + +@Returns: + + + + + + +@i: + + + + + + + + + + + + + + + + + + +@Param1: +@Param2: +@Returns: + + + + + + +@Returns: + + + + + + +@obj: + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@Returns: + + + + + + +@bs: +@num_bits: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + +vlc + + + + + + + +@vid_stream: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@filename: +@extname: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Param1: +@Param2: + + + + + + + + + + + + +@fr: +@no: +@Returns: + + + + + + + + +putbits + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@sp: +@bp: +@lmask: +@Returns: + + + + + + + + + + + + + + + + + + +@pb: + + + + + + + + +marker + + + + + + + + + + + + + + + + + + + + + + + + + +@image: + + + + + + + + + + + + +@vid_stream: +@hp: +@vp: +@h: +@v: +@Returns: + + + + + + + + + + + + +output + + + + + + + + + + + + + +@mb: +@scr: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@riff: +@Returns: + + + + + + + + +GtkXvImage + + + + + + + +@mb: + + + + + + + + +L3 + + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + +@stream_id: +@STD_buffer_bound_scale: +@STD_buffer_size_bound: + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + +dga + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@sys_header: +@rate_bound: +@audio_bound: +@fixed: +@CSPS: +@audio_lock: +@video_lock: +@video_bound: +@stream1: +@buffer1_scale: +@buffer1_size: +@stream2: +@buffer2_scale: +@buffer2_size: +@which_streams: + + + + + + + + + + + + +@Param1: + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + +@Varargs: + + +dct + + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@Param1: +@Param2: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@index: +@value: + + + + + + + + + + + + + + +itype + + + +uncouple + + + + + + + + + + + + + +@vid_stream: +@index: + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parseavi: +@pad_nr: +@strf: +@Returns: + + + + + + + + + + + + +@Param1: +@Varargs: +@Varargs: +@Returns: + + + + + + +@length: +@original_length: +@frame_type: +@PTS: +@DTS: + + + + + + + + + + + + + + + + + + +@matrix: +@qptr: +@qfact: + + + + + + +@vid_stream: +@huff: +@Returns: + + + + + + + + + + + + + + +main + + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + +@bs: +@pcm: +@Returns: + + + + + + + + +video + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Param1: +@Param2: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@flag: + + + + + + +@sp: +@bp: + + + + + + + + + + + + +@Param1: + + + + + + +@sp: +@bp: + + + + + + +@Returns: + + + + + + +@bs: + + + + + + + + + + + + +@syncinfo: +@gb: + + + + + + + + + + + + +@mb: + + + + + + + + + + + + + + + + + + +@Param1: + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ctables + + + + + + + +@obj: + + + + + + +@src: + + + + + + + + + + + + + + + + + + + + + + + + +@sp: +@bp: +@Returns: + + + + + + +@sp: +@bp: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + +@pad: +@buf: + + +tables + + + + + + + +@fscod: +@bsi: +@audblk: + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + +stream + + + + + + + + + + + +@fr: +@bandPtr: +@channel: +@out: +@pnt: +@Returns: + + + + + + + + + + + + + + + + + + + + + + +@mb: + + + + + + + + + + + + +@Param1: +@Param2: +@Param3: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Param1: +@Returns: + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + +@txt: + + + + + + + + + + + + +@mb: +@size: + + + + + + +@file: +@Returns: + + +size + + + + + + + +@name: +@Returns: + + + + + + +@name: +@Returns: + + + + + + + + + + + + +@b: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@mp: + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@obj: + + + + + + +@obj: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@Returns: + + + + + + + + + + + + +@var: +@lo: +@hi: +@str: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + +@gb: +@value: + + + + + + +@imatrix: +@omatrix: + + + + + + +@bsi: +@audblk: +@gb: + + + + + + +@Varargs: +@Varargs: +@Returns: + + + + + + + + + + + + + + +tableawd + + + +debug + + + + + + + +@Param1: +@Returns: + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + +proto + + + + + + + + + + + + + + + +acconfig + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Varargs: +@Param2: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@tc: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + +@Param1: +@Returns: + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + + + + + + + +@image: +@val: + + + + + + +@buf: +@rgb: + + + + + + +@info: + + + + + + +@pad: +@buf: + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + +@vid_stream: +@Returns: + + + + + + +@vid_stream: +@Returns: + + + + + + + + + + + + +@vid_stream: +@filename: + + + + + + +@vid_stream: +@index: +@matrix: + + + + + + +@matrix: +@newmatrix: + + + + + + + + + + + + +@pad: +@buf: + + +htable + + + + + + + + + + + + + + + + + +@vid_stream: +@hp: +@vp: +@h: +@v: + + + + + + + + +gstriff + + + + + + + +@vid_stream: + + + + + + + + + + + + + + +crc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +downmix + + + + + + + + + + + + + + + + + + + +@filename: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + +config + + + + + + + +@buf: +@rgb: + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + + + + + + + +@blk: +@i_quant_mat: +@Returns: + + + + + + + + + + + + + + + + + + +gdkxvimage + + + + + + + + + + + + + +@offset: +@id: +@size: + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@data: + + + + + + + + + + + + +@vid_stream: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@index: +@matrix: + + + + + + + + + + + + +@Param1: +@Param2: +@Returns: + + + + + + +@pb: +@buffer: +@len: + + + + + + + + + + + + +@h: +@framebytes_arg: +@reduction_code: +@transform_code: +@convert_code: +@freq_limit: +@Returns: + + + + + + + + + + + + +@enc: +@Returns: + + + + + + + + + + + + +@Returns: + + + + + + +@vid_stream: +@coef: +@LocalEHuff: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@value: +@flag: + + + + + + + + + + + + +@vid_stream: + + + + + + +@buf: +@n: +@h: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + +@vid_stream: + + + + + + +@Varargs: +@Param2: + + + + + + + + + + + + +buffer + + + + + + + +@cobin: + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@type: +@width: +@height: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@filename: +@pwidth: +@pheight: +@mem: +@Returns: + + + + + + + + + + +@bs: +@pcm: +@Returns: + + + + + + +@mem: + + + + + + +@vid_stream: +@matrix: +@XIob: +@YIob: + + + + + + +@vid_stream: +@RefFS: +@NewFS: + + + + + + +@vid_stream: +@LocalDHuff: +@Returns: + + + + + + +@riff: +@fourcc: +@Returns: + + + + + + + + + + + + + + + + + + +@buffer: +@length: +@base: +@scan_pos: +@last_pos: +@current_start: +@buffer_type: +@stream_id: +@new_frame: +@next_frame_time: + + + + + + + + + + + + +@syncinfo: +@bsi: + + + + + + + + + + + + + + + + + + +@parseavi: +@pad_nr: +@strf: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@matrix: + + + + + + +@fr: +@Returns: + + + + + + + + + + + + +@matrix: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + +huffman + + + +system + + + +ring_buffer + + + + + + + + + + + + + +@vid_stream: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@matrix: +@XIob: + + + + + + + + + + +@pb: + + + + + + + + + + + + +@gb: +@runval: +@levelval: + + + + + + + + + + + + +@buf: +@rgb: + + + + + + + + + + + + +@vid_stream: + + + + + + +@index: +@value: + + +util + + + + + + + +@vid_stream: + + + + + + +@name: +@Returns: + + + + + + + + +getvlc + + + + + + + + + + + + + +stamp + + + + + + + + + + + + + +@vid_stream: +@Returns: + + +prototypes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + +@name: +@Returns: + + + + + + + + +mpg123 + + + + + + + + + + + + + +@vid_stream: +@n: +@Returns: + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + +@bsi: +@audblk: +@coeffs: + + +core + + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + +@Param1: + + + + + + +@klass: + + + + + + + + + + + + +@Param1: +@Varargs: + + + + + + + + + + + + +@outbfr: +@outbase: +@temp: +@outcnt: +@bytecnt: +@len: +@newlen: + + + + + + + + + + +@Param1: +@Varargs: + + + + + + +@vid_stream: + + + + + + +@vid_stream: + + + + + + +@fourcc: +@Returns: + + + + + + +@Param1: +@Returns: + + + + + + +@name: + + +mantissa + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +imdct + + + + + + + + + + + + + + + + + + + +@pad: +@buf: + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@fmcmatrix: +@bmcmatrix: +@imcmatrix: +@XIob: +@YIob: + + + + + + +@vid_stream: + + + + + + +@gb: +@runval: +@levelval: + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + +@bsi: +@audblk: +@coeffs: + + + + + + + + + + + + +@vid_stream: + + + + + + +@Param1: +@Param2: +@Returns: + + + + + + + + + + + + + + + + + + + + + + +@sp: +@bp: +@lmask: +@cmask: +@Returns: + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@Returns: + + + + + + + + + + + + +@Param1: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@packet_length: +@PES_scrambling_control: +@PES_priority: +@data_alignment_indicator: +@copyright: +@original_or_copy: +@PTS_DTS_flags: +@ESCR_flag: +@ES_rate_flag: +@DSM_trick_mode_flag: +@additional_copy_info_flag: +@CRC_flag: +@PES_extension_flag: +@PES_header_data_length: +@PTS: +@DTS: +@ESCR_base: +@ESCR_extension: +@ES_rate: +@trick_mode_control: + + + + + + +@pad: +@buf: + + + + + + + + + + + + +@type: +@byte_order: +@width: +@height: +@depth: +@bpp: +@bpl: +@mem: + + + + + + + + + + + + +@Param1: +@Param2: + + +rematrix + + + + + + + + + + + + + +@form: +@chunks: +@state: +@curoffset: +@nextlikely: + + + + + + + + + + + + +@ptr: +@index: +@value: + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@a: +@b: +@samples: + + + + + + +@vs: +@o: +@i: + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@header: +@Returns: + + + + + + +decoders + + + + + + + +@x: +@coef: + + + + + + + + + + + + + + + + + + +@riff: +@number: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@syncinfo: +@gb: + + +dither + + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + +@gb: +@macro_val: + + + + + + + + + + + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@vid_stream: +@source: +@dest: + + + + + + + + + + + + + + +jdw + + + + + + + +@vid_stream: + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + +@vid_stream: +@pmem: +@fmem: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@gb: +@coded_bp: + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstspectrum.sgml b/docs/plugins/tmpl/gstspectrum.sgml new file mode 100644 index 0000000000..feebe84b6e --- /dev/null +++ b/docs/plugins/tmpl/gstspectrum.sgml @@ -0,0 +1,21 @@ + +GstSpectrum + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstv4lsrc.sgml b/docs/plugins/tmpl/gstv4lsrc.sgml new file mode 100644 index 0000000000..cece4f3cdb --- /dev/null +++ b/docs/plugins/tmpl/gstv4lsrc.sgml @@ -0,0 +1,86 @@ + +GstV4lSrc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstwincodec.sgml b/docs/plugins/tmpl/gstwincodec.sgml new file mode 100644 index 0000000000..8b34fd613a --- /dev/null +++ b/docs/plugins/tmpl/gstwincodec.sgml @@ -0,0 +1,16 @@ + +GstWin + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstwindec.sgml b/docs/plugins/tmpl/gstwindec.sgml new file mode 100644 index 0000000000..b3e9fc4613 --- /dev/null +++ b/docs/plugins/tmpl/gstwindec.sgml @@ -0,0 +1,26 @@ + +GstWinDec + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstwinenc.sgml b/docs/plugins/tmpl/gstwinenc.sgml new file mode 100644 index 0000000000..2a4997b045 --- /dev/null +++ b/docs/plugins/tmpl/gstwinenc.sgml @@ -0,0 +1,49 @@ + +GstWinEnc + + + + + + + + + + + + + + + + + + + +@gstwinenc: the object which received the signal. +@arg1: + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstxa.sgml b/docs/plugins/tmpl/gstxa.sgml new file mode 100644 index 0000000000..259ac0a862 --- /dev/null +++ b/docs/plugins/tmpl/gstxa.sgml @@ -0,0 +1,16 @@ + +GstXa + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/gstxing.sgml b/docs/plugins/tmpl/gstxing.sgml new file mode 100644 index 0000000000..cf9d21493a --- /dev/null +++ b/docs/plugins/tmpl/gstxing.sgml @@ -0,0 +1,16 @@ + +GstXing + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/median.sgml b/docs/plugins/tmpl/median.sgml new file mode 100644 index 0000000000..aa35882720 --- /dev/null +++ b/docs/plugins/tmpl/median.sgml @@ -0,0 +1,26 @@ + +GstMedian + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/mp1videoparse.sgml b/docs/plugins/tmpl/mp1videoparse.sgml new file mode 100644 index 0000000000..4e79b5c405 --- /dev/null +++ b/docs/plugins/tmpl/mp1videoparse.sgml @@ -0,0 +1,16 @@ + +Mp1VideoParse + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/mp2videoparse.sgml b/docs/plugins/tmpl/mp2videoparse.sgml new file mode 100644 index 0000000000..fd9d6a8479 --- /dev/null +++ b/docs/plugins/tmpl/mp2videoparse.sgml @@ -0,0 +1,16 @@ + +Mp2VideoParse + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/mp3parse.sgml b/docs/plugins/tmpl/mp3parse.sgml new file mode 100644 index 0000000000..6836a94154 --- /dev/null +++ b/docs/plugins/tmpl/mp3parse.sgml @@ -0,0 +1,21 @@ + +Mp3Parse + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/mpeg1parse.sgml b/docs/plugins/tmpl/mpeg1parse.sgml new file mode 100644 index 0000000000..a77682a3d2 --- /dev/null +++ b/docs/plugins/tmpl/mpeg1parse.sgml @@ -0,0 +1,21 @@ + +Mpeg1Parse + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/mpeg2parse.sgml b/docs/plugins/tmpl/mpeg2parse.sgml new file mode 100644 index 0000000000..fafd52ecf5 --- /dev/null +++ b/docs/plugins/tmpl/mpeg2parse.sgml @@ -0,0 +1,21 @@ + +Mpeg2Parse + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/mpeg2subt.sgml b/docs/plugins/tmpl/mpeg2subt.sgml new file mode 100644 index 0000000000..b70dee2bb3 --- /dev/null +++ b/docs/plugins/tmpl/mpeg2subt.sgml @@ -0,0 +1,21 @@ + +Mpeg2Subt + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/rtjpegdec.sgml b/docs/plugins/tmpl/rtjpegdec.sgml new file mode 100644 index 0000000000..219eaa84ef --- /dev/null +++ b/docs/plugins/tmpl/rtjpegdec.sgml @@ -0,0 +1,16 @@ + +RTJpegDec + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/rtjpegenc.sgml b/docs/plugins/tmpl/rtjpegenc.sgml new file mode 100644 index 0000000000..6b40115927 --- /dev/null +++ b/docs/plugins/tmpl/rtjpegenc.sgml @@ -0,0 +1,16 @@ + +RTJpegEnc + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/smooth.sgml b/docs/plugins/tmpl/smooth.sgml new file mode 100644 index 0000000000..f4ee1d3066 --- /dev/null +++ b/docs/plugins/tmpl/smooth.sgml @@ -0,0 +1,31 @@ + +GstSmooth + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/smoothwave.sgml b/docs/plugins/tmpl/smoothwave.sgml new file mode 100644 index 0000000000..c9e149c7c5 --- /dev/null +++ b/docs/plugins/tmpl/smoothwave.sgml @@ -0,0 +1,31 @@ + +GstSmoothWave + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/spindentity.sgml b/docs/plugins/tmpl/spindentity.sgml new file mode 100644 index 0000000000..58c174a695 --- /dev/null +++ b/docs/plugins/tmpl/spindentity.sgml @@ -0,0 +1,16 @@ + +GstSpindentity + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/stereo.sgml b/docs/plugins/tmpl/stereo.sgml new file mode 100644 index 0000000000..09f343c3f8 --- /dev/null +++ b/docs/plugins/tmpl/stereo.sgml @@ -0,0 +1,26 @@ + +GstStereo + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/synaesthesia.sgml b/docs/plugins/tmpl/synaesthesia.sgml new file mode 100644 index 0000000000..ac866565bc --- /dev/null +++ b/docs/plugins/tmpl/synaesthesia.sgml @@ -0,0 +1,31 @@ + +GstSynaesthesia + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/system_encode.sgml b/docs/plugins/tmpl/system_encode.sgml new file mode 100644 index 0000000000..497a7934a8 --- /dev/null +++ b/docs/plugins/tmpl/system_encode.sgml @@ -0,0 +1,26 @@ + +System_Encode + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/vcdsrc.sgml b/docs/plugins/tmpl/vcdsrc.sgml new file mode 100644 index 0000000000..b00fc82390 --- /dev/null +++ b/docs/plugins/tmpl/vcdsrc.sgml @@ -0,0 +1,16 @@ + +VCDSrc + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/videoscale.sgml b/docs/plugins/tmpl/videoscale.sgml new file mode 100644 index 0000000000..b3b8699d84 --- /dev/null +++ b/docs/plugins/tmpl/videoscale.sgml @@ -0,0 +1,26 @@ + +Videoscale + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/videosink.sgml b/docs/plugins/tmpl/videosink.sgml new file mode 100644 index 0000000000..0dfafbac05 --- /dev/null +++ b/docs/plugins/tmpl/videosink.sgml @@ -0,0 +1,55 @@ + +GstVideoSink + + + + + + + + + + + + + + + + + + + +@gstvideosink: the object which received the signal. + +@arg1: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/volume.sgml b/docs/plugins/tmpl/volume.sgml new file mode 100644 index 0000000000..d285c5c442 --- /dev/null +++ b/docs/plugins/tmpl/volume.sgml @@ -0,0 +1,26 @@ + +GstVolume + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/vorbisdec.sgml b/docs/plugins/tmpl/vorbisdec.sgml new file mode 100644 index 0000000000..37f99b0f97 --- /dev/null +++ b/docs/plugins/tmpl/vorbisdec.sgml @@ -0,0 +1,16 @@ + +VorbisDec + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/vorbisenc.sgml b/docs/plugins/tmpl/vorbisenc.sgml new file mode 100644 index 0000000000..358d634e9c --- /dev/null +++ b/docs/plugins/tmpl/vorbisenc.sgml @@ -0,0 +1,16 @@ + +VorbisEnc + + + + + + + + + + + + + + diff --git a/docs/plugins/tmpl/vumeter.sgml b/docs/plugins/tmpl/vumeter.sgml new file mode 100644 index 0000000000..34abf7a5c8 --- /dev/null +++ b/docs/plugins/tmpl/vumeter.sgml @@ -0,0 +1,46 @@ + +GstVuMeter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gst/elements/gstasyncdisksrc.c b/gst/elements/gstasyncdisksrc.c index 36b9d010ee..3bb7fab4ba 100644 --- a/gst/elements/gstasyncdisksrc.c +++ b/gst/elements/gstasyncdisksrc.c @@ -46,8 +46,8 @@ enum { ARG_0, ARG_LOCATION, ARG_BYTESPERREAD, - ARG_LENGTH, ARG_OFFSET, + ARG_SIZE, }; @@ -101,10 +101,10 @@ gst_asyncdisksrc_class_init(GstAsyncDiskSrcClass *klass) { GTK_ARG_READWRITE, ARG_LOCATION); gtk_object_add_arg_type("GstAsyncDiskSrc::bytesperread", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_BYTESPERREAD); - gtk_object_add_arg_type("GstAsyncDiskSrc::length", GTK_TYPE_LONG, - GTK_ARG_READABLE, ARG_LENGTH); gtk_object_add_arg_type("GstAsyncDiskSrc::offset", GTK_TYPE_LONG, GTK_ARG_READWRITE, ARG_OFFSET); + gtk_object_add_arg_type("GstAsyncDiskSrc::size", GTK_TYPE_LONG, + GTK_ARG_READABLE, ARG_SIZE); gtkobject_class->set_arg = gst_asyncdisksrc_set_arg; gtkobject_class->get_arg = gst_asyncdisksrc_get_arg; @@ -178,12 +178,12 @@ static void gst_asyncdisksrc_get_arg(GtkObject *object,GtkArg *arg,guint id) { case ARG_BYTESPERREAD: GTK_VALUE_INT(*arg) = src->bytes_per_read; break; - case ARG_LENGTH: - GTK_VALUE_LONG(*arg) = src->size; - break; case ARG_OFFSET: GTK_VALUE_LONG(*arg) = src->curoffset; break; + case ARG_SIZE: + GTK_VALUE_LONG(*arg) = src->size; + break; default: arg->type = GTK_TYPE_INVALID; break; diff --git a/gst/elements/gstaudiosink.c b/gst/elements/gstaudiosink.c index fb53a82965..d3674b5320 100644 --- a/gst/elements/gstaudiosink.c +++ b/gst/elements/gstaudiosink.c @@ -155,8 +155,7 @@ gst_audiosink_class_init(GstAudioSinkClass *klass) { gst_audiosink_signals[SIGNAL_HANDOFF] = gtk_signal_new("handoff",GTK_RUN_LAST,gtkobject_class->type, GTK_SIGNAL_OFFSET(GstAudioSinkClass,handoff), - gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1, - GST_TYPE_AUDIOSINK); + gtk_marshal_NONE__NONE,GTK_TYPE_NONE,0); gtk_object_class_add_signals(gtkobject_class,gst_audiosink_signals, LAST_SIGNAL); diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index ca99a85eb4..c5827aa505 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -42,6 +42,15 @@ GstBufferPool *gst_buffer_pool_new() return pool; } +/** + * gst_buffer_pool_set_create_function: + * @pool: the pool to set the create function for + * @create: the create function + * @user_data: any user data to be passed in the create function + * + * Sets the function that will be called when a buffer is created + * from this pool. + */ void gst_buffer_pool_set_create_function(GstBufferPool *pool, GstBufferPoolCreateFunction create, gpointer user_data) { g_return_if_fail(pool != NULL); @@ -50,6 +59,15 @@ void gst_buffer_pool_set_create_function(GstBufferPool *pool, GstBufferPoolCreat pool->new_user_data = user_data; } +/** + * gst_buffer_pool_set_destroy_function: + * @pool: the pool to set the destroy function for + * @destroy: the destroy function + * @user_data: any user data to be passed in the create function + * + * Sets the function that will be called when a buffer is destroyed + * from this pool. + */ void gst_buffer_pool_set_destroy_function(GstBufferPool *pool, GstBufferPoolDestroyFunction destroy, gpointer user_data) { g_return_if_fail(pool != NULL); @@ -58,6 +76,12 @@ void gst_buffer_pool_set_destroy_function(GstBufferPool *pool, GstBufferPoolDest pool->destroy_user_data = user_data; } +/** + * gst_buffer_pool_destroy: + * @pool: the pool to destroy + * + * frees the memory for this bufferpool + */ void gst_buffer_pool_destroy(GstBufferPool *pool) { g_return_if_fail(pool != NULL); @@ -65,6 +89,14 @@ void gst_buffer_pool_destroy(GstBufferPool *pool) g_free(pool); } +/** + * gst_buffer_pool_new_buffer: + * @pool: the pool to create the buffer from + * + * uses the given pool to create a new buffer. + * + * Returns: The new buffer + */ GstBuffer *gst_buffer_pool_new_buffer(GstBufferPool *pool) { GstBuffer *buffer; @@ -77,6 +109,13 @@ GstBuffer *gst_buffer_pool_new_buffer(GstBufferPool *pool) return buffer; } +/** + * gst_buffer_pool_destroy_buffer: + * @pool: the pool to return the buffer to + * @buffer: the buffer to return to the pool + * + * Gives a buffer back to the given pool. + */ void gst_buffer_pool_destroy_buffer(GstBufferPool *pool, GstBuffer *buffer) { g_return_if_fail(pool != NULL); diff --git a/gst/gstconnection.c b/gst/gstconnection.c index 38be65cbcd..1e026150b8 100644 --- a/gst/gstconnection.c +++ b/gst/gstconnection.c @@ -85,6 +85,12 @@ GstElement *gst_connection_new(gchar *name) { return connection; } +/** + * gst_connection_push: + * @connection: the connection to push + * + * Push a buffer along a connection + */ void gst_connection_push(GstConnection *connection) { GstConnectionClass *oclass; diff --git a/gst/gstcpu.c b/gst/gstcpu.c index c2ee86c3e5..23fcf7cd02 100644 --- a/gst/gstcpu.c +++ b/gst/gstcpu.c @@ -55,7 +55,7 @@ void _gst_cpu_initialize(void) } -guint32 gst_cpu_get_flags(void) +GstCPUFlags gst_cpu_get_flags(void) { return _gst_cpu_flags; } diff --git a/gst/gstcpu.h b/gst/gstcpu.h index e8ebd3ee50..c6ee4fb91c 100644 --- a/gst/gstcpu.h +++ b/gst/gstcpu.h @@ -23,11 +23,13 @@ #include -#define GST_CPU_FLAG_MMX (1 << 0) -#define GST_CPU_FLAG_SSE (1 << 1) +typedef enum { + GST_CPU_FLAG_MMX = (1<<0), + GST_CPU_FLAG_SSE = (1<<1), +} GstCPUFlags; void _gst_cpu_initialize(); -guint32 gst_cpu_get_flags(); +GstCPUFlags gst_cpu_get_flags(); #endif /* __GST_CPU_H__ */ diff --git a/gst/gstelement.c b/gst/gstelement.c index 1a3d1ca7b8..fa26e66170 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -523,6 +523,8 @@ xmlNodePtr gst_element_save_thyself(GstElement *element,xmlNodePtr parent) { /** * gst_element_load_thyself: * @parent: the xml parent node + * @elements: a hashtable to store the elements in. This is used + * to resolve inter element dependecies during the loading. * * load the element based on the XML description * diff --git a/gst/gstelement.h b/gst/gstelement.h index a2df7842f4..2f33610077 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -72,7 +72,7 @@ static inline char *_gst_print_statename(int state) { (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_ELEMENT,GstElementClass)) #define GST_IS_ELEMENT(obj) \ (GTK_CHECK_TYPE((obj),GST_TYPE_ELEMENT)) -#define GST_IS_ELEMENT_CLASS(obj) \ +#define GST_IS_ELEMENT_CLASS(klass) \ (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT)) typedef enum { diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index cc841d5108..28afac3698 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -77,7 +77,7 @@ GstElementFactory *gst_elementfactory_find(gchar *name) { * * Get the global list of elementfactories. * - * Returns: GList of type #GstElementFactory + * Returns: GList of type #GstElementFactory */ GList *gst_elementfactory_get_list() { return _gst_elementfactories; diff --git a/gst/gstmeta.c b/gst/gstmeta.c index 4b9665fda3..dd259cc0b1 100644 --- a/gst/gstmeta.c +++ b/gst/gstmeta.c @@ -22,6 +22,14 @@ #include +/** + * gst_meta_new_size: + * @size: the size of the new meta data + * + * Create a new metadata object with a given size + * + * Returns: new meta object + */ GstMeta *gst_meta_new_size(gint size) { GstMeta *meta; @@ -31,6 +39,12 @@ GstMeta *gst_meta_new_size(gint size) { return meta; } +/** + * gst_meta_ref: + * @meta: the meta object to ref + * + * increases the refcount of a meta object + */ void gst_meta_ref(GstMeta *meta) { g_return_if_fail(meta != NULL); @@ -38,6 +52,13 @@ void gst_meta_ref(GstMeta *meta) { meta->refcount++; } +/** + * gst_meta_unref: + * @meta: the meta object to unref + * + * decreases the refcount of a meta object. if the refcount is zero, the + * meta object is freed. + */ void gst_meta_unref(GstMeta *meta) { g_return_if_fail(meta != NULL); @@ -52,6 +73,15 @@ void gst_meta_unref(GstMeta *meta) { } +/** + * gst_meta_cow: + * @meta: the meta object prepare for write + * + * prepares a meta object for writing. A copy of the meta + * object is returned if needed. + * + * Returns: the meta object or a copy. + */ GstMeta *gst_meta_cow(GstMeta *meta) { g_return_val_if_fail(meta != NULL, NULL); return NULL; diff --git a/gst/gstmeta.h b/gst/gstmeta.h index 2ba8998afd..47b33fb037 100644 --- a/gst/gstmeta.h +++ b/gst/gstmeta.h @@ -33,8 +33,8 @@ extern "C" { #define GST_META(meta) ((GstMeta *)(meta)) -#define GST_META_FLAGS(buf) \ - (GST_META(buf)->flags) +#define GST_META_FLAGS(meta) \ + (GST_META(meta)->flags) #define GST_META_FLAG_IS_SET(meta,flag) \ (GST_META_FLAGS(meta) & (flag)) #define GST_META_FLAG_SET(meta,flag) \ diff --git a/gst/gstpad.c b/gst/gstpad.c index 063a44d2d5..f02ae37649 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -156,6 +156,13 @@ gchar *gst_pad_get_name(GstPad *pad) { return pad->name; } +/** + * gst_pad_set_pull_function: + * @pad: the pad to set the pull function for + * @pull: the pull function + * + * Set the given pull function for the pad + */ void gst_pad_set_pull_function(GstPad *pad,GstPadPullFunction pull) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -165,6 +172,13 @@ void gst_pad_set_pull_function(GstPad *pad,GstPadPullFunction pull) { pad->pullfunc = pull; } +/** + * gst_pad_set_chain_function: + * @pad: the pad to set the chain function for + * @chain: the chain function + * + * Set the given chain function for the pad + */ void gst_pad_set_chain_function(GstPad *pad,GstPadChainFunction chain) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -172,6 +186,13 @@ void gst_pad_set_chain_function(GstPad *pad,GstPadChainFunction chain) { pad->chainfunc = chain; } +/** + * gst_pad_set_qos_function: + * @pad: the pad to set the qos function for + * @qos: the qos function + * + * Set the given qos function for the pad + */ void gst_pad_set_qos_function(GstPad *pad,GstPadQoSFunction qos) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -179,7 +200,13 @@ void gst_pad_set_qos_function(GstPad *pad,GstPadQoSFunction qos) { pad->qosfunc = qos; } -/* gst_pad_push is handed the src pad and the buffer to push */ +/** + * gst_pad_push: + * @pad: the pad to push + * @buffer: the buffer to push + * + * pushes a buffer along a src pad + */ void gst_pad_push(GstPad *pad,GstBuffer *buffer) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -206,7 +233,14 @@ void gst_pad_push(GstPad *pad,GstBuffer *buffer) { } -/* gst_pad_pull() is given the sink pad */ +/** + * gst_pad_pull: + * @pad: the pad to pull + * + * pulls a buffer along a sink pad + * + * Returns: the buffer that was pulled + */ GstBuffer *gst_pad_pull(GstPad *pad) { GstBuffer *buf; // GstElement *peerparent; @@ -246,6 +280,12 @@ GstBuffer *gst_pad_pull(GstPad *pad) { return NULL; } +/** + * gst_pad_chain: + * @pad: the pad to chain + * + * call the chain function of the given pad + */ void gst_pad_chain(GstPad *pad) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -262,6 +302,7 @@ void gst_pad_chain(GstPad *pad) { * @pad: the pad to handle the QoS message * @qos_message: the QoS message to handle * + * pass the qos message downstream */ void gst_pad_handle_qos(GstPad *pad, glong qos_message) @@ -292,6 +333,13 @@ void gst_pad_handle_qos(GstPad *pad, return; } +/** + * gst_pad_disconnect: + * @srcpad: the source pad to disconnect + * @sinkpad: the sink pad to disconnect + * + * disconnects the source pad from the sink pad + */ void gst_pad_disconnect(GstPad *srcpad,GstPad *sinkpad) { /* generic checks */ @@ -313,6 +361,13 @@ void gst_pad_disconnect(GstPad *srcpad,GstPad *sinkpad) { srcpad->pullfunc = NULL; } +/** + * gst_pad_connect: + * @srcpad: the source pad to connect + * @sinkpad: the sink pad to connect + * + * connects the source pad to the sink pad + */ void gst_pad_connect(GstPad *srcpad,GstPad *sinkpad) { GstPad *temppad; @@ -348,6 +403,13 @@ void gst_pad_connect(GstPad *srcpad,GstPad *sinkpad) { /* FIXME: set connected flag */ } +/** + * gst_pad_set_parent: + * @pad: the pad to set the parent + * @parent: the object to set the parent to + * + * sets the parent object of a pad. + */ void gst_pad_set_parent(GstPad *pad,GstObject *parent) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -361,6 +423,13 @@ void gst_pad_set_parent(GstPad *pad,GstObject *parent) { pad->parent = parent; } +/** + * gst_pad_add_ghost_parent: + * @pad: the pad to set the ghost parent + * @parent: the object to set the ghost parent to + * + * add a ghost parent object to a pad. + */ void gst_pad_add_ghost_parent(GstPad *pad,GstObject *parent) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -371,6 +440,13 @@ void gst_pad_add_ghost_parent(GstPad *pad,GstObject *parent) { } +/** + * gst_pad_remove_ghost_parent: + * @pad: the pad to remove the ghost parent + * @parent: the object to remove the ghost parent from + * + * remove a ghost parent object from a pad. + */ void gst_pad_remove_ghost_parent(GstPad *pad,GstObject *parent) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -380,6 +456,14 @@ void gst_pad_remove_ghost_parent(GstPad *pad,GstObject *parent) { pad->ghostparents = g_list_remove(pad->ghostparents,parent); } +/** + * gst_pad_get_parent: + * @pad: the pad to get the parent from + * + * get the parent object of this pad + * + * Returns: the parent object + */ GstObject *gst_pad_get_parent(GstPad *pad) { g_return_val_if_fail(pad != NULL, NULL); g_return_val_if_fail(GST_IS_PAD(pad), NULL); @@ -387,6 +471,14 @@ GstObject *gst_pad_get_parent(GstPad *pad) { return pad->parent; } +/** + * gst_pad_get_ghost_parents: + * @pad: the pad to get the ghost parents from + * + * get the ghost parents of this pad + * + * Returns: a list of ghost parent objects + */ GList *gst_pad_get_ghost_parents(GstPad *pad) { g_return_val_if_fail(pad != NULL, NULL); g_return_val_if_fail(GST_IS_PAD(pad), NULL); @@ -394,6 +486,14 @@ GList *gst_pad_get_ghost_parents(GstPad *pad) { return pad->ghostparents; } +/** + * gst_pad_get_type_id: + * @pad: the pad to get the type id from + * + * get the type of this pad + * + * Returns: the type of this pad + */ guint16 gst_pad_get_type_id(GstPad *pad) { g_return_val_if_fail(pad != NULL, 0); g_return_val_if_fail(GST_IS_PAD(pad), 0); @@ -401,6 +501,13 @@ guint16 gst_pad_get_type_id(GstPad *pad) { return pad->type; } +/** + * gst_pad_set_type_id: + * @pad: the pad to set the type id to + * @id: the type id to set this pad to + * + * set the type of this pad + */ void gst_pad_set_type_id(GstPad *pad,guint16 id) { g_return_if_fail(pad != NULL); g_return_if_fail(GST_IS_PAD(pad)); @@ -409,6 +516,14 @@ void gst_pad_set_type_id(GstPad *pad,guint16 id) { pad->type = id; } +/** + * gst_pad_get_peer: + * @pad: the pad to get the peer from + * + * Get the peer pad of this pad + * + * Returns: the peer pad + */ GstPad *gst_pad_get_peer(GstPad *pad) { g_return_val_if_fail(pad != NULL, NULL); g_return_val_if_fail(GST_IS_PAD(pad), NULL); @@ -428,15 +543,13 @@ static void gst_pad_real_destroy(GtkObject *object) { /** - * gst_pad_handle_qos: + * gst_pad_load_and_connect: * @parent: the parent XML node to read the description from * @element: the element that has the source pad * @elements: a hashtable with elements * * Read the pad definition from the XML node and connect the given pad * in element to a pad of an element in the hashtable. - * - * Returns: the new Pad definition. */ void gst_pad_load_and_connect(xmlNodePtr parent, GstObject *element, GHashTable *elements) { xmlNodePtr field = parent->childs; @@ -477,6 +590,15 @@ cleanup: } +/** + * gst_pad_save_thyself: + * @pad: the pad to save + * @parent: the parent XML node to save the description in + * + * Saves the pad into an xml representation + * + * Returns: the xml representation of the pad + */ xmlNodePtr gst_pad_save_thyself(GstPad *pad,xmlNodePtr parent) { GstPad *peer; @@ -494,6 +616,16 @@ xmlNodePtr gst_pad_save_thyself(GstPad *pad,xmlNodePtr parent) { return parent; } +/** + * gst_pad_ghost_save_thyself: + * @pad: the pad to save + * @bin: the bin + * @parent: the parent XML node to save the description in + * + * Saves the ghost pad into an xml representation + * + * Returns: the xml representation of the pad + */ xmlNodePtr gst_pad_ghost_save_thyself(GstPad *pad,GstElement *bin,xmlNodePtr parent) { xmlNodePtr self; diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 8ea28be4c9..171bc59604 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -348,6 +348,14 @@ GstElementFactory *gst_plugin_find_elementfactory(gchar *name) { return NULL; } +/** + * gst_plugin_load_elementfactory: + * @name: name of elementfactory to load + * + * Load a registered elementfactory by name. + * + * Returns: @GstElementFactory if loaded, NULL if not + */ GstElementFactory *gst_plugin_load_elementfactory(gchar *name) { GList *plugins, *factories; GstElementFactory *factory = NULL; @@ -380,6 +388,12 @@ GstElementFactory *gst_plugin_load_elementfactory(gchar *name) { return factory; } +/** + * gst_plugin_load_typefactory: + * @mime: name of typefactory to load + * + * Load a registered typefactory by mime type. + */ void gst_plugin_load_typefactory(gchar *mime) { GList *plugins, *factories; GstTypeFactory *factory; @@ -416,7 +430,7 @@ void gst_plugin_load_typefactory(gchar *mime) { * @plugin: plugin to add factory to * @factory: factory to add * - * Add factory to the list of those provided by the element. + * Add factory to the list of those provided by the plugin. */ void gst_plugin_add_factory(GstPlugin *plugin,GstElementFactory *factory) { g_return_if_fail(plugin != NULL); @@ -426,6 +440,13 @@ void gst_plugin_add_factory(GstPlugin *plugin,GstElementFactory *factory) { plugin->elements = g_list_append(plugin->elements,factory); } +/** + * gst_plugin_add_type: + * @plugin: plugin to add type to + * @factory: the typefactory to add + * + * Add a typefactory to the list of those provided by the plugin. + */ void gst_plugin_add_type(GstPlugin *plugin,GstTypeFactory *factory) { g_return_if_fail(plugin != NULL); g_return_if_fail(factory != NULL); @@ -445,6 +466,14 @@ GList *gst_plugin_get_list() { return _gst_plugins; } +/** + * gst_plugin_save_thyself: + * @parent: the parent node to save the plugin to + * + * saves the plugin into an XML representation + * + * Returns: the new XML node + */ xmlNodePtr gst_plugin_save_thyself(xmlNodePtr parent) { xmlNodePtr tree, subtree; GList *plugins = NULL, *elements = NULL, *types = NULL; @@ -479,6 +508,12 @@ xmlNodePtr gst_plugin_save_thyself(xmlNodePtr parent) { return parent; } +/** + * gst_plugin_load_thyself: + * @parent: the parent node to load the plugin from + * + * load the plugin from an XML representation + */ void gst_plugin_load_thyself(xmlNodePtr parent) { xmlNodePtr kinderen; gint elementcount = 0; diff --git a/gst/gstthread.c b/gst/gstthread.c index 2a2cf246b7..6c2c2b444f 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -57,6 +57,7 @@ static void gst_thread_restore_thyself(GstElement *element,xmlNodePtr parent, GH static void gst_thread_signal_thread(GstThread *thread); static void gst_thread_create_plan_dummy(GstBin *bin); +static void *gst_thread_main_loop(void *arg); static GstBin *parent_class = NULL; //static guint gst_thread_signals[LAST_SIGNAL] = { 0 }; @@ -253,7 +254,7 @@ static GstElementStateReturn gst_thread_change_state(GstElement *element) { * The main loop of the thread. The thread will iterate * while the state is GST_THREAD_STATE_SPINNING */ -void *gst_thread_main_loop(void *arg) { +static void *gst_thread_main_loop(void *arg) { GstThread *thread = GST_THREAD(arg); gst_info("gstthread: thread \"%s\" is running with PID %d\n", diff --git a/gst/gstthread.h b/gst/gstthread.h index ceac92dcdc..bdecf353a3 100644 --- a/gst/gstthread.h +++ b/gst/gstthread.h @@ -69,9 +69,6 @@ struct _GstThreadClass { GtkType gst_thread_get_type(void); GstElement *gst_thread_new(guchar *name); -void *gst_thread_main_loop(void *arg); -void gst_thread_iterate(GstThread *thread); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/gst/gstutils.c b/gst/gstutils.c index cc631706fa..2d2c32ea27 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -20,6 +20,15 @@ #include +/** + * gst_util_get_int_arg: + * @object: the object to query + * @argname: the name of the argument + * + * retrieves a property of an object as an integer + * + * Returns: the property of the object + */ gint gst_util_get_int_arg(GtkObject *object,guchar *argname) { GtkArg arg; @@ -28,6 +37,15 @@ gint gst_util_get_int_arg(GtkObject *object,guchar *argname) { return GTK_VALUE_INT(arg); } +/** + * gst_util_get_long_arg: + * @object: the object to query + * @argname: the name of the argument + * + * retrieves a property of an object as a long + * + * Returns: the property of the object + */ glong gst_util_get_long_arg(GtkObject *object,guchar *argname) { GtkArg arg; @@ -36,6 +54,15 @@ glong gst_util_get_long_arg(GtkObject *object,guchar *argname) { return GTK_VALUE_LONG(arg); } +/** + * gst_util_get_float_arg: + * @object: the object to query + * @argname: the name of the argument + * + * retrieves a property of an object as a float + * + * Returns: the property of the object + */ gfloat gst_util_get_float_arg(GtkObject *object,guchar *argname) { GtkArg arg; @@ -44,6 +71,15 @@ gfloat gst_util_get_float_arg(GtkObject *object,guchar *argname) { return GTK_VALUE_FLOAT(arg); } +/** + * gst_util_get_double_arg: + * @object: the object to query + * @argname: the name of the argument + * + * retrieves a property of an object as a double + * + * Returns: the property of the object + */ gdouble gst_util_get_double_arg(GtkObject *object,guchar *argname) { GtkArg arg; @@ -52,6 +88,15 @@ gdouble gst_util_get_double_arg(GtkObject *object,guchar *argname) { return GTK_VALUE_DOUBLE(arg); } +/** + * gst_util_get_string_arg: + * @object: the object to query + * @argname: the name of the argument + * + * retrieves a property of an object as a string + * + * Returns: the property of the object + */ guchar *gst_util_get_string_arg(GtkObject *object,guchar *argname) { GtkArg arg; @@ -60,6 +105,15 @@ guchar *gst_util_get_string_arg(GtkObject *object,guchar *argname) { return GTK_VALUE_STRING(arg); } +/** + * gst_util_get_pointer_arg: + * @object: the object to query + * @argname: the name of the argument + * + * retrieves a property of an object as a pointer + * + * Returns: the property of the object + */ gpointer gst_util_get_pointer_arg(GtkObject *object,guchar *argname) { GtkArg arg; @@ -68,6 +122,15 @@ gpointer gst_util_get_pointer_arg(GtkObject *object,guchar *argname) { return GTK_VALUE_POINTER(arg); } +/** + * gst_util_get_widget_arg: + * @object: the object to query + * @argname: the name of the argument + * + * retrieves a property of an object as a widget + * + * Returns: the property of the object + */ GtkWidget *gst_util_get_widget_arg(GtkObject *object,guchar *argname) { GtkArg arg; @@ -76,6 +139,14 @@ GtkWidget *gst_util_get_widget_arg(GtkObject *object,guchar *argname) { return GTK_WIDGET(GTK_VALUE_OBJECT(arg)); } +/** + * gst_util_dump_mem: + * @mem: a pointer to the memory to dump + * @size: the size of the memory block to dump + * + * dumps the memory block into a hex representation. usefull + * for debugging. + */ void gst_util_dump_mem(guchar *mem, guint size) { guint i, j; diff --git a/gst/gstxml.c b/gst/gstxml.c index 9ad5d763c2..4d702438d7 100644 --- a/gst/gstxml.c +++ b/gst/gstxml.c @@ -124,7 +124,7 @@ GstXML *gst_xml_new(const guchar *fname, const guchar *root) { * @xml: The GstXML to get the element from * @name: The name of element to retreive * - * This function is used to get a pointer to the GStElement corresponding + * This function is used to get a pointer to the GstElement corresponding * to name in the pipeline description. You would use this if you have * to do anything to the element after loading. * diff --git a/libs/colorspace/gstcolorspace.h b/libs/colorspace/gstcolorspace.h index 1704d748ff..b8b89a97cd 100644 --- a/libs/colorspace/gstcolorspace.h +++ b/libs/colorspace/gstcolorspace.h @@ -28,26 +28,28 @@ #include "yuv2rgb.h" typedef enum { -#define GST_COLORSPACE_RGB_FIRST GST_COLORSPACE_RGB555 GST_COLORSPACE_RGB555, GST_COLORSPACE_BGR555, GST_COLORSPACE_RGB565, GST_COLORSPACE_BGR565, - GST_COLORSPACE_RGB24, // RGB - GST_COLORSPACE_BGR24, // RGB + GST_COLORSPACE_RGB24, + GST_COLORSPACE_BGR24, GST_COLORSPACE_RGB32, GST_COLORSPACE_BGR32, + + GST_COLORSPACE_YUV420, + GST_COLORSPACE_YUV420P, + GST_COLORSPACE_YUV422, + GST_COLORSPACE_YUV422P + +} GstColorSpaceType; + +#define GST_COLORSPACE_RGB_FIRST GST_COLORSPACE_RGB555 #define GST_COLORSPACE_RGB_LAST GST_COLORSPACE_BGR32 #define GST_COLORSPACE_YUV_FIRST GST_COLORSPACE_YUV420 - GST_COLORSPACE_YUV420, // YUV - GST_COLORSPACE_YUV420P, // YUV planar - GST_COLORSPACE_YUV422, - GST_COLORSPACE_YUV422P, #define GST_COLORSPACE_YUV_LAST GST_COLORSPACE_YUV422P -} GstColorSpaceType; - typedef struct _GstColorSpaceConverter GstColorSpaceConverter; typedef void (*GstColorSpaceConvertFunction) (GstColorSpaceConverter *space, guchar *src, guchar *dest); @@ -67,12 +69,14 @@ struct _GstColorSpaceConverter { #define GST_COLORSPACE_IS_RGB_TYPE(type) ((type)>=GST_COLORSPACE_RGB_FIRST && \ (type)<=GST_COLORSPACE_RGB_LAST) + #define GST_COLORSPACE_IS_YUV_TYPE(type) ((type)>=GST_COLORSPACE_YUV_FIRST && \ (type)<=GST_COLORSPACE_YUV_LAST) GstColorSpaceConverter *gst_colorspace_converter_new(gint width, gint height, GstColorSpaceType srcspace, GstColorSpaceType destspace, GdkVisual *destvisual); -#define gst_colorspace_convert(converter, src, dest) (converter)->convert((converter), (src), (dest)) +#define gst_colorspace_convert(converter, src, dest) \ + (converter)->convert((converter), (src), (dest)) void gst_colorspace_destroy(GstColorSpaceConverter *space); #endif /* __GST_COLORSPACE_H__ */ diff --git a/libs/idct/gstidct.h b/libs/idct/gstidct.h index 1d26bf4fa1..2e0fd4b061 100644 --- a/libs/idct/gstidct.h +++ b/libs/idct/gstidct.h @@ -24,12 +24,12 @@ #include typedef enum { - GST_IDCT_DEFAULT, // default - GST_IDCT_INT, // integer IDCT - GST_IDCT_FAST_INT, // fastest integer - GST_IDCT_FLOAT, // accurate float version - GST_IDCT_MMX, // fast MMX (not accurate) - GST_IDCT_MMX32, // accurate MMX + GST_IDCT_DEFAULT, + GST_IDCT_INT, + GST_IDCT_FAST_INT, + GST_IDCT_FLOAT, + GST_IDCT_MMX, + GST_IDCT_MMX32 } GstIDCTMethod; typedef struct _GstIDCT GstIDCT; diff --git a/libs/riff/gstriff.h b/libs/riff/gstriff.h index 75b96fae14..7d586d6fb5 100644 --- a/libs/riff/gstriff.h +++ b/libs/riff/gstriff.h @@ -26,18 +26,21 @@ #include -#define GST_RIFF_OK 0 -#define GST_RIFF_ENOTRIFF -1 /* not a RIFF file */ -#define GST_RIFF_EINVAL -2 /* wrong parameters */ -#define GST_RIFF_ENOMEM -3 /* out of memory */ +typedef enum { + GST_RIFF_OK = 0, + GST_RIFF_ENOTRIFF = -1, + GST_RIFF_EINVAL = -2, + GST_RIFF_ENOMEM = -3 +} GstRiffReturn; /* states */ -#define GST_RIFF_STATE_INITIAL 0 -#define GST_RIFF_STATE_HASAVIH 1 -#define GST_RIFF_STATE_HASSTRH 2 -#define GST_RIFF_STATE_HASSTRF 3 -#define GST_RIFF_STATE_MOVI 4 - +typedef enum { + GST_RIFF_STATE_INITIAL = 0, + GST_RIFF_STATE_HASAVIH = 1, + GST_RIFF_STATE_HASSTRH = 2, + GST_RIFF_STATE_HASSTRF = 3, + GST_RIFF_STATE_MOVI = 4 +} GstRiffParserState; #define MAKE_FOUR_CC(a,b,c,d) ( ((guint32)a) | (((guint32)b)<< 8) | \ ((guint32)c)<<16 | (((guint32)d)<<24) ) @@ -331,7 +334,7 @@ struct _GstRiff { GstRiffChunk *incomplete_chunk; guint32 incomplete_chunk_size; /* parse state */ - gint state; + GstRiffParserState state; guint32 curoffset; guint32 nextlikely; /* leftover data */ @@ -356,14 +359,14 @@ struct _GstRiffChunk { /* from gstriffparse.c */ GstRiff *gst_riff_parser_new(GstRiffCallback function, gpointer data); -gint gst_riff_parser_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off); +GstRiffReturn gst_riff_parser_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off); /* from gstriffencode.c */ GstRiff *gst_riff_encoder_new(guint32 type); -gint gst_riff_encoder_avih(GstRiff *riff, gst_riff_avih *head, gulong size); -gint gst_riff_encoder_strh(GstRiff *riff, guint32 fcc_type, gst_riff_strh *head, gulong size); -gint gst_riff_encoder_strf(GstRiff *riff, void *format, gulong size); -gint gst_riff_encoder_chunk(GstRiff *riff, guint32 chunk_type, void *chunk, gulong size); +GstRiffReturn gst_riff_encoder_avih(GstRiff *riff, gst_riff_avih *head, gulong size); +GstRiffReturn gst_riff_encoder_strh(GstRiff *riff, guint32 fcc_type, gst_riff_strh *head, gulong size); +GstRiffReturn gst_riff_encoder_strf(GstRiff *riff, void *format, gulong size); +GstRiffReturn gst_riff_encoder_chunk(GstRiff *riff, guint32 chunk_type, void *chunk, gulong size); GstBuffer *gst_riff_encoder_get_buffer(GstRiff *riff); GstBuffer *gst_riff_encoder_get_and_reset_buffer(GstRiff *riff); diff --git a/plugins/elements/gstasyncdisksrc.c b/plugins/elements/gstasyncdisksrc.c index 36b9d010ee..3bb7fab4ba 100644 --- a/plugins/elements/gstasyncdisksrc.c +++ b/plugins/elements/gstasyncdisksrc.c @@ -46,8 +46,8 @@ enum { ARG_0, ARG_LOCATION, ARG_BYTESPERREAD, - ARG_LENGTH, ARG_OFFSET, + ARG_SIZE, }; @@ -101,10 +101,10 @@ gst_asyncdisksrc_class_init(GstAsyncDiskSrcClass *klass) { GTK_ARG_READWRITE, ARG_LOCATION); gtk_object_add_arg_type("GstAsyncDiskSrc::bytesperread", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_BYTESPERREAD); - gtk_object_add_arg_type("GstAsyncDiskSrc::length", GTK_TYPE_LONG, - GTK_ARG_READABLE, ARG_LENGTH); gtk_object_add_arg_type("GstAsyncDiskSrc::offset", GTK_TYPE_LONG, GTK_ARG_READWRITE, ARG_OFFSET); + gtk_object_add_arg_type("GstAsyncDiskSrc::size", GTK_TYPE_LONG, + GTK_ARG_READABLE, ARG_SIZE); gtkobject_class->set_arg = gst_asyncdisksrc_set_arg; gtkobject_class->get_arg = gst_asyncdisksrc_get_arg; @@ -178,12 +178,12 @@ static void gst_asyncdisksrc_get_arg(GtkObject *object,GtkArg *arg,guint id) { case ARG_BYTESPERREAD: GTK_VALUE_INT(*arg) = src->bytes_per_read; break; - case ARG_LENGTH: - GTK_VALUE_LONG(*arg) = src->size; - break; case ARG_OFFSET: GTK_VALUE_LONG(*arg) = src->curoffset; break; + case ARG_SIZE: + GTK_VALUE_LONG(*arg) = src->size; + break; default: arg->type = GTK_TYPE_INVALID; break; diff --git a/plugins/elements/gstaudiosink.c b/plugins/elements/gstaudiosink.c index fb53a82965..d3674b5320 100644 --- a/plugins/elements/gstaudiosink.c +++ b/plugins/elements/gstaudiosink.c @@ -155,8 +155,7 @@ gst_audiosink_class_init(GstAudioSinkClass *klass) { gst_audiosink_signals[SIGNAL_HANDOFF] = gtk_signal_new("handoff",GTK_RUN_LAST,gtkobject_class->type, GTK_SIGNAL_OFFSET(GstAudioSinkClass,handoff), - gtk_marshal_NONE__POINTER,GTK_TYPE_NONE,1, - GST_TYPE_AUDIOSINK); + gtk_marshal_NONE__NONE,GTK_TYPE_NONE,0); gtk_object_class_add_signals(gtkobject_class,gst_audiosink_signals, LAST_SIGNAL); diff --git a/test/ac3play.c b/test/ac3play.c index f5808923ee..69eac2e47b 100644 --- a/test/ac3play.c +++ b/test/ac3play.c @@ -76,7 +76,7 @@ int main(int argc,char *argv[]) { // sleep(1); g_print("about to enter loop\n"); while (1) { - gst_thread_main_loop(GST_THREAD(playthread)); + gst_bin_iterate(GST_BIN(playthread)); g_print("using %d bytes\n",vmsize()); } diff --git a/test/qtest.c b/test/qtest.c index dd93405efc..6695830c4c 100644 --- a/test/qtest.c +++ b/test/qtest.c @@ -93,7 +93,7 @@ int main(int argc,char *argv[]) { g_print("\niterating on %p and %p\n",decodethread,playthread); while (playing) { - gst_thread_main_loop(GST_THREAD(playthread)); + gst_bin_iterate(GST_BIN(playthread)); /* buffers got wedged in the queue, unstick them */ // while (((GstQueue *)queue)->buffers_queued) // gst_connection_push(GST_CONNECTION(queue));