SUBDIRS = autoplug $(GST_LOADSAVE_DIRS) \
helloworld helloworld2 \
queue queue2 queue3 queue4 \
- launch thread plugins mixer cutter pingpong
+ launch thread plugins mixer cutter pingpong manual
DIST_SUBDIRS = autoplug \
helloworld helloworld2 \
queue queue2 queue3 queue4 \
- launch thread xml plugins typefind mixer cutter pingpong
+ launch thread xml plugins typefind mixer cutter pingpong manual
--- /dev/null
+if HAVE_LIBGNOMEUI
+GNOME=gnome
+else
+GNOME=
+endif
+
+EXAMPLES = $(GNOME) xml
+noinst_PROGRAMS = $(EXAMPLES)
+
+LDADD = $(GST_LIBS)
+INCLUDES = $(GST_CFLAGS)
+
+gnome_LDADD = $(GST_LIBS) $(LIBGNOMEUI_LIBS)
+gnome_CFLAGS = $(GST_CFLAGS) $(LIBGNOMEUI_CFLAGS)
+
+# for some reason specifying %.c runs us into trouble when running make
+# clean, it starts looking for things like mostlyclean-am.c, please
+# help me fix that so we don't need to specify all sources here
+# also, it's a bit irritating that right now a change in any xml file
+# triggers a rebuild of all examples
+#%.c:
+gnome.c xml.c: $(top_srcdir)/docs/manual/*.xml
+ $(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml
--- /dev/null
+#!/usr/bin/perl
+
+# extract code fragments from xml program listings
+# first argument: source code file to find
+# second argument: xml files to extract code from
+
+# main
+
+# decodes xml by translating & < > back to what they should be
+sub
+xml_decode ($)
+{
+ my $input = shift;
+
+ $input =~ s/\&/&/g;
+ $input =~ s/</</g;
+ $input =~ s/>/>/g;
+
+ return $input;
+}
+
+# main
+my $output = shift @ARGV;
+
+foreach $file (@ARGV)
+{
+ open FILE, $file or die "Cannot open file $file";
+
+ while ($line = <FILE>)
+ {
+ if ($line =~ /\/\* example-begin $output \*\//)
+ {
+ print "Extracting $output from $file\n";
+ open OUTPUT, ">$output";
+ print OUTPUT xml_decode ($line);
+ my $example = 1;
+ while (($line = <FILE>) && $example)
+ {
+ if ($line =~ /\/\* example-end/)
+ {
+ print OUTPUT xml_decode ($line);
+ close OUTPUT;
+ $example = 0;
+ }
+ else
+ {
+ print OUTPUT xml_decode ($line);
+ }
+ }
+ }
+ }
+}
SUBDIRS = autoplug $(GST_LOADSAVE_DIRS) \
helloworld helloworld2 \
queue queue2 queue3 queue4 \
- launch thread plugins mixer cutter pingpong
+ launch thread plugins mixer cutter pingpong manual
DIST_SUBDIRS = autoplug \
helloworld helloworld2 \
queue queue2 queue3 queue4 \
- launch thread xml plugins typefind mixer cutter pingpong
+ launch thread xml plugins typefind mixer cutter pingpong manual
--- /dev/null
+if HAVE_LIBGNOMEUI
+GNOME=gnome
+else
+GNOME=
+endif
+
+EXAMPLES = $(GNOME) xml
+noinst_PROGRAMS = $(EXAMPLES)
+
+LDADD = $(GST_LIBS)
+INCLUDES = $(GST_CFLAGS)
+
+gnome_LDADD = $(GST_LIBS) $(LIBGNOMEUI_LIBS)
+gnome_CFLAGS = $(GST_CFLAGS) $(LIBGNOMEUI_CFLAGS)
+
+# for some reason specifying %.c runs us into trouble when running make
+# clean, it starts looking for things like mostlyclean-am.c, please
+# help me fix that so we don't need to specify all sources here
+# also, it's a bit irritating that right now a change in any xml file
+# triggers a rebuild of all examples
+#%.c:
+gnome.c xml.c: $(top_srcdir)/docs/manual/*.xml
+ $(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml
--- /dev/null
+#!/usr/bin/perl
+
+# extract code fragments from xml program listings
+# first argument: source code file to find
+# second argument: xml files to extract code from
+
+# main
+
+# decodes xml by translating & < > back to what they should be
+sub
+xml_decode ($)
+{
+ my $input = shift;
+
+ $input =~ s/\&/&/g;
+ $input =~ s/</</g;
+ $input =~ s/>/>/g;
+
+ return $input;
+}
+
+# main
+my $output = shift @ARGV;
+
+foreach $file (@ARGV)
+{
+ open FILE, $file or die "Cannot open file $file";
+
+ while ($line = <FILE>)
+ {
+ if ($line =~ /\/\* example-begin $output \*\//)
+ {
+ print "Extracting $output from $file\n";
+ open OUTPUT, ">$output";
+ print OUTPUT xml_decode ($line);
+ my $example = 1;
+ while (($line = <FILE>) && $example)
+ {
+ if ($line =~ /\/\* example-end/)
+ {
+ print OUTPUT xml_decode ($line);
+ close OUTPUT;
+ $example = 0;
+ }
+ else
+ {
+ print OUTPUT xml_decode ($line);
+ }
+ }
+ }
+ }
+}