gnomemm r1934 - in gstreamermm/trunk: . build_shared docs/reference gstreamer gstreamer/gstreamermm gstreamer/gstreamermm/private gstreamer/src gstreamerbase gstreamerbase/gstreamerbasemm gstreamerbase/gstreamerbasemm/private gstreamerbase/src tools tools/extra_defs_gen tools/m4



Author: jaalburqu
Date: Fri Jan  2 19:29:21 2009
New Revision: 1934
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1934&view=rev

Log:
2009-01-02  Josà Alburquerque  <jaalburqu svn gnome org>

	* configure.ac: Modified so that C preprocessor symbols are defined
	for each existing plug-in from two lists (the core list and the base
	list) of all possible plug-ins.
	* gstreamer/gstreamermmconfig.h.in:
	* gstreamerbase/gstreamerbasemmconfig.h.in: Modified so that if
	plug-ins exist, a C preprocessor symbol for the plug-in is defined in
	the two configuration files.
	* gstreamer/gstreamermm/wrap_init.h:
	* gstreamerbase/gstreamerbasemm/wrap_init.h: Modified to include the
	configuration files so that wrap_init()s know if plug-ins exist.

	* tools/generate_wrap_init.pl.in: Added local copy so that #ifdefs are
	included in wrap_init() methods.

	* tools/extra_defs_gen/generate_plugin_gmmproc_file.cc:
	* tools/m4/Makefile_list_of_sources.am_fragment:
	* tools/m4/convert.m4:
	* tools/m4/shared.m4: Modified plug-in generation tool to include a
	"marking" m4 macro (_IS_GSTREAMERMM_PLUGIN) so that wrap_init
	generation tool knows and can include proper #ifdefs for each plug-in.
	Defined the macro in the shared.m4 file so that it is simply removed
	from the .hg when generating the .h file (much like what happens with
	the optional windows wrapping macro in gtkmm).

	* build_shared/Makefile_gensrc.am_fragment:
	* gstreamer/src/Makefile_list_of_hg.am_fragment:
	* gstreamerbase/src/Makefile_list_of_hg.am_fragment: Modified so that
	all plug-ins are always generated, but only in maintainer mode and so
	the local copy of generate_wrap_init.pl is used to generate
	wrap_init() functions.

	* build_shared/Makefile_build_gensrc.am_fragment:
	* build_shared/Makefile_build.am_fragment:
	* gstreamer/gstreamermm/Makefile.am:
	* gstreamer/gstreamermm/private/Makefile.am:
	* gstreamerbase/gstreamerbasemm/Makefile.am:
	* gstreamerbase/gstreamerbasemm/private/Makefile.am: Modified build
	files so that only the plug-ins that exist are built, installed and
	included in the shared object libraries, but so that all plug-in files
	are distributed in the tarballs whether the plug-ins exist or not.

	* docs/reference/Makefile.am: Modified to make sure that the distcheck
	is successful.  Added tarball building targets.

	* gstreamerbase/src/colorbalance.hg: Commented unused enum for now to
	fix the build with most recent changes to GStreamer sources in cvs.

	* gstreamer/src/Makefile.am:
	* gstreamerbase/src/Makefile.am: Whitespace.

Added:
   gstreamermm/trunk/tools/generate_wrap_init.pl.in
   gstreamermm/trunk/tools/m4/shared.m4
Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/build_shared/Makefile_build.am_fragment
   gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment
   gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment
   gstreamermm/trunk/configure.ac
   gstreamermm/trunk/docs/reference/Makefile.am
   gstreamermm/trunk/gstreamer/gstreamermm/Makefile.am
   gstreamermm/trunk/gstreamer/gstreamermm/private/Makefile.am
   gstreamermm/trunk/gstreamer/gstreamermm/wrap_init.h
   gstreamermm/trunk/gstreamer/gstreamermmconfig.h.in
   gstreamermm/trunk/gstreamer/src/Makefile.am
   gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
   gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am
   gstreamermm/trunk/gstreamerbase/gstreamerbasemm/private/Makefile.am
   gstreamermm/trunk/gstreamerbase/gstreamerbasemm/wrap_init.h
   gstreamermm/trunk/gstreamerbase/gstreamerbasemmconfig.h.in
   gstreamermm/trunk/gstreamerbase/src/Makefile.am
   gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment
   gstreamermm/trunk/gstreamerbase/src/colorbalance.hg
   gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
   gstreamermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment
   gstreamermm/trunk/tools/m4/convert.m4

Modified: gstreamermm/trunk/build_shared/Makefile_build.am_fragment
==============================================================================
--- gstreamermm/trunk/build_shared/Makefile_build.am_fragment	(original)
+++ gstreamermm/trunk/build_shared/Makefile_build.am_fragment	Fri Jan  2 19:29:21 2009
@@ -29,11 +29,15 @@
 		  -I$(top_builddir)/gstreamer		-I$(top_srcdir)/gstreamer \
 				  $(sublib_cflags)
 
-dist_sources	= $(files_all_built_cc) $(files_all_extra_cc) $(files_all_built_h) $(files_all_extra_h)
-DISTFILES	= $(DIST_COMMON) $(dist_sources) $(TEXINFOS) $(EXTRA_DIST)
+dist_sources	= $(files_all_built_cc) $(files_all_extra_cc) \
+		  $(files_all_built_h) $(files_all_extra_h) \
+		  $(files_all_plugin_built_cc) $(files_all_plugin_built_h)
 
+dist_patches 	= $(files_patched_h:.h=.h.patch)
+
+DISTFILES	= $(DIST_COMMON) $(dist_sources) $(dist_patches) $(TEXINFOS) \
+		  $(EXTRA_DIST)
 
-CLEANFILES = $(files_plugin_built_h) $(files_plugin_built_cc) $(files_plugin_built_h:%.h=%.loT)
 
 DEFS = @DEFS@ -DG_LOG_DOMAIN=\"$(sublib_name)\"
 DEFAULT_INCLUDES	=
@@ -41,11 +45,14 @@
 # DISABLE_DEPRECATED_CFLAGS is empty unless --enable-deprecated is specified to configure:
 INCLUDES = $(strip $(all_includes)) $(DISABLE_DEPRECATED_CFLAGS)
 
+EXTRA_HEADERS = $(files_all_plugin_built_h)
+
 sublib_includedir	= $(includedir)/$(sublib_libname)/$(sublib_name)
 sublib_include_HEADERS	= $(files_all_built_h) $(files_all_extra_h)
-nodist_sublib_include_HEADERS = $(files_plugin_built_h)
-
-maintainer-clean-local:
-	(cd $(srcdir) && rm -f $(files_all_built_cc) $(files_all_built_h))
 
+EXTRA_sublib_includedir	= $(includedir)/$(sublib_libname)/$(sublib_name)
+EXTRA_sublib_include_HEADERS	= $(files_existing_plugin_built_h)
 
+maintainer-clean-local:
+	(cd $(srcdir) && rm -f $(files_all_built_cc) $(files_all_built_h) \
+		$(files_all_plugin_built_cc) $(files_all_plugin_built_h))

Modified: gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment
==============================================================================
--- gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment	(original)
+++ gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment	Fri Jan  2 19:29:21 2009
@@ -47,16 +47,19 @@
 files_hg = $(files_general_hg) $(files_posix_hg) $(files_general_deprecated_hg)
 endif
 
-files_built_cc = $(files_hg:.hg=.cc)
+files_built_cc = $(files_hg:.hg=.cc) wrap_init.cc
 files_built_h = $(files_hg:.hg=.h)
 
 files_patched_h = $(files_patched_hg:.hg=.h)
 
-files_all_built_cc = $(files_all_hg:.hg=.cc)
+files_all_built_cc = $(files_all_hg:.hg=.cc) wrap_init.cc
 files_all_built_h = $(files_all_hg:.hg=.h)
 
-files_plugin_built_cc = $(files_plugin_hg:.hg=.cc)
-files_plugin_built_h = $(files_plugin_hg:.hg=.h)
+files_all_plugin_built_cc = $(files_all_plugin_hg:.hg=.cc)
+files_all_plugin_built_h = $(files_all_plugin_hg:.hg=.h)
+files_existing_plugin_built_cc = $(files_existing_plugin_hg:.hg=.cc)
+files_existing_plugin_built_h = $(files_existing_plugin_hg:.hg=.h)
+files_existing_plugin_built_lo = $(files_existing_plugin_hg:.hg=.lo)
 
 # Extra files
 

Modified: gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment
==============================================================================
--- gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment	(original)
+++ gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment	Fri Jan  2 19:29:21 2009
@@ -28,9 +28,10 @@
 
 include $(srcdir)/../src/Makefile_list_of_hg.am_fragment
 files_all_ccg	= $(files_all_hg:%.hg=%.ccg)
+files_all_plugin_ccg = $(files_all_plugin_hg:%.hg=%.ccg)
 files_h		= $(files_all_hg:%.hg=$(gensrc_destdir)/%.h)
 files_stamp	= $(files_all_hg:%.hg=$(stamp_dir)/stamp-%)
-files_plugin_stamp = $(plugin_cpptype_names:%=$(stamp_plugin_dir)/stamp-%-plugin)
+files_stamp_plugin = $(cppnames_plugin_all:%=$(stamp_plugin_dir)/stamp-%-plugin)
 destdir_files_stamp = $(files_patched_hg:%.hg=$(destdir_stamp_dir)/stamp-%)
 
 #Installed gmmproc stuff, from glibmm:
@@ -43,9 +44,10 @@
 run_gmmproc	= $(gmmproc_path) $(gmmproc_args)
 
 # The normal Glib::wrap() table initialization:
-gen_wrap_init_path = $(gmmproc_dir)/generate_wrap_init.pl
+gen_wrap_init_in = $(tools_dir)/generate_wrap_init.pl.in
+gen_wrap_init_path = $(tools_dir)/generate_wrap_init.pl
 gen_wrap_init_args = --namespace=$(sublib_namespace) --parent_dir=$(sublib_parentdir)
-run_gen_wrap_init  = $(gen_wrap_init_path) $(gen_wrap_init_args)
+run_gen_wrap_init  = $(PERL_PATH) $(gen_wrap_init_path) $(gen_wrap_init_args)
 
 # The Gst::wrap() table initialization:
 gen_gst_wrap_init_in = $(tools_dir)/generate_gst_wrap_init.pl.in
@@ -58,28 +60,28 @@
 generate_plugin_gmmproc_file_args = --namespace=$(sublib_namespace) --main-defs=$(main_defs) --target=$(sublib_parentdir)
 run_generate_plugin_gmmproc_file = $(generate_plugin_gmmproc_file_path) $(generate_plugin_gmmproc_file_args)
 
-files_plugin_hg_with_path = $(patsubst %.hg,$(srcdir)/%.hg,$(files_plugin_hg))
-files_plugin_camel_hg_with_path = $(patsubst %,$(stamp_plugin_dir)/%.hg,$(plugin_cpptype_names))
+files_all_plugin_hg_with_path = $(patsubst %.hg,$(srcdir)/%.hg,\
+				$(files_all_plugin_hg))
+files_all_plugin_camel_hg_with_path = $(patsubst %,$(stamp_plugin_dir)/%.hg,\
+				      $(cppnames_plugin_all))
 
 
 EXTRA_DIST	= Makefile_list_of_hg.am_fragment $(files_defs) \
-		  $(files_all_hg) $(files_all_ccg) $(patsubst %.h,\
-		  $(gensrc_destdir)/%.h.patch,$(files_patched_h))
+		  $(files_all_hg) $(files_all_ccg) $(files_all_plugin_hg) \
+		  $(files_all_plugin_ccg)
 
-CLEANFILES = $(files_plugin_hg) $(files_plugin_hg:%.hg=%.ccg) \
-	$(files_plugin_camel_hg_with_path) \
-	$(files_plugin_camel_hg_with_path:.hg=.ccg) \
-	$(gensrc_destdir)/wrap_init.cc $(gensrc_destdir)/gst_wrap_init.cc \
-	$(files_plugin_stamp)
 
+if MAINTAINER_MODE
+generate_plugin_dep = $(generate_plugin_gmmproc_file_path)
+endif
 
 # This is to generate plugin .hg files.  The generated .hg file s piped through
 # m4 using the macros in tools/m4/ctocpp_base.m4 which then produces the final
 # .hg file.  Finally, the camel hg file is linked to the final .hg file to
 # signal the successful generation of the .hg file.
-$(files_plugin_camel_hg_with_path): $(generate_plugin_gmmproc_file_path) \
+$(files_all_plugin_camel_hg_with_path): $(generate_plugin_dep) \
 	$(tools_plugin_m4) $(files_defs)
-	$(eval hg_lowercase = $$(shell echo $$@ | tr '[:upper:]' '[:lower:]'))
+	$(eval hg_lowercase = $$(shell echo $$@ | tr [:upper:] [:lower:]))
 	$(run_generate_plugin_gmmproc_file) --hg \
 		$(notdir $(subst .hg,,$@)) | $(M4) -I $(tools_dir_m4) > \
 		$(srcdir)/$(notdir $(hg_lowercase))
@@ -88,8 +90,8 @@
 # This is to generate plugin .ccg files.  The .ccg file is generated and then
 # the camel ccg file is linked to the generated .ccg file to signal the
 # successful generation of the .hg file.
-$(files_plugin_camel_hg_with_path:.hg=.ccg): \
-	$(generate_plugin_gmmproc_file_path) $(tools_plugin_m4) $(files_defs)
+$(files_all_plugin_camel_hg_with_path:.hg=.ccg): $(generate_plugin_dep) \
+	$(tools_plugin_m4) $(files_defs)
 	$(eval ccg_lowercase = $$(shell echo $$@ | tr '[:upper:]' '[:lower:]'))
 	$(run_generate_plugin_gmmproc_file) --ccg \
 		$(notdir $(subst .ccg,,$@)) >  \
@@ -103,9 +105,7 @@
 # This is to run the generated plug-in .hg and .ccg files through gmmproc
 # (they're generated if necessary by the .../%.hg and .../%.ccg dependencies.
 $(stamp_plugin_dir)/stamp-%-plugin: $(stamp_plugin_dir)/%.hg \
-	$(stamp_plugin_dir)/%.ccg \
-	$(generate_plugin_gmmproc_file_path) $(tools_m4) $(tools_plugin_m4) \
-	$(files_defs)
+	$(stamp_plugin_dir)/%.ccg $(tools_m4) $(tools_plugin_m4) $(files_defs)
 	$(eval plugin_name_lowercase = \
 		$$(shell echo $$* | tr '[:upper:]' '[:lower:]'))
 	$(run_gmmproc) $(plugin_name_lowercase) $(srcdir) $(gensrc_destdir)
@@ -119,12 +119,10 @@
 
 files_hg_with_path	= $(patsubst %.hg,$(srcdir)/%.hg,$(files_all_hg))
 
-$(gensrc_destdir)/wrap_init.cc: $(gen_wrap_init_path) $(files_hg_with_path) \
-	$(files_plugin_hg_with_path)
+$(gensrc_destdir)/wrap_init.cc: $(gen_wrap_init_in) $(files_hg_with_path) \
+	$(files_all_plugin_hg_with_path)
 	$(run_gen_wrap_init) $(files_all_hg:%.hg=$(srcdir)/%.hg) \
-	  $(filter %.hg,$(foreach plugin,$(subst .hg,,$(files_plugin_hg)), \
-	  $(srcdir)/$(shell $(run_generate_plugin_gmmproc_file) \
-	  --suggest-hg $(plugin)))) >$@
+	  $(files_all_plugin_hg:%.hg=$(srcdir)/%.hg) > $@
 
 $(gensrc_destdir)/gst_wrap_init.cc: $(gen_gst_wrap_init_in) \
 	$(files_hg_with_path)
@@ -140,13 +138,11 @@
 	@(test -d $(destdir_stamp_dir) || mkdir $(destdir_stamp_dir))
 
 if MAINTAINER_MODE
-all-local: create-stamp-dir $(files_stamp) $(files_plugin_stamp) \
+all-local: create-stamp-dir $(files_stamp) $(files_stamp_plugin) \
 	$(gensrc_destdir)/wrap_init.cc $(gensrc_destdir)/gst_wrap_init.cc \
 	$(destdir_files_stamp)
-else
-BUILT_SOURCES = $(stamp_plugin_dir) $(files_plugin_stamp) \
-		$(gensrc_destdir)/wrap_init.cc
 endif
 
 maintainer-clean-local:
-	rm -rf $(stamp_dir) $(stamp_plugin_dir) $(destdir_stamp_dir)
+	rm -rf $(stamp_dir) $(stamp_plugin_dir) $(destdir_stamp_dir) \
+		$(files_all_plugin_hg) $(files_all_plugin_ccg)

Modified: gstreamermm/trunk/configure.ac
==============================================================================
--- gstreamermm/trunk/configure.ac	(original)
+++ gstreamermm/trunk/configure.ac	Fri Jan  2 19:29:21 2009
@@ -20,6 +20,7 @@
 pushdef([GSTREAMERMM_VERSION], GSTREAMERMM_MAJOR_VERSION.GSTREAMERMM_MINOR_VERSION.GSTREAMERMM_MICRO_VERSION[]GSTREAMERMM_EXTRA_VERSION)
 AC_INIT([gstreamermm], GSTREAMERMM_VERSION, [gtkmm-list gnome org])
 AC_CONFIG_SRCDIR([gstreamer/gstreamermmconfig.h.in])
+AC_CONFIG_SRCDIR([gstreamerbase/gstreamerbasemmconfig.h.in])
 AC_PREREQ(2.59)
 
 #########################################################################
@@ -164,6 +165,85 @@
 
 
 #########################################################################
+#  Plug-in processing
+#########################################################################
+
+# make sure grep and head are available:
+AC_PROG_GREP()
+AC_PATH_PROG([HEAD], [head])
+
+# make sure gst-inspect is available:
+AC_PATH_PROG([GST_INSPECT], [gst-inspect])
+if test x$GST_INSPECT = x ; then
+  AC_MSG_ERROR([gst-inspect is needed for plug-in processing. Please, install it.])
+fi
+AC_ARG_VAR([GST_INSPECT], [Variable to store gst-inspect executable])
+AC_SUBST(GST_INSPECT)
+
+################ gstreamermm plug-in processing ################ 
+
+# To add a plugin, add the C++ class name (which must be the plugin name as
+# recognized by gst-inspect but in camel case -- as is appropriate for a class
+# name) to the plug-in C++ name list below.  Also add the target .hg file name
+# (same name all in lowercase with a .hg) to the files_all_plugin_hg variable
+# in the gstreamer/src/Makefile_list_of_hg.am_fragment file.  Finally, be sure
+# to include an #undef in the gstreamermmconfig.h.in file.
+
+GSTREAMERMM_ALL_PLUGIN_CPPNAMES="CapsFilter FakeSrc FakeSink FdSink FdSrc \
+FileSrc FileSink Identity MultiQueue Queue Tee TypeFind"
+
+for cppname in $GSTREAMERMM_ALL_PLUGIN_CPPNAMES; do
+  plugin=[`echo $cppname | tr [:upper:] [:lower:]`]
+  if test -z "`$GST_INSPECT $plugin | $HEAD -n 1 | $GREP "No such element"`"; then
+    plugin_define=["GSTREAMERMM_PLUGIN_`echo $plugin | tr [:lower:] [:upper:]`"]
+    AC_DEFINE_UNQUOTED($plugin_define)
+    GSTREAMERMM_EXISTING_PLUGIN_CPPNAMES="$GSTREAMERMM_EXISTING_PLUGIN_CPPNAMES $cppname"
+    GSTREAMERMM_EXISTING_PLUGIN_HG="$GSTREAMERMM_EXISTING_PLUGIN_HG $plugin.hg"
+  fi
+done
+AC_SUBST(GSTREAMERMM_ALL_PLUGIN_CPPNAMES)
+AC_SUBST(GSTREAMERMM_EXISTING_PLUGIN_CPPNAMES)
+AC_SUBST(GSTREAMERMM_EXISTING_PLUGIN_HG)
+
+################ gstreamerbasemm plug-in processing ################ 
+
+# To add a plugin, add the C++ class name (which must be the plugin name as
+# recognized by gst-inspect but in camel case -- as is appropriate for a class
+# name) to the plug-in C++ name list below.  Also add the target .hg file name
+# (same name all in lowercase with a .hg) to the files_all_plugin_hg variable
+# in the gstreamebase/src/Makefile_list_of_hg.am_fragment file.  Finally, be
+# sure to include an #undef in the gstreamebasemmconfig.h.in file.
+
+GSTREAMERBASEMM_ALL_PLUGIN_CPPNAMES="Adder AlsaMixer AlsaSink AlsaSrc \
+AudioConvert AudioResample AudioTestSrc CdParanoiaSrc ClockOverlay DecodeBin \
+FfmpegColorSpace GioSink GioSrc GioStreamSink GioStreamSrc OggDemux OggMux \
+PlayBin2 TextOverlay TextRender TheoraDec TheoraEnc TimeOverlay VideoRate \
+VideoScale VideoTestSrc Volume VorbisDec VorbisEnc VorbisParse VorbisTag \
+XImageSink XvImageSink"
+
+# TODO: gdpdepay and gdppay plug-ins (to be added above) cause several warnings
+# when their wrap_new() methods are registered in GstBase::wrap_init() (from
+# GstBase::init).
+
+# TODO: The following plug-ins (to be added above) can't be wrapped yet because
+# their signals or properties use the GValueArray type which might have to be
+# wrapped in glibmm first: DecodeBin2, MultiFdSink, PlayBin, TcpServerSink,
+# TheoraParse, UriDecodeBin.
+
+for cppname in $GSTREAMERBASEMM_ALL_PLUGIN_CPPNAMES; do
+  plugin=[`echo $cppname | tr [:upper:] [:lower:]`]
+  if test -z "`$GST_INSPECT $plugin | $HEAD -n 1 | $GREP "No such element"`"; then
+    plugin_define=["GSTREAMERBASEMM_PLUGIN_`echo $plugin | tr [:lower:] [:upper:]`"]
+    AC_DEFINE_UNQUOTED($plugin_define)
+    GSTREAMERBASEMM_EXISTING_PLUGIN_CPPNAMES="$GSTREAMERBASEMM_EXISTING_PLUGIN_CPPNAMES $cppname"
+    GSTREAMERBASEMM_EXISTING_PLUGIN_HG="$GSTREAMERBASEMM_EXISTING_PLUGIN_HG $plugin.hg"
+  fi
+done
+AC_SUBST(GSTREAMERBASEMM_ALL_PLUGIN_CPPNAMES)
+AC_SUBST(GSTREAMERBASEMM_EXISTING_PLUGIN_CPPNAMES)
+AC_SUBST(GSTREAMERBASEMM_EXISTING_PLUGIN_HG)
+
+#########################################################################
 #  C++ checks
 #########################################################################
 AC_PROG_CXX
@@ -349,6 +429,7 @@
       gstreamerbase/gstreamerbasemm/private/Makefile
 
   tools/Makefile
+    tools/generate_wrap_init.pl
     tools/generate_gst_wrap_init.pl
     tools/m4/Makefile
     tools/extra_defs_gen/Makefile

Modified: gstreamermm/trunk/docs/reference/Makefile.am
==============================================================================
--- gstreamermm/trunk/docs/reference/Makefile.am	(original)
+++ gstreamermm/trunk/docs/reference/Makefile.am	Fri Jan  2 19:29:21 2009
@@ -1,23 +1,34 @@
 doxygenprog= DOXYGEN@
 
 doxygen_configfile=Doxyfile
+doxygen_configfile_source=$(srcdir)/Doxyfile.in
 beautify_docs = @GMMPROC_DIR@/beautify_docs.pl
 
+EXTRA_DIST= Doxyfile.in html reference-index.txt
+
 docdir = $(datadir)/doc/gstreamermm-0.10/docs
 referencedir=$(docdir)/reference/html
 
-EXTRA_DIST=$(doxygen_configfile) reference-index.txt
-
 HTML_INDEX=html/index.html
 
-$(HTML_INDEX): $(doxygen_configfile) $(beautify_docs_source) $(top_srcdir)/gstreamer/gstreamermm/*.h $(top_srcdir)/gstreamerbase/gstreamerbasemm/*.h
-	rm -rf html
+$(HTML_INDEX): $(doxygen_configfile_source) $(beautify_docs) \
+	$(top_srcdir)/gstreamer/gstreamermm/*.h \
+	$(top_srcdir)/gstreamerbase/gstreamerbasemm/*.h
+	-rm -rf html
 	$(doxygenprog) $(doxygen_configfile)
 	$(PERL_PATH) $(beautify_docs) html && touch $@
 
+gstreamermm-reference-html.tar.gz: $(HTML_INDEX)
+	tar cf - html | gzip -c --best >$@
+
+gstreamermm-reference-html.tar.bz2: $(HTML_INDEX)
+	tar cf - html | bzip2 -c >$@
+
 doc-clean:
-	rm -rf html
-	rm -f doxygen-warnings.txt
+	-rm -rf html
+	-rm -f doxygen-warnings.txt
+	-rm -f gstreamermm-reference-html.tar.gz \
+		gstreamermm-reference-html.tar.bz2
 
 install-reference: $(HTML_INDEX)
 	@$(NORMAL_INSTALL)

Modified: gstreamermm/trunk/gstreamer/gstreamermm/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamer/gstreamermm/Makefile.am	(original)
+++ gstreamermm/trunk/gstreamer/gstreamermm/Makefile.am	Fri Jan  2 19:29:21 2009
@@ -25,6 +25,8 @@
 
 lib_LTLIBRARIES = libgstreamermm-0.10.la
 libgstreamermm_0_10_la_SOURCES = $(files_built_cc) $(files_extra_cc)
-nodist_libgstreamermm_0_10_la_SOURCES = $(files_plugin_built_cc) wrap_init.cc
+EXTRA_libgstreamermm_0_10_la_SOURCES = $(files_all_plugin_built_cc)
 libgstreamermm_0_10_la_LDFLAGS = $(common_ldflags)
-libgstreamermm_0_10_la_LIBADD  = $(GSTREAMERMM_LIBS)
+libgstreamermm_0_10_la_LIBADD  = $(GSTREAMERMM_LIBS) \
+				 $(files_existing_plugin_built_lo)
+libgstreamermm_0_10_la_DEPENDENCIES = $(files_existing_plugin_built_lo)

Modified: gstreamermm/trunk/gstreamer/gstreamermm/private/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamer/gstreamermm/private/Makefile.am	(original)
+++ gstreamermm/trunk/gstreamer/gstreamermm/private/Makefile.am	Fri Jan  2 19:29:21 2009
@@ -5,18 +5,23 @@
 
 files_built_p_h		= $(files_hg:.hg=_p.h)
 files_built_all_p_h	= $(files_all_hg:.hg=_p.h)
-files_built_plugin_p_h	= $(files_plugin_hg:.hg=_p.h)
+files_all_plugin_p_h = $(files_all_plugin_hg:.hg=_p.h)
+files_existing_plugin_p_h = $(files_existing_plugin_hg:.hg=_p.h)
 files_extra_p_h		= object_p.h miniobject_p.h taglist_p.h
 files_extra_all_p_h	= object_p.h miniobject_p.h taglist_p.h
 
-dist_sources = $(files_built_all_p_h) $(files_extra_all_p_h)
+dist_sources = $(files_built_all_p_h) $(files_extra_all_p_h) \
+	       $(files_all_plugin_p_h)
+
 DISTFILES = $(DIST_COMMON) $(dist_sources)
 
-CLEANFILES = $(files_built_plugin_p_h)
+EXTRA_HEADERS = $(files_all_plugin_p_h)
 
 private_includedir	= $(includedir)/gstreamermm-0.10/gstreamermm/private
 private_include_HEADERS	= $(files_built_p_h) $(files_extra_p_h)
-nodist_private_include_HEADERS	= $(files_built_plugin_p_h)
+
+EXTRA_private_includedir = $(includedir)/gstreamermm-0.10/gstreamermm/private
+EXTRA_private_include_HEADERS = $(files_existing_plugin_p_h)
 
 maintainer-clean-local:
-	(cd $(srcdir) && rm -f $(files_built_p_h) $(files_built_plugin_p_h))
+	(cd $(srcdir) && rm -f $(files_built_p_h) $(files_all_plugin_p_h))

Modified: gstreamermm/trunk/gstreamer/gstreamermm/wrap_init.h
==============================================================================
--- gstreamermm/trunk/gstreamer/gstreamermm/wrap_init.h	(original)
+++ gstreamermm/trunk/gstreamer/gstreamermm/wrap_init.h	Fri Jan  2 19:29:21 2009
@@ -24,6 +24,8 @@
 
 // wrap_init.cc is generated by tools/generate_wrap_init.pl
 
+#include <gstreamermmconfig.h>
+
 namespace Gst
 {
   /** Initializes the main gstreamermm wrapping system.  There's no need to use

Modified: gstreamermm/trunk/gstreamer/gstreamermmconfig.h.in
==============================================================================
--- gstreamermm/trunk/gstreamer/gstreamermmconfig.h.in	(original)
+++ gstreamermm/trunk/gstreamer/gstreamermmconfig.h.in	Fri Jan  2 19:29:21 2009
@@ -8,5 +8,19 @@
 #undef GSTREAMERMM_MINOR_VERSION
 #undef GSTREAMERMM_MICRO_VERSION
 
+/* plug-in defines */
+#undef GSTREAMERMM_PLUGIN_CAPSFILTER
+#undef GSTREAMERMM_PLUGIN_FAKESRC
+#undef GSTREAMERMM_PLUGIN_FAKESINK
+#undef GSTREAMERMM_PLUGIN_FDSINK
+#undef GSTREAMERMM_PLUGIN_FDSRC
+#undef GSTREAMERMM_PLUGIN_FILESRC
+#undef GSTREAMERMM_PLUGIN_FILESINK
+#undef GSTREAMERMM_PLUGIN_IDENTITY
+#undef GSTREAMERMM_PLUGIN_MULTIQUEUE
+#undef GSTREAMERMM_PLUGIN_QUEUE
+#undef GSTREAMERMM_PLUGIN_TEE
+#undef GSTREAMERMM_PLUGIN_TYPEFIND
+
 #endif /* _GSTREAMERMM_CONFIG_H */
 

Modified: gstreamermm/trunk/gstreamer/src/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamer/src/Makefile.am	(original)
+++ gstreamermm/trunk/gstreamer/src/Makefile.am	Fri Jan  2 19:29:21 2009
@@ -9,4 +9,3 @@
 main_defs = gst
 
 include $(top_srcdir)/build_shared/Makefile_gensrc.am_fragment
-

Modified: gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment	(original)
+++ gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment	Fri Jan  2 19:29:21 2009
@@ -17,20 +17,24 @@
 
 files_general_deprecated_hg =
 
-# To add a plugin, add the C++ class name to plugin_cpptype_names (which must
-# be the plugin name as recognized by gst-inspect but in camel case -- as is
-# appropriate for a class name) and also the target .hg file name (the same
-# as the class name all in lowercase with an .hg extension) to files_plugin_hg
-# below:
-
-plugin_cpptype_names = CapsFilter FakeSrc FakeSink FdSink FdSrc \
-		  FileSrc FileSink Identity MultiQueue Queue \
-		  Tee TypeFind
+# To add a plugin, add the C++ class name (which must be the plugin name as
+# recognized by gst-inspect but in camel case -- as is appropriate for a class
+# name) to the plug-in C++ name list (GSTREAMERMM_ALL_PLUGIN_CPPNAMES) in the
+# configure.ac file.  Also add the target .hg file name (same name all in
+# lowercase with a .hg) to the variable below.  Finally, be sure to include an
+# #undef in the gstreamermmconfig.h.in file.
 
-files_plugin_hg = capsfilter.hg fakesrc.hg fakesink.hg fdsink.hg fdsrc.hg \
+files_all_plugin_hg = capsfilter.hg fakesrc.hg fakesink.hg fdsink.hg fdsrc.hg \
 		  filesrc.hg filesink.hg identity.hg multiqueue.hg queue.hg \
 		  tee.hg typefind.hg
 
+# The following variables are needed for the build process to know what class
+# name to use for the plug-ins and the list of the existing plug-ins in the
+# system so only those are included in the build:
+
+cppnames_plugin_all = $(GSTREAMERMM_ALL_PLUGIN_CPPNAMES)
+files_existing_plugin_hg = $(GSTREAMERMM_EXISTING_PLUGIN_HG)
+
 files_patched_hg = taglist.hg
 
 include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment

Modified: gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am	(original)
+++ gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am	Fri Jan  2 19:29:21 2009
@@ -25,7 +25,8 @@
 
 lib_LTLIBRARIES = libgstreamerbasemm-0.10.la
 libgstreamerbasemm_0_10_la_SOURCES = $(files_built_cc) $(files_extra_cc)
-nodist_libgstreamerbasemm_0_10_la_SOURCES = $(files_plugin_built_cc) \
-					    wrap_init.cc
+EXTRA_libgstreamerbasemm_0_10_la_SOURCES = $(files_all_plugin_built_cc)
 libgstreamerbasemm_0_10_la_LDFLAGS = $(common_ldflags)
-libgstreamerbasemm_0_10_la_LIBADD  = $(GSTREAMERBASEMM_LIBS)
+libgstreamerbasemm_0_10_la_LIBADD  = $(GSTREAMERBASEMM_LIBS) \
+				     $(files_existing_plugin_built_lo)
+libgstreamerbasemm_0_10_la_DEPENDENCIES = $(files_existing_plugin_built_lo)

Modified: gstreamermm/trunk/gstreamerbase/gstreamerbasemm/private/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamerbase/gstreamerbasemm/private/Makefile.am	(original)
+++ gstreamermm/trunk/gstreamerbase/gstreamerbasemm/private/Makefile.am	Fri Jan  2 19:29:21 2009
@@ -5,19 +5,23 @@
 
 files_built_p_h		= $(files_hg:.hg=_p.h)
 files_built_all_p_h	= $(files_all_hg:.hg=_p.h)
-files_built_plugin_p_h	= $(files_plugin_hg:.hg=_p.h)
+files_all_plugin_p_h 	= $(files_all_plugin_hg:.hg=_p.h)
+files_existing_plugin_p_h 	= $(files_existing_plugin_hg:.hg=_p.h)
 files_extra_p_h		= 
 files_extra_all_p_h	= 
 
-dist_sources = $(files_built_all_p_h) $(files_extra_all_p_h)
+dist_sources = $(files_built_all_p_h) $(files_extra_all_p_h) \
+	       $(files_all_plugin_p_h)
 
 DISTFILES = $(DIST_COMMON) $(dist_sources)
 
-CLEANFILES = $(files_built_plugin_p_h)
+EXTRA_HEADERS = $(files_all_plugin_p_h)
 
 private_includedir	= $(includedir)/gstreamerbasemm-0.10/gstreamerbasemm/private
 private_include_HEADERS	= $(files_built_p_h) $(files_extra_p_h)
-nodist_private_include_HEADERS	= $(files_built_plugin_p_h)
+
+EXTRA_private_includedir	= $(includedir)/gstreamerbasemm-0.10/gstreamerbasemm/private
+EXTRA_private_include_HEADERS	= $(files_existing_plugin_p_h)
 
 maintainer-clean-local:
-	(cd $(srcdir) && rm -f $(files_built_p_h) $(files_built_plugin_p_h))
+	(cd $(srcdir) && rm -f $(files_built_p_h) $(files_all_plugin_p_h))

Modified: gstreamermm/trunk/gstreamerbase/gstreamerbasemm/wrap_init.h
==============================================================================
--- gstreamermm/trunk/gstreamerbase/gstreamerbasemm/wrap_init.h	(original)
+++ gstreamermm/trunk/gstreamerbase/gstreamerbasemm/wrap_init.h	Fri Jan  2 19:29:21 2009
@@ -24,6 +24,8 @@
 
 // wrap_init.cc is generated by tools/generate_wrap_init.pl
 
+#include <gstreamerbasemmconfig.h>
+
 namespace GstBase
 {
   /** Initializes the main gstreamerbasemm wrapping system.  There's no need to

Modified: gstreamermm/trunk/gstreamerbase/gstreamerbasemmconfig.h.in
==============================================================================
--- gstreamermm/trunk/gstreamerbase/gstreamerbasemmconfig.h.in	(original)
+++ gstreamermm/trunk/gstreamerbase/gstreamerbasemmconfig.h.in	Fri Jan  2 19:29:21 2009
@@ -3,5 +3,39 @@
 
 #include "glibmmconfig.h"
 
-#endif /* _GSTREAMERBASEMM_CONFIG_H */
+/* plug-in defines */
+#undef GSTREAMERBASEMM_PLUGIN_ADDER
+#undef GSTREAMERBASEMM_PLUGIN_ALSAMIXER
+#undef GSTREAMERBASEMM_PLUGIN_ALSASINK
+#undef GSTREAMERBASEMM_PLUGIN_ALSASRC
+#undef GSTREAMERBASEMM_PLUGIN_AUDIOCONVERT
+#undef GSTREAMERBASEMM_PLUGIN_AUDIORESAMPLE
+#undef GSTREAMERBASEMM_PLUGIN_AUDIOTESTSRC
+#undef GSTREAMERBASEMM_PLUGIN_CDPARANOIASRC
+#undef GSTREAMERBASEMM_PLUGIN_CLOCKOVERLAY
+#undef GSTREAMERBASEMM_PLUGIN_DECODEBIN
+#undef GSTREAMERBASEMM_PLUGIN_FFMPEGCOLORSPACE
+#undef GSTREAMERBASEMM_PLUGIN_GIOSINK
+#undef GSTREAMERBASEMM_PLUGIN_GIOSRC
+#undef GSTREAMERBASEMM_PLUGIN_GIOSTREAMSINK
+#undef GSTREAMERBASEMM_PLUGIN_GIOSTREAMSRC
+#undef GSTREAMERBASEMM_PLUGIN_OGGDEMUX
+#undef GSTREAMERBASEMM_PLUGIN_OGGMUX
+#undef GSTREAMERBASEMM_PLUGIN_PLAYBIN2
+#undef GSTREAMERBASEMM_PLUGIN_TEXTOVERLAY
+#undef GSTREAMERBASEMM_PLUGIN_TEXTRENDER
+#undef GSTREAMERBASEMM_PLUGIN_THEORADEC
+#undef GSTREAMERBASEMM_PLUGIN_THEORAENC
+#undef GSTREAMERBASEMM_PLUGIN_TIMEOVERLAY
+#undef GSTREAMERBASEMM_PLUGIN_VIDEORATE
+#undef GSTREAMERBASEMM_PLUGIN_VIDEOSCALE
+#undef GSTREAMERBASEMM_PLUGIN_VIDEOTESTSRC
+#undef GSTREAMERBASEMM_PLUGIN_VOLUME
+#undef GSTREAMERBASEMM_PLUGIN_VORBISDEC
+#undef GSTREAMERBASEMM_PLUGIN_VORBISENC
+#undef GSTREAMERBASEMM_PLUGIN_VORBISPARSE
+#undef GSTREAMERBASEMM_PLUGIN_VORBISTAG
+#undef GSTREAMERBASEMM_PLUGIN_XIMAGESINK
+#undef GSTREAMERBASEMM_PLUGIN_XVIMAGESINK
 
+#endif /* _GSTREAMERBASEMM_CONFIG_H */

Modified: gstreamermm/trunk/gstreamerbase/src/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/Makefile.am	(original)
+++ gstreamermm/trunk/gstreamerbase/src/Makefile.am	Fri Jan  2 19:29:21 2009
@@ -9,4 +9,3 @@
 main_defs = gstbase
 
 include $(top_srcdir)/build_shared/Makefile_gensrc.am_fragment
-

Modified: gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment	(original)
+++ gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment	Fri Jan  2 19:29:21 2009
@@ -12,25 +12,14 @@
 
 files_general_deprecated_hg =
 
-# To add a plugin, add the C++ class name to plugin_cpptype_names (which must
-# be the plugin name as recognized by gst-inspect but in camel case -- as is
-# appropriate for a class name) and also the target .hg file name (the same
-# as the class name all in lowercase with an .hg extension) to files_plugin_hg
-# below:
-
-plugin_cpptype_names = Adder AlsaMixer AlsaSink AlsaSrc \
-		  AudioConvert AudioResample AudioTestSrc \
-		  CdParanoiaSrc ClockOverlay DecodeBin \
-		  FfmpegColorSpace GioSink GioSrc GioStreamSink \
-		  GioStreamSrc \
-		  OggDemux OggMux PlayBin2 \
-		  TextOverlay \
-		  TextRender TheoraDec TheoraEnc \
-		  TimeOverlay VideoRate VideoScale \
-		  VideoTestSrc Volume VorbisDec VorbisEnc \
-		  VorbisParse VorbisTag XImageSink XvImageSink
+# To add a plugin, add the C++ class name (which must be the plugin name as
+# recognized by gst-inspect but in camel case -- as is appropriate for a class
+# name) to the plug-in C++ name list (GSTREAMERBASEMM_ALL_PLUGIN_CPPNAMES) in
+# the configure.ac file.  Also add the target .hg file name (same name all in
+# lowercase with a .hg) to the variable below.  Finally, be sure to include an
+# #undef in the gstreamebasemmconfig.h.in file.
 
-files_plugin_hg = adder.hg alsamixer.hg alsasink.hg alsasrc.hg \
+files_all_plugin_hg = adder.hg alsamixer.hg alsasink.hg alsasrc.hg \
 		  audioconvert.hg audioresample.hg audiotestsrc.hg \
 		  cdparanoiasrc.hg clockoverlay.hg decodebin.hg \
 		  ffmpegcolorspace.hg giosink.hg giosrc.hg giostreamsink.hg \
@@ -42,13 +31,11 @@
 		  videotestsrc.hg volume.hg vorbisdec.hg vorbisenc.hg \
 		  vorbisparse.hg vorbistag.hg ximagesink.hg xvimagesink.hg
 
-# TODO: gdpdepay and gdppay plug-ins cause several warnings when their
-# wrap_new() methods are registered in GstBase::wrap_init() (from
-# GstBase::init).
-
-# TODO: The following plug-ins can't be wrapped yet because their signals or
-# properties use the GValueArray type which might have to be wrapped in glibmm
-# first: DecodeBin2, MultiFdSink, PlayBin, TcpServerSink, TheoraParse,
-# UriDecodeBin.
+# The following variables are needed for the build process to know what class
+# name to use for the plug-ins and the list of the existing plug-ins in the
+# system so only those are included in the build:
+
+cppnames_plugin_all = $(GSTREAMERBASEMM_ALL_PLUGIN_CPPNAMES)
+files_existing_plugin_hg = $(GSTREAMERBASEMM_EXISTING_PLUGIN_HG)
 
 include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment

Modified: gstreamermm/trunk/gstreamerbase/src/colorbalance.hg
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/colorbalance.hg	(original)
+++ gstreamermm/trunk/gstreamerbase/src/colorbalance.hg	Fri Jan  2 19:29:21 2009
@@ -27,7 +27,7 @@
 namespace GstBase
 {
 
-_WRAP_ENUM(ColorBalanceType, GstColorBalanceType)
+//TODO: _WRAP_ENUM(ColorBalanceType, GstColorBalanceType)
 
 class ColorBalanceChannel;
 

Modified: gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
==============================================================================
--- gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc	(original)
+++ gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc	Fri Jan  2 19:29:21 2009
@@ -423,10 +423,12 @@
 
   std::cout << "/** " << nmspace << "::" << cppTypeName << " â " << pluginName << " plugin." << std::endl;
   std::cout << " * Please include <" << target << "/" <<
-    cppTypeName.lowercase() << ".h> to use.  Also, though using the\n"
-    " * underlying GObject is fine, using its C <B>type</B> is not "
-    "guaranteed to be\n * API stable across releases because it is not "
-    "guaranteed to always remain\n * the same." << std::endl;
+    cppTypeName.lowercase() << ".h> to use.  Please note that, though\n"
+    " * using the underlying GObject is fine, using its C <B>type</B> is not\n"
+    " * guaranteed to be API stable across releases because it is not "
+    "guaranteed to\n * always remain the same.  Also, not all plug-ins are "
+    "available on all systems\n * and the ones that aren't available are not "
+    "included in the build." << std::endl;
   std::cout << " *" << std::endl;
   std::cout << " * @ingroup " << nmspace << "Plugins" << std::endl;
   std::cout << " */" << std::endl;
@@ -451,6 +453,8 @@
   //been wrapped.
   //std::cout << interfaceMacros << std::endl;
 
+  std::cout << "  _IS_GSTREAMERMM_PLUGIN" << std::endl << std::endl;
+
   std::cout << "protected:" << std::endl;
   std::cout << "  " << cppTypeName << "();" << std::endl;
   std::cout << "  " << cppTypeName << "(const Glib::ustring& name);" << std::endl << std::endl;

Added: gstreamermm/trunk/tools/generate_wrap_init.pl.in
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/tools/generate_wrap_init.pl.in	Fri Jan  2 19:29:21 2009
@@ -0,0 +1,445 @@
+#! @PERL_PATH@
+#
+# @configure_input@
+#
+
+use strict;
+
+my @namespace_whole = (); # list of strings.
+my $function_prefix = "";
+my $parent_dir = ""; # e.g. gtkmm
+my $path = "gtk--";
+my $debug = 0;
+my @filenames_headers = ();
+my %objects = ();
+my %exceptions = ();
+my %namespaces = (); # hashmap of lists of strings.
+my %basenames = ();
+my %win32_nowrap = ();
+my %deprecated = ();
+my %is_gstreamermm_plugin = ();
+
+# Loop through command line arguments, setting variables:
+while ($ARGV[0] =~ /^-/)
+{
+  if ($ARGV[0] =~ /--namespace=(\S+)/)
+  {
+    push(@namespace_whole, $1);
+
+    if($parent_dir eq "")
+      { $parent_dir = lc($1) . "mm"; }
+  }
+  elsif ($ARGV[0] =~ /--function_prefix=(\S+)/)
+  {
+    $function_prefix = "$1";
+  }
+  elsif ($ARGV[0] =~ /--parent_dir=(\S+)/)
+  {
+    $parent_dir = "$1";
+  }
+  elsif
+  (
+    $ARGV[0] =~ /--debug/) {$debug = 1;
+  }
+  elsif ($ARGV[0] =~ /--path=(\S+)/)
+  {
+    $path = "$1";
+  }
+  else
+  {
+    print "Error: unknown option $ARGV[0]\n";
+    exit;
+  }
+
+  shift @ARGV;
+}
+
+
+
+while ($ARGV[0])
+{
+  if ($debug) {warn "Processing file : $ARGV[0]\n";}
+
+  my $filename = $ARGV[0];
+  open FILE, $filename or die "Couldn't open file $ARGV[0] : $!\n";
+
+  # my $file = $ARGV[0];
+  # $file =~ s/.*\/([^\/]+)$/$1/;
+  # $file =~ s/\.hg//;
+  my @tmpnamespace = @namespace_whole;
+  my $cppname = "";
+  my $cname = "";
+  my $ccast = "";
+  while (<FILE>)
+  {
+    if (/CLASS_START\((\w+)\)/) #We need a new way to get the namespace.
+    {
+      print "generate_wrap_init: namespace found: $1\n";
+      push(@tmpnamespace, $1);
+    }
+    elsif (/_CLASS_GOBJECT\s*\(/) #TODO: There is duplication of code here.
+    {
+      my $line = $_;
+      while ($line !~ /\)/ && ($_ = <FILE>))
+      {
+        $line .= $_;
+      }
+
+      $line =~ s/^.*_CLASS_GOBJECT\s*\(//;
+      $line =~ s/\s+//g;
+      ($cppname, $cname, $ccast) = split(/,/, $line);
+
+      $objects{$cppname} = $cname;
+      @{$namespaces{$cppname}} = ( @tmpnamespace ); #both are lists of strings
+      $basenames{$cppname} = lc($ccast);
+    }
+    elsif (/_CLASS_GTKOBJECT\s*\(/)
+    {
+      my $line = $_;
+      while ($line !~ /\)/ && ($_ = <FILE>))
+      {
+        $line .= $_;
+      }
+
+      $line =~ s/^.*_CLASS_GTKOBJECT\s*\(//;
+      $line =~ s/\s+//g;
+      ($cppname, $cname, $ccast) = split(/,/, $line);
+
+      #TODO: Remove this hack eventually.
+      if( ($cname ne "GtkTree") && ($cname ne "GtkTreeItem") && ($cname ne "GtkText") )
+      {
+        $objects{$cppname} = $cname;
+        @{$namespaces{$cppname}} = ( @tmpnamespace ); #both are lists of strings
+        $basenames{$cppname} = lc($ccast);
+      }
+    }
+    elsif (/_WRAP_GERROR\s*\(/) #TODO: There is duplication of code here.
+    {
+      my $line = $_;
+      while ($line !~ /\)/ && ($_ = <FILE>))
+      {
+        $line .= $_;
+      }
+
+      $line =~ s/^.*_WRAP_GERROR\s*\(//;
+      $line =~ s/\s+//g;
+      $line =~ s/\)//;
+      ($cppname, $cname, $ccast) = split(/,/, $line);
+
+      $exceptions{$cppname} = $cname;
+      @{$namespaces{$cppname}} = ( @tmpnamespace ); #both are lists of strings
+      $basenames{$cppname} = lc($ccast);
+    }
+    elsif (/_GTKMMPROC_WIN32_NO_WRAP/)
+    {
+      $win32_nowrap{$cppname} = 1;
+    }
+    elsif (/_IS_DEPRECATED/)
+    {
+      $deprecated{$cppname} = 1;
+    }
+    elsif (/_IS_GSTREAMERMM_PLUGIN/)
+    {
+      $is_gstreamermm_plugin{$cppname} = 1;
+    }
+  }
+
+  # Store header filename so that we can #include it later:
+  my $filename_header = $filename;
+  $filename_header =~ s/.*\/([^\/]+)\.hg/$1.h/;
+  push(@filenames_headers, $filename_header);
+
+  shift @ARGV;
+  close(FILE);
+}
+
+# my $namespace_whole_lower = lc($namespace_whole);
+
+print << "EOF";
+
+#include <glib.h>
+
+// Disable the 'const' function attribute of the get_type() functions.
+// GCC would optimize them out because we don't use the return value.
+#undef  G_GNUC_CONST
+#define G_GNUC_CONST /* empty */
+
+#include <${parent_dir}/wrap_init.h>
+#include <glibmm/error.h>
+#include <glibmm/object.h>
+
+// #include the widget headers so that we can call the get_type() static methods:
+
+EOF
+
+foreach( @filenames_headers )
+{
+  print "#include \"" . $_ . "\"\n";
+}
+
+print "\n";
+
+# Here we have to be subtle. The gtkmm objects are easy, they all go
+# into the Gtk namespace. But in gnomemm, some go into the Gnome
+# namespace (most of them), and some into the Gtk one (because the
+# corresponding widget is Gtk-prefixed, e.g. GtkTed, GtkDial, etc...
+
+# First, the Gtk namespace
+
+print "extern \"C\"\n";
+print "{\n";
+print "\n//Declarations of the *_get_type() functions:\n\n";
+
+my $i = 0;
+foreach $i (sort keys %objects)
+{
+  if( $deprecated{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifndef " . uc($parent_dir) ."_DISABLE_DEPRECATED\n"
+  }
+
+  #On Win32, these classes are not compiled:
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#ifndef G_OS_WIN32\n"
+  }
+
+  # ifdefs are used for gstreamermm plug-ins in case they don't exist:
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifdef " . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+  
+  print "GType $basenames{$i}_get_type(void);\n";
+
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#endif //G_OS_WIN32\n"
+  }
+
+  if( $deprecated{$i} eq 1 )
+  {
+    print "#endif // *_DISABLE_DEPRECATED\n"
+  }
+
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    print "#endif //" . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+}
+
+print "\n//Declarations of the *_error_quark() functions:\n\n";
+
+my $i = 0;
+foreach $i (sort keys %exceptions)
+{
+  print "GQuark $basenames{$i}_quark(void);\n";
+}
+
+print "} // extern \"C\"\n";
+print "\n";
+
+print "\n//Declarations of the *_Class::wrap_new() methods, instead of including all the private headers:\n\n";
+
+my $i = 0;
+foreach $i (sort keys %objects)
+{
+  if( $deprecated{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifndef " . uc($parent_dir) ."_DISABLE_DEPRECATED\n"
+  }
+
+  #On Win32, these classes are not compiled:
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#ifndef G_OS_WIN32\n"
+  }
+
+  # ifdefs are used for gstreamermm plug-ins in case they don't exist:
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifdef " . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+  
+  my $namespace_declarations = "";
+  my $namespace_close = "";
+  foreach ( @{$namespaces{$i}} )
+  {
+    $namespace_declarations .= "namespace $_ { ";
+    $namespace_close .= " }";
+  }
+
+  print "${namespace_declarations} class ${i}_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; ${namespace_close}\n";
+  
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#endif //G_OS_WIN32\n"
+  }
+
+  if( $deprecated{$i} eq 1 )
+  {
+    print "#endif // *_DISABLE_DEPRECATED\n"
+  }
+
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    print "#endif //" . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+}
+
+# print "\n//Declarations of the *Error::throw_func() methods:\n\n";
+#
+# my $i = 0;
+# foreach $i (sort keys %exceptions)
+# {
+#   my $namespace_declarations = "";
+#   my $namespace_close = "";
+#   foreach ( @{$namespaces{$i}} )
+#   {
+#     $namespace_declarations .= "namespace $_ { ";
+#     $namespace_close .= " }";
+#   }
+#
+#   print "${namespace_declarations} class ${i} { public: static void throw_func(GError*); }; ${namespace_close}\n";
+# }
+
+my $namespace_whole_declarations = "";
+my $namespace_whole_close = "";
+foreach( @namespace_whole )
+{
+  $namespace_whole_declarations .= "namespace " . $_ ." { ";
+  $namespace_whole_close = "} //" . $_ . "\n" . $namespace_whole_close;
+}
+
+print "\n";
+print "$namespace_whole_declarations\n";
+print "\n";
+print "void " .$function_prefix . "wrap_init()\n{\n";
+
+
+# Generate namespace::wrap_init() body
+#
+
+print "  // Register Error domains:\n";
+
+foreach $i (sort keys %exceptions)
+{
+  my $namespace_prefix = "";
+  foreach( @{$namespaces{$i}} )
+  {
+    $namespace_prefix .= $_ ."::";
+  }
+
+  print "  Glib::Error::register_domain($basenames{$i}_quark(), &", "${namespace_prefix}${i}::throw_func);\n";
+}
+
+print "\n";
+print "// Map gtypes to gtkmm wrapper-creation functions:\n";
+
+foreach $i (sort keys %objects)
+{
+  if( $deprecated{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifndef " . uc($parent_dir) ."_DISABLE_DEPRECATED\n"
+  }
+
+  #On Win32, these classes are not compiled:
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#ifndef G_OS_WIN32\n"
+  }
+
+  # ifdefs are used for gstreamermm plug-ins in case they don't exist:
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifdef " . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+  
+  my $namespace_prefix = "";
+  foreach( @{$namespaces{$i}} )
+  {
+    $namespace_prefix .= $_ ."::";
+  }
+
+  print "  Glib::wrap_register($basenames{$i}_get_type(), &", "${namespace_prefix}${i}_Class::wrap_new);\n";
+
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#endif //G_OS_WIN32\n"
+  }
+
+  if( $deprecated{$i} eq 1 )
+  {
+    print "#endif // *_DISABLE_DEPRECATED\n"
+  }
+
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    print "#endif //" . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+}
+
+print "\n";
+print "  // Register the gtkmm gtypes:\n";
+
+foreach $i (sort keys %objects)
+{
+  if( $deprecated{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifndef " . uc($parent_dir) ."_DISABLE_DEPRECATED\n"
+  }
+
+  #On Win32, these classes are not compiled:
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#ifndef G_OS_WIN32\n"
+  }
+
+  # ifdefs are used for gstreamermm plug-ins in case they don't exist:
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    # The uc(parent_dir) is a bit of a hack. One day it will get it wrong.
+    print "#ifdef " . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+  
+  my $namespace_prefix = "";
+  foreach( @{$namespaces{$i}} )
+  {
+    $namespace_prefix .= $_ ."::";
+  }
+
+  print "  ${namespace_prefix}${i}::get_type();\n";
+
+  if( $win32_nowrap{$i} eq 1 )
+  {
+    print "#endif //G_OS_WIN32\n"
+  }
+
+  if( $deprecated{$i} eq 1 )
+  {
+    print "#endif // *_DISABLE_DEPRECATED\n"
+  }
+
+  if( $is_gstreamermm_plugin{$i} eq 1 )
+  {
+    print "#endif //" . uc($parent_dir) . "_PLUGIN_" . uc($i) . "\n";
+  }
+}
+
+print << "EOF";
+
+} // wrap_init()
+
+$namespace_whole_close
+
+EOF
+
+exit 0;
+

Modified: gstreamermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment
==============================================================================
--- gstreamermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment	(original)
+++ gstreamermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment	Fri Jan  2 19:29:21 2009
@@ -1,5 +1,5 @@
 files_tools_m4 = convert.m4 convert_gst.m4 convert_gstbase.m4 \
-		 class_gstminiobject.m4 class_boxedtype_extra.m4
+		 class_gstminiobject.m4 class_boxedtype_extra.m4 shared.m4
 
 files_tools_plugin_m4 = ctocpp_base.m4 ctocpp.m4
 

Modified: gstreamermm/trunk/tools/m4/convert.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert.m4	(original)
+++ gstreamermm/trunk/tools/m4/convert.m4	Fri Jan  2 19:29:21 2009
@@ -1,3 +1,4 @@
+include(shared.m4)
 include(convert_base.m4)
 include(convert_glib.m4)
 include(convert_gst.m4)

Added: gstreamermm/trunk/tools/m4/shared.m4
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/tools/m4/shared.m4	Fri Jan  2 19:29:21 2009
@@ -0,0 +1,6 @@
+
+dnl _IS_GSTREAMERMM_PLUGIN
+dnl Just process it to remove it from the generated file.
+dnl generate_wrap_init.pl will look for this in the original .hg file.
+dnl
+define(`_IS_GSTREAMERMM_PLUGIN',`')dnl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]