mistelix r2 - in trunk: . data data/themes extensions extensions/SlideTransitions extensions/SlideTransitions/Fade extensions/SlideTransitions/OpaqueLines gstreamer gstreamer/gst-ffmpeg libmistelix po src src/backends src/core src/datamodel src/dialogs src/widgets



Author: jmas
Date: Wed Mar 18 14:33:32 2009
New Revision: 2
URL: http://svn.gnome.org/viewvc/mistelix?rev=2&view=rev

Log:
Mistelix 0.1

Added:
   trunk/AUTHORS
   trunk/COPYING
   trunk/ChangeLog
   trunk/MAINTAINERS
   trunk/Makefile.am
   trunk/NEWS
   trunk/README
   trunk/aclocal.m4
   trunk/autogen.sh   (contents, props changed)
   trunk/configure.in
   trunk/data/
   trunk/data/ChangeLog
   trunk/data/Makefile.am
   trunk/data/mistelix.png   (contents, props changed)
   trunk/data/mistelix.spec
   trunk/data/mistelix.svg
   trunk/data/themes/
   trunk/data/themes/Themes.xml
   trunk/data/themes/beach_mainmenu.jpg   (contents, props changed)
   trunk/data/themes/beach_menu_highlight.svg
   trunk/data/themes/beach_menu_normal.svg
   trunk/data/themes/europe_mainmenu.jpg   (contents, props changed)
   trunk/data/themes/europe_menu_highlight.svg
   trunk/data/themes/europe_menu_normal.svg
   trunk/data/themes/winter_mainmenu.jpg   (contents, props changed)
   trunk/data/themes/winter_menu_highlight.svg
   trunk/data/themes/winter_menu_normal.svg
   trunk/extensions/
   trunk/extensions/ChangeLog
   trunk/extensions/Makefile.am
   trunk/extensions/SlideTransitions/
   trunk/extensions/SlideTransitions/Fade/
   trunk/extensions/SlideTransitions/Fade/Fade.addin.xml
   trunk/extensions/SlideTransitions/Fade/Fade.cs
   trunk/extensions/SlideTransitions/Fade/Makefile.am
   trunk/extensions/SlideTransitions/Makefile.am
   trunk/extensions/SlideTransitions/OpaqueLines/
   trunk/extensions/SlideTransitions/OpaqueLines/Makefile.am
   trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.addin.xml
   trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.cs
   trunk/extensions/mistelix.global.addins
   trunk/gstreamer/
   trunk/gstreamer/ChangeLog
   trunk/gstreamer/Makefile.am
   trunk/gstreamer/c.sh   (contents, props changed)
   trunk/gstreamer/gst-ffmpeg/
   trunk/gstreamer/gst-ffmpeg/gst-ffmpeg.patch
   trunk/gstreamer/gstmistelixvideosrc.c
   trunk/gstreamer/gstmistelixvideosrc.h
   trunk/gstreamer/mistelixsocket.c
   trunk/gstreamer/mistelixsocket.h
   trunk/gstreamer/mistelixvideosrc.c
   trunk/gstreamer/mistelixvideosrc.h
   trunk/libmistelix/
   trunk/libmistelix/ChangeLog
   trunk/libmistelix/Makefile.am
   trunk/libmistelix/mistelix.c
   trunk/libmistelix/mistelix.h
   trunk/mistelix.desktop.in
   trunk/po/
   trunk/po/ChangeLog
   trunk/po/LINGUAS
   trunk/po/POTFILES.in
   trunk/po/POTFILES.skip
   trunk/po/README
   trunk/po/ca.po
   trunk/po/nn_NO.po
   trunk/src/
   trunk/src/ChangeLog
   trunk/src/Defines.cs.in
   trunk/src/Makefile.am
   trunk/src/backends/
   trunk/src/backends/DvdAuthor.cs
   trunk/src/backends/Spumux.cs
   trunk/src/core/
   trunk/src/core/Button.cs
   trunk/src/core/Dependencies.cs
   trunk/src/core/DvdMenu.cs
   trunk/src/core/DvdProjectBuilder.cs
   trunk/src/core/Logger.cs
   trunk/src/core/MistelixLib.cs
   trunk/src/core/NoneTransition.cs
   trunk/src/core/Preferences.cs
   trunk/src/core/SlideImage.cs
   trunk/src/core/SlideShow.cs
   trunk/src/core/SvgImage.cs
   trunk/src/core/ThemeManager.cs
   trunk/src/core/TheoraProjectBuilder.cs
   trunk/src/core/ThumbnailSizeManager.cs
   trunk/src/core/TransitionManager.cs
   trunk/src/core/Video.cs
   trunk/src/core/XmlStorage.cs
   trunk/src/datamodel/
   trunk/src/datamodel/AspectRatio.cs
   trunk/src/datamodel/BackgroundTask.cs
   trunk/src/datamodel/BackgroundTaskCollection.cs
   trunk/src/datamodel/ButtonProjectElement.cs
   trunk/src/datamodel/ITransition.cs
   trunk/src/datamodel/IntList.cs
   trunk/src/datamodel/ObservableList.cs
   trunk/src/datamodel/PathList.cs
   trunk/src/datamodel/ProgressEventArgs.cs
   trunk/src/datamodel/Project.cs
   trunk/src/datamodel/ProjectBuilder.cs
   trunk/src/datamodel/ProjectDetails.cs
   trunk/src/datamodel/ProjectElement.cs
   trunk/src/datamodel/SlideShowProjectElement.cs
   trunk/src/datamodel/TextPosition.cs
   trunk/src/datamodel/Theme.cs
   trunk/src/datamodel/ThumbnailSize.cs
   trunk/src/datamodel/VideoProjectElement.cs
   trunk/src/datamodel/VisibleProjectElement.cs
   trunk/src/dialogs/
   trunk/src/dialogs/AboutDialog.cs
   trunk/src/dialogs/AddSlideDialog.cs
   trunk/src/dialogs/AddVideoDialog.cs
   trunk/src/dialogs/BuildProjectDialog.cs
   trunk/src/dialogs/ButtonPropertiesDialog.cs
   trunk/src/dialogs/CheckDependenciesDialog.cs
   trunk/src/dialogs/GtkDialog.cs
   trunk/src/dialogs/NewProjectDialog.cs
   trunk/src/dialogs/PreferencesDialog.cs
   trunk/src/dialogs/ProjectPropertiesDialog.cs
   trunk/src/dialogs/ThemeSelectionDialog.cs
   trunk/src/mistelix.addin.xml
   trunk/src/mistelix.cs
   trunk/src/mistelix.glade
   trunk/src/mistelix.in
   trunk/src/mono-addins-strings.xml
   trunk/src/widgets/
   trunk/src/widgets/AuthoringPaneView.cs
   trunk/src/widgets/BrowseDirectory.cs
   trunk/src/widgets/DirectoryView.cs
   trunk/src/widgets/FileView.cs
   trunk/src/widgets/GtkMenu.cs
   trunk/src/widgets/GtkUtils.cs
   trunk/src/widgets/ImagesFileView.cs
   trunk/src/widgets/PixbufImageSurface.cs
   trunk/src/widgets/ProjectElementView.cs
   trunk/src/widgets/SlideShowImageView.cs
   trunk/src/widgets/VideosFileView.cs

Added: trunk/AUTHORS
==============================================================================
--- (empty file)
+++ trunk/AUTHORS	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,4 @@
+Jordi Mas i Hernandez <jmas softcatala org>
+
+
+

Added: trunk/COPYING
==============================================================================
--- (empty file)
+++ trunk/COPYING	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,7 @@
+Copyright (C) 2008 Jordi Mas i Hernandez
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Added: trunk/MAINTAINERS
==============================================================================
--- (empty file)
+++ trunk/MAINTAINERS	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,6 @@
+Jordi Mas i Hernandez
+E-mail: jmas softcatala org
+Userid: jmas
+
+
+

Added: trunk/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,41 @@
+SUBDIRS = 		\
+	gstreamer	\
+	src		\
+	extensions	\
+	po		\
+	libmistelix	\
+	data		
+
+
+desktop_in_files=	\
+	mistelix.desktop.in
+
+desktop_files=$(desktop_in_files:.desktop.in=.desktop)
+ INTLTOOL_DESKTOP_RULE@
+
+Applicationsdir = $(datadir)/applications
+Applications_DATA = $(desktop_files)
+
+CLEANFILES =			\
+	intltool-extract	\
+	intltool-update		\
+	intltool-merge
+
+EXTRA_DIST =			\
+	MAINTAINERS		\
+	intltool-extract.in	\
+	intltool-merge.in	\
+	intltool-update.in	\
+        $(desktop_in_files)     \
+        $(desktop_files)
+
+DISTCLEANFILES = \
+        intltool-extract        \
+        intltool-merge          \
+        intltool-update         \
+	gnome-doc-utils.make	\
+        $(desktop_files)
+
+DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper
+
+

Added: trunk/NEWS
==============================================================================
--- (empty file)
+++ trunk/NEWS	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,12 @@
+Mistelix NEWS
+
+Version 0.1
+
+* Create slideshows from a set of images
+* Include videos in your projects
+* Create new slide transition effects using extensions
+* Publish your projects into DVD or Theora videos
+* Localizable to any language
+* Save and load authoring projects
+
+

Added: trunk/README
==============================================================================
--- (empty file)
+++ trunk/README	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,8 @@
+Introduction
+
+Mistelix is a DVD authoring application with also Theora slideshow creation 
+capabilities
+
+See http://www.mistelix.org for instructions on installation and use
+
+

Added: trunk/aclocal.m4
==============================================================================
--- (empty file)
+++ trunk/aclocal.m4	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,9977 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Configure paths for GLIB
+# Owen Taylor     1997-2001
+
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
+dnl gthread, or gio is specified in MODULES, pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GLIB_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
+		    , enable_glibtest=yes)
+
+  pkg_config_args=glib-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export) 
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject) 
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+         gio*) 
+             pkg_config_args="$pkg_config_args $module-2.0"
+         ;;
+      esac
+  done
+
+  PKG_PROG_PKG_CONFIG([0.16])
+
+  no_glib=""
+
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
+  fi
+
+  min_glib_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+	  enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+	  :
+    else
+	  no_glib=yes
+    fi
+  fi
+
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.glibtest");
+
+  /* HP/UX 9 (% #!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n";);
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/";
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  AC_SUBST(GLIB_GENMARSHAL)
+  AC_SUBST(GOBJECT_QUERY)
+  AC_SUBST(GLIB_MKENUMS)
+  rm -f conf.glibtest
+])
+
+# Copyright (C) 1995-2002 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003,2004 Red Hat, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License.  As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+#
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper cygnus com>, 1995, 1996
+#
+# Modified to never use included libintl. 
+# Owen Taylor <otaylor redhat com>, 12/15/1998
+#
+# Major rework to remove unused code
+# Owen Taylor <otaylor redhat com>, 12/11/2002
+#
+# Added better handling of ALL_LINGUAS from GNU gettext version 
+# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
+#
+# Modified to require ngettext
+# Matthias Clasen <mclasen redhat com> 08/06/2004
+#
+# We need this here as well, since someone might use autoconf-2.5x
+# to configure GLib then an older version to configure a package
+# using AM_GLIB_GNU_GETTEXT
+AC_PREREQ(2.53)
+
+dnl
+dnl We go to great lengths to make sure that aclocal won't 
+dnl try to pull in the installed version of these macros
+dnl when running aclocal in the glib directory.
+dnl
+m4_copy([AC_DEFUN],[glib_DEFUN])
+m4_copy([AC_REQUIRE],[glib_REQUIRE])
+dnl
+dnl At the end, if we're not within glib, we'll define the public
+dnl definitions in terms of our private definitions.
+dnl
+
+# GLIB_LC_MESSAGES
+#--------------------
+glib_DEFUN([GLIB_LC_MESSAGES],
+  [AC_CHECK_HEADERS([locale.h])
+    if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES, 1,
+        [Define if your <locale.h> file defines LC_MESSAGES.])
+    fi
+  fi])
+
+# GLIB_PATH_PROG_WITH_TEST
+#----------------------------
+dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in ifelse([$5], , $PATH, [$5]); do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if [$3]; then
+	ac_cv_path_$1="$ac_dir/$ac_word"
+	break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+# GLIB_WITH_NLS
+#-----------------
+glib_DEFUN([GLIB_WITH_NLS],
+  dnl NLS is obligatory
+  [USE_NLS=yes
+    AC_SUBST(USE_NLS)
+
+    gt_cv_have_gettext=no
+
+    CATOBJEXT=NONE
+    XGETTEXT=:
+    INTLLIBS=
+
+    AC_CHECK_HEADER(libintl.h,
+     [gt_cv_func_dgettext_libintl="no"
+      libintl_extra_libs=""
+
+      #
+      # First check in libc
+      #
+      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
+        [AC_TRY_LINK([
+#include <libintl.h>
+],
+         [return !ngettext ("","", 1)],
+	  gt_cv_func_ngettext_libc=yes,
+          gt_cv_func_ngettext_libc=no)
+        ])
+  
+      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
+	      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
+        	[AC_TRY_LINK([
+#include <libintl.h>
+],
+	          [return !dgettext ("","")],
+		  gt_cv_func_dgettext_libc=yes,
+	          gt_cv_func_dgettext_libc=no)
+        	])
+      fi
+  
+      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
+        AC_CHECK_FUNCS(bind_textdomain_codeset)
+      fi
+
+      #
+      # If we don't have everything we want, check in libintl
+      #
+      if test "$gt_cv_func_dgettext_libc" != "yes" \
+	 || test "$gt_cv_func_ngettext_libc" != "yes" \
+         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
+        
+        AC_CHECK_LIB(intl, bindtextdomain,
+	    [AC_CHECK_LIB(intl, ngettext,
+		    [AC_CHECK_LIB(intl, dgettext,
+			          gt_cv_func_dgettext_libintl=yes)])])
+
+	if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
+	  AC_MSG_CHECKING([if -liconv is needed to use gettext])
+	  AC_MSG_RESULT([])
+  	  AC_CHECK_LIB(intl, ngettext,
+          	[AC_CHECK_LIB(intl, dcgettext,
+		       [gt_cv_func_dgettext_libintl=yes
+			libintl_extra_libs=-liconv],
+			:,-liconv)],
+		:,-liconv)
+        fi
+
+        #
+        # If we found libintl, then check in it for bind_textdomain_codeset();
+        # we'll prefer libc if neither have bind_textdomain_codeset(),
+        # and both have dgettext and ngettext
+        #
+        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
+          glib_save_LIBS="$LIBS"
+          LIBS="$LIBS -lintl $libintl_extra_libs"
+          unset ac_cv_func_bind_textdomain_codeset
+          AC_CHECK_FUNCS(bind_textdomain_codeset)
+          LIBS="$glib_save_LIBS"
+
+          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
+            gt_cv_func_dgettext_libc=no
+          else
+            if test "$gt_cv_func_dgettext_libc" = "yes" \
+		&& test "$gt_cv_func_ngettext_libc" = "yes"; then
+              gt_cv_func_dgettext_libintl=no
+            fi
+          fi
+        fi
+      fi
+
+      if test "$gt_cv_func_dgettext_libc" = "yes" \
+	|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
+        gt_cv_have_gettext=yes
+      fi
+  
+      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
+        INTLLIBS="-lintl $libintl_extra_libs"
+      fi
+  
+      if test "$gt_cv_have_gettext" = "yes"; then
+	AC_DEFINE(HAVE_GETTEXT,1,
+	  [Define if the GNU gettext() function is already present or preinstalled.])
+	GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+	if test "$MSGFMT" != "no"; then
+          glib_save_LIBS="$LIBS"
+          LIBS="$LIBS $INTLLIBS"
+	  AC_CHECK_FUNCS(dcgettext)
+	  MSGFMT_OPTS=
+	  AC_MSG_CHECKING([if msgfmt accepts -c])
+	  GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: test 1.0\n"
+"PO-Revision-Date: 2007-02-15 12:01+0100\n"
+"Last-Translator: test <foo bar xx>\n"
+"Language-Team: C <LL li org>\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+	  AC_SUBST(MSGFMT_OPTS)
+	  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+	  GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+	    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+	  AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+			 return _nl_msg_cat_cntr],
+	    [CATOBJEXT=.gmo 
+             DATADIRNAME=share],
+	    [case $host in
+	    *-*-solaris*)
+	    dnl On Solaris, if bind_textdomain_codeset is in libc,
+	    dnl GNU format message catalog is always supported,
+            dnl since both are added to the libc all together.
+	    dnl Hence, we'd like to go with DATADIRNAME=share and
+	    dnl and CATOBJEXT=.gmo in this case.
+            AC_CHECK_FUNC(bind_textdomain_codeset,
+	      [CATOBJEXT=.gmo 
+               DATADIRNAME=share],
+	      [CATOBJEXT=.mo
+               DATADIRNAME=lib])
+	    ;;
+	    *)
+	    CATOBJEXT=.mo
+            DATADIRNAME=lib
+	    ;;
+	    esac])
+          LIBS="$glib_save_LIBS"
+	  INSTOBJEXT=.mo
+	else
+	  gt_cv_have_gettext=no
+	fi
+      fi
+    ])
+
+    if test "$gt_cv_have_gettext" = "yes" ; then
+      AC_DEFINE(ENABLE_NLS, 1,
+        [always defined to indicate that i18n is enabled])
+    fi
+
+    dnl Test whether we really found GNU xgettext.
+    if test "$XGETTEXT" != ":"; then
+      dnl If it is not GNU xgettext we define it as : so that the
+      dnl Makefiles still can work.
+      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+        : ;
+      else
+        AC_MSG_RESULT(
+	  [found xgettext program is not GNU xgettext; ignore it])
+        XGETTEXT=":"
+      fi
+    fi
+
+    # We need to process the po/ directory.
+    POSUB=po
+
+    AC_OUTPUT_COMMANDS(
+      [case "$CONFIG_FILES" in *po/Makefile.in*)
+        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+      esac])
+
+    dnl These rules are solely for the distribution goal.  While doing this
+    dnl we only have to keep exactly one list of the available catalogs
+    dnl in configure.in.
+    for lang in $ALL_LINGUAS; do
+      GMOFILES="$GMOFILES $lang.gmo"
+      POFILES="$POFILES $lang.po"
+    done
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST(CATALOGS)
+    AC_SUBST(CATOBJEXT)
+    AC_SUBST(DATADIRNAME)
+    AC_SUBST(GMOFILES)
+    AC_SUBST(INSTOBJEXT)
+    AC_SUBST(INTLLIBS)
+    AC_SUBST(PO_IN_DATADIR_TRUE)
+    AC_SUBST(PO_IN_DATADIR_FALSE)
+    AC_SUBST(POFILES)
+    AC_SUBST(POSUB)
+  ])
+
+# AM_GLIB_GNU_GETTEXT
+# -------------------
+# Do checks necessary for use of gettext. If a suitable implementation 
+# of gettext is found in either in libintl or in the C library,
+# it will set INTLLIBS to the libraries needed for use of gettext
+# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
+# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
+# on various variables needed by the Makefile.in.in installed by 
+# glib-gettextize.
+dnl
+glib_DEFUN([GLIB_GNU_GETTEXT],
+  [AC_REQUIRE([AC_PROG_CC])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   
+   GLIB_LC_MESSAGES
+   GLIB_WITH_NLS
+
+   if test "$gt_cv_have_gettext" = "yes"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for presentlang in $ALL_LINGUAS; do
+         useit=no
+         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
+           desiredlanguages="$LINGUAS"
+         else
+           desiredlanguages="$ALL_LINGUAS"
+         fi
+         for desiredlang in $desiredlanguages; do
+ 	   # Use the presentlang catalog if desiredlang is
+           #   a. equal to presentlang, or
+           #   b. a variant of presentlang (because in this case,
+           #      presentlang can be used as a fallback for messages
+           #      which are not translated in the desiredlang catalog).
+           case "$desiredlang" in
+             "$presentlang"*) useit=yes;;
+           esac
+         done
+         if test $useit = yes; then
+           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
+         fi
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
+   dnl Try to locate is.
+   MKINSTALLDIRS=
+   if test -n "$ac_aux_dir"; then
+     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
+   fi
+   if test -z "$MKINSTALLDIRS"; then
+     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+   fi
+   AC_SUBST(MKINSTALLDIRS)
+
+   dnl Generate list of files to be processed by xgettext which will
+   dnl be included in po/Makefile.
+   test -d po || mkdir po
+   if test "x$srcdir" != "x."; then
+     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+       posrcprefix="$srcdir/"
+     else
+       posrcprefix="../$srcdir/"
+     fi
+   else
+     posrcprefix="../"
+   fi
+   rm -f po/POTFILES
+   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+	< $srcdir/po/POTFILES.in > po/POTFILES
+  ])
+
+# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
+# -------------------------------
+# Define VARIABLE to the location where catalog files will
+# be installed by po/Makefile.
+glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
+[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
+glib_save_prefix="$prefix"
+glib_save_exec_prefix="$exec_prefix"
+glib_save_datarootdir="$datarootdir"
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+datarootdir=`eval echo "${datarootdir}"`
+if test "x$CATOBJEXT" = "x.mo" ; then
+  localedir=`eval echo "${libdir}/locale"`
+else
+  localedir=`eval echo "${datadir}/locale"`
+fi
+prefix="$glib_save_prefix"
+exec_prefix="$glib_save_exec_prefix"
+datarootdir="$glib_save_datarootdir"
+AC_DEFINE_UNQUOTED($1, "$localedir",
+  [Define the location where the catalogs will be installed])
+])
+
+dnl
+dnl Now the definitions that aclocal will find
+dnl
+ifdef(glib_configure_in,[],[
+AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
+AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
+])dnl
+
+# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
+# 
+# Create a temporary file with TEST-FILE as its contents and pass the
+# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
+# 0 and perform ACTION-IF-FAIL for any other exit status.
+AC_DEFUN([GLIB_RUN_PROG],
+[cat >conftest.foo <<_ACEOF
+$2
+_ACEOF
+if AC_RUN_LOG([$1 conftest.foo]); then
+  m4_ifval([$3], [$3], [:])
+m4_ifvaln([$4], [else $4])dnl
+echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
+sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
+fi])
+
+
+dnl GNOME_COMPILE_WARNINGS
+dnl Turn on many useful compiler warnings
+dnl For now, only works on GCC
+AC_DEFUN([GNOME_COMPILE_WARNINGS],[
+    dnl ******************************
+    dnl More compiler warnings
+    dnl ******************************
+
+    AC_ARG_ENABLE(compile-warnings, 
+                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
+                                 [Turn on compiler warnings]),,
+                  [enable_compile_warnings="m4_default([$1],[yes])"])
+
+    warnCFLAGS=
+    if test "x$GCC" != xyes; then
+	enable_compile_warnings=no
+    fi
+
+    warning_flags=
+    realsave_CFLAGS="$CFLAGS"
+
+    case "$enable_compile_warnings" in
+    no)
+	warning_flags=
+	;;
+    minimum)
+	warning_flags="-Wall"
+	;;
+    yes)
+	warning_flags="-Wall -Wmissing-prototypes"
+	;;
+    maximum|error)
+	warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
+	CFLAGS="$warning_flags $CFLAGS"
+	for option in -Wno-sign-compare; do
+		SAVE_CFLAGS="$CFLAGS"
+		CFLAGS="$CFLAGS $option"
+		AC_MSG_CHECKING([whether gcc understands $option])
+		AC_TRY_COMPILE([], [],
+			has_option=yes,
+			has_option=no,)
+		CFLAGS="$SAVE_CFLAGS"
+		AC_MSG_RESULT($has_option)
+		if test $has_option = yes; then
+		  warning_flags="$warning_flags $option"
+		fi
+		unset has_option
+		unset SAVE_CFLAGS
+	done
+	unset option
+	if test "$enable_compile_warnings" = "error" ; then
+	    warning_flags="$warning_flags -Werror"
+	fi
+	;;
+    *)
+	AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
+	;;
+    esac
+    CFLAGS="$realsave_CFLAGS"
+    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+    AC_MSG_RESULT($warning_flags)
+
+    AC_ARG_ENABLE(iso-c,
+                  AC_HELP_STRING([--enable-iso-c],
+                                 [Try to warn if code is not ISO C ]),,
+                  [enable_iso_c=no])
+
+    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
+    complCFLAGS=
+    if test "x$enable_iso_c" != "xno"; then
+	if test "x$GCC" = "xyes"; then
+	case " $CFLAGS " in
+	    *[\ \	]-ansi[\ \	]*) ;;
+	    *) complCFLAGS="$complCFLAGS -ansi" ;;
+	esac
+	case " $CFLAGS " in
+	    *[\ \	]-pedantic[\ \	]*) ;;
+	    *) complCFLAGS="$complCFLAGS -pedantic" ;;
+	esac
+	fi
+    fi
+    AC_MSG_RESULT($complCFLAGS)
+
+    WARN_CFLAGS="$warning_flags $complCFLAGS"
+    AC_SUBST(WARN_CFLAGS)
+])
+
+dnl For C++, do basically the same thing.
+
+AC_DEFUN([GNOME_CXX_WARNINGS],[
+  AC_ARG_ENABLE(cxx-warnings,
+                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
+                               [Turn on compiler warnings.]),,
+                [enable_cxx_warnings="m4_default([$1],[minimum])"])
+
+  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
+  warnCXXFLAGS=
+  if test "x$GXX" != xyes; then
+    enable_cxx_warnings=no
+  fi
+  if test "x$enable_cxx_warnings" != "xno"; then
+    if test "x$GXX" = "xyes"; then
+      case " $CXXFLAGS " in
+      *[\ \	]-Wall[\ \	]*) ;;
+      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
+      esac
+
+      ## -W is not all that useful.  And it cannot be controlled
+      ## with individual -Wno-xxx flags, unlike -Wall
+      if test "x$enable_cxx_warnings" = "xyes"; then
+	warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
+      fi
+    fi
+  fi
+  AC_MSG_RESULT($warnCXXFLAGS)
+
+   AC_ARG_ENABLE(iso-cxx,
+                 AC_HELP_STRING([--enable-iso-cxx],
+                                [Try to warn if code is not ISO C++ ]),,
+                 [enable_iso_cxx=no])
+
+   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
+   complCXXFLAGS=
+   if test "x$enable_iso_cxx" != "xno"; then
+     if test "x$GXX" = "xyes"; then
+      case " $CXXFLAGS " in
+      *[\ \	]-ansi[\ \	]*) ;;
+      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
+      esac
+
+      case " $CXXFLAGS " in
+      *[\ \	]-pedantic[\ \	]*) ;;
+      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
+      esac
+     fi
+   fi
+  AC_MSG_RESULT($complCXXFLAGS)
+
+  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
+  AC_SUBST(WARN_CXXFLAGS)
+])
+
+
+dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
+# serial 40 IT_PROG_INTLTOOL
+AC_DEFUN([IT_PROG_INTLTOOL], [
+AC_PREREQ([2.50])dnl
+AC_REQUIRE([AM_NLS])dnl
+
+case "$am__api_version" in
+    1.[01234])
+	AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
+    ;;
+    *)
+    ;;
+esac
+
+if test -n "$1"; then
+    AC_MSG_CHECKING([for intltool >= $1])
+
+    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
+    INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
+    [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
+    ]
+    AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
+    test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
+	AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
+fi
+
+AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
+AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
+AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
+if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
+    AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
+fi
+
+  INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+     INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+     INTLTOOL_PROP_RULE='%.prop:      %.prop.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+      INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
+     INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+   INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+    INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+       INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+      INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+      INTLTOOL_XML_NOMERGE_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' 
+      INTLTOOL_XAM_RULE='%.xam:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+      INTLTOOL_KBD_RULE='%.kbd:       %.kbd.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+    INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+  INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+    INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+    INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+   INTLTOOL_POLICY_RULE='%.policy:    %.policy.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+
+AC_SUBST(INTLTOOL_DESKTOP_RULE)
+AC_SUBST(INTLTOOL_DIRECTORY_RULE)
+AC_SUBST(INTLTOOL_KEYS_RULE)
+AC_SUBST(INTLTOOL_PROP_RULE)
+AC_SUBST(INTLTOOL_OAF_RULE)
+AC_SUBST(INTLTOOL_PONG_RULE)
+AC_SUBST(INTLTOOL_SERVER_RULE)
+AC_SUBST(INTLTOOL_SHEET_RULE)
+AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
+AC_SUBST(INTLTOOL_UI_RULE)
+AC_SUBST(INTLTOOL_XAM_RULE)
+AC_SUBST(INTLTOOL_KBD_RULE)
+AC_SUBST(INTLTOOL_XML_RULE)
+AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
+AC_SUBST(INTLTOOL_CAVES_RULE)
+AC_SUBST(INTLTOOL_SCHEMAS_RULE)
+AC_SUBST(INTLTOOL_THEME_RULE)
+AC_SUBST(INTLTOOL_SERVICE_RULE)
+AC_SUBST(INTLTOOL_POLICY_RULE)
+
+# Check the gettext tools to make sure they are GNU
+AC_PATH_PROG(XGETTEXT, xgettext)
+AC_PATH_PROG(MSGMERGE, msgmerge)
+AC_PATH_PROG(MSGFMT, msgfmt)
+AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
+    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+fi
+xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
+mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
+mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
+if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
+    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+fi
+
+AC_PATH_PROG(INTLTOOL_PERL, [perl])
+if test -z "$INTLTOOL_PERL"; then
+   AC_MSG_ERROR([perl not found; required for intltool])
+fi
+if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
+   AC_MSG_ERROR([perl 5.x required for intltool])
+fi
+if test "x$2" != "xno-xml"; then
+   AC_MSG_CHECKING([for XML::Parser])
+   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
+       AC_MSG_RESULT([ok])
+   else
+       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
+   fi
+fi
+
+# Substitute ALL_LINGUAS so we can use it in po/Makefile
+AC_SUBST(ALL_LINGUAS)
+
+# Set DATADIRNAME correctly if it is not set yet
+# (copied from glib-gettext.m4)
+if test -z "$DATADIRNAME"; then
+  AC_LINK_IFELSE(
+    [AC_LANG_PROGRAM([[]],
+                     [[extern int _nl_msg_cat_cntr;
+                       return _nl_msg_cat_cntr]])],
+    [DATADIRNAME=share],
+    [case $host in
+    *-*-solaris*)
+    dnl On Solaris, if bind_textdomain_codeset is in libc,
+    dnl GNU format message catalog is always supported,
+    dnl since both are added to the libc all together.
+    dnl Hence, we'd like to go with DATADIRNAME=share
+    dnl in this case.
+    AC_CHECK_FUNC(bind_textdomain_codeset,
+      [DATADIRNAME=share], [DATADIRNAME=lib])
+    ;;
+    *)
+    [DATADIRNAME=lib]
+    ;;
+    esac])
+fi
+AC_SUBST(DATADIRNAME)
+
+IT_PO_SUBDIR([po])
+
+])
+
+
+# IT_PO_SUBDIR(DIRNAME)
+# ---------------------
+# All po subdirs have to be declared with this macro; the subdir "po" is
+# declared by IT_PROG_INTLTOOL.
+#
+AC_DEFUN([IT_PO_SUBDIR],
+[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
+dnl
+dnl The following CONFIG_COMMANDS should be exetuted at the very end
+dnl of config.status.
+AC_CONFIG_COMMANDS_PRE([
+  AC_CONFIG_COMMANDS([$1/stamp-it], [
+    if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" ]; then
+       AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
+    fi
+    rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
+    >"$1/stamp-it.tmp"
+    [sed '/^#/d
+	 s/^[[].*] *//
+	 /^[ 	]*$/d
+	'"s|^|	$ac_top_srcdir/|" \
+      "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
+    ]
+    [sed '/^POTFILES =/,/[^\\]$/ {
+		/^POTFILES =/!d
+		r $1/POTFILES
+	  }
+	 ' "$1/Makefile.in" >"$1/Makefile"]
+    rm -f "$1/Makefile.tmp"
+    mv "$1/stamp-it.tmp" "$1/stamp-it"
+  ])
+])dnl
+])
+
+# deprecated macros
+AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
+# A hint is needed for aclocal from Automake <= 1.9.4:
+# AC_DEFUN([AC_PROG_INTLTOOL], ...)
+
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_quote(m4_if([$2], [],
+		     m4_quote(lt_decl_tag_varnames),
+		  m4_quote(m4_shift($@)))),
+     m4_split(m4_normalize(m4_quote(_LT_TAGS))))])
+m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+  ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool gnu org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+  lt_cl_success=:
+  test "$silent" = yes &&
+    lt_config_lt_args="$lt_config_lt_args --quiet"
+  exec AS_MESSAGE_LOG_FD>/dev/null
+  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+  exec AS_MESSAGE_LOG_FD>>config.log
+  $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_XSI_SHELLFNS
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on 
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it? 
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  if test "$GCC" = "yes"; then
+    output_verbose_link_cmd=echo
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<_LT_EOF
+[$]*
+_LT_EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
+
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
+
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
+    IFS="$lt_save_ifs"
+
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+      else
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
+
+	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
+
+	  if test "$prev" != 'sed 50q "[$]0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
+      fi
+    fi
+  fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+    [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+	[], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+       [shlibpath_overrides_runpath=yes])])
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+ 
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool gnu org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[ ?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC*)
+	    # IBM XL 8.0 on PPC
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd* | netbsdelf*-gnu)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
+      icc* | ecc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl*)
+	# IBM XL C 8.0/Fortran 10.1 on PPC
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+	[Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+	[Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  linux* | k*bsd*-gnu)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+  ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 best com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+	_LT_TAGVAR(link_all_deplibs, $1)=no
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        AC_LINK_IFELSE(int foo(void) {},
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+        )
+        LDFLAGS="$save_LDFLAGS"
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $RM conftest*
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+        _LT_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $RM conftest*
+      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+    [[If ld is used when linking, flag to hardcode $libdir into a binary
+    during linking.  This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+    [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <jrb3 best com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+        # as there is no search path for DLLs.
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+        _LT_TAGVAR(always_export_symbols, $1)=no
+        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    cp $export_symbols $output_objdir/$soname.def;
+          else
+	    echo EXPORTS > $output_objdir/$soname.def;
+	    cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          _LT_TAGVAR(ld_shlibs, $1)=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[[12]]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 will use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  xl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='echo'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=echo
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='echo'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${F77-"f77"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$[ ]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]+=\$[2]"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+    ;;
+  esac
+])
+
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
+
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+m4_define([lt_combine],
+[m4_if([$2], [], [],
+  [m4_if([$4], [], [],
+    [lt_join(m4_quote(m4_default([$1], [[, ]])),
+      lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2],
+		   [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]),
+			       [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl
+])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
+
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 2976 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.4])
+m4_define([LT_PACKAGE_REVISION], [1.2976])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.4'
+macro_revision='1.2976'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+
+# nls.m4 serial 3 (gettext-0.15)
+dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper cygnus com>, 1995-2000.
+dnl   Bruno Haible <haible clisp cons org>, 2000-2003.
+
+AC_PREREQ(2.50)
+
+AC_DEFUN([AM_NLS],
+[
+  AC_MSG_CHECKING([whether NLS is requested])
+  dnl Default is enabled NLS
+  AC_ARG_ENABLE(nls,
+    [  --disable-nls           do not use Native Language Support],
+    USE_NLS=$enableval, USE_NLS=yes)
+  AC_MSG_RESULT($USE_NLS)
+  AC_SUBST(USE_NLS)
+])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright  2004 Scott James Remnant <scott netsplit com>.
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+    if test -n "$$1"; then
+        pkg_cv_[]$1="$$1"
+    else
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+			 [pkg_failed=yes])
+    fi
+else
+	pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+		[AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+	 [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode  enable make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out.  Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+

Added: trunk/autogen.sh
==============================================================================
--- (empty file)
+++ trunk/autogen.sh	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,160 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+PROJECT=mistelix
+TEST_TYPE=-f
+FILE=src/mistelix.glade
+
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have autoconf installed to compile $PROJECT."
+	echo "Download the appropriate package for your distribution,"
+	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
+	DIE=1
+}
+
+AUTOMAKE=automake-1.9
+ACLOCAL=aclocal-1.9
+
+($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
+        AUTOMAKE=automake
+        ACLOCAL=aclocal
+}
+
+($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have automake installed to compile $PROJECT."
+	echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz";
+	echo "(or a newer version if it is available)"
+	DIE=1
+}
+
+(grep "^AM_PROG_LIBTOOL" configure.in >/dev/null) && {
+  (libtool --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
+    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz";
+    echo "(or a newer version if it is available)"
+    DIE=1
+  }
+}
+
+grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null && {
+  grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+  (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "**Error**: You must have \`glib' installed to compile $PROJECT."
+    DIE=1
+  }
+}
+
+(which gnome-doc-prepare && gnome-doc-prepare )|| {
+	echo "**Error**: You must have gnome-common installed to compile $PROJECT."
+	DIE=1
+}
+
+if test "$DIE" -eq 1; then
+	exit 1
+fi
+
+test $TEST_TYPE $FILE || {
+	echo "You must run this script in the top-level $PROJECT directory"
+	exit 1
+}
+
+if test -z "$*"; then
+	echo "I am going to run ./configure with no arguments - if you wish "
+        echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+case $CC in
+*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
+esac
+
+for coin in `find $srcdir -name configure.in -print`
+do 
+  dr=`dirname $coin`
+  if test -f $dr/NO-AUTO-GEN; then
+    echo skipping $dr -- flagged as no auto-gen
+  else
+    echo processing $dr
+    macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
+    ( cd $dr
+      aclocalinclude="$ACLOCAL_FLAGS"
+      for k in $macrodirs; do
+  	if test -d $k; then
+          aclocalinclude="$aclocalinclude -I $k"
+  	##else 
+	##  echo "**Warning**: No such directory \`$k'.  Ignored."
+        fi
+      done
+      if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
+	if grep "sed.*POTFILES" configure.in >/dev/null; then
+	  : do nothing -- we still have an old unmodified configure.in
+	else
+	  echo "Creating $dr/aclocal.m4 ..."
+	  test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+	  echo "Running gettextize...  Ignore non-fatal messages."
+	  echo "no" | gettextize --force --copy
+	  echo "Making $dr/aclocal.m4 writable ..."
+	  test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+        fi
+      fi
+      if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
+	echo "Creating $dr/aclocal.m4 ..."
+	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+	echo "Running gettextize...  Ignore non-fatal messages."
+	echo "no" | gettextize --force --copy
+	echo "Making $dr/aclocal.m4 writable ..."
+	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+      fi
+      if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
+	echo "Creating $dr/aclocal.m4 ..."
+	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+	echo "Running gettextize...  Ignore non-fatal messages."
+	echo "no" | glib-gettextize --force --copy
+	echo "Making $dr/aclocal.m4 writable ..."
+	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+      fi
+      if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then
+        echo "Running intltoolize..."
+        intltoolize --copy --force --automake
+      fi
+      if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
+	echo "Running libtoolize..."
+	libtoolize --force --copy
+      fi
+      echo "Running $ACLOCAL $aclocalinclude ..."
+      $ACLOCAL $aclocalinclude
+      if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+	echo "Running autoheader..."
+	autoheader
+      fi
+      echo "Running $AUTOMAKE --gnu $am_opt ..."
+      $AUTOMAKE --add-missing --gnu $am_opt
+      echo "Running autoconf ..."
+      autoconf
+    )
+  fi
+done
+
+conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+
+cd "$ORIGDIR"
+
+if test x$NOCONFIGURE = x; then
+  echo Running $srcdir/configure $conf_flags "$@" ...
+  $srcdir/configure $conf_flags "$@" \
+  && echo Now type \`make\' to compile $PROJECT  || exit 1
+else
+  echo Skipping configure process.
+fi
+
+

Added: trunk/configure.in
==============================================================================
--- (empty file)
+++ trunk/configure.in	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,136 @@
+AC_INIT(mistelix, 0.10)
+AC_CONFIG_SRCDIR(src/mistelix.cs)
+
+AM_CONFIG_HEADER(config.h)
+
+AM_INIT_AUTOMAKE([tar-ustar])
+
+AM_MAINTAINER_MODE
+
+AC_PROG_INTLTOOL([0.35])
+
+AC_PROG_CC
+AC_ISC_POSIX
+AC_HEADER_STDC
+AM_PROG_LIBTOOL
+
+GNOME_COMPILE_WARNINGS
+AM_PATH_GLIB_2_0
+
+dnl --- Check for mono and gmcs
+
+AC_PATH_PROG(MONO, mono)
+AC_PATH_PROG(MCS, gmcs)
+
+CS="C#"
+if test ! -x "$MCS"; then
+	AC_MSG_ERROR([No $CS compiler found])
+fi
+
+
+dnl -- Check for mono pc file
+
+AC_MSG_CHECKING([for mono.pc])
+if test -z `$PKG_CONFIG --variable=prefix mono`; then
+  AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
+else
+  AC_MSG_RESULT([found])
+fi
+
+dnl -- check for various mono DLLs that we need.
+
+needed_dlls="Mono.Posix Mono.Cairo"
+for i in $needed_dlls; do
+  AC_MSG_CHECKING([for $i.dll])
+  if test ! \( -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll -o -e `$PKG_CONFIG --variable=prefix mono`/lib64/mono/2.0//$i.dll \); then
+    AC_MSG_ERROR([missing required mono 2.0 DLL: $i.dll])
+  else
+    AC_MSG_RESULT([found])
+  fi
+done
+
+dnl --- Required libraries
+
+dnl --- Required Gstreamer libraries for gstreamer plug-in
+
+GSTREAMER_REQUIRED_VERSION=0.10.3
+AC_SUBST(GSTREAMER_REQUIRED_VERSION)
+
+PKG_CHECK_MODULES(GST,
+	gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
+	gstreamer-base-0.10 >= $GSTREAMER_REQUIRED_VERSION
+	gstreamer-plugins-base-0.10 >= $GSTREAMER_REQUIRED_VERSION)
+
+AC_SUBST(GST_CFLAGS)
+AC_SUBST(GST_LIBS)
+
+# 2.10 is required for Pango / Cairo compatibility
+GTKSHARP_REQUIRED=2.10
+MONO_REQUIRED=1.1.7
+
+PKG_CHECK_MODULES(MISTELIX_CORE, mono >= $MONO_REQUIRED)
+
+PKG_CHECK_MODULES(MISTELIX,
+	gtk-sharp-2.0 >= $GTKSHARP_REQUIRED
+	gnome-sharp-2.0 >= $GTKSHARP_REQUIRED
+	glade-sharp-2.0 >= $GTKSHARP_REQUIRED
+	mono-addins >= 0.3
+	mono-addins-setup >= 0.3
+	mono-addins-gui >= 0.3)
+AC_SUBST(MISTELIX_LIBS)
+
+dnl -- Intl
+
+GETTEXT_PACKAGE=mistelix
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
+AM_GLIB_GNU_GETTEXT
+
+
+dnl --- libmistelix requirements
+
+PKG_CHECK_MODULES(LIBMISTELIX,
+	glib-2.0
+	gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
+	gstreamer-base-0.10 >= $GSTREAMER_REQUIRED_VERSION
+	gstreamer-plugins-base-0.10 >= $GSTREAMER_REQUIRED_VERSION)
+
+LIBMISTELIX_LIBS="$LIBMISTELIX_LIBS -lgstvideo-0.10 -lgstinterfaces-0.10 -lgstcdda-0.10"
+
+AC_SUBST(LIBMISTELIX_CFLAGS)
+AC_SUBST(LIBMISTELIX_LIBS)
+
+dnl --- Prologue
+
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+
+CSC=gmcs
+AC_SUBST(CSC)
+
+expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac
+		   case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac
+		   eval echo $libdir )`
+AC_SUBST(expanded_libdir)
+
+AC_CONFIG_FILES([src/mistelix],[chmod +x src/mistelix])
+
+GNOME_ICON_THEME_PREFIX=`$PKG_CONFIG --variable=prefix gnome-icon-theme`
+AC_SUBST(GNOME_ICON_THEME_PREFIX)
+
+
+
+AC_OUTPUT([
+Makefile
+data/Makefile
+src/Defines.cs
+src/Makefile
+gstreamer/Makefile
+po/Makefile.in
+libmistelix/Makefile
+extensions/Makefile
+extensions/SlideTransitions/Makefile
+extensions/SlideTransitions/Fade/Makefile
+extensions/SlideTransitions/OpaqueLines/Makefile
+])

Added: trunk/data/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,58 @@
+
+themesdir = $(pkgdatadir)
+pixmapdir = $(datadir)/pixmaps
+pixmap_DATA = mistelix.png \
+		mistelix.svg
+
+
+hicolordir = $(datadir)/icons/hicolor
+images = $(datadir)/mistelix
+
+
+tango_icons = 				\
+	mistelix.png	\
+	mistelix.svg
+
+install-data-local:
+	@-$(mkinstalldirs) $(DESTDIR)$(hicolordir)/scalable/apps
+	$(INSTALL_DATA) $(srcdir)/mistelix.svg $(DESTDIR)$(hicolordir)/scalable/apps/mistelix.svg
+	@-$(mkinstalldirs) $(DESTDIR)$(hicolordir)/16x16/apps
+	$(INSTALL_DATA) $(srcdir)/mistelix.png $(DESTDIR)$(hicolordir)/16x16/apps/mistelix.png
+	@-$(mkinstalldirs) $(DESTDIR)$(hicolordir)/32x32/apps
+	$(INSTALL_DATA) $(srcdir)/mistelix.png $(DESTDIR)$(hicolordir)/32x32/apps/mistelix.png
+	@-$(mkinstalldirs) $(DESTDIR)$(hicolordir)/48x48/apps
+	$(INSTALL_DATA) $(srcdir)/mistelix.png $(DESTDIR)$(hicolordir)/48x48/apps/mistelix.png
+
+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
+
+install-data-hook:
+	@-if test -z "$(DESTDIR)"; then \
+		echo "Updating Gtk icon cache."; \
+		$(gtk_update_icon_cache); \
+	else \
+		echo "*** Icon cache not updated.  After install, run this:"; \
+		echo "***   $(gtk_update_icon_cache)"; \
+	fi
+
+uninstall-hook:
+	rm -f $(DESTDIR)$(hicolordir)/48x48/apps/mistelix.png
+	rm -f $(DESTDIR)$(hicolordir)/32x32/apps/mistelix.png
+	rm -f $(DESTDIR)$(hicolordir)/16x16/apps/mistelix.png
+	rm -f $(DESTDIR)$(hicolordir)/scalable/apps/mistelix.svg
+
+noinst_DATA = 	
+
+themes_DATA = \
+	themes/Themes.xml \
+	themes/beach_mainmenu.jpg \
+	themes/beach_menu_highlight.svg \
+	themes/beach_menu_normal.svg \
+	themes/europe_mainmenu.jpg \
+	themes/winter_mainmenu.jpg \
+	themes/winter_menu_highlight.svg \
+	themes/winter_menu_normal.svg \
+	themes/europe_menu_highlight.svg \
+	themes/europe_menu_normal.svg
+
+
+EXTRA_DIST = $(pixmap_DATA) $(tango_icons) $(themes_DATA)

Added: trunk/data/mistelix.png
==============================================================================
Binary file. No diff available.

Added: trunk/data/mistelix.spec
==============================================================================
--- (empty file)
+++ trunk/data/mistelix.spec	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,77 @@
+#
+# spec file for package mistelix
+#
+# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+# norootforbuild
+
+Name:           mistelix
+Version:        20090222
+Release:        1.0
+License:        X11/MIT
+Source:         %{name}-%{version}.tar.gz
+Autoreqprov:    on
+PreReq:         filesystem
+URL:            http://www.mistelix.org
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+BuildRequires:  mono-devel gtk-sharp2 perl-XML-Parser intltool 
+Group: 		Applications/Multimedia
+Summary:        Author DVDs and slideshows
+
+%if 0%{?suse_version}
+BuildRequires: glade-sharp2 gnome-sharp2 librsvg-devel gstreamer010-devel gstreamer010-plugins-base-devel update-desktop-files mono-addins
+Requires: mono-addins >= 0.3
+%endif
+
+%if 0%{?fedora_version}
+BuildRequires: gtk-sharp2-devel gnome-sharp-devel librsvg2-devel gstreamer gstreamer-plugins-base-devel gstreamer-devel mono-addins-devel
+Requires: mono-addins
+%endif
+
+%description
+Mistelix is a DVD authoring application with also Theora slideshow creation capabilities. It allows you to create slideshows with transition effects from a set of images, and even include videos in your presentations.
+
+This package includes the main application with OGG compatibility. An additional plugin will be necessary in order to export your creations to a format suitable for DVDs.
+
+%prep
+%setup -q
+
+%build
+autoreconf -f -i
+intltoolize --force
+export MONO_SHARED_DIR=/var/tmp
+export CFLAGS="$RPM_OPT_FLAGS"
+%configure
+make
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%if 0%{?suse_version}
+%suse_update_desktop_file %{name} -N mistelix
+%endif
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS NEWS README COPYING
+%{_bindir}/mistelix
+%{_libdir}/mistelix/mistelix.exe
+%{_libdir}/mistelix/libmistelix.so
+%{_datadir}/applications/mistelix.desktop
+%{_datadir}/mistelix/*
+%{_datadir}/mistelix/
+%{_datadir}/icons/hicolor/*/apps/*
+%{_datadir}/locale/*/LC_MESSAGES/mistelix.mo
+%{_datadir}/pixmaps/*
+%{_libdir}/mistelix/*
+%{_libdir}/mistelix/
+%changelog
+

Added: trunk/data/mistelix.svg
==============================================================================
--- (empty file)
+++ trunk/data/mistelix.svg	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,505 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="193.89"
+   height="144.98"
+   viewBox="0 0 999 747"
+   id="svg4798"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="mistelix.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <metadata
+     id="metadata4911">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs4909">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 72.490501 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="193.88699 : 72.490501 : 1"
+       inkscape:persp3d-origin="96.943497 : 48.327001 : 1"
+       id="perspective122" />
+    <linearGradient
+       id="linearGradient11802">
+      <stop
+         style="stop-color:#6d5a1a;stop-opacity:1;"
+         offset="0"
+         id="stop11804" />
+      <stop
+         style="stop-color:#50480f;stop-opacity:1;"
+         offset="1"
+         id="stop11806" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10825">
+      <stop
+         style="stop-color:#a5c4c7;stop-opacity:1;"
+         offset="0"
+         id="stop10827" />
+      <stop
+         style="stop-color:#86a4b7;stop-opacity:0.99607843;"
+         offset="1"
+         id="stop10829" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10817">
+      <stop
+         style="stop-color:#cac08d;stop-opacity:1;"
+         offset="0"
+         id="stop10819" />
+      <stop
+         style="stop-color:#a9976f;stop-opacity:1;"
+         offset="1"
+         id="stop10821" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10809">
+      <stop
+         style="stop-color:#fcc719;stop-opacity:1;"
+         offset="0"
+         id="stop10811" />
+      <stop
+         style="stop-color:#fca519;stop-opacity:1;"
+         offset="1"
+         id="stop10813" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5914">
+      <stop
+         style="stop-color:#9b9b9b;stop-opacity:1;"
+         offset="0"
+         id="stop5916" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop5918" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5906">
+      <stop
+         style="stop-color:#9b9b9b;stop-opacity:1;"
+         offset="0"
+         id="stop5908" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop5910" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5898">
+      <stop
+         style="stop-color:#9b9b9b;stop-opacity:1;"
+         offset="0"
+         id="stop5900" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop5902" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5890">
+      <stop
+         style="stop-color:#9b9b9b;stop-opacity:1;"
+         offset="0"
+         id="stop5892" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop5894" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient5882">
+      <stop
+         style="stop-color:#9b9b9b;stop-opacity:1;"
+         offset="0"
+         id="stop5884" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="1"
+         id="stop5886" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5882"
+       id="linearGradient5888"
+       x1="110.44397"
+       y1="69"
+       x2="113.85258"
+       y2="246.98146"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5890"
+       id="linearGradient5896"
+       x1="114.42544"
+       y1="260"
+       x2="115.85258"
+       y2="436"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5898"
+       id="linearGradient5904"
+       x1="619.5"
+       y1="47"
+       x2="619.5"
+       y2="171.42628"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9393988,0.3428262,-0.3428262,0.9393988,98.72165,-249.05025)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5906"
+       id="linearGradient5912"
+       x1="740.05475"
+       y1="145"
+       x2="696.8526"
+       y2="328.31424"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9393988,0.3428262,-0.3428262,0.9393988,98.72165,-249.05025)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5914"
+       id="linearGradient5920"
+       x1="796.203"
+       y1="303.68576"
+       x2="802.07501"
+       y2="428.5181"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9393988,0.3428262,-0.3428262,0.9393988,98.72165,-249.05025)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10809"
+       id="linearGradient11861"
+       gradientUnits="userSpaceOnUse"
+       x1="451"
+       y1="575.5"
+       x2="514"
+       y2="575.5"
+       gradientTransform="matrix(0.8426833,-0.5384096,0.5384096,0.8426833,194.10088,483.46287)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10825"
+       id="linearGradient11863"
+       gradientUnits="userSpaceOnUse"
+       x1="451"
+       y1="472.5"
+       x2="514"
+       y2="472.5"
+       gradientTransform="matrix(0.8426833,-0.5384096,0.5384096,0.8426833,194.10088,483.46287)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11802"
+       id="linearGradient11865"
+       gradientUnits="userSpaceOnUse"
+       x1="450.91949"
+       y1="441.42639"
+       x2="514.04706"
+       y2="441.42639"
+       gradientTransform="matrix(0.8426833,-0.5384096,0.5384096,0.8426833,194.10088,483.46287)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10817"
+       id="linearGradient11867"
+       gradientUnits="userSpaceOnUse"
+       x1="450.96487"
+       y1="702.28851"
+       x2="514.03253"
+       y2="702.28851"
+       gradientTransform="matrix(0.8426833,-0.5384096,0.5384096,0.8426833,194.10088,483.46287)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10809"
+       id="linearGradient11884"
+       gradientUnits="userSpaceOnUse"
+       x1="451"
+       y1="575.5"
+       x2="514"
+       y2="575.5"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-289.04946,715.03125)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10825"
+       id="linearGradient11886"
+       gradientUnits="userSpaceOnUse"
+       x1="451"
+       y1="472.5"
+       x2="514"
+       y2="472.5"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-289.04946,715.03125)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11802"
+       id="linearGradient11888"
+       gradientUnits="userSpaceOnUse"
+       x1="450.91949"
+       y1="441.42639"
+       x2="514.04706"
+       y2="441.42639"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-289.04946,715.03125)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10817"
+       id="linearGradient11890"
+       gradientUnits="userSpaceOnUse"
+       x1="450.96487"
+       y1="702.28851"
+       x2="514.03253"
+       y2="702.28851"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-289.04946,715.03125)" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10817"
+       id="linearGradient11894"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.80387,301.44256)"
+       x1="450.96487"
+       y1="702.28851"
+       x2="514.03253"
+       y2="702.28851" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11802"
+       id="linearGradient11897"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.80387,301.44256)"
+       x1="450.91949"
+       y1="441.42639"
+       x2="514.04706"
+       y2="441.42639" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10825"
+       id="linearGradient11900"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.80387,301.44256)"
+       x1="451"
+       y1="472.5"
+       x2="514"
+       y2="472.5" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10809"
+       id="linearGradient11903"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.80387,301.44256)"
+       x1="451"
+       y1="575.5"
+       x2="514"
+       y2="575.5" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10809"
+       id="linearGradient12951"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.0438089,306.55385)"
+       x1="451"
+       y1="575.5"
+       x2="514"
+       y2="575.5" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10825"
+       id="linearGradient12953"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.0438089,306.55385)"
+       x1="451"
+       y1="472.5"
+       x2="514"
+       y2="472.5" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11802"
+       id="linearGradient12955"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.0438089,306.55385)"
+       x1="450.91949"
+       y1="441.42639"
+       x2="514.04706"
+       y2="441.42639" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10817"
+       id="linearGradient12957"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.9239176,-0.3825916,0.3825916,0.9239176,-5.0438089,306.55385)"
+       x1="450.96487"
+       y1="702.28851"
+       x2="514.03253"
+       y2="702.28851" />
+  </defs>
+  <sodipodi:namedview
+     inkscape:window-height="725"
+     inkscape:window-width="1280"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     guidetolerance="10.0"
+     gridtolerance="10.0"
+     objecttolerance="10.0"
+     borderopacity="1.0"
+     bordercolor="#666666"
+     pagecolor="#ffffff"
+     id="base"
+     inkscape:zoom="2.0555692"
+     inkscape:cx="126.09362"
+     inkscape:cy="90.189701"
+     inkscape:window-x="0"
+     inkscape:window-y="52"
+     inkscape:current-layer="svg4798"
+     showgrid="false"
+     showborder="true"
+     inkscape:showpageshadow="true"
+     borderlayer="false" />
+  <g
+     id="g12970"
+     transform="matrix(1.6852358,-0.2458681,0.335056,1.2366462,-731.96121,252.64767)"
+     inkscape:export-filename="/home/jordi/dev/mistelix-fresh/data/mistelix48.png"
+     inkscape:export-xdpi="41.238842"
+     inkscape:export-ydpi="41.238842">
+    <path
+       id="path4800"
+       d="M 444.19103,76.089585 L 686.18874,-35.723238 L 692.42171,-32.38406 L 699.9369,-29.641452 L 708.3024,-23.394986 L 719.48611,-16.120053 L 724.43685,-12.184295 L 729.98417,-6.9663147 L 743.30041,3.2158956 L 749.4443,9.7161092 L 755.58819,16.216314 L 761.38925,23.655915 L 767.19031,31.095517 L 772.99137,38.535127 L 778.4496,46.914125 L 783.56501,56.232529 L 787.74102,65.208105 L 792.5136,75.465905 L 796.94335,86.663102 L 799.49431,97.174654 L 801.70243,108.62559 L 803.7459,114.69389 L 804.84997,120.41937 L 805.43304,133.40628 L 806.01613,146.39321 L 806.25638,160.31952 L 804.27501,174.49958 L 803.23303,189.02247 L 802.4583,194.06229 L 801.34074,200.04151 L 800.73068,210.46398 L 801.06001,221.22927 L 802.67157,231.39799 L 804.28312,241.56672 L 807.17691,251.13886 L 811.01009,261.05383 L 813.90387,270.62598 L 815.6936,274.47266 L 819.36211,279.00499 L 823.19529,288.91996 L 828.99634,296.35956 L 834.45458,304.73857 L 840.25564,312.17817 L 846.0567,319.61777 L 858.59822,33
 4.83981 L 871.22881,346.90082 L 877.71553,352.46163 L 883.85941,358.96183 L 896.57909,367.86182 L 907.41997,376.07616 L 916.38205,383.60484 L 923.21159,388.22625 L 929.44456,391.56543 L 687.44684,503.37825 L 680.87104,500.97847 L 672.75928,496.95364 L 662.51498,490.02152 L 652.27067,483.08941 L 638.6116,473.84659 L 624.35594,463.32155 L 611.12877,449.97831 L 598.24443,435.69568 L 592.44337,428.25608 L 586.38857,418.59485 L 580.93034,410.21585 L 575.81493,400.89745 L 573.42864,395.76854 L 571.04234,390.63965 L 565.33036,380.03902 L 561.84001,369.18464 L 558.94622,359.6125 L 556.14153,346.87932 L 555.21562,334.8318 L 554.28972,322.78428 L 554.04946,308.85798 L 554.22762,302.53592 L 555.68801,295.61731 L 557.66938,281.43725 L 558.78694,275.45803 L 558.62227,270.07538 L 559.57516,258.71351 L 560.52806,247.35165 L 559.25933,236.24353 L 557.64776,226.07481 L 555.09681,215.56326 L 553.48525,205.39454 L 549.30924,196.41897 L 545.47606,186.50399 L 542.23945,177.87124 L 536.78122,169.
 49224 L 531.66581,160.17384 L 526.80415,153.07706 L 521.00309,145.63745 L 515.20203,138.19785 L 510.34037,131.10108 L 504.19649,124.60086 L 497.70977,119.04006 L 485.67575,108.26127 L 474.23829,98.764711 L 464.33682,90.893204 L 450.08116,80.36816 L 444.19103,76.089585 z"
+       style="fill:#2b2725" />
+    <path
+       id="path4802"
+       d="M 538.87053,61.674638 L 659.3997,5.5968095 L 665.28983,9.8753979 L 671.17997,14.153981 L 678.60609,20.057614 L 685.68937,26.900649 L 693.71205,34.086498 L 701.39191,42.211763 L 706.85014,50.590759 L 710.51865,55.123088 L 713.84435,60.594818 L 717.17004,66.066539 L 719.55633,71.195445 L 724.32891,81.453245 L 728.16209,91.368221 L 729.5199,99.315314 L 732.50277,105.72644 L 732.66743,111.10909 L 610.51322,168.72288 L 608.46975,162.65458 L 602.59311,146.6713 L 597.82052,136.4135 L 592.10855,125.81288 L 586.99315,116.49448 L 581.87774,107.17608 L 576.07667,99.736469 L 569.33622,91.954037 L 555.51247,77.32858 L 543.47845,66.54979 L 538.87053,61.674638 z"
+       style="fill:url(#linearGradient5904);fill-opacity:1" />
+    <path
+       id="path4804"
+       d="M 633.2748,360.12537 L 753.55021,301.82591 L 762.84163,320.11989 L 767.36047,328.15607 L 771.8793,336.19224 L 777.33753,344.57125 L 781.85637,352.60743 L 789.53623,360.73268 L 797.81265,370.14017 L 807.02848,379.89047 L 815.05116,387.07633 L 830.84279,399.22642 L 836.73292,403.50501 L 710.98578,465.13014 L 704.15624,460.50873 L 698.95176,454.35135 L 690.92907,447.1655 L 673.34774,431.16872 L 665.41414,420.82185 L 658.67368,413.03942 L 654.15485,405.00324 L 648.69661,396.62423 L 640.94117,379.95531 L 633.2748,360.12537 z"
+       style="fill:url(#linearGradient5920);fill-opacity:1" />
+    <path
+       id="path4806"
+       d="M 617.06203,194.53205 L 623.65405,331.06609 L 746.74766,273.79512 L 741.34878,139.82553 L 617.06203,194.53205 z"
+       style="fill:url(#linearGradient5912);fill-opacity:1" />
+    <g
+       id="g12940"
+       transform="matrix(0.9393988,0.3428262,-0.3428262,0.9393988,98.72165,-249.05025)">
+      <path
+         style="fill:#ffffff"
+         d="M 499,186 L 479,179 L 494,161 L 514,169 L 499,186 z"
+         id="path4808" />
+      <path
+         style="fill:#ffffff"
+         d="M 545,210 L 526,199 L 543,184 L 563,195 L 545,210 z"
+         id="path4810" />
+      <path
+         style="fill:#ffffff"
+         d="M 584,244 L 569,229 L 584,211 L 600,227 L 584,244 z"
+         id="path4812" />
+      <path
+         style="fill:#ffffff"
+         d="M 615,294 L 605,272 L 618,253 L 630,275 L 615,294 z"
+         id="path4814" />
+      <path
+         style="fill:#ffffff"
+         d="M 653,400 L 640,377 L 657,361 L 670,385 L 653,400 z"
+         id="path4816" />
+      <path
+         style="fill:#ffffff"
+         d="M 688,437 L 668,419 L 686,405 L 705,422 L 688,437 z"
+         id="path4818" />
+      <path
+         style="fill:#ffffff"
+         d="M 733,464 L 708,451 L 727,438 L 751,451 L 733,464 z"
+         id="path4820" />
+      <path
+         style="fill:#ffffff"
+         d="M 781,483 L 755,474 L 771,458 L 798,466 L 781,483 z"
+         id="path4822" />
+      <path
+         style="fill:#ffffff"
+         d="M 628,345 L 623,321 L 641,301 L 646,325 L 628,345 z"
+         id="path4824" />
+    </g>
+    <g
+       id="g12959"
+       transform="matrix(0.9393988,0.3428262,-0.3428262,0.9393988,98.72165,-249.05025)">
+      <path
+         style="fill:#ffffff"
+         d="M 647,39 L 627,32 L 642,14 L 663,22 L 647,39 z"
+         id="path4826" />
+      <path
+         style="fill:#ffffff"
+         d="M 692,62 L 674,52 L 692,37 L 710,48 L 692,62 z"
+         id="path4828" />
+      <path
+         style="fill:#ffffff"
+         d="M 732,97 L 717,82 L 733,64 L 747,79 L 732,97 z"
+         id="path4830" />
+      <path
+         style="fill:#ffffff"
+         d="M 763,146 L 753,124 L 766,106 L 778,128 L 763,146 z"
+         id="path4832" />
+      <path
+         style="fill:#ffffff"
+         d="M 801,252 L 787,229 L 805,214 L 818,237 L 801,252 z"
+         id="path4834" />
+      <path
+         style="fill:#ffffff"
+         d="M 835,290 L 816,272 L 834,257 L 853,274 L 835,290 z"
+         id="path4836" />
+      <path
+         style="fill:#ffffff"
+         d="M 881,317 L 857,304 L 875,290 L 899,304 L 881,317 z"
+         id="path4838" />
+      <path
+         style="fill:#ffffff"
+         d="M 929,335 L 903,327 L 920,310 L 945,319 L 929,335 z"
+         id="path4840" />
+      <path
+         style="fill:#ffffff"
+         d="M 776,198 L 771,174 L 789,153 L 794,178 L 776,198 z"
+         id="path4842" />
+    </g>
+  </g>
+  <g
+     id="g11810"
+     transform="matrix(1.2659243,0.8525235,-1.1617737,0.9289505,-144.11367,-516.36718)"
+     inkscape:export-xdpi="41.238842"
+     inkscape:export-ydpi="41.238842"
+     inkscape:export-filename="/home/jordi/dev/mistelix-fresh/data/mistelix48.png">
+    <g
+       id="g12874">
+      <path
+         style="fill:url(#linearGradient12951);fill-opacity:1"
+         d="M 797.24559,42.41131 L 797.24559,265.41131 L 766.24559,305.41131 L 734.24559,264.41131 L 734.24559,42.41131 L 734.24559,28.41131 L 734.24559,27.41131 L 734.24559,26.41131 L 737.24559,24.41131 L 739.24559,22.41131 L 743.24559,21.41131 L 748.24559,20.41131 L 754.24559,19.41131 L 759.24559,18.41131 L 766.24559,18.41131 L 772.24559,18.41131 L 778.24559,19.41131 L 784.24559,20.41131 L 788.24559,21.41131 L 792.24559,22.41131 L 795.24559,24.41131 L 796.24559,25.41131 L 797.24559,26.41131 L 797.24559,28.41131 L 797.24559,42.41131 z"
+         id="path4898" />
+      <path
+         style="fill:url(#linearGradient12953);fill-opacity:1"
+         d="M 734.24559,48.41131 L 797.24559,48.41131 L 797.24559,69.41131 L 734.24559,69.41131 L 734.24559,48.41131 z"
+         id="path4902" />
+      <path
+         id="path5922"
+         style="fill:url(#linearGradient12955);fill-opacity:1"
+         d="M 734.24217,26.03667 L 797.21553,26.03667 L 797.21553,48.57161 L 734.24217,48.57161 L 734.24217,26.03667 z M 797.29262,27.50026 C 797.29262,38.75913 783.15205,47.89675 765.72885,47.89675 C 748.30564,47.89675 734.16507,38.75913 734.16507,27.50026 C 734.16507,16.24141 748.30564,7.10376 765.72885,7.10376 C 783.15205,7.10376 797.29262,16.24141 797.29262,27.50026 z" />
+      <path
+         style="fill:url(#linearGradient12957);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         d="M 734.21046,264.38022 L 758.1474,315.67733 L 774.17364,315.54378 L 797.27813,265.32824 L 786.32687,273.87557 L 777.77954,263.05786 L 765.62631,273.74201 L 754.00729,261.72234 L 743.99089,272.6736 L 734.21046,264.38022 z"
+         id="path7884"
+         sodipodi:nodetypes="cccccccccc" />
+      <path
+         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         d="M 758.13286,315.65455 L 765.93165,332.36927 L 774.16346,315.50105 L 758.13286,315.65455 z"
+         id="path8869"
+         sodipodi:nodetypes="cccc" />
+    </g>
+  </g>
+</svg>

Added: trunk/data/themes/Themes.xml
==============================================================================
--- (empty file)
+++ trunk/data/themes/Themes.xml	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<ThemeConfiguration>
+  <ArrayOfTheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+    <Theme>
+      <name>Beach</name>
+      <menu_background>beach_mainmenu.jpg</menu_background>
+      <button_select>beach_menu_normal.svg</button_select>
+      <button_highlight>beach_menu_highlight.svg</button_highlight>
+    </Theme>
+    <Theme>
+      <name>Europe</name>
+      <menu_background>europe_mainmenu.jpg</menu_background>
+      <button_select>europe_menu_normal.svg</button_select>
+      <button_highlight>europe_menu_highlight.svg</button_highlight>
+    </Theme>
+    <Theme>
+      <name>Winter</name>
+      <menu_background>winter_mainmenu.jpg</menu_background>
+      <button_select>winter_menu_normal.svg</button_select>
+      <button_highlight>winter_menu_highlight.svg</button_highlight>
+    </Theme>
+  </ArrayOfTheme>
+</ThemeConfiguration>

Added: trunk/data/themes/beach_mainmenu.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/data/themes/beach_menu_highlight.svg
==============================================================================
--- (empty file)
+++ trunk/data/themes/beach_menu_highlight.svg	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="10pt" height="10pt" viewBox="0 0 10 10" version="1.1">
+<g id="surface0">
+<path style="fill: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke: rgb(0%,0%,100%); stroke-opacity: 1;stroke-miterlimit: 10; " d="M 0 0 L 10 0 "/>
+</g>
+</svg>

Added: trunk/data/themes/beach_menu_normal.svg
==============================================================================
--- (empty file)
+++ trunk/data/themes/beach_menu_normal.svg	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="10pt" height="10pt" viewBox="0 0 10 10" version="1.1">
+<g id="surface0">
+<path style="fill: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke: rgb(0%,0%,0%); stroke-opacity: 1;stroke-miterlimit: 10; " d="M 0 0 L 10 0 "/>
+</g>
+</svg>

Added: trunk/data/themes/europe_mainmenu.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/data/themes/europe_menu_highlight.svg
==============================================================================
--- (empty file)
+++ trunk/data/themes/europe_menu_highlight.svg	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="10pt"
+   height="10pt"
+   viewBox="0 0 10 10"
+   version="1.0"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="europe_menu_normal.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <metadata
+     id="metadata10">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs8">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 6.25 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="12.5 : 6.25 : 1"
+       inkscape:persp3d-origin="6.25 : 4.1666667 : 1"
+       id="perspective12" />
+  </defs>
+  <sodipodi:namedview
+     inkscape:window-height="727"
+     inkscape:window-width="647"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     guidetolerance="10.0"
+     gridtolerance="10.0"
+     objecttolerance="10.0"
+     borderopacity="1.0"
+     bordercolor="#666666"
+     pagecolor="#ffffff"
+     id="base"
+     showgrid="false"
+     units="pt"
+     inkscape:zoom="39.52"
+     inkscape:cx="6.25"
+     inkscape:cy="6.1740891"
+     inkscape:window-x="50"
+     inkscape:window-y="52"
+     inkscape:current-layer="svg2" />
+  <path
+     sodipodi:type="arc"
+     style="opacity:1;fill:#000000;fill-opacity:1"
+     id="path2389"
+     sodipodi:cx="1.2955465"
+     sodipodi:cy="4.4838057"
+     sodipodi:rx="0.54655868"
+     sodipodi:ry="0.49595141"
+     d="M 1.8421052,4.4838057 A 0.54655868,0.49595141 0 1 1 0.74898785,4.4838057 A 0.54655868,0.49595141 0 1 1 1.8421052,4.4838057 z" />
+</svg>

Added: trunk/data/themes/europe_menu_normal.svg
==============================================================================
--- (empty file)
+++ trunk/data/themes/europe_menu_normal.svg	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="10pt"
+   height="10pt"
+   viewBox="0 0 10 10"
+   version="1.0"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="europe_menu_normal.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <metadata
+     id="metadata10">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs8">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 6.25 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="12.5 : 6.25 : 1"
+       inkscape:persp3d-origin="6.25 : 4.1666667 : 1"
+       id="perspective12" />
+  </defs>
+  <sodipodi:namedview
+     inkscape:window-height="727"
+     inkscape:window-width="647"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     guidetolerance="10.0"
+     gridtolerance="10.0"
+     objecttolerance="10.0"
+     borderopacity="1.0"
+     bordercolor="#666666"
+     pagecolor="#ffffff"
+     id="base"
+     showgrid="false"
+     units="pt"
+     inkscape:zoom="39.52"
+     inkscape:cx="6.25"
+     inkscape:cy="6.1740891"
+     inkscape:window-x="50"
+     inkscape:window-y="52"
+     inkscape:current-layer="svg2" />
+  <path
+     sodipodi:type="arc"
+     style="opacity:1;fill:#000000;fill-opacity:1"
+     id="path2389"
+     sodipodi:cx="1.2955465"
+     sodipodi:cy="4.4838057"
+     sodipodi:rx="0.54655868"
+     sodipodi:ry="0.49595141"
+     d="M 1.8421052,4.4838057 A 0.54655868,0.49595141 0 1 1 0.74898785,4.4838057 A 0.54655868,0.49595141 0 1 1 1.8421052,4.4838057 z" />
+</svg>

Added: trunk/data/themes/winter_mainmenu.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/data/themes/winter_menu_highlight.svg
==============================================================================
--- (empty file)
+++ trunk/data/themes/winter_menu_highlight.svg	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="10pt" height="10pt" viewBox="0 0 10 10" version="1.1">
+<g id="surface0">
+<path style="fill: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke: rgb(0%,0%,100%); stroke-opacity: 1;stroke-miterlimit: 10; " d="M 0 10 L 10 10 "/>
+</g>
+</svg>

Added: trunk/data/themes/winter_menu_normal.svg
==============================================================================
--- (empty file)
+++ trunk/data/themes/winter_menu_normal.svg	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="10pt" height="10pt" viewBox="0 0 10 10" version="1.1">
+<g id="surface0">
+<path style="fill: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke: rgb(0%,0%,0%); stroke-opacity: 1;stroke-miterlimit: 10; " d="M 0 10 L 10 10 "/>
+</g>
+</svg>

Added: trunk/extensions/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/extensions/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,7 @@
+SUBDIRS = 			\
+	SlideTransitions
+
+addinsdir = $(pkglibdir)
+addins_DATA = mistelix.global.addins
+
+EXTRA_DIST = mistelix.global.addins

Added: trunk/extensions/SlideTransitions/Fade/Fade.addin.xml
==============================================================================
--- (empty file)
+++ trunk/extensions/SlideTransitions/Fade/Fade.addin.xml	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,17 @@
+<Addin namespace="Mistelix"
+	version="0.10"
+	name="Fade"
+	description="Fade SlideShow"
+	author="Jordi Mas"
+	url=""
+	defaultEnabled="true"
+	category="SlideTransitions">
+
+	<Dependencies>
+		<Addin id="Mistelix" version="0.10"/>
+	</Dependencies>
+
+	<Extension path="/Mistelix/SlideTransitions">
+		<SlideTransitions type="Mistelix.Transitions.Fade" />
+	</Extension>
+</Addin>

Added: trunk/extensions/SlideTransitions/Fade/Fade.cs
==============================================================================
--- (empty file)
+++ trunk/extensions/SlideTransitions/Fade/Fade.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,77 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mistelix.DataModel;
+
+namespace Mistelix.Transitions
+{
+	public class Fade: ITransition
+	{
+		public string DisplayName {
+			get { return ("Fade"); }
+		}
+
+		public string Name {
+			get { return ("fade"); }
+		}
+
+		public SlideImage[] Effect (SlideImage o, SlideImage trg, int frames_per_sec, int sec)
+		{
+			int frames = frames_per_sec * sec;
+			SlideImage [] images = new SlideImage [frames];
+			int pos;
+			double percentage = 1d - (1d / frames);
+			SlideImage org = o;
+
+			// Go to black in N frames
+			for (int f = 0; f < frames - 1; f++)
+			{
+				images[f] = new SlideImage ();
+				images[f].CopyProperties (org);
+				images[f].Pixels = new byte [org.stride * org.height];
+
+				for (int h = 0; h < org.height; h++)
+				{
+					pos = h *  org.stride;
+					for (int w = 0; w < org.width; w++)
+					{
+						for (int c = 0; c < org.channels; c++)
+							images[f].Pixels[pos + c] = (byte) (org.Pixels[pos + c] * percentage); 
+						pos += org.channels;
+					}
+				}
+				org = images[f];
+			}
+
+			images[frames - 1] = new SlideImage ();
+			images[frames - 1].CopyProperties (org);
+			images[frames - 1].Pixels = new byte [org.stride * org.height];
+
+			for (int i = 0; i < org.stride * org.height; i++)
+				images[frames - 1].Pixels[i] = trg.Pixels[i];
+
+			return images;
+		}
+	}
+}

Added: trunk/extensions/SlideTransitions/Fade/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/extensions/SlideTransitions/Fade/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,39 @@
+PLUGIN_NAME = Fade
+
+PLUGIN_MANIFEST = $(PLUGIN_NAME).addin.xml
+
+PLUGIN_ASSEMBLY = $(PLUGIN_NAME).dll
+
+PLUGIN_SOURCES =			\
+	$(srcdir)/Fade.cs
+
+REFS =					\
+	-r:$(top_builddir)/src/mistelix.exe
+
+PKGS =					\
+	-pkg:gtk-sharp-2.0
+
+RESOURCES =				\
+	-resource:$(srcdir)/$(PLUGIN_MANIFEST)
+
+all: $(PLUGIN_ASSEMBLY)
+
+mpack: $(PLUGIN_ASSEMBLY)
+	mautil p $(PLUGIN_ASSEMBLY)
+
+$(PLUGIN_ASSEMBLY): $(PLUGIN_SOURCES) $(PLUGIN_MANIFEST)
+	$(CSC) -target:library -out:$@ $(CSC_DEFINES) $(PLUGIN_SOURCES) $(REFS) $(PKGS) $(ASSEMBLIES) $(RESOURCES)
+
+plugindir = $(pkglibdir)/extensions
+
+plugin_DATA =			\
+	$(PLUGIN_ASSEMBLY)
+
+EXTRA_DIST = 			\
+	$(PLUGIN_SOURCES)	\
+	$(PLUGIN_MANIFEST)
+
+CLEANFILES =			\
+	$(PLUGIN_ASSEMBLY)	\
+	$(PLUGIN_ASSEMBLY).mdb	\
+	*.mpack

Added: trunk/extensions/SlideTransitions/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/extensions/SlideTransitions/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,3 @@
+SUBDIRS = 			\
+	Fade	\
+	OpaqueLines

Added: trunk/extensions/SlideTransitions/OpaqueLines/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/extensions/SlideTransitions/OpaqueLines/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,39 @@
+PLUGIN_NAME = OpaqueLines
+
+PLUGIN_MANIFEST = $(PLUGIN_NAME).addin.xml
+
+PLUGIN_ASSEMBLY = $(PLUGIN_NAME).dll
+
+PLUGIN_SOURCES =			\
+	$(srcdir)/OpaqueLines.cs
+
+REFS =					\
+	-r:$(top_builddir)/src/mistelix.exe
+
+PKGS =					\
+	-pkg:gtk-sharp-2.0
+
+RESOURCES =				\
+	-resource:$(srcdir)/$(PLUGIN_MANIFEST)
+
+all: $(PLUGIN_ASSEMBLY)
+
+mpack: $(PLUGIN_ASSEMBLY)
+	mautil p $(PLUGIN_ASSEMBLY)
+
+$(PLUGIN_ASSEMBLY): $(PLUGIN_SOURCES) $(PLUGIN_MANIFEST)
+	$(CSC) -target:library -out:$@ $(CSC_DEFINES) $(PLUGIN_SOURCES) $(REFS) $(PKGS) $(ASSEMBLIES) $(RESOURCES)
+
+plugindir = $(pkglibdir)/extensions
+
+plugin_DATA =			\
+	$(PLUGIN_ASSEMBLY)
+
+EXTRA_DIST = 			\
+	$(PLUGIN_SOURCES)	\
+	$(PLUGIN_MANIFEST)
+
+CLEANFILES =			\
+	$(PLUGIN_ASSEMBLY)	\
+	$(PLUGIN_ASSEMBLY).mdb	\
+	*.mpack

Added: trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.addin.xml
==============================================================================
--- (empty file)
+++ trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.addin.xml	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,17 @@
+<Addin namespace="Mistelix"
+	version="0.10"
+	name="Opaque Lines"
+	description="Opaque Lines SlideShow"
+	author="Jordi Mas"
+	url=""
+	defaultEnabled="true"
+	category="SlideTransitions">
+
+	<Dependencies>
+		<Addin id="Mistelix" version="0.10"/>
+	</Dependencies>
+
+	<Extension path="/Mistelix/SlideTransitions">
+		<SlideTransitions type="Mistelix.Transitions.OpaqueLines" />
+	</Extension>
+</Addin>

Added: trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.cs
==============================================================================
--- (empty file)
+++ trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,96 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mistelix.DataModel;
+
+namespace Mistelix.Transitions
+{
+	//
+	// Goes black from the bottom to the top
+	//
+	public class OpaqueLines: ITransition
+	{
+		// TODO: Wipe?
+		public string DisplayName {
+			get { return ("Opaque Lines"); }
+		}
+
+		public string Name {
+			get { return ("opaquelines"); }
+		}
+
+		public SlideImage[] Effect (SlideImage o, SlideImage trg, int frames_per_sec, int sec)
+		{
+			int frames = frames_per_sec * sec;
+			SlideImage [] images = new SlideImage [frames];
+			int pos;
+			SlideImage org = o;
+
+			// Go to black in N frames
+			for (int f = 0; f < frames - 1; f++)
+			{
+				images[f] = new SlideImage ();
+				images[f].CopyProperties (org);
+				images[f].Pixels = new byte [org.stride * org.height];
+
+				// Black
+				int h;
+				for (h = 0; h < org.height * (double) ((double)f / (double)frames); h++)
+				{
+					pos = h *  org.stride;
+					for (int w = 0; w < org.width; w++)
+					{
+						for (int c = 0; c < org.channels; c++)
+							images[f].Pixels[pos + c] = 0;
+ 
+						pos += org.channels;
+					}
+				}
+				
+				// Rest of the image not get blacked
+				for (; h < org.height; h++)
+				{
+					pos = h *  org.stride;
+					for (int w = 0; w < org.width; w++)
+					{
+						for (int c = 0; c < org.channels; c++)
+							images[f].Pixels[pos + c] = (byte) (org.Pixels[pos + c]); 
+						pos += org.channels;
+					}
+				}
+				org = images[f];
+			}
+
+			images[frames - 1] = new SlideImage ();
+			images[frames - 1].CopyProperties (org);
+			images[frames - 1].Pixels = new byte [org.stride * org.height];
+
+			for (int i = 0; i < org.stride * org.height; i++)
+				images[frames - 1].Pixels[i] = trg.Pixels[i];
+
+			return images;
+		}
+	}
+}
+

Added: trunk/extensions/mistelix.global.addins
==============================================================================
--- (empty file)
+++ trunk/extensions/mistelix.global.addins	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,3 @@
+<Addins>
+  <Directory>./extensions</Directory>
+</Addins>

Added: trunk/gstreamer/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/gstreamer/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,17 @@
+plugin_LTLIBRARIES = libgstmistelixvideosrc.la
+
+GST_INFO_FLAGS = \
+	-DGST_LICENSE=\"LGPL\" \
+	-DGST_PACKAGE_NAME=\"mistelix\" \
+	-DGST_PACKAGE_ORIGIN=\"gst-plugins-good\"
+
+plugindir = $(pkglibdir)/gstreamer
+libgstmistelixvideosrc_la_SOURCES = \
+			gstmistelixvideosrc.c \
+			mistelixvideosrc.c  \
+			mistelixsocket.c 
+
+libgstmistelixvideosrc_la_CFLAGS = $(GST_CFLAGS) $(LIBOIL_CFLAGS)  $(GST_INFO_FLAGS)
+libgstmistelixvideosrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+
+noinst_HEADERS = gstmistelixvideosrc.h mistelixvideosrc.h mistelixsocket.h

Added: trunk/gstreamer/c.sh
==============================================================================
--- (empty file)
+++ trunk/gstreamer/c.sh	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,6 @@
+#/usr/bin/sh
+make
+rm -f out.mpg
+sudo cp .libs/libgstmistelixvideosrc.so /usr/lib/gstreamer-0.10/
+#gst-launch-0.10 mistelixvideosrc num-buffers=160 ! 'video/x-raw-yuv,format=(fourcc)I420,width=384,height=512,framerate=(fraction)25/1' !  mpeg2enc ! filesink location=out.mpg
+#totem out.mpg

Added: trunk/gstreamer/gst-ffmpeg/gst-ffmpeg.patch
==============================================================================
--- (empty file)
+++ trunk/gstreamer/gst-ffmpeg/gst-ffmpeg.patch	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,128 @@
+Index: ext/ffmpeg/gstffmpegcodecmap.c
+===================================================================
+RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegcodecmap.c,v
+retrieving revision 1.178
+diff -u -r1.178 gstffmpegcodecmap.c
+--- ext/ffmpeg/gstffmpegcodecmap.c	5 Jan 2009 18:08:20 -0000	1.178
++++ ext/ffmpeg/gstffmpegcodecmap.c	10 Feb 2009 20:30:24 -0000
+@@ -2313,6 +2313,17 @@
+ 
+     *video_codec_list = mpeg_video_list;
+     *audio_codec_list = mpeg_audio_list;
++  } else if (!strcmp (format_name, "dvd")) {
++    static enum CodecID mpeg_video_list[] = { CODEC_ID_MPEG2VIDEO,
++      CODEC_ID_NONE
++    };
++    static enum CodecID mpeg_audio_list[] = { CODEC_ID_MP2,
++      CODEC_ID_MP3,
++      CODEC_ID_NONE
++    };
++
++    *video_codec_list = mpeg_video_list;
++    *audio_codec_list = mpeg_audio_list;
+   } else if (!strcmp (format_name, "mpegts")) {
+     static enum CodecID mpegts_video_list[] = { CODEC_ID_MPEG1VIDEO,
+       CODEC_ID_MPEG2VIDEO,
+Index: ext/ffmpeg/gstffmpegmux.c
+===================================================================
+RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegmux.c,v
+retrieving revision 1.55
+diff -u -r1.55 gstffmpegmux.c
+--- ext/ffmpeg/gstffmpegmux.c	16 Dec 2008 15:58:05 -0000	1.55
++++ ext/ffmpeg/gstffmpegmux.c	10 Feb 2009 20:30:24 -0000
+@@ -100,6 +100,13 @@
+   /* FILL ME */
+ };
+ 
++enum
++{
++  PROP_0,
++  PROP_PRELOAD,
++  PROP_MAXDELAY
++};
++
+ /* A number of function prototypes are given so we can refer to them later. */
+ static void gst_ffmpegmux_class_init (GstFFMpegMuxClass * klass);
+ static void gst_ffmpegmux_base_init (gpointer g_class);
+@@ -118,6 +125,11 @@
+ static GstStateChangeReturn gst_ffmpegmux_change_state (GstElement * element,
+     GstStateChange transition);
+ 
++static void gst_ffmpegmux_set_property (GObject * object, guint prop_id,
++    const GValue * value, GParamSpec * pspec);
++static void gst_ffmpegmux_get_property (GObject * object, guint prop_id,
++    GValue * value, GParamSpec * pspec);
++
+ #define GST_FFMUX_PARAMS_QDATA g_quark_from_static_string("ffmux-params")
+ 
+ static GstElementClass *parent_class = NULL;
+@@ -182,6 +194,19 @@
+ 
+   parent_class = g_type_class_peek_parent (klass);
+ 
++  gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_ffmpegmux_set_property);
++  gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_ffmpegmux_get_property);
++
++  g_object_class_install_property (gobject_class, PROP_PRELOAD,
++      g_param_spec_int ("preload", "preload",
++          "Set the initial demux-decode delay", 0, G_MAXINT,
++          0, G_PARAM_READWRITE));
++
++  g_object_class_install_property (gobject_class, PROP_MAXDELAY,
++      g_param_spec_int ("maxdelay", "maxdelay",
++          "Set the maximum mux-decode delay", 0, G_MAXINT,
++          0, G_PARAM_READWRITE));
++
+   gstelement_class->request_new_pad = gst_ffmpegmux_request_new_pad;
+   gstelement_class->change_state = gst_ffmpegmux_change_state;
+   gobject_class->finalize = gst_ffmpegmux_finalize;
+@@ -214,6 +239,49 @@
+ }
+ 
+ static void
++gst_ffmpegmux_set_property (GObject * object, guint prop_id,
++    const GValue * value, GParamSpec * pspec)
++{
++  GstFFMpegMux *src;
++
++  src = (GstFFMpegMux *) object;
++
++  switch (prop_id) {
++    case PROP_PRELOAD:
++      src->context->preload = g_value_get_int (value);
++      break;
++    case PROP_MAXDELAY:
++      src->context->max_delay = g_value_get_int (value);
++      break;
++    default:
++      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++      break;
++  }
++}
++
++static void
++gst_ffmpegmux_get_property (GObject * object, guint prop_id, GValue * value,
++    GParamSpec * pspec)
++{
++  GstFFMpegMux *src;
++
++  src = (GstFFMpegMux *) object;
++
++  switch (prop_id) {
++    case PROP_PRELOAD:
++      g_value_set_int (value, src->context->preload);
++      break;
++    case PROP_MAXDELAY:
++      g_value_set_int (value, src->context->max_delay);
++      break;
++    default:
++      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++      break;
++  }
++}
++
++
++static void
+ gst_ffmpegmux_finalize (GObject * object)
+ {
+   GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) object;

Added: trunk/gstreamer/gstmistelixvideosrc.c
==============================================================================
--- (empty file)
+++ trunk/gstreamer/gstmistelixvideosrc.c	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,542 @@
+/* 
+ * Based on gstvideotextsrc by:
+ *
+ * Copyright (C) <1999> Erik Walthinsen <omega cse ogi edu>
+ * Copyright (C) <2002> David A. Schleef <ds schleef org>
+ *
+ *
+ * Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "gstmistelixvideosrc.h"
+#include "mistelixvideosrc.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+#define USE_PEER_BUFFERALLOC
+
+GST_DEBUG_CATEGORY_STATIC (video_test_src_debug);
+#define GST_CAT_DEFAULT video_test_src_debug
+
+
+static const GstElementDetails video_test_src_details =
+GST_ELEMENT_DETAILS ("Mistelix source video",
+    "Source/Video",
+    "Creates a video stream from a set of images",
+    "Mistelix project");
+
+
+GST_BOILERPLATE (GstMistelixVideoSrc, gst_mistelix_video_src, GstPushSrc,
+    GST_TYPE_PUSH_SRC);
+
+
+static void gst_mistelix_video_src_set_pattern (GstMistelixVideoSrc * videotestsrc,
+    int pattern_type);
+
+static GstCaps *gst_mistelix_video_src_getcaps (GstBaseSrc * bsrc);
+static gboolean gst_mistelix_video_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
+static void gst_mistelix_video_src_src_fixate (GstPad * pad, GstCaps * caps);
+
+static gboolean gst_mistelix_video_src_is_seekable (GstBaseSrc * psrc);
+static gboolean gst_mistelix_video_src_do_seek (GstBaseSrc * bsrc,
+    GstSegment * segment);
+static gboolean gst_mistelix_video_src_query (GstBaseSrc * bsrc, GstQuery * query);
+
+static void gst_mistelix_video_src_get_times (GstBaseSrc * basesrc,
+    GstBuffer * buffer, GstClockTime * start, GstClockTime * end);
+static GstFlowReturn gst_mistelix_video_src_create (GstPushSrc * psrc,
+    GstBuffer ** buffer);
+static gboolean gst_mistelix_video_src_start (GstBaseSrc * basesrc);
+static gboolean gst_mistelix_video_src_stop (GstBaseSrc * basesrc);
+
+#define GST_TYPE_MISTELIX_VIDEO_SRC_PATTERN (gst_mistelix_video_src_pattern_get_type ())
+static GType
+gst_mistelix_video_src_pattern_get_type (void)
+{
+  static GType video_test_src_pattern_type = 0;
+  static const GEnumValue pattern_types[] = {
+    {GST_MISTELIX_VIDEO_SRC_WHITE, "100% White", "white"},
+    {0, NULL, NULL}
+  };
+
+  if (!video_test_src_pattern_type) {
+    video_test_src_pattern_type =
+        g_enum_register_static ("GstMistelixVideoSrcPattern", pattern_types);
+  }
+  return video_test_src_pattern_type;
+}
+
+static void
+gst_mistelix_video_src_base_init (gpointer g_class)
+{
+  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+  gst_element_class_set_details (element_class, &video_test_src_details);
+
+  gst_element_class_add_pad_template (element_class,
+      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
+          gst_mistelix_video_src_getcaps (NULL)));
+}
+
+static void
+gst_mistelix_video_src_class_init (GstMistelixVideoSrcClass * klass)
+{
+  GObjectClass *gobject_class;
+  GstBaseSrcClass *gstbasesrc_class;
+  GstPushSrcClass *gstpushsrc_class;
+
+  gobject_class = (GObjectClass *) klass;
+  gstbasesrc_class = (GstBaseSrcClass *) klass;
+  gstpushsrc_class = (GstPushSrcClass *) klass;
+
+  gobject_class->set_property = NULL;
+  gobject_class->get_property = NULL;
+
+  gstbasesrc_class->get_caps = gst_mistelix_video_src_getcaps;
+  gstbasesrc_class->set_caps = gst_mistelix_video_src_setcaps;
+  gstbasesrc_class->is_seekable = gst_mistelix_video_src_is_seekable;
+  gstbasesrc_class->do_seek = gst_mistelix_video_src_do_seek;
+  gstbasesrc_class->query = gst_mistelix_video_src_query;
+  gstbasesrc_class->get_times = gst_mistelix_video_src_get_times;
+  gstbasesrc_class->start = gst_mistelix_video_src_start;
+  gstbasesrc_class->stop = gst_mistelix_video_src_stop;
+
+  gstpushsrc_class->create = gst_mistelix_video_src_create;
+}
+
+static void
+gst_mistelix_video_src_init (GstMistelixVideoSrc * src, GstMistelixVideoSrcClass * g_class)
+{
+  GstPad *pad = GST_BASE_SRC_PAD (src);
+
+  gst_pad_set_fixatecaps_function (pad, gst_mistelix_video_src_src_fixate);
+
+  gst_mistelix_video_src_set_pattern (src, GST_MISTELIX_VIDEO_SRC_SMPTE);
+
+  src->timestamp_offset = 0;
+
+  /* we operate in time */
+  gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME);
+  gst_base_src_set_live (GST_BASE_SRC (src), FALSE);
+}
+
+static void
+gst_mistelix_video_src_src_fixate (GstPad * pad, GstCaps * caps)
+{
+  GstStructure *structure;
+
+  structure = gst_caps_get_structure (caps, 0);
+
+  gst_structure_fixate_field_nearest_int (structure, "width", 320);
+  gst_structure_fixate_field_nearest_int (structure, "height", 240);
+  gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1);
+}
+
+static void
+gst_mistelix_video_src_set_pattern (GstMistelixVideoSrc * videotestsrc,
+    int pattern_type)
+{
+  videotestsrc->pattern_type = pattern_type;
+
+  GST_DEBUG_OBJECT (videotestsrc, "setting pattern to %d", pattern_type);
+
+  switch (pattern_type) {
+    case GST_MISTELIX_VIDEO_SRC_SMPTE:
+      videotestsrc->make_image = gst_mistelix_video_src_smpte;
+      break;
+//    case GST_MISTELIX_VIDEO_SRC_WHITE:
+  //    videotestsrc->make_image = gst_mistelix_video_src_white;
+  //    break;
+    default:
+      g_assert_not_reached ();
+  }
+}
+
+
+/* threadsafe because this gets called as the plugin is loaded */
+static GstCaps *
+gst_mistelix_video_src_getcaps (GstBaseSrc * unused)
+{
+  static GstCaps *capslist = NULL;
+
+  if (!capslist) {
+    GstCaps *caps;
+    GstStructure *structure;
+    int i;
+
+    caps = gst_caps_new_empty ();
+    for (i = 0; i < n_fourccs; i++) {
+      structure = paint_get_structure (fourcc_list + i);
+      gst_structure_set (structure,
+          "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
+          "height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
+          "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
+      gst_caps_append_structure (caps, structure);
+    }
+
+    capslist = caps;
+  }
+
+  return gst_caps_copy (capslist);
+}
+
+static gboolean
+gst_mistelix_video_src_parse_caps (const GstCaps * caps,
+    gint * width, gint * height, gint * rate_numerator, gint * rate_denominator,
+    struct fourcc_list_struct **fourcc)
+{
+  const GstStructure *structure;
+  GstPadLinkReturn ret;
+  const GValue *framerate;
+
+  GST_DEBUG ("parsing caps");
+
+  if (gst_caps_get_size (caps) < 1)
+    return FALSE;
+
+  structure = gst_caps_get_structure (caps, 0);
+
+  // Jordi: Decides the format
+  if (!(*fourcc = paintinfo_find_by_structure (structure)))
+    goto unknown_format;
+
+  ret = gst_structure_get_int (structure, "width", width);
+  ret &= gst_structure_get_int (structure, "height", height);
+  framerate = gst_structure_get_value (structure, "framerate");
+
+  if (framerate) {
+    *rate_numerator = gst_value_get_fraction_numerator (framerate);
+    *rate_denominator = gst_value_get_fraction_denominator (framerate);
+  } else
+    goto no_framerate;
+
+  return ret;
+
+  /* ERRORS */
+unknown_format:
+  {
+    GST_DEBUG ("videotestsrc format not found");
+    return FALSE;
+  }
+no_framerate:
+  {
+    GST_DEBUG ("videotestsrc no framerate given");
+    return FALSE;
+  }
+}
+
+static gboolean
+gst_mistelix_video_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
+{
+  gboolean res;
+  gint width, height, rate_denominator, rate_numerator;
+  struct fourcc_list_struct *fourcc;
+  GstMistelixVideoSrc *videotestsrc;
+
+  videotestsrc = GST_MISTELIX_VIDEO_SRC (bsrc);
+
+  res = gst_mistelix_video_src_parse_caps (caps, &width, &height,
+      &rate_numerator, &rate_denominator, &fourcc);
+  if (res) {
+    /* looks ok here */
+    videotestsrc->fourcc = fourcc;
+    videotestsrc->width = width;
+    videotestsrc->height = height;
+    videotestsrc->rate_numerator = rate_numerator;
+    videotestsrc->rate_denominator = rate_denominator;
+    videotestsrc->bpp = videotestsrc->fourcc->bitspp;
+
+    GST_DEBUG_OBJECT (videotestsrc, "size %dx%d, %d/%d fps",
+        videotestsrc->width, videotestsrc->height,
+        videotestsrc->rate_numerator, videotestsrc->rate_denominator);
+  }
+  return res;
+}
+
+static gboolean
+gst_mistelix_video_src_query (GstBaseSrc * bsrc, GstQuery * query)
+{
+  gboolean res;
+  GstMistelixVideoSrc *src;
+
+  src = GST_MISTELIX_VIDEO_SRC (bsrc);
+
+  switch (GST_QUERY_TYPE (query)) {
+    case GST_QUERY_CONVERT:
+    {
+      GstFormat src_fmt, dest_fmt;
+      gint64 src_val, dest_val;
+
+      gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
+      if (src_fmt == dest_fmt) {
+        dest_val = src_val;
+        goto done;
+      }
+
+      switch (src_fmt) {
+        case GST_FORMAT_DEFAULT:
+          switch (dest_fmt) {
+            case GST_FORMAT_TIME:
+              /* frames to time */
+              if (src->rate_numerator) {
+                dest_val = gst_util_uint64_scale (src_val,
+                    src->rate_denominator * GST_SECOND, src->rate_numerator);
+              } else {
+                dest_val = 0;
+              }
+              break;
+            default:
+              goto error;
+          }
+          break;
+        case GST_FORMAT_TIME:
+          switch (dest_fmt) {
+            case GST_FORMAT_DEFAULT:
+              /* time to frames */
+              if (src->rate_numerator) {
+                dest_val = gst_util_uint64_scale (src_val,
+                    src->rate_numerator, src->rate_denominator * GST_SECOND);
+              } else {
+                dest_val = 0;
+              }
+              break;
+            default:
+              goto error;
+          }
+          break;
+        default:
+          goto error;
+      }
+    done:
+      gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
+      res = TRUE;
+      break;
+    }
+    default:
+      res = GST_BASE_SRC_CLASS (parent_class)->query (bsrc, query);
+  }
+  return res;
+
+  /* ERROR */
+error:
+  {
+    GST_DEBUG_OBJECT (src, "query failed");
+    return FALSE;
+  }
+}
+
+static void
+gst_mistelix_video_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
+    GstClockTime * start, GstClockTime * end)
+{
+  /* for live sources, sync on the timestamp of the buffer */
+  if (gst_base_src_is_live (basesrc)) {
+    GstClockTime timestamp = GST_BUFFER_TIMESTAMP (buffer);
+
+    if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
+      /* get duration to calculate end time */
+      GstClockTime duration = GST_BUFFER_DURATION (buffer);
+
+      if (GST_CLOCK_TIME_IS_VALID (duration)) {
+        *end = timestamp + duration;
+      }
+      *start = timestamp;
+    }
+  } else {
+    *start = -1;
+    *end = -1;
+  }
+}
+
+static gboolean
+gst_mistelix_video_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment)
+{
+  GstClockTime time;
+  GstMistelixVideoSrc *src;
+
+  src = GST_MISTELIX_VIDEO_SRC (bsrc);
+
+  segment->time = segment->start;
+  time = segment->last_stop;
+
+  /* now move to the time indicated */
+  if (src->rate_numerator) {
+    src->n_frames = gst_util_uint64_scale (time,
+        src->rate_numerator, src->rate_denominator * GST_SECOND);
+  } else {
+    src->n_frames = 0;
+  }
+  if (src->rate_numerator) {
+    src->running_time = gst_util_uint64_scale (src->n_frames,
+        src->rate_denominator * GST_SECOND, src->rate_numerator);
+  } else {
+    /* FIXME : Not sure what to set here */
+    src->running_time = 0;
+  }
+
+  g_assert (src->running_time <= time);
+
+  return TRUE;
+}
+
+static gboolean
+gst_mistelix_video_src_is_seekable (GstBaseSrc * psrc)
+{
+  /* we're seekable... */
+  return TRUE;
+}
+
+// Called for every frame
+static GstFlowReturn
+gst_mistelix_video_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
+{
+  GstMistelixVideoSrc *src;
+  gulong newsize;
+  GstBuffer *outbuf;
+  GstFlowReturn res;
+  GstClockTime next_time;
+
+  src = GST_MISTELIX_VIDEO_SRC (psrc);
+
+//  printf ("gst_mistelix_video_src_create AKI %u\n", src->element.parent.num_buffers_left);
+
+  if (G_UNLIKELY (src->fourcc == NULL))
+    goto not_negotiated;
+
+  /* 0 framerate and we are at the second frame, eos */
+  if (G_UNLIKELY (src->rate_numerator == 0 && src->n_frames == 1))
+    goto eos;
+
+  newsize = gst_mistelix_video_src_get_size (src, src->width, src->height);
+
+  g_return_val_if_fail (newsize > 0, GST_FLOW_ERROR);
+
+#ifdef USE_PEER_BUFFERALLOC
+  res =
+      gst_pad_alloc_buffer_and_set_caps (GST_BASE_SRC_PAD (psrc),
+      GST_BUFFER_OFFSET_NONE, newsize, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc)),
+      &outbuf);
+  if (res != GST_FLOW_OK)
+    goto no_buffer;
+#else
+  outbuf = gst_buffer_new_and_alloc (newsize);
+  gst_buffer_set_caps (outbuf, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc)));
+#endif
+
+  //printf ("Buffer size %u\n", (int) newsize);
+
+  if (src->pattern_type == GST_MISTELIX_VIDEO_SRC_BLINK) {
+    if (src->n_frames & 0x1) {
+      //gst_mistelix_video_src_white (src, (void *) GST_BUFFER_DATA (outbuf),
+        //  src->width, src->height);
+    } else {
+     // gst_mistelix_video_src_black (src, (void *) GST_BUFFER_DATA (outbuf),
+      //    src->width, src->height);
+    }
+  } else {
+    src->make_image (src, (void *) GST_BUFFER_DATA (outbuf),
+        src->width, src->height);
+  }
+
+  GST_BUFFER_TIMESTAMP (outbuf) = src->timestamp_offset + src->running_time;
+  GST_BUFFER_OFFSET (outbuf) = src->n_frames;
+  src->n_frames++;
+  GST_BUFFER_OFFSET_END (outbuf) = src->n_frames;
+  if (src->rate_numerator) {
+    next_time = gst_util_uint64_scale_int (src->n_frames * GST_SECOND,
+        src->rate_denominator, src->rate_numerator);
+    GST_BUFFER_DURATION (outbuf) = next_time - src->running_time;
+  } else {
+    next_time = src->timestamp_offset;
+    /* NONE means forever */
+    GST_BUFFER_DURATION (outbuf) = GST_CLOCK_TIME_NONE;
+  }
+
+  src->running_time = next_time;
+
+  *buffer = outbuf;
+
+  if (src->element.parent.num_buffers_left == 0)
+	gst_mistelix_video_src_deamon_shutdown ();
+
+  return GST_FLOW_OK;
+
+not_negotiated:
+  {
+    GST_ELEMENT_ERROR (src, CORE, NEGOTIATION, (NULL),
+        ("format wasn't negotiated before get function"));
+    return GST_FLOW_NOT_NEGOTIATED;
+  }
+eos:
+  {
+    GST_DEBUG_OBJECT (src, "eos: 0 framerate, frame %d", (gint) src->n_frames);
+    return GST_FLOW_UNEXPECTED;
+  }
+no_buffer:
+  {
+    GST_DEBUG_OBJECT (src, "could not allocate buffer, reason %s",
+        gst_flow_get_name (res));
+    return res;
+  }
+}
+
+static gboolean
+gst_mistelix_video_src_start (GstBaseSrc * basesrc)
+{
+	GstMistelixVideoSrc *src = GST_MISTELIX_VIDEO_SRC (basesrc);
+
+	src->running_time = 0;
+	src->n_frames = 0;
+
+	return TRUE;
+}
+
+
+static gboolean
+gst_mistelix_video_src_stop (GstBaseSrc * basesrc)
+{
+//	printf ("gst_mistelix_video_src_stop called\n");
+	gst_mistelix_video_src_deamon_shutdown ();
+	return TRUE;
+}
+
+
+#define PLUGIN_NAME "mistelixvideosrc"
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+
+  GST_DEBUG_CATEGORY_INIT (video_test_src_debug, PLUGIN_NAME, 0,
+      "Video Test Source");
+
+  return gst_element_register (plugin, PLUGIN_NAME, GST_RANK_NONE,
+      GST_TYPE_MISTELIX_VIDEO_SRC);
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+    GST_VERSION_MINOR,
+    PLUGIN_NAME,
+    "Creates a test video stream",
+    plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
+
+

Added: trunk/gstreamer/gstmistelixvideosrc.h
==============================================================================
--- (empty file)
+++ trunk/gstreamer/gstmistelixvideosrc.h	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,93 @@
+/* 
+ * Based on gstvideotextsrc by:
+ *
+ * Copyright (C) <1999> Erik Walthinsen <omega cse ogi edu>
+ * Copyright (C) <2002> David A. Schleef <ds schleef org>
+ *
+ *
+ * Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GST_MISTELIX_VIDEO_SRC_H__
+#define __GST_MISTELIX_VIDEO_SRC_H__
+
+#include <gst/gst.h>
+#include <gst/base/gstpushsrc.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_MISTELIX_VIDEO_SRC \
+  (gst_mistelix_video_src_get_type())
+#define GST_MISTELIX_VIDEO_SRC(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MISTELIX_VIDEO_SRC,GstMistelixVideoSrc))
+#define GST_MISTELIX_VIDEO_SRC_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MISTELIX_VIDEO_SRC,GstMistelixVideoSrcClass))
+#define GST_IS_MISTELIX_VIDEO_SRC(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MISTELIX_VIDEO_SRC))
+#define GST_IS_MISTELIX_VIDEO_SRC_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MISTELIX_VIDEO_SRC))
+
+
+typedef enum {
+  GST_MISTELIX_VIDEO_SRC_SMPTE,
+  GST_MISTELIX_VIDEO_SRC_WHITE,
+  GST_MISTELIX_VIDEO_SRC_BLINK
+} GstMistelixVideoSrcPattern;
+
+typedef struct _GstMistelixVideoSrc GstMistelixVideoSrc;
+typedef struct _GstMistelixVideoSrcClass GstMistelixVideoSrcClass;
+
+/**
+ * GstMistelixVideoSrc:
+ *
+ * Opaque data structure.
+ */
+struct _GstMistelixVideoSrc {
+  GstPushSrc element;
+
+  /*< private >*/
+
+  /* type of output */
+  GstMistelixVideoSrcPattern pattern_type;
+
+  /* video state */
+  char *format_name;
+  gint width;
+  gint height;
+  struct fourcc_list_struct *fourcc;
+  gint bpp;
+  gint rate_numerator;
+  gint rate_denominator;
+
+  /* private */
+  gint64 timestamp_offset;              /* base offset */
+  GstClockTime running_time;            /* total running time */
+  gint64 n_frames;                      /* total frames sent */
+
+  void (*make_image) (GstMistelixVideoSrc *v, unsigned char *dest, int w, int h);
+};
+
+struct _GstMistelixVideoSrcClass {
+  GstPushSrcClass parent_class;
+};
+
+GType gst_mistelix_video_src_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_MISTELIX_VIDEO_SRC_H__ */

Added: trunk/gstreamer/mistelixsocket.c
==============================================================================
--- (empty file)
+++ trunk/gstreamer/mistelixsocket.c	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,309 @@
+/* 
+ * Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <mistelixsocket.h>
+
+#define PROTOCOL_FILELENGTH 4
+#define PROTOCOL_COMMANDLEN 2
+#define PORT 2048
+
+
+/* Keep in sync with mistelix.c */
+typedef enum 
+{
+	None	 	= 0,
+	InitParams	= 1, 	/* Length (4 bytes) + pixels */
+	NewImage	= 2,	/* Length (4 bytes) seconds  */
+	FixedImage	= 3,	/* Length (4 bytes) + nframes + pixels */
+	End		= 4
+} Command;
+
+fd_set master;
+fd_set read_fds;
+int fdmax;
+int sock = 0;
+int newfd;
+char buf [32768];
+int nbytes;
+int addrlen;
+int i;
+struct timeval timeout;
+Command status;
+
+
+
+/*
+	Initializes the socket layer
+*/
+int
+gst_mistelix_video_src_deamon_init ()
+{
+	struct sockaddr_in serveraddr;
+	int yes = 1;
+
+	FD_ZERO (&master);
+	FD_ZERO (&read_fds);
+	
+	/* Time out 10 seconds */
+	timeout.tv_sec = 10;
+	timeout.tv_usec = 0;
+
+	if ((sock = socket (AF_INET, SOCK_STREAM, 0)) == -1)
+	{
+		perror ("Mistelix: error calling sock!");
+		return -1;
+	}
+
+	if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1)
+	{
+		perror ("Mistelix: error calling setsockopt!");
+		close (sock);
+		return -1;
+	}
+
+	serveraddr.sin_family = AF_INET;
+	serveraddr.sin_addr.s_addr = INADDR_ANY;
+	serveraddr.sin_port = htons(PORT);
+	memset (&(serveraddr.sin_zero), '\0', 8);
+
+	if (bind (sock, (struct sockaddr *)&serveraddr, sizeof(serveraddr)) == -1)
+	{
+		close (sock);
+		perror ("Mistelix: error calling bind!");
+		return -1;
+	}
+
+	if (listen (sock, 1) == -1)
+	{
+		close (sock);
+		perror ("Mistelix: error calling listen!");
+		return -1;
+	}
+
+	/* add the sock to the master set */
+	FD_SET (sock, &master);
+	fdmax = sock; /* so far, it's this one*/
+
+	printf ("Mistelix: deamon initialized...\n");
+	return 0;
+}
+
+//
+// Gets a frame from the socket connection
+//
+// 'fixed' indicates how many times the caller should process the same image as N 'fixed' number of frames
+//
+int
+gst_mistelix_video_src_deamon_getfile (unsigned char** buffer, int* buf_length, int* fixed)
+{
+	struct sockaddr_in clientaddr;
+	int file_length = 0;
+	unsigned char* pos = NULL;
+	status = None;
+
+	//total_count++;
+	//printf ("gst_mistelix_video_src_deamon_getfile %u\n", total_count);
+
+	if (sock == 0) {
+		gst_mistelix_video_src_deamon_init ();
+	}
+
+	*fixed = 0;
+
+	for (;;)
+	{
+		read_fds = master;
+		if (select (fdmax+1, &read_fds, NULL, NULL, NULL /*&timeout*/) == -1) {
+			perror ("Misteix: error doing a select");
+		    	return -1;
+		}
+
+		/* Run through the existing connections looking for data to be read */
+		for (i = 0; i <= fdmax; i++)
+		{
+			if (FD_ISSET(i, &read_fds))
+			{
+				if(i == sock)
+				{
+					addrlen = sizeof(clientaddr);
+					if((newfd = accept(sock, (struct sockaddr *)&clientaddr, &addrlen)) == -1)
+					{
+					   	perror ("Misteix: error accepting socket");
+						return -1;
+					}
+					
+					FD_SET(newfd, &master);
+					if(newfd > fdmax)
+						fdmax = newfd;
+				}
+				else
+				{
+					switch (status) {
+					case None:
+						nbytes = gst_mistelix_video_src_deamon_getdata (buf, PROTOCOL_COMMANDLEN); /* Get a new command */
+						break;
+					case NewImage:
+					case FixedImage:
+						nbytes = gst_mistelix_video_src_deamon_getdata (buf, file_length > sizeof (buf) ? sizeof (buf) : file_length);	/* Get a new command */
+						break;
+					default:
+						nbytes = -1;
+						break;
+					}
+
+					//printf ("readed %u file len %u (status %u) frames %u, total_imgs %u\n", nbytes, file_length, status, fixed_frames, total_count);
+					if (nbytes <= 0) /* Data readed */
+					{
+						perror ("Mistelix: error calling recv\n");
+						return  -1;
+					}
+
+					//printf ("%x %x %x\n", buf[0], buf[1], status);
+					switch (status) {
+					case None:
+					{
+						int length;
+						int command;
+
+						if (*buf & 0xff != 0xff) {
+							perror ("Mistelix: invalid new command\n");
+							return -1;
+						}
+						command = (int) (*(buf + 1)) & 0xff;
+						//printf ("Command %x\n", command);
+
+						switch (command) 
+						{
+						case NewImage: {
+							nbytes = gst_mistelix_video_src_deamon_getdata (buf, PROTOCOL_FILELENGTH);
+							status = NewImage;
+							length = build_int (buf);
+							file_length = length;
+							*buffer = malloc (length);
+							*buf_length = length;
+							pos = *buffer;
+							//printf ("Len %u\n", length);
+							break;
+							}
+						case FixedImage: {
+							nbytes = gst_mistelix_video_src_deamon_getdata (buf, PROTOCOL_FILELENGTH);
+							status = FixedImage;
+						
+							length = build_int (buf);
+							file_length = length;
+							*buffer = malloc (length);
+							*buf_length = length;
+							pos = *buffer;
+
+							nbytes = gst_mistelix_video_src_deamon_getdata (buf, PROTOCOL_FILELENGTH);
+							*fixed = build_int (buf);
+							//printf ("Length %u Fixed %u\n", length, *fixed);
+							break;
+							}
+						case End:
+							status = End;
+							printf ("Status End\n");
+							gst_mistelix_video_src_deamon_shutdown ();
+							return -1;
+						} 
+						break;
+					} // case None:
+					case NewImage:
+ 					{
+						memcpy (pos, buf, nbytes);
+						file_length -= nbytes;
+						pos += nbytes;
+
+						if (file_length == 0) {
+							//printf ("File completed\n");
+							return 0;
+						}
+						break;
+					}
+					case FixedImage:
+ 					{
+						memcpy (pos, buf, nbytes);
+						file_length -= nbytes;
+						pos += nbytes;
+
+						if (file_length == 0) {
+							//printf ("File completed (fixed)\n");
+							return 0;
+						}
+						break;
+					}
+						
+					default:
+						nbytes = -1;
+						break;
+					}
+				} 
+			} /* if (FD_ISSET(i, &read_fds)) */
+		} /* for (i = 0; i <= fdmax; i++) */
+	}
+	return 0;
+}
+
+/*
+	Closes the socket
+*/
+void
+gst_mistelix_video_src_deamon_shutdown ()
+{
+	printf ("*** gst_mistelix_video_src_deamon_shutdown\n");
+	close (sock);
+	sock = 0;
+}
+
+
+/*
+	Get Data from streamer	
+*/
+int
+gst_mistelix_video_src_deamon_getdata (char *buffer, int bytes_requested)
+{
+	int read;
+
+	read = recv (i, buffer, bytes_requested, 0);
+	return read;
+}
+
+/*
+	Helper functions
+*/
+
+int
+build_int (char *buffer)
+{
+	int data;
+
+	data = ((*(buffer + 0)) & 0xff);
+	data +=  ((*(buffer + 1) << 8) & 0xff00);
+	data +=  ((*(buffer + 2) << 16) & 0xff0000);
+	data +=  ((*(buffer + 3) << 24) & 0xff000000);
+	return data;
+}
+
+

Added: trunk/gstreamer/mistelixsocket.h
==============================================================================
--- (empty file)
+++ trunk/gstreamer/mistelixsocket.h	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,35 @@
+/* 
+ * Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <stdlib.h>
+
+#ifndef __GST_MISTELIX_SOCKET_H__
+#define __GST_MISTELIX_SOCKET_H__
+
+int
+gst_mistelix_video_src_deamon_init ();
+
+int
+gst_mistelix_video_src_deamon_getfile (unsigned char** buffer, int* length, int* fixed);
+
+void
+gst_mistelix_video_src_deamon_shutdown ();
+
+
+#endif

Added: trunk/gstreamer/mistelixvideosrc.c
==============================================================================
--- (empty file)
+++ trunk/gstreamer/mistelixvideosrc.c	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,264 @@
+/* 
+ * Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstmistelixvideosrc.h"
+#include "mistelixvideosrc.h"
+#include "mistelixsocket.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+
+static void paint_setup_I420 (paintinfo * p, unsigned char *dest);
+
+struct fourcc_list_struct fourcc_list[] = 
+{
+	{VTS_YUV, "I420", "I420", 12, paint_setup_I420, NULL},
+};
+int n_fourccs = G_N_ELEMENTS (fourcc_list);
+
+struct fourcc_list_struct *
+paintinfo_find_by_structure (const GstStructure * structure)
+{
+	int i;
+	const char *media_type = gst_structure_get_name (structure);
+	int ret;
+
+	g_return_val_if_fail (structure, NULL);
+
+	if (strcmp (media_type, "video/x-raw-yuv") != 0) {
+		g_critical ("format not found for media type %s", media_type);
+		return NULL;
+	}
+
+	char *s;
+	int fourcc;
+	guint32 format;
+
+	ret = gst_structure_get_fourcc (structure, "format", &format);
+	if (!ret)
+		return NULL;
+
+	return fourcc_list;
+} 
+
+
+GstStructure *
+paint_get_structure (struct fourcc_list_struct * format)
+{
+  GstStructure *structure = NULL;
+  unsigned int fourcc;
+  int endianness;
+
+  g_return_val_if_fail (format, NULL);
+
+  fourcc =
+      GST_MAKE_FOURCC (format->fourcc[0], format->fourcc[1], format->fourcc[2],
+      format->fourcc[3]);
+
+  switch (format->type) {
+    case VTS_RGB:
+      if (format->bitspp == 16) {
+        endianness = G_BYTE_ORDER;
+      } else {
+        endianness = G_BIG_ENDIAN;
+      }
+      structure = gst_structure_new ("video/x-raw-rgb",
+          "bpp", G_TYPE_INT, format->bitspp,
+          "endianness", G_TYPE_INT, endianness,
+          "depth", G_TYPE_INT, format->depth,
+          "red_mask", G_TYPE_INT, format->red_mask,
+          "green_mask", G_TYPE_INT, format->green_mask,
+          "blue_mask", G_TYPE_INT, format->blue_mask, NULL);
+      if (format->depth == 32 && format->alpha_mask > 0) {
+        gst_structure_set (structure, "alpha_mask", G_TYPE_INT,
+            format->alpha_mask, NULL);
+      }
+      break;
+    case VTS_YUV:
+      structure = gst_structure_new ("video/x-raw-yuv",
+          "format", GST_TYPE_FOURCC, fourcc, NULL);
+      break;
+    case VTS_BAYER:
+      structure = gst_structure_new ("video/x-raw-bayer", NULL);
+      break;
+    default:
+      g_assert_not_reached ();
+      break;
+  }
+  return structure;
+}
+
+
+
+/* returns the size in bytes for one video frame of the given dimensions
+ * given the fourcc in GstMistelixVideoSrc */
+int
+gst_mistelix_video_src_get_size (GstMistelixVideoSrc * v, int w, int h)
+{
+  paintinfo pi = { NULL, };
+  paintinfo *p = &pi;
+  struct fourcc_list_struct *fourcc;
+
+  p->width = w;
+  p->height = h;
+  fourcc = v->fourcc;
+  if (fourcc == NULL)
+    return 0;
+
+  fourcc->paint_setup (p, NULL);
+
+  return (unsigned long) p->endptr;
+}
+
+static int cnt = 0;
+static int files = 0;
+unsigned char* buffer = NULL;
+int length = 0;
+
+unsigned char* buffer_fixed = NULL;
+int length_fixed = 0;
+int first_fixed = 0;
+int fixed_frames = 0;
+
+// Jordi: Default video format generator
+// It is called the as many times as total_seconds * frames are
+void
+gst_mistelix_video_src_smpte (GstMistelixVideoSrc * v, unsigned char *dest, int w, int h)
+{
+  	int read;
+	paintinfo pi = { NULL, };
+	paintinfo *p = &pi;
+	struct fourcc_list_struct *fourcc;
+
+	//printf ("gst_mistelix_video_src_deamon_getfile get_file enters: %u\n", files);
+
+	if (files == 0)
+		gst_mistelix_video_src_deamon_init ();
+
+	p->width = w;
+	p->height = h;
+	fourcc = v->fourcc;
+	if (fourcc == NULL)
+		return;
+
+	files++;
+
+	fourcc->paint_setup (p, dest);
+
+	if (fixed_frames == 0) {
+		if (buffer != NULL) {
+			free (buffer);
+			buffer = NULL;
+		}
+
+		if (gst_mistelix_video_src_deamon_getfile (&buffer, &length, &fixed_frames) == -1) {
+			printf ("gst_mistelix_video_src_deamon_getfile error calling get_file\n");
+			files = -1;
+			return;
+		}
+	}
+
+	if (fixed_frames > 0 && first_fixed == 1) { // serve from buffer_fixed
+		memcpy (dest, buffer_fixed, length_fixed);
+		fixed_frames--;
+
+		if (fixed_frames == 0) {
+			if (buffer_fixed != NULL) {
+				free (buffer_fixed);
+				buffer_fixed = NULL;
+				first_fixed = 0;
+			}
+		}
+
+		return;
+	}
+
+	
+	unsigned char *pos = buffer;
+	unsigned char R, G, B;
+	unsigned char Y, V, U;
+	unsigned char* posY, *posV, *posU;
+	int x = 0, y = 0;
+
+	read = length;
+
+	while (read > 0) {
+		R = pos [0];
+		G = pos [1];
+		B = pos [2];
+
+		if (x == p->ystride) {
+			x = 0;
+			y++;
+		}
+
+		//   The following 2 sets of formulae are taken from information from Keith Jack's
+		//   excellent book "Video Demystified" (ISBN 1-878707-09-4).	
+		Y = ((0.257 * R) + (0.504 * G) + (0.098 * B) + 16);
+
+		// See: http://en.wikipedia.org/wiki/Y%27UV
+		posY = p->yp + (y * p->ystride) + x;
+
+		if (read % 2) { // Optimization, every two positions U V are the same, no need to write the same again
+			V = ((0.439 * R) - (0.368 * G) - (0.071 * B) + 128);
+			U = (-(0.148 * R) - (0.291 * G) + (0.439 * B) + 128);
+			posV = p->vp + (y >> 1) * p->ustride + (x >> 1);
+			posU = p->up + (y >> 1) * p->ustride + (x >> 1);
+			*posV = V;
+			*posU = U;
+		}
+
+		*posY = Y;
+		pos += 3;
+		read -= 3;
+		x++;
+	}
+
+	// Save into buffer
+	if (fixed_frames > 0) {
+		if (first_fixed == 0) {
+			first_fixed = 1;
+			length_fixed = gst_mistelix_video_src_get_size (v, w, h);
+			buffer_fixed = malloc (length_fixed);
+			memcpy (buffer_fixed, dest, length_fixed);
+			fixed_frames--;
+		}
+	}
+}
+
+
+static void
+paint_setup_I420 (paintinfo * p, unsigned char *dest)
+{
+	p->yp = dest;
+	p->ystride = GST_ROUND_UP_4 (p->width);
+	p->up = p->yp + p->ystride * GST_ROUND_UP_2 (p->height);
+	p->ustride = GST_ROUND_UP_8 (p->width) / 2;
+	p->vp = p->up + p->ustride * GST_ROUND_UP_2 (p->height) / 2;
+	p->vstride = GST_ROUND_UP_8 (p->ystride) / 2;
+	p->endptr = p->vp + p->vstride * GST_ROUND_UP_2 (p->height) / 2;
+}
+
+

Added: trunk/gstreamer/mistelixvideosrc.h
==============================================================================
--- (empty file)
+++ trunk/gstreamer/mistelixvideosrc.h	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,84 @@
+/* 
+ * Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __MISTELIX_VIDEO_SRC_H__
+#define __MISTELIX_VIDEO_SRC_H__
+
+#include <glib.h>
+
+enum {
+  VTS_YUV,
+  VTS_RGB,
+  VTS_BAYER
+};
+
+struct vts_color_struct {
+        guint8 Y, U, V;
+        guint8 R, G, B;
+	guint8 A;
+};
+
+typedef struct paintinfo_struct paintinfo;
+struct paintinfo_struct
+{
+  unsigned char *dest;          /* pointer to first byte of video data */
+  unsigned char *yp, *up, *vp;  /* pointers to first byte of each component
+                                 * for both packed/planar YUV and RGB */
+  unsigned char *ap;            /* pointer to first byte of alpha component */
+  unsigned char *endptr;        /* pointer to byte beyond last video data */
+  int ystride;
+  int ustride;
+  int vstride;
+  int width;
+  int height;
+  const struct vts_color_struct *color;
+  void (*paint_hline) (paintinfo * p, int x, int y, int w);
+};
+
+struct fourcc_list_struct
+{
+  int type;
+  char *fourcc;
+  char *name;
+  int bitspp;
+  void (*paint_setup) (paintinfo * p, unsigned char *dest);
+  void (*paint_hline) (paintinfo * p, int x, int y, int w);
+  int depth;
+  unsigned int red_mask;
+  unsigned int green_mask;
+  unsigned int blue_mask;
+  unsigned int alpha_mask;
+};
+
+struct fourcc_list_struct *
+        paintrect_find_fourcc           (int find_fourcc);
+struct fourcc_list_struct *
+        paintrect_find_name             (const char *name);
+struct fourcc_list_struct *
+        paintinfo_find_by_structure     (const GstStructure *structure);
+GstStructure *
+        paint_get_structure             (struct fourcc_list_struct *format);
+int     gst_mistelix_video_src_get_size     (GstMistelixVideoSrc * v, int w, int h);
+void    gst_mistelix_video_src_smpte        (GstMistelixVideoSrc * v,
+                                         unsigned char *dest, int w, int h);
+
+extern struct fourcc_list_struct fourcc_list[];
+extern int n_fourccs;
+
+#endif

Added: trunk/libmistelix/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/libmistelix/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,20 @@
+INCLUDES = -I$(top_srcdir)
+
+AM_CFLAGS = -DG_LOG_DOMAIN=\"libmistelix\"	\
+	    $(LIBMISTELIX_CFLAGS)
+
+
+dolibdir = $(libdir)/mistelix
+dolib_LTLIBRARIES = libmistelix.la
+
+libmistelix_la_SOURCES =		\
+	mistelix.c
+
+noinst_HEADERS =  \
+	mistelix.h
+
+libmistelix_la_LDFLAGS = -export-dynamic -module -avoid-version
+libmistelix_la_LIBADD = $(LIBMISTELIX_LIBS)
+
+maintainer-clean-local:
+	rm -f Makefile.in

Added: trunk/libmistelix/mistelix.c
==============================================================================
--- (empty file)
+++ trunk/libmistelix/mistelix.c	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,680 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#include <stdio.h>
+#include <netdb.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+
+#include "mistelix.h"
+
+//#define _DEBUG 1
+
+typedef struct 
+{	
+	gchar filename [1024];
+	unsigned int weight;
+	unsigned int height;
+	unsigned int frames_sec;
+	unsigned int total_frames;
+	unsigned int type;
+} ThreadParams;
+
+typedef enum 
+{
+	None	 	= 0,
+	InitParams	= 1, 	/* Length (4 bytes) + pixels */
+	NewImage	= 2,	/* Length (4 bytes) seconds  */
+	FixedImage	= 3,	/* Length (4 bytes) + nframes + pixels */
+	End		= 4
+} Command;
+
+
+const gchar* address = "localhost";
+const int port = 2048;
+static int mis_socket;
+ThreadParams params;
+char audio[1024];
+int started;
+GThread* thread;
+int gstreamer_init = 0;
+
+// It is assumed that there is only one client using the library at the time
+// There are no handles for session, just the active session
+
+void
+mistelix_slideshow_createstream (const gchar* filename, unsigned int type, unsigned int weight, unsigned int height, unsigned int frames_sec, unsigned int total_frames)
+{
+#ifdef _DEBUG
+	printf ("*** mistelix_slideshow_createstream: %s, %u, %u, %u, %u\n", filename, type, weight, height, frames_sec);
+#endif
+	thread =  NULL;
+	started = 0;
+	*audio = '\x0';
+	strcpy ((char*) params.filename,filename);
+	params.weight = weight;
+	params.height = height;
+	params.frames_sec = frames_sec;
+	params.total_frames = total_frames;
+	params.type = type;
+}
+
+void
+mistelix_slideshow_add_image (unsigned char* bytes, unsigned int len)
+{
+	unsigned char header[6];
+	unsigned char* pos = (unsigned char*) &len;
+	int i;
+#ifdef _DEBUG
+	printf ("*** mistelix_slideshow_add_image %x\n", len);
+#endif
+	mistelix_check_started ();
+
+	// Command
+	header[0] = 0xff;
+	header[1] = NewImage;
+
+	// Len
+	for (i = 0; i < sizeof (unsigned int); i++) {
+		header[2 + i] = *pos;
+		pos++;
+	}
+
+	mistelix_socket_send (header, 6);
+	mistelix_socket_send (bytes, len);
+}
+
+void
+mistelix_slideshow_add_imagefixed (unsigned char* bytes, unsigned int len, unsigned int frames)
+{
+	unsigned char header[10]; // 2 bytes header, 4 length buffer, 4 number of frames
+	unsigned char* pos = (unsigned char*) &len;
+	int i;
+#ifdef _DEBUG
+	printf ("*** mistelix_slideshow_add_image_fixed %x %u\n", len, frames);
+#endif
+	mistelix_check_started ();
+
+	// Command
+	header[0] = 0xff;
+	header[1] = FixedImage;
+
+	// Len
+	for (i = 0; i < sizeof (unsigned int); i++) {	
+		header[2 + i] = *pos;
+		pos++;
+	}
+
+	// Frames
+	pos = (unsigned char*) &frames;
+	for (i = 0; i < sizeof (unsigned int); i++) {
+		header[6 + i] = *pos;
+		pos++;
+	}
+
+	mistelix_socket_send (header, 10);
+	mistelix_socket_send (bytes, len);
+}
+
+
+void
+mistelix_slideshow_close ()
+{
+	// Wait until the pipe line completes
+	g_thread_join (thread);
+}
+
+
+void
+mistelix_slideshow_add_audio (const gchar* filename)
+{
+	strcpy (audio, filename);
+}
+
+unsigned int
+mistelix_get_codecs_count ()
+{
+	GList *plugins, *plugins_org, *features;
+	GstPluginFeature *feature;
+	GstPlugin *plugin;
+	unsigned int count = 0;
+
+	mistelix_check_init ();
+	plugins_org = plugins = gst_default_registry_get_plugin_list ();
+
+	while (plugins) {
+		plugin = (GstPlugin *) (plugins->data);
+		count++;
+		features = gst_registry_get_feature_list_by_plugin (gst_registry_get_default (), plugin->desc.name);
+		while (features) {
+			feature = GST_PLUGIN_FEATURE (features->data);
+			if (GST_IS_ELEMENT_FACTORY (feature))
+				count++;
+	
+			features = g_list_next (features);
+		}
+		gst_plugin_list_free (features);
+		plugins = g_list_next (plugins);
+	}
+	gst_plugin_list_free (plugins_org);
+	return count;
+}
+
+// TODO: These are not really codec are plug-ins
+void
+mistelix_get_codecs (char *codecs[])
+{
+	GList *plugins, *features;
+	GstPlugin *plugin;
+	GstPluginFeature *feature;
+	const char *name;
+	int cnt = 0;
+
+	mistelix_check_init ();
+	plugins = gst_default_registry_get_plugin_list ();
+
+	while (plugins) {
+		plugin = (GstPlugin *) (plugins->data);
+		codecs[cnt] = malloc (strlen (plugin->desc.name) + 1);
+		strcpy (codecs[cnt], plugin->desc.name);
+		cnt++;
+
+		features = gst_registry_get_feature_list_by_plugin (gst_registry_get_default (), plugin->desc.name);
+
+		while (features) {
+			feature = GST_PLUGIN_FEATURE (features->data);
+			name = gst_plugin_feature_get_name (feature);
+							
+			if (GST_IS_ELEMENT_FACTORY (feature)) {
+				codecs[cnt] = malloc (strlen (name) + 1);
+				strcpy (codecs[cnt], name);
+				cnt++;
+			}
+
+			features = g_list_next (features);
+		}
+		gst_plugin_list_free (features);
+		plugins = g_list_next (plugins);
+	}
+	gst_plugin_list_free (plugins);
+}
+
+//
+// TODO: This should not be here and should be managed code when I have time to investigate
+// how to capture output of a process (C# Process.StandardOutput) when it is in binary format
+//
+void mistelix_launchtool (const char* app, const char* args, const char* in_file, const char* out_file, const char* err_file)
+{
+	// SEE: http://www.cs.purdue.edu/homes/cs354/LectureNotes/Spring2002/week6-3/
+	int pid;
+	const char * parmList[] =  {app, args, NULL};
+
+	pid = fork ();
+
+	if (pid == -1) {
+	      	printf ("fork() error\n");
+		return;
+	}
+
+	// Parent process returns once the child has completed
+	if (pid > 0) {
+		wait ();
+		return;
+	}
+
+	// Child execution
+
+	// Redirect input
+	if (in_file != NULL) {
+		FILE* in = fopen (in_file, "rb");
+		if (in == NULL) {
+			printf ("Error opening input file\n");
+			return;
+		} 
+
+		dup2 (fileno (in), fileno (stdin));
+		fclose (in);
+	}
+
+	// Redirect ouput
+	if (out_file != NULL) {
+		FILE* out = fopen (out_file, "wb");
+		if (out == NULL) {
+			printf ("Error opening output file\n");
+			return;
+		}
+
+		dup2 (fileno (out), fileno (stdout)); 
+		fclose (out);
+	}
+
+	// Redirect error
+	FILE* er;
+
+	if (err_file != NULL) {
+		er = fopen (err_file, "wb");
+
+		if (er == NULL) {
+			printf ("Error opening output error file\n");
+			return;
+		} 
+
+		dup2 (fileno (er), fileno (stderr));
+		fclose (er);
+	}
+	else {
+		er = fopen ("/dev/null", "wb");
+		dup2 (fileno (er), fileno (stderr)); 
+	}
+
+	execvp (app, parmList);
+}
+
+typedef struct
+{
+	const char *media;
+	const char *plugin;
+	const char *pipeline;
+} supported_media;
+
+supported_media supported_medias[] = 
+{
+	{"video/mpeg", "ffenc_mpeg2video", "filesrc location=%s ! decodebin !ffenc_mpeg2video ! ffmux_dvd !filesink location=%s"},
+
+};
+
+int 
+mistelix_media_supported (const char* file, char* msg)
+{
+	char media [2048];
+	int i, ncodecs, c, media_present, plugin_present;
+	char* pos;
+
+#ifdef _DEBUG
+	printf ("*** mistelix_media_supported %s\n", file);
+#endif
+
+	mistelix_detect_media (file, media);
+
+	pos = strchr (media, ',');
+
+	if (pos != NULL)
+		*pos = 0x0;
+
+	if (*media == 0x0)
+		return 1; // Could not identify media
+
+	ncodecs = mistelix_get_codecs_count ();
+	char *codecs[ncodecs];
+	mistelix_get_codecs (codecs);
+
+	media_present =  plugin_present = 0;
+	for (i = 0; i < sizeof (supported_medias) / sizeof (supported_media); i++)
+	{
+		//printf ("Comparing %s with %s\n", media, supported_medias[i].media);
+		if (strcmp (media, supported_medias[i].media) != 0)
+			continue;
+
+		media_present = 1;
+		for (c = 0; c < ncodecs; c++)
+		{
+			//printf ("Comparing %s with %s\n", supported_medias[i].plugin, codecs[c]);
+			if (strcmp (supported_medias[i].plugin, codecs[c]) == 0)
+			{
+				plugin_present = 1;
+				break;
+			}
+		}
+		break;
+	}
+
+	for (c = 0; c < ncodecs; c++)
+		free (codecs [c]);
+
+	if (media_present == 0)
+		return 2; // Format not supported 
+
+	if (media_present == 1 && plugin_present == 0) {
+		strcpy (msg, supported_medias[i].plugin);
+		return 3; // Supported media but codec not found + codec name
+	}
+
+	return 0; // Supported media & codec found
+}
+
+int
+mistelix_convert_media (const char* filein, const char* fileout)
+{
+	char media [2048];
+	int i, ncodecs, c, media_present, plugin_present;
+	char* pos;
+
+	mistelix_detect_media (filein, media);
+
+#ifdef _DEBUG
+	printf ("*** mistelix_convert_media %s %s\n", filein, fileout);
+#endif
+
+	pos = strchr (media, ',');
+
+	if (pos != NULL)
+		*pos = 0x0;
+
+	if (*media == 0x0)
+		return 1; // Could not identify media
+
+	ncodecs = mistelix_get_codecs_count ();
+	char *codecs[ncodecs];
+	mistelix_get_codecs (codecs);
+
+	media_present =  plugin_present = 0;
+	for (i = 0; i < sizeof (supported_medias) / sizeof (supported_media); i++)
+	{
+		if (strcmp (media, supported_medias[i].media) != 0)
+			continue;
+
+		media_present = 1;
+		for (c = 0; c < ncodecs; c++)
+		{
+			if (strcmp (supported_medias[i].plugin, codecs[c]) == 0)
+			{
+				plugin_present = 1;
+				break;
+			}
+		}
+		break;
+	}
+
+	for (c = 0; c < ncodecs; c++)
+		free (codecs [c]);
+
+	if (media_present == 0)
+		return 2; // Format not supported 
+
+	if (media_present == 1 && plugin_present == 0)
+		return 3; // Supported media but codec not found + codec name
+
+	char desc [1024];
+	GstElement *pipe;
+
+	mistelix_check_init ();
+	sprintf (desc, supported_medias[i].pipeline, filein, fileout);
+	printf ("pipe %s\n", desc);
+	pipe = gst_parse_launch (desc, NULL);
+	run_pipeline (pipe);
+	return 0;
+}
+
+void
+mistelix_thumbnail_video (const char* filein, const char* fileout, int width, int height)
+{
+	GstElement* pipe;
+	char desc [1024];
+
+	mistelix_check_init ();
+
+	// TODO: num-buffers is not the smarter way of doing this. Check gnlfilesource gstreamer element
+	if (height == -1) // use videoscale aspect ratio
+		sprintf (desc, "filesrc location=\"%s\" num-buffers=100 ! decodebin ! videoscale ! video/x-raw-yuv,format=(fourcc)I420,width=%u !jpegenc ! filesink location=%s", filein, width, fileout);
+	else
+		sprintf (desc, "filesrc location=\"%s\" num-buffers=100 ! decodebin ! videoscale ! video/x-raw-yuv,format=(fourcc)I420,width=%u,height=%u !jpegenc ! filesink location=%s", filein, width, height, fileout);
+#ifdef _DEBUG
+	printf ("*** mistelix_thumbnail_video pipe %s\n", desc);
+#endif
+	pipe = gst_parse_launch (desc, NULL);
+	run_pipeline (pipe);
+	//gst_element_set_state (GST_ELEMENT (pipe), GST_STATE_NULL);
+	//gst_object_unref (GST_OBJECT (pipe));
+}
+
+//
+// Private
+//
+
+void
+mistelix_detect_media (const char* file, char* media)
+{
+	GstElement* pipe, *filesrc, *typefind, *fakesink;
+	GstBus *bus;
+	char media_type [2048];
+
+	mistelix_check_init ();
+
+	pipe = gst_pipeline_new ("pipe");
+	bus = gst_pipeline_get_bus (GST_PIPELINE (pipe));
+//	gst_bus_add_watch (bus, cb_typefound, (gpointer) media_type);
+	gst_object_unref (bus);
+
+	// create file source and typefind element
+	filesrc = gst_element_factory_make ("filesrc", "source");
+	g_object_set (G_OBJECT (filesrc), "location", file, NULL);
+	typefind = gst_element_factory_make ("typefind", "typefinder");
+	g_signal_connect (typefind, "have-type", G_CALLBACK (cb_typefound), (gpointer) media_type);
+	fakesink = gst_element_factory_make ("fakesink", "sink");
+
+	gst_bin_add_many (GST_BIN (pipe), filesrc, typefind, fakesink, NULL);
+	gst_element_link_many (filesrc, typefind, fakesink, NULL);
+	gst_element_set_state (GST_ELEMENT (pipe), GST_STATE_PLAYING);
+
+	run_pipeline (pipe);
+
+	gst_element_set_state (GST_ELEMENT (pipe), GST_STATE_NULL);
+	gst_object_unref (GST_OBJECT (pipe));
+	strcpy (media, media_type);
+
+	printf ("*** mistelix_detect_media result for %s is [%s]\n", file, media);
+}
+
+void
+mistelix_check_init ()
+{
+	if (gstreamer_init == 1)
+		return;
+	
+	gst_init (NULL, NULL);
+	gstreamer_init = 1;
+}
+
+static void
+cb_typefound (GstElement *typefind,
+	      guint       probability,
+	      GstCaps    *caps,
+	      gpointer    data)
+{
+	gchar *type;
+	char* media_type = (char*) data;
+
+	type = gst_caps_to_string (caps);
+
+//#ifdef _DEBUG
+	printf ("Media type %s found, probability %d%%, %x\n", type, probability, (unsigned int) caps);
+//#endif
+	if (caps!= NULL && type != NULL)
+		strcpy (media_type, type);
+
+	g_free (type);
+}
+
+//
+// Do not want to start the thread until is necessary
+// to allow for example to add an audio channel before launching it
+//
+void
+mistelix_check_started ()
+{
+	if (started != 0)
+		return;
+
+	started = 1;
+
+	thread = g_thread_create (mistelix_launch_gstreamer, (gpointer) &params, TRUE, NULL);
+	// TODO: To be replaced by socket timeout
+	sleep (2);
+	mistelix_socket_connect ();
+}
+
+
+// Method to launch gstreamer thread. Method signature as required by g_thread_create
+gpointer 
+mistelix_launch_gstreamer  (gpointer data)
+{
+	char desc [1024];
+	GstElement *pipe;
+	GstElement* elem;
+	ThreadParams* params = (ThreadParams *) data;
+
+	mistelix_check_init ();
+
+	// Also mpeg2enc available
+	//  theoraenc ! oggmux  for ogg
+	if (params->type == 0)  {// Theora
+		sprintf (desc, 
+			"mistelixvideosrc num-buffers=%u ! video/x-raw-yuv,format=(fourcc)I420,width=%u,height=%u,framerate=(fraction)%u/1 !theoraenc ! oggmux !filesink location=%s", 
+				params->total_frames, params->weight, params->height, params->frames_sec, params->filename);
+	}
+	else{ // DVD
+		if (*audio == '\x0') {
+			//
+			// ffenc_mpeg2video
+			//    We use 'bitrate'element to set the quality of the generated MPEG2 video. 
+			//    Every additional 10000 bits/s represent approximately 10% additional time 
+			//    to generate the video
+			//
+			// ffmux_dvd
+			//    We use maxdelay and preload to generate MPEG2 compatible streams with DVD
+			//
+			sprintf (desc, 
+				"mistelixvideosrc num-buffers=%u ! video/x-raw-yuv,format=(fourcc)I420,width=%u,height=%u,framerate=(fraction)%u/1 ! ffenc_mpeg2video bitrate=500000 ! ffmux_dvd preload=500000 maxdelay=699999 !filesink location=%s", 
+					params->total_frames, params->weight, params->height, params->frames_sec, params->filename);
+		} else {
+			// ffenc_ac3 does not seem to be recognised by ffmpeg when preparing the final MPEG
+			sprintf (desc, 
+				"mistelixvideosrc num-buffers=%u ! video/x-raw-yuv,format=(fourcc)I420,width=%u,height=%u,framerate=(fraction)%u/1 ! ffenc_mpeg2video bitrate=500000 ! queue ! mux. filesrc location=%s ! mad ! audioconvert ! ffenc_mp2 ! ffmux_dvd name=mux preload=500000 maxdelay=699999 ! filesink location=%s", 
+					params->total_frames, params->weight, params->height, params->frames_sec, audio, params->filename);
+		}
+	}	
+#ifdef _DEBUG
+	printf ("mistelix_launch_gstreamer: %s\n", desc);
+#endif
+	pipe = gst_parse_launch (desc, NULL);
+	run_pipeline (pipe);
+
+	return NULL;
+}
+
+void 
+mistelix_socket_connect ()
+{
+	struct sockaddr_in serveraddr;
+	int yes = 1;
+#ifdef _DEBUG
+	printf ("*** mistelix_socket_connect %s %u\n", address, port);
+#endif
+	if ((mis_socket = socket (AF_INET, SOCK_STREAM, 0)) == -1)
+		return;
+
+	if (setsockopt (mis_socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1)
+	{
+		close (mis_socket);
+		return;
+	}
+
+	serveraddr.sin_family = AF_INET;
+	serveraddr.sin_addr.s_addr = INADDR_ANY;
+	serveraddr.sin_port = htons (port);
+	memset (&(serveraddr.sin_zero), '\0', 8);
+
+	if (connect (mis_socket,(struct sockaddr *)&serveraddr,sizeof (serveraddr)) < 0)
+	{
+		printf ("*** mistelix_socket_connect error. It may be caused because not all the assumed pipe elements are present\n");
+		return;
+	}
+
+	printf ("*** mistelix_socket_connect %d\n", mis_socket);
+}
+
+
+
+void 
+mistelix_socket_send (unsigned char* data, unsigned int bytes)
+{
+	write (mis_socket, data, bytes);
+}
+
+
+void
+run_pipeline (GstElement * pipe)
+{
+	GstBus *bus;
+	GstMessage *message;
+	GstMessageType revent;
+	GstStateChangeReturn ret;
+
+#ifdef _DEBUG
+	printf ("*** run_pipeline start\n");
+#endif
+	g_assert (pipe);
+	bus = gst_element_get_bus (pipe);
+	g_assert (bus);
+
+	gst_element_set_state (pipe, GST_STATE_PLAYING);
+	
+	// We get a GST_MESSAGE_EOS when the pipe is finished
+	while (1) {
+		message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 2);
+
+		if (message) {
+			revent = GST_MESSAGE_TYPE (message);
+#ifdef _DEBUG
+			printf ("*** run_pipeline message: %s (%x)\n", gst_message_type_get_name (revent), revent);
+#endif
+			gst_message_unref (message);
+		}
+
+		if (revent == GST_MESSAGE_ERROR) {
+#ifdef _DEBUG
+			printf ("*** run_pipeline exiting reason GST_MESSAGE_ERROR\n");
+#endif
+			break;
+		}
+
+		if (revent == GST_MESSAGE_EOS) {
+#ifdef _DEBUG
+			printf ("*** run_pipeline exiting reason: GST_MESSAGE_EOS\n");
+#endif
+			break;
+		}
+	}
+
+	gst_element_get_state (pipe, NULL, NULL, GST_CLOCK_TIME_NONE);
+	//gst_object_unref (pipe);
+
+	gst_bus_set_flushing (bus, TRUE);
+	//gst_object_unref (bus);
+#ifdef _DEBUG
+	printf ("*** run_pipeline end\n");
+#endif
+}
+

Added: trunk/libmistelix/mistelix.h
==============================================================================
--- (empty file)
+++ trunk/libmistelix/mistelix.h	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,68 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#ifndef __MISTELIX_H__
+#define __MISTELIX_H__
+
+#include <stdio.h>
+#include <gst/check/gstcheck.h>
+
+// Public API
+void mistelix_slideshow_createstream (const gchar* filename, unsigned int type, unsigned int weight, unsigned int height, unsigned int framessec, unsigned int total_frames);
+
+void mistelix_slideshow_add_image (unsigned char* bytes, unsigned int len);
+
+void mistelix_slideshow_add_imagefixed (unsigned char* bytes, unsigned int len, unsigned int frames);
+
+void mistelix_slideshow_add_audio (const gchar* filename);
+
+void mistelix_slideshow_close ();
+
+void mistelix_launchtool (const char* app, const char* args, const char* in, const char* out, const char* err);
+
+int mistelix_convert_media (const char* filein, const char* fileout);
+
+void mistelix_thumbnail_video (const char* filein, const char* fileout, int width, int height);
+
+
+// Private (not exposed)
+
+void mistelix_detect_media (const char* file, char* media);
+
+static void cb_typefound (GstElement *typefind, guint probability, GstCaps *caps, gpointer data);
+
+void mistelix_check_init ();
+
+void mistelix_check_started ();
+
+void run_pipeline (GstElement * pipe);
+
+gpointer mistelix_launch_gstreamer  (gpointer data);
+
+void mistelix_socket_connect ();
+
+void mistelix_socket_send (unsigned char *data, unsigned int bytes);
+
+
+
+#endif /* __MISTELIX_H__ */

Added: trunk/mistelix.desktop.in
==============================================================================
--- (empty file)
+++ trunk/mistelix.desktop.in	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Version=1.0
+_Name=Mistelix
+_GenericName=DVDs and slideshows
+_Comment=Author DVDs and slideshows
+Exec=mistelix
+Icon=mistelix
+StartupNotify=true
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;AudioVideo;Video;AudioVideoEditing;

Added: trunk/po/LINGUAS
==============================================================================
--- (empty file)
+++ trunk/po/LINGUAS	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,4 @@
+# please keep this list sorted alphabetically
+#
+ca
+nn_NO

Added: trunk/po/POTFILES.in
==============================================================================
--- (empty file)
+++ trunk/po/POTFILES.in	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,25 @@
+[encoding: UTF-8]
+mistelix.desktop.in
+src/core/Dependencies.cs
+src/core/DvdProjectBuilder.cs
+src/core/MistelixLib.cs
+src/core/NoneTransition.cs
+src/core/TheoraProjectBuilder.cs
+src/core/ThumbnailSizeManager.cs
+src/datamodel/AspectRatio.cs
+src/datamodel/ProjectBuilder.cs
+src/datamodel/TextPosition.cs
+src/dialogs/AboutDialog.cs
+src/dialogs/AddSlideDialog.cs
+src/dialogs/CheckDependenciesDialog.cs
+src/dialogs/NewProjectDialog.cs
+src/dialogs/ProjectPropertiesDialog.cs
+src/dialogs/ThemeSelectionDialog.cs
+src/mistelix.glade
+src/mistelix.cs
+src/mono-addins-strings.xml
+src/widgets/AuthoringPaneView.cs
+src/widgets/BrowseDirectory.cs
+src/widgets/DirectoryView.cs
+src/widgets/ProjectElementView.cs
+src/widgets/SlideShowImageView.cs

Added: trunk/po/POTFILES.skip
==============================================================================
--- (empty file)
+++ trunk/po/POTFILES.skip	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,3 @@
+[encoding: UTF-8]
+
+

Added: trunk/po/README
==============================================================================
--- (empty file)
+++ trunk/po/README	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,22 @@
+Notes on how to do a localization (l10n) for Mistelix
+====================================================
+
+Creating a l10n:
+        First of all you create a template to base your translation on:
+                intltool-update --pot
+
+        Then copy it to your translation
+                cp mistelix.pot ca_ES.po
+        Do your translation, with some kind of editor
+                emacs ca_ES.po
+		it has to be UTF-8 encoded.
+
+        Add your l10n to configure.in, find the ALL_LINGUAS variable and add your
+        l10n to it.
+
+Updating your l10n:
+------------------
+        To update an existing po, for example ca_ES.po, just do:
+                intltool-update ca_ES
+
+

Added: trunk/src/Defines.cs.in
==============================================================================
--- (empty file)
+++ trunk/src/Defines.cs.in	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,45 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+static public class Defines
+{
+	public const string APPNAME = "Mistelix";
+	public const string APPNAME_LOWER = "mistelix";
+	public const string VERSION = "@VERSION@";
+	public const string GNOME_LOCALE_DIR = "@prefix@/share/locale";
+	public const string DATA_DIR = "@prefix@/share/mistelix/";
+	public const string PROJECT_EXTENSION = ".mistelix";
+	public const string PROJECT_EXTENSION_FILTER = "*.mistelix";
+
+	public const string SPUMUX_FILE = "spumux_mistelix.xml";
+	public const string DVDAUTHOR_FILE = "dvd_mistelix.xml";
+	public const string DVDAUTHOR_OUTDIR = "dvd";
+
+	public const string MAIN_MENU_FILE_PNG = "main_menu.png";
+	public const string MAIN_MENU_FILE_SRC = "welcome.mpeg";
+	public const string MAIN_MENU_FILE = "menu.mpeg";
+	public const string THEMES_FILE = "Themes.xml";
+	public const string PREFERENCES_FILE = "Preferences.xml";
+}

Added: trunk/src/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/Makefile.am	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,107 @@
+EXTRAFLAGS = -nowarn:0169  -unsafe $(CSC_DEFINES)
+
+WRAPPER = mistelix
+
+MISTELIX_CSDISTFILES =				\
+	$(srcdir)/mistelix.cs 			\
+	$(srcdir)/datamodel/PathList.cs 	\
+	$(srcdir)/datamodel/IntList.cs 	\
+	$(srcdir)/datamodel/Project.cs	\
+	$(srcdir)/datamodel/ProjectDetails.cs	\
+	$(srcdir)/datamodel/ButtonProjectElement.cs	\
+	$(srcdir)/datamodel/VisibleProjectElement.cs	\
+	$(srcdir)/datamodel/ProjectElement.cs	\
+	$(srcdir)/datamodel/SlideShowProjectElement.cs	\
+	$(srcdir)/datamodel/VideoProjectElement.cs	\
+	$(srcdir)/datamodel/BackgroundTaskCollection.cs 	\
+	$(srcdir)/datamodel/BackgroundTask.cs 	\
+	$(srcdir)/datamodel/Theme.cs	\
+	$(srcdir)/datamodel/ProjectBuilder.cs	\
+	$(srcdir)/widgets/DirectoryView.cs 	\
+	$(srcdir)/widgets/FileView.cs 	\
+	$(srcdir)/widgets/ImagesFileView.cs 	\
+	$(srcdir)/widgets/VideosFileView.cs 	\
+	$(srcdir)/widgets/SlideShowImageView.cs	\
+	$(srcdir)/widgets/AuthoringPaneView.cs	\
+	$(srcdir)/widgets/ProjectElementView.cs	\
+	$(srcdir)/widgets/PixbufImageSurface.cs	\
+	$(srcdir)/widgets/GtkMenu.cs	\
+	$(srcdir)/dialogs/GtkDialog.cs	\
+	$(srcdir)/dialogs/AddSlideDialog.cs	\
+	$(srcdir)/dialogs/AddVideoDialog.cs	\
+	$(srcdir)/dialogs/NewProjectDialog.cs	\
+	$(srcdir)/datamodel/ProgressEventArgs.cs \
+	$(srcdir)/dialogs/BuildProjectDialog.cs	\
+	$(srcdir)/dialogs/ThemeSelectionDialog.cs	\
+	$(srcdir)/backends/Spumux.cs		\
+	$(srcdir)/backends/DvdAuthor.cs		\
+	$(srcdir)/datamodel/ITransition.cs	\
+	$(srcdir)/core/MistelixLib.cs \
+	$(srcdir)/core/NoneTransition.cs	\
+	$(srcdir)/core/TransitionManager.cs	\
+	$(srcdir)/core/XmlStorage.cs	\
+	$(srcdir)/core/SlideImage.cs 	\
+	$(srcdir)/core/SlideShow.cs	\
+	$(srcdir)/core/DvdProjectBuilder.cs	\
+	$(srcdir)/core/TheoraProjectBuilder.cs	\
+	$(srcdir)/core/Logger.cs	\
+	$(srcdir)/core/DvdMenu.cs	\
+	$(srcdir)/core/ThemeManager.cs	\
+	$(srcdir)/dialogs/PreferencesDialog.cs  \
+	$(srcdir)/core/Video.cs \
+	$(srcdir)/widgets/GtkUtils.cs \
+	$(srcdir)/dialogs/ButtonPropertiesDialog.cs  \
+	$(srcdir)/core/Button.cs \
+	$(srcdir)/dialogs/ProjectPropertiesDialog.cs \
+	$(srcdir)/core/Preferences.cs \
+	$(srcdir)/widgets/BrowseDirectory.cs \
+	$(srcdir)/datamodel/ThumbnailSize.cs  \
+	$(srcdir)/core/ThumbnailSizeManager.cs \
+	$(srcdir)/datamodel/TextPosition.cs \
+	$(srcdir)/core/SvgImage.cs \
+	$(srcdir)/datamodel/AspectRatio.cs \
+	$(srcdir)/dialogs/AboutDialog.cs \
+	$(srcdir)/core/Dependencies.cs \
+	$(srcdir)/dialogs/CheckDependenciesDialog.cs \
+	$(srcdir)/datamodel/ObservableList.cs
+
+ASSEMBLIES = \
+	 $(MISTELIX_LIBS)    		\
+	-r:Mono.Cairo.dll		\
+	-r:Mono.Posix
+
+RESOURCES =										\
+-resource:$(srcdir)/mistelix.glade  \
+-resource:$(top_srcdir)/data/mistelix.svg  \
+-resource:$(top_srcdir)/data/mistelix.png  \
+-resource:$(srcdir)/mistelix.addin.xml
+
+mistelixdir = $(libdir)/mistelix
+mistelix_SCRIPTS = mistelix.exe
+bin_SCRIPTS = mistelix
+
+MISTELIX_CSFILES = $(MISTELIX_CSDISTFILES)	\
+	Defines.cs
+
+mistelix.exe: $(MISTELIX_CSFILES) 
+	$(CSC) -target:winexe -out:$@ $(EXTRAFLAGS) $(MISTELIX_CSFILES) $(ASSEMBLIES) $(RESOURCES)
+
+all: mistelix.exe
+
+EXTRA_DIST =					\
+	mistelix.glade \
+	$(srcdir)/mistelix.addin.xml	\
+	$(srcdir)/mono-addins-strings.xml \
+	$(MISTELIX_CSDISTFILES)			
+
+
+CLEANFILES =					\
+	mistelix.exe.config			\
+	mistelix.exe.mdb				\
+	mistelix.exe				\
+	mistelix
+
+
+DISTCLEANFILES = 				\
+	Makefile
+

Added: trunk/src/backends/DvdAuthor.cs
==============================================================================
--- (empty file)
+++ trunk/src/backends/DvdAuthor.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,178 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.IO;
+
+using Mistelix.DataModel;
+
+namespace Mistelix.Backends
+{
+	// Generates XML file for dvdauthor command line tool
+	public class DvdAuthor
+	{
+		Project project;
+	
+		public DvdAuthor (Project project)
+		{
+			this.project = project;
+		}
+
+		public void Create ()
+		{
+			StringBuilder sb = new StringBuilder (2048);
+			
+			sb.Append (String.Format ("<!-- Generated by {0} version {1} -->\n", Defines.APPNAME, Defines.VERSION));
+			sb.Append (String.Format ("<dvdauthor dest = \"{0}\">\n", Path.Combine (project.Details.OutputDir, Defines.DVDAUTHOR_OUTDIR)));
+				
+			sb.Append (GenerateVMGM ());
+
+			sb.Append (" <titleset>\n");
+			sb.Append (GenerateMenus ());
+			sb.Append (GenerateTitles ());
+			sb.Append (" </titleset>\n");
+
+			sb.Append ("</dvdauthor>\n");
+
+
+			using (FileStream fs = File.Create (project.FileToFullPath (Defines.DVDAUTHOR_FILE)))
+			{
+				StreamWriter sw = new StreamWriter (fs);
+				sw.Write (sb.ToString ());
+				sw.Close ();
+			}
+		}
+
+		public void Destroy ()
+		{
+			if (Mistelix.Debugging == false)
+			{
+				File.Delete (project.FileToFullPath (Defines.DVDAUTHOR_FILE));
+			}
+		}
+
+		string VideoFormatString {
+			get {
+				string video_format;
+		
+				if (project.Details.Format == VideoFormat.PAL)
+					video_format = "pal";
+				else
+					video_format = "ntsc";
+
+				return video_format;
+			}
+		}
+
+		string AspectRatioString {
+			get {
+				string aspect_ratio;
+		
+				if (project.Details.AspectRatio == AspectRatio.FourByThree)
+					aspect_ratio = "4:3";
+				else
+					aspect_ratio = "16:9";
+
+				return aspect_ratio;
+			}
+		}
+		// A PGC is just a fancy term for either a menu or a title
+		string GenerateVMGM ()
+		{
+			StringBuilder sb = new StringBuilder (2048);
+		
+			sb.Append (" <vmgm>\n");  
+			sb.Append ("  <menus>\n");
+			sb.Append ("   <video format=\"" + VideoFormatString + "\" aspect=\"" + AspectRatioString + "\" />\n");
+			sb.Append ("   <audio format=\"pcm\" lang=\"EN\" />\n");
+			sb.Append ("   <subpicture lang=\"EN\" />\n");
+			sb.Append ("    <pgc>\n");
+			sb.Append ("      <post>jump titleset 1 menu;</post>\n");
+			sb.Append ("    </pgc>\n");
+			sb.Append ("  </menus>\n");
+			sb.Append (" </vmgm>\n");
+
+			return sb.ToString ();	
+		}
+
+		string GenerateMenus ()
+		{
+			StringBuilder sb = new StringBuilder (4096);
+			sb.Append (" <menus>\n");
+			sb.Append ("  <video format=\"" + VideoFormatString + "\" aspect=\"" + AspectRatioString + "\" />\n");
+			sb.Append ("  <audio format=\"pcm\" lang=\"EN\" />\n");
+			sb.Append ("  <subpicture lang=\"EN\" />\n");
+
+			for (int cnt = 0; cnt < project.Buttons.Count; cnt++)
+			{			
+				sb.Append ("  <pgc pause = \"inf\">\n");
+				sb.Append (String.Format ("    <vob file = \"{0}\" />\n", project.FileToFullPath (Defines.MAIN_MENU_FILE)));
+				cnt++;
+
+				// Map every button to every title
+				for (int id = 0; id < project.Buttons.Count; id++)
+				{
+					int j;
+
+					if (id + 1  > project.Buttons.Count)
+						j = 1;
+					else
+						j = id + 1;
+
+					sb.Append (String.Format ("    <button name=\"button{0}\">\n", id));
+					sb.Append ("    { jump title " +  j + ";}</button>\n");
+				}
+
+				sb.Append ("  </pgc>\n");
+			}
+			sb.Append (" </menus>\n");
+			return sb.ToString ();	
+		}
+
+		string GenerateTitles ()
+		{
+			StringBuilder sb = new StringBuilder (2048);
+			VisibleProjectElement element;
+
+			sb.Append (" <titles>\n");
+			sb.Append ("  <video format=\"" + VideoFormatString + "\" aspect=\""+ AspectRatioString +"\" />\n");
+			sb.Append ("  <audio format=\"pcm\" lang=\"EN\" />\n");
+			sb.Append ("  <subpicture lang=\"EN\" />\n");
+
+			// There is a direct correspondence between a button and a video element
+			foreach (ButtonProjectElement button in project.Buttons)
+			{
+				element = project.ElementFromID (button.LinkedId);
+				sb.Append ("   <pgc>\n");
+				sb.Append (String.Format ("    <vob file=\"{0}\" />\n", project.FileToFullPath (element.GetOutputFile (project.Details.Type))));
+				sb.Append ("    <post>call menu;</post>\n");
+				sb.Append ("   </pgc>\n");
+			}
+
+			sb.Append (" </titles>\n");
+			return sb.ToString ();
+		}
+	}
+}

Added: trunk/src/backends/Spumux.cs
==============================================================================
--- (empty file)
+++ trunk/src/backends/Spumux.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,277 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.IO;
+using System.Collections.Generic;
+
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Backends
+{
+	//
+	// Generates XML file for Spumux command line tool
+	// 
+	public class Spumux
+	{
+		const string menu_normal = "menu_normal.png";
+		const string menu_highlight = "menu_highlight.png";
+
+		Project project;
+	
+		public Spumux (Project project)
+		{
+			this.project = project;
+		}
+
+		public void Create ()
+		{
+			StringBuilder sb = new StringBuilder (2048);
+
+			sb.Append ("<subpictures>\n");
+			sb.Append (" <stream>\n");
+			sb.Append ("  <spu start=\"00:00:00.00\" end=\"00:00:00.00\"\n");
+			sb.Append ("    highlight=\"" + project.FileToFullPath (menu_highlight) + "\"\n");
+			sb.Append ("    select=\"" + project.FileToFullPath (menu_normal) + "\"\n");
+			sb.Append ("    xoffset=\"" + 0 + "\" yoffset=\""+ 0 +"\"\n");
+			sb.Append ("    force = \"yes\">\n");
+				
+			sb.Append (GenerateMenus ());
+
+			sb.Append ("   </spu>\n");	
+			sb.Append (" </stream> \n");
+			sb.Append ("</subpictures> \n");
+
+			using (FileStream fs = File.Create (project.FileToFullPath (Defines.SPUMUX_FILE)))
+			{
+				StreamWriter sw = new StreamWriter (fs);
+				sw.Write (sb.ToString ());
+				sw.Close ();
+			}
+		}
+
+		public void Destroy ()
+		{
+			if (Mistelix.Debugging == false)
+			{
+				File.Delete (project.FileToFullPath (menu_normal));
+				File.Delete (project.FileToFullPath (menu_highlight));
+				File.Delete (project.FileToFullPath (Defines.SPUMUX_FILE));
+			}
+		}
+
+		void DrawButtons (Button button, Cairo.Context high, Cairo.Context normal)
+		{
+			// The coordinates should match what we provide to Spumux
+			DrawImageFromFile (normal, Path.Combine (Defines.DATA_DIR, project.Details.Theme.ButtonSelect),
+				button.X, button.Y, button.DrawingBoxWidth, button.DrawingBoxHeight);
+
+			DrawImageFromFile (high, Path.Combine (Defines.DATA_DIR, project.Details.Theme.ButtonHighlight),
+				button.X, button.Y, button.DrawingBoxWidth, button.DrawingBoxHeight);
+		}
+
+		public void DrawImageFromFile (Cairo.Context cr, string filename, double x, double y, double width, double height)
+		{
+			SvgImage image;
+			const int rsvg_width = 10, rsvg_height = 10; // TODO: Use svg size or predetermined?
+
+			if (width <= 0 || height <= 0)
+				throw new ArgumentException (String.Format ("Spumux->DrawImageFromFile. DVD menu buttons width {0} and height {1} should be > 0", width, height));
+
+			try {
+				image = new SvgImage (filename);
+			}
+			catch (Exception)
+			{
+				Logger.Error ("Spumux.DrawImageFromFile->Error loading file {0}", filename);
+				return;
+			}
+
+			Logger.Debug ("Spumux.DrawImageFromFile->Loaded file {0}, w:{1} h:{2}", filename, image.Width, image.Height);
+			cr.Save ();
+
+			// Have to clip for RenderToCairo
+			cr.Rectangle (x, y, width, height);
+			cr.Clip ();
+
+			cr.Translate (x, y);
+			cr.Scale (width / image.Width, height / image.Height);
+			image.RenderToCairo (cr.Handle);
+			cr.Restore ();
+
+			image.Dispose ();
+		}
+
+		string GenerateMenus ()
+		{
+			StringBuilder sb = new StringBuilder (2048);
+			Cairo.ImageSurface shigh = new Cairo.ImageSurface (Cairo.Format.ARGB32, project.Details.Width, project.Details.Height);
+			Cairo.Context chight = new Cairo.Context (shigh);
+
+			Cairo.ImageSurface snormal = new Cairo.ImageSurface (Cairo.Format.ARGB32, project.Details.Width, project.Details.Height);
+			Cairo.Context cnormal = new Cairo.Context (snormal);
+
+			for (int i = 0; i < project.Buttons.Count; i++)
+			{	
+				Button button = (Button)project.Buttons [i];
+				sb.Append ("   <button name = \"button" + i + "\"\n");
+				sb.Append ("    x0 = \"" + project.Buttons[i].X + "\"\n");
+				sb.Append ("    y0 = \"" + project.Buttons[i].Y + "\"\n");
+				sb.Append ("    x1 = \"" + (project.Buttons[i].X + button.DrawingBoxWidth) + "\"\n");
+				sb.Append ("    y1 = \"" + (project.Buttons[i].Y + button.DrawingBoxHeight) + "\"\n");
+
+				sb.Append ("    down = \"ActionDown\"\n");
+				sb.Append ("    up = \"ActionUp\"\n");
+				sb.Append ("   />\n");
+				DrawButtons (button, chight, cnormal);
+			}
+
+			// Quantize the images given
+			{
+				// See: http://www.cairographics.org/manual/bindings-surfaces.html
+				byte [] pixels_normal = QuantizeSurface (snormal);
+				Cairo.ImageSurface snormal_quantized =  new Cairo.ImageSurface (ref pixels_normal, snormal.Format, snormal.Width, snormal.Height, snormal.Stride);
+			
+				byte [] pixels_high = QuantizeSurface (shigh);
+				Cairo.ImageSurface shigh_quantized =  new Cairo.ImageSurface (ref pixels_high, shigh.Format, shigh.Width, shigh.Height, shigh.Stride);
+
+				snormal_quantized.WriteToPng (project.FileToFullPath (menu_normal));
+				shigh_quantized.WriteToPng (project.FileToFullPath (menu_highlight));
+
+				snormal_quantized.Destroy ();
+				shigh_quantized.Destroy ();
+			}
+			
+			if (Mistelix.Debugging)
+			{
+				snormal.WriteToPng (project.FileToFullPath ("menu_normal_unquantized.png"));
+				shigh.WriteToPng (project.FileToFullPath ("menu_highlight_unquantized.png"));
+			}
+
+			((IDisposable)cnormal).Dispose ();
+			((IDisposable)chight).Dispose ();
+			shigh.Destroy ();
+			snormal.Destroy ();
+			return sb.ToString ();	
+		}
+
+		// The images used by spumux can each have a maximum of 4 colors (reality is actually 3) (with four you get 'ERR: Cannot pick button masks')
+		// We do a color quantization using a popularity algorithm by finding the 3 most frequently appearing colors in the original image.
+		// and setting every pixel to one of these frequently appearing colors
+		byte[] QuantizeSurface (Cairo.ImageSurface surface)
+		{
+			const int palete_size = 3; 
+			byte[] pixels = surface.Data;
+			byte[] target = new byte [pixels.Length];
+			uint pixel;
+			Dictionary <uint, int> table = new Dictionary <uint, int> ();
+
+			// 1. Create a list of the pixels and how popular they are
+			for (int i = 0 ; i < pixels.Length; i = i + 4) 
+			{
+				pixel = (uint) ((pixels[i + 0]) & 0xff);
+				pixel += (uint) ((pixels[i + 1] << 8) & 0xff00);
+				pixel += (uint) ((pixels[i + 2] << 16) & 0xff0000);
+				pixel += (uint) ((pixels[i + 3] << 24) & 0xff000000);
+
+				if (table.ContainsKey (pixel) == false) {
+					table.Add (pixel, 1);
+				} else
+				{
+					int times = table[pixel];
+					times++;
+					table[pixel] = times;
+				}
+			}
+			Logger.Debug ("Spumux.QuantizeSurface -> Phase 1. Values: {0}", table.Count);
+
+			// 2. Select the most N most popular elements to build the palete
+			uint [] palete = new uint [palete_size];
+			int [] popularity = new int [palete_size];
+			foreach (KeyValuePair <uint, int> kvp in table)
+			{
+				int popular = kvp.Value;
+				int insert_pos = -1;
+				for (int i = 0; i < popularity.Length; i++)
+				{
+					if (popular > popularity[i]) {
+						if (insert_pos == -1 || popularity[insert_pos] < popularity[i])
+							insert_pos = i;
+					}
+				}
+				if (insert_pos != -1) {
+					popularity [insert_pos] = popular;
+					palete [insert_pos ] = kvp.Key;
+				}			
+			}
+			
+			for (int i = 0; i <palete_size; i++)
+				Logger.Debug ("Spumux.QuantizeSurface -> Phase 2. Palete {0:X} popularity {1}", palete[i], popularity[i]);
+
+			// Go tru all the palete and select the neartest color in the palete
+			for (int i = 0 ; i < pixels.Length; i = i + 4) 
+			{
+				pixel = (uint) ((pixels[i + 0]) & 0xff);
+				pixel += (uint) ((pixels[i + 1] << 8) & 0xff00);
+				pixel += (uint) ((pixels[i + 2] << 16) & 0xff0000);
+				pixel += (uint) ((pixels[i + 3] << 24) & 0xff000000);
+
+				float dist, val, better = -1;
+				int element = -1;
+
+				for (int p = 0; p < palete_size; p++) 
+				{
+					// Calculate the Euclidean distance for every color component . See: http://en.wikipedia.org/wiki/Euclidean_distance
+					dist = 0;
+					val = pixels[i + 0] - (byte) ((palete[p] & 0xff));
+					dist += val * val;
+
+					val = pixels[i + 1] - (byte) ((palete[p] >> 8) & 0xff);
+					dist += val * val;
+
+					val = pixels[i + 2] - (byte) ((palete[p] >> 16) & 0xff);
+					dist += val * val;
+
+					val = pixels[i + 3] - (byte) ((palete[p] >> 24) & 0xff);
+					dist += val * val;
+
+					dist = (float) Math.Sqrt (dist);
+
+					if (p == 0 || dist < better) {
+						better = dist;
+						element = p;
+					}
+				}
+				target [i + 0] = (byte) ((palete[element] & 0xff));
+				target [i + 1] = (byte) ((palete[element] >> 8) & 0xff);
+				target [i + 2] = (byte) ((palete[element] >> 16) & 0xff);
+				target [i + 3] = (byte) ((palete[element] >> 24) & 0xff);
+			}
+
+			return target;
+		}
+	}
+}

Added: trunk/src/core/Button.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/Button.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,159 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gdk;
+using Gtk;
+using Pango;
+
+using Mistelix.Transitions;
+using Mistelix.Core;
+using Mistelix.DataModel;
+using Mistelix.Widgets;
+
+namespace Mistelix.Core
+{
+	// DVD Button
+	public class Button : ButtonProjectElement // TODO: Should use Dispose pattern
+	{
+		PixbufImageSurface thumbnail;	
+		int imgbox_width, imgbox_height;
+		int box_width, box_height;
+
+		public Button ()
+		{	
+
+		}
+
+		public Button (int x, int y, int linked_id) : base (x, y, linked_id)
+		{
+		}
+
+		// Space needed horizontally to represent the object
+		public int DrawingBoxWidth {
+			get {
+				if (ShowAs == ButtonShowAs.Thumbnail)
+					return imgbox_width;
+
+				return box_width;
+			}
+		}
+
+		// Space needed vertically to represent the object
+		public int DrawingBoxHeight {
+			get {
+				if (ShowAs == ButtonShowAs.Thumbnail)
+					return imgbox_height;
+
+				return box_height;
+			}
+		}
+
+		// Check if a point is part of the button
+		public bool Contains (int x, int y)
+		{
+			if ((x >= X && x <= X + DrawingBoxWidth) &&
+				(y >= Y && y <= Y + DrawingBoxHeight))
+				return true;
+
+			return false;
+		}		
+
+		public void Draw (Cairo.Context cr, Project project)
+		{
+			Draw (cr, project, X, Y);
+		}
+
+		public void Draw (Cairo.Context cr, Project project, int x, int y)
+		{
+			if (ShowAs == ButtonShowAs.Thumbnail)
+				DrawThumbnail (cr, project, x, y);
+			else
+				DrawText (cr, project, x, y);
+		}
+
+		public void InvalidateThumbnail ()
+		{
+			if (thumbnail == null)
+				return;
+
+			((IDisposable)thumbnail).Dispose ();
+			thumbnail = null;
+		}
+
+		void DrawThumbnail (Cairo.Context cr, Project project, int x, int y)
+		{
+			if (thumbnail == null)
+				LoadThumbnail (project);
+	
+			thumbnail.Render (cr, x, y);
+		}
+
+		void DrawText (Cairo.Context cr, Project project, int x, int y)
+		{
+			using (Pango.Layout layout = Pango.CairoHelper.CreateLayout (cr))
+			{
+				layout.FontDescription = Pango.FontDescription.FromString (project.Details.ButtonsFontName);
+				layout.SetMarkup (Text);
+				layout.Ellipsize = Pango.EllipsizeMode.End;
+				layout.Alignment = Pango.Alignment.Center;
+				layout.GetPixelSize (out box_width, out box_height);
+				cr.MoveTo (x, y);
+				layout.SingleParagraphMode = true;
+				layout.Width = -1;
+				
+				cr.Color = project.Details.ButtonsForeColor;
+	     			Pango.CairoHelper.ShowLayout (cr, layout);
+			}
+		}
+	
+		void LoadThumbnail (Project project)
+		{
+			Gdk.Pixbuf pix = null;
+			ThumbnailSize size;
+
+			size = ThumbnailSizeManager.List [project.Details.ButtonThumbnailSize];
+
+			try  {
+				VisibleProjectElement element;
+
+				element = project.ElementFromID (LinkedId);
+
+				if (element is SlideShowProjectElement == false && element is VideoProjectElement == false)
+					throw new InvalidOperationException ("Only videos and slideshows allowed");
+
+				pix =  element.GetThumbnail (size.Width, size.Height);
+
+				imgbox_width = pix.Width;
+				imgbox_height = pix.Height;
+			} 
+			catch (Exception e) {
+				Logger.Error ("Button.LoadThumbnail. Exception {0}", e.Message);
+				pix = Gtk.IconTheme.Default.LoadIcon ("gtk-new", size.Width, (Gtk.IconLookupFlags) 0);
+			}
+			finally {
+				thumbnail = new PixbufImageSurface (pix, true);				
+			}
+		}
+	}
+}

Added: trunk/src/core/Dependencies.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/Dependencies.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,210 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using Mono.Unix;
+using System.Diagnostics;
+
+using Mistelix.Transitions;
+using Mistelix.DataModel;
+
+namespace Mistelix.Core
+{
+	public class Dependencies
+	{
+		enum Codecs
+		{
+			MPEG2VIDEO,
+			FFMUX_DVD,
+			MISTELIXVIDEOSRC,
+			THEORAENC,
+			OGGMUX
+		};
+
+		public struct Dependency
+		{
+			string component;
+			bool available;
+			string action;
+
+			public Dependency (string component, bool available, string action)
+			{
+				this.component = component;
+				this.available = available;
+
+				if (available)
+					this.action = Catalog.GetString ("No action required");
+				else
+					this.action = action;
+			}
+
+			public string Component {
+				get { return component; } 
+			}
+
+			public bool Available {
+				get { return available; } 
+			}
+
+			public string Action {
+				get { return action; } 
+			}
+		}
+
+		List <Dependency> DependencyList;
+		bool status_checked;
+		bool dvd_support, theora_support;
+
+		public Dependencies ()
+		{
+			DependencyList = new List <Dependency> ();
+		}
+
+		public bool DvdSupport {
+			get {
+				Check ();
+				return dvd_support;
+			}
+		}
+
+		public string CapabilitiesSummary {
+			get {
+				Check ();
+
+				if (theora_support && dvd_support)
+					return Catalog.GetString ("Your system supports DVD and Theora authoring.");
+
+				if (dvd_support)
+					return Catalog.GetString ("Your system only supports DVD authoring.");
+
+				if (theora_support)
+					return Catalog.GetString ("Your system only supports Theora authoring.");
+
+				return Catalog.GetString ("Your system has no support for DVD or Theora authoring. Please, execute the suggested actions to enhance your system support for Mistelix.");
+			}
+		}
+
+		public bool TheoraSupport {
+			get {
+				Check ();
+				return theora_support;
+			}
+		}
+
+		public List <Dependency> Status {
+			get {
+				Check ();
+				return DependencyList;
+			}
+		}
+
+		void Check ()
+		{
+			if (status_checked == true)
+				return;
+
+			status_checked = true;
+			List <string> codecs = MistelixLib.GetCodecs ();
+			string [] used =  {"ffenc_mpeg2video", "ffmux_dvd", "mistelixvideosrc", "theoraenc", "oggmux"};
+			bool [] founds = new bool [used.Length];
+
+			// TODO: Better a hash table
+			foreach (string codec in codecs)
+			{
+				for (int i = 0; i < used.Length; i++)
+				{
+					if (codec.Equals (used[i])) 
+					{
+						founds[i] = true;
+						Logger.Info ("GStreamer codec found: " + used[i]);
+						break;
+					}
+				}
+			}
+	
+			DependencyList.Add (new Dependency (used [(int) Codecs.MPEG2VIDEO], founds [(int) Codecs.MPEG2VIDEO],
+				Catalog.GetString ("Missing ffmpeg2video codec.  Make sure that you have downloaded a gst-ffmpeg library from www.mistelix.org. Many distributions do not include MPEG2 encoding capabilities with the gst-ffmpeg version that package.")));
+
+			DependencyList.Add (new Dependency (used [(int) Codecs.FFMUX_DVD], founds [(int) Codecs.FFMUX_DVD],
+				Catalog.GetString ("Missing ffmux_dvd muxer. Make sure that you have downloaded a gst-ffmpeg library from www.mistelix.org. The standard GStreamer plug-in does not exposes the DVD muxer.")));
+
+			DependencyList.Add (new Dependency (used [(int) Codecs.MISTELIXVIDEOSRC], founds [(int) Codecs.MISTELIXVIDEOSRC],
+				Catalog.GetString ("Missing mistelixvideosrc plug-in. This GStreamer plug-in is provided as part of Mistelix application. Mistelix is probably not installed correctly.")));
+
+			DependencyList.Add (new Dependency (used [(int) Codecs.THEORAENC], founds [(int) Codecs.THEORAENC],
+				Catalog.GetString ("Missing Theora codec. You need to install GStreamer Base Plugins.")));
+
+			DependencyList.Add (new Dependency (used [(int) Codecs.OGGMUX], founds [(int) Codecs.OGGMUX],
+				Catalog.GetString ("Missing ogg muxer. You need to install GStreamer Base Plugins.")));
+
+			// Check for application
+			bool dvdauthor, spumux;
+	
+			dvdauthor = CheckApp ("dvdauthor");
+			DependencyList.Add (new Dependency ("dvdauthor", dvdauthor,
+				Catalog.GetString ("Install dvdauthor package from your Linux distribution application manager.")));
+
+			spumux = CheckApp ("spumux");
+			DependencyList.Add (new Dependency ("spumux", spumux,
+				Catalog.GetString ("Install dvdauthor from your Linux distribution application manager. Spumux is included with dvdauthor package")));
+
+			// DVD Authoring support
+			if (founds [(int) Codecs.FFMUX_DVD] && 
+				founds [(int) Codecs.MPEG2VIDEO] && 
+				founds [(int) Codecs.MISTELIXVIDEOSRC]
+				&& spumux 
+				&& dvdauthor) 
+			{
+				dvd_support = true;
+			}
+
+
+			// Spumux Author support
+			if (founds [(int) Codecs.THEORAENC] && 
+				founds [(int) Codecs.OGGMUX] && 
+				founds [(int) Codecs.MISTELIXVIDEOSRC])
+			{
+				theora_support = true;
+			}
+		}
+
+		bool CheckApp (string application)
+		{
+			bool app_exists = false;
+
+			try {
+				Process process = new Process ();
+				process.StartInfo.FileName = application;
+				process.StartInfo.UseShellExecute = false; 
+				process.StartInfo.RedirectStandardOutput = true;
+				process.StartInfo.RedirectStandardError = true;
+				process.Start ();
+				app_exists = true;
+			}
+			catch (Exception) {}
+
+			return app_exists;
+		}
+	}
+}

Added: trunk/src/core/DvdMenu.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/DvdMenu.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,166 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using Gdk;
+using Mono.Addins;
+using System.Collections.Generic;
+
+using Mistelix.Transitions;
+using Mistelix.DataModel;
+using Mistelix.Widgets;
+
+namespace Mistelix.Core
+{
+	// Generates MPEG for DVD menu. Designed for a single menu
+	public class DvdMenu : IDisposable
+	{
+		Project project;
+		Gdk.Pixbuf background;
+
+		public DvdMenu (Project project)
+		{
+			this.project = project;
+			UpdateTheme ();
+		}
+
+		~DvdMenu ()
+		{
+			Dispose (false);
+		}
+
+		public void Dispose ()
+		{
+			Dispose (true);
+			System.GC.SuppressFinalize (this);
+		}
+
+		protected virtual void Dispose (bool disposing)
+		{	
+			Logger.Debug ("DvdMenu.Disposing");
+			if (background != null)
+				background.Dispose ();
+		}
+
+		public string GenerateMPEG (/*, ProgressEventHandler progress*/)
+		{
+			SlideShow sw;
+	
+			Save (project.FileToFullPath (Defines.MAIN_MENU_FILE_PNG));
+
+			string outfile;
+			sw = new SlideShow ();
+			sw.filename = Defines.MAIN_MENU_FILE_SRC;
+			//sw.audiofile = "/home/jordi/dev/mistelix/themes/music/incompetech/Fluidscape.mp3";
+			//sw.audiofile = "/home/jordi/dev/mistelix/libmistelix/song.mp3";
+			sw.images.Add (new SlideImage (project.FileToFullPath (Defines.MAIN_MENU_FILE_PNG), string.Empty, 5, TransitionManager.None.Name));
+			outfile = sw.Generate (project, null);
+		
+			if (Mistelix.Debugging == false)
+				File.Delete (project.FileToFullPath (Defines.MAIN_MENU_FILE_PNG));
+
+			return outfile;
+		}
+
+		public void UpdateTheme ()
+		{	
+			string name;
+			Theme theme = null;
+			Gdk.Pixbuf im = null;
+
+			if (project == null)
+				return;
+
+			name = project.Details.ThemeName;
+
+			if (name != null)
+				theme = ThemeManager.FromName (name);
+
+			if (background != null)
+				background.Dispose ();
+
+			foreach (Button button in project.Buttons)
+				button.InvalidateThumbnail ();
+	
+			if (theme == null) {
+				background = null;
+				return;
+			}
+
+			try {
+				if (project.Details.CustomMenuBackground != null)
+					im = new Gdk.Pixbuf (project.Details.CustomMenuBackground);
+
+			}
+			catch {
+				Logger.Error (String.Format ("DvdMenu.UpdateTheme: Error loading custom background {0}", project.Details.CustomMenuBackground));
+			}
+			
+			try {
+				if (im == null)
+					im = new Gdk.Pixbuf (Path.Combine (Defines.DATA_DIR, theme.MenuBackground));
+			}
+
+			catch {
+				Logger.Error (String.Format ("DvdMenu.UpdateTheme: Error loading menu background {0}", Path.Combine (Defines.DATA_DIR, theme.MenuBackground)));
+			}
+
+			background = im.ScaleSimple (project.Details.Width, project.Details.Height, InterpType.Nearest);
+			im.Dispose ();
+		}
+	
+		public void Draw (Cairo.Context cr, Core.Button moving_button)
+		{
+			// See: http://kapo-cpp.blogspot.com/2008/01/drawing-pixbuf-to-cairo-context-2.html
+
+			if (background != null) {
+				Gdk.CairoHelper.SetSourcePixbuf (cr, background, 0, 0);
+				cr.Paint ();
+			}
+
+			if (project == null)
+				return;
+
+			// Draw buttons
+			foreach (Button button in project.Buttons)
+			{
+				if (moving_button != null && moving_button.LinkedId == button.LinkedId) {
+					// In the button object the image is already loaded and cached
+					button.Draw (cr, project, moving_button.X, moving_button.Y);
+					GtkUtils.DrawSelectionBox (cr, moving_button.X, moving_button.Y, button.DrawingBoxWidth, button.DrawingBoxHeight);
+				}
+				else
+					button.Draw (cr, project);
+			}
+		}
+
+		public void Save (string file)
+		{
+			Cairo.ImageSurface s = new Cairo.ImageSurface (Cairo.Format.Rgb24, project.Details.Width, project.Details.Height);
+			Cairo.Context cr = new Cairo.Context (s);
+			Draw (cr, null);
+			s.WriteToPng (file);
+		}
+	}
+}

Added: trunk/src/core/DvdProjectBuilder.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/DvdProjectBuilder.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,182 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using Mono.Unix;
+using System.IO;
+using System.Threading;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+using Mistelix.Backends;
+using Mistelix.Dialogs;
+
+namespace Mistelix.Core
+{
+	// Builds the DVD structure
+	public class DvdProjectBuilder : ProjectBuilder
+	{
+		public DvdProjectBuilder (Project project, ProgressEventHandler total_handler, ProgressEventHandler task_handler)
+			: base (project, total_handler, task_handler)
+		{
+
+		}
+
+		public override void Create ()
+		{
+			DateTime start_time = DateTime.Now;
+			List <ProjectElement> elements = project.ElementsGenerate;
+			ProgressEventArgs progress = new ProgressEventArgs ();
+			DvdMenu menu = new DvdMenu (project);
+			ProgressEventArgs text = new ProgressEventArgs ();
+			int tasks = 0;
+			List <string> temporary_files;
+			string outfile;
+
+			temporary_files = new List <string> ();
+			text.Text = Catalog.GetString ("Project building process started") + "\n";
+			total_handler (this, text);
+	
+			try {
+				EnsureOutputDir (project.Details.OutputDir);
+			} 
+			catch (Exception e) {
+				text.Text = String.Format (Catalog.GetString ("Error creating output directory '{0}'") + "\n", e.Message);
+				total_handler (this, text);				
+				return;
+			}
+
+			// Count all tasks to do
+			for (int i = 0; i < elements.Count; i++)
+			{
+				if (typeof (SlideShow) != elements[i].GetType ())
+					continue;
+	
+				tasks += ((SlideShow) elements[i]).images.Count;
+			}
+
+			text.Text = Catalog.GetString ("Generating main DVD menu...") + "\n";
+			total_handler (this, text);
+	
+			outfile = menu.GenerateMPEG ();
+			temporary_files.Add (outfile);
+
+			total.Total = tasks;
+			total.Progress = 0;
+		
+			// Generate all the slideshows
+			SlideShow slideshow;			
+			for (int i = 0; i < elements.Count; i++)
+			{				
+				if (typeof (SlideShow) != elements[i].GetType ())
+					continue;
+
+				slideshow = (SlideShow) elements[i];
+				Logger.Debug ("DvdProjectBuilder.Create -> Generating slide " + slideshow.Name);
+				Logger.Debug ("DvdProjectBuilder.Create completed");
+
+				text.Text = String.Format (Catalog.GetString ("Generating slideshow '{0}'"), slideshow.Name) + "\n";
+				total_handler (this, text);
+
+				outfile = slideshow.Generate (project, OnProgressTaskLocal);
+			}
+
+			// Convert videos
+			Video video;
+			for (int i = 0; i < elements.Count; i++)
+			{
+				if (typeof (Video) != elements[i].GetType ())
+					continue;
+
+				video = (Video) elements[i];
+				Logger.Debug ("DvdProjectBuilder.Create -> converting " + video.Name);
+
+				text.Text = String.Format (Catalog.GetString ("Converting video '{0}'"), video.Name) + "\n";
+				total_handler (this, text);
+				outfile = video.Convert (project);
+			}
+			
+			// Create XML for external tools
+			Spumux sp = new Spumux (project);
+			sp.Create ();
+		
+			//LaunchTool (string app, string args, string in_file, string out_file, string err_file);
+			MistelixLib.LaunchTool ("spumux", 
+				project.FileToFullPath (Defines.SPUMUX_FILE),
+				project.FileToFullPath (Defines.MAIN_MENU_FILE_SRC),
+				project.FileToFullPath (Defines.MAIN_MENU_FILE),
+				Mistelix.Debugging ? project.FileToFullPath ("spumux_output.txt") : null);
+
+			// Delete output dvd directory
+			// DVDauthor builds on top of previous contents
+			string outdir = Path.Combine (project.Details.OutputDir, Defines.DVDAUTHOR_OUTDIR);
+
+			try {
+				if (Directory.Exists (outdir))
+					Directory.Delete (outdir, true);
+			}
+	
+			catch (Exception) {
+				Logger.Error (String.Format ("DvdProjectBuilder.Create -> cannot delete {0} directory", outdir));
+			}
+			
+			DvdAuthor dvd = new DvdAuthor (project);
+			dvd.Create ();
+
+			string args = String.Format ("-x{0}", project.FileToFullPath (Defines.DVDAUTHOR_FILE));
+
+			MistelixLib.LaunchTool ("dvdauthor",
+				args,
+				null,
+				null,
+				Mistelix.Debugging ? project.FileToFullPath ("dvd_author_output.txt") : null);
+			
+			TimeSpan time = DateTime.Now - start_time;
+			total.Text = Catalog.GetString (String.Format ("Completed. Time used: {0}", TimeSpanToStr (time))) + "\n";
+			total_handler (this, total);
+
+			// Delete temporary files
+			sp.Destroy ();
+			dvd.Destroy ();
+
+			if (Mistelix.Debugging == false) {
+				temporary_files.Add (project.FileToFullPath (Defines.MAIN_MENU_FILE));
+				foreach (string file in temporary_files) {
+					File.Delete (file);
+				}
+			}
+			Logger.Debug ("DvdProjectBuilder.Create thread finished");
+		}
+
+		// Local progress tracking that fires two separate events
+		public void OnProgressTaskLocal (object sender, ProgressEventArgs e)
+		{	
+			task_handler (sender, e);
+			total.Progress = total.Progress + 1;
+			total_handler (this, total);
+		}
+	}
+}

Added: trunk/src/core/Logger.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/Logger.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,182 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+
+namespace Mistelix.Core
+{
+	public enum Level { DEBUG, INFO, WARN, ERROR, FATAL };
+
+	public interface ILogger
+	{
+		void Log (Level lvl, string msg, params object[] args);
+	}
+
+	class NullLogger : ILogger
+	{
+		public void Log (Level lvl, string msg, params object[] args)
+		{
+		}
+	}
+
+	class ConsoleLogger : ILogger
+	{
+		public void Log (Level lvl, string msg, params object[] args)
+		{
+			msg = string.Format ("{0} [{1}]: {2}",
+			                     DateTime.Now.ToString(),
+			                     Enum.GetName (typeof (Level), lvl),
+			                     msg);
+
+			Console.WriteLine (msg, args);
+		}
+	}
+
+	class FileLogger : ILogger
+	{
+		StreamWriter log;
+		ConsoleLogger console;
+
+		public FileLogger ()
+		{
+			try {
+				log = File.CreateText (Path.Combine (
+#if WIN32
+				                               Services.NativeApplication.ConfDir,
+#else
+				                               Environment.GetEnvironmentVariable ("HOME"),
+#endif
+				                               ".mistelix.log"));
+				log.Flush ();
+			} catch (IOException) {
+				// FIXME: Use temp file
+			}
+
+			console = new ConsoleLogger ();
+		}
+
+		~FileLogger ()
+		{
+			if (log != null)
+				try {
+					log.Flush ();
+				} catch { }
+		}
+
+		public void Log (Level lvl, string msg, params object[] args)
+		{
+			console.Log (lvl, msg, args);
+
+			if (log != null) {
+				msg = string.Format ("{0} [{1}]: {2}",
+				                     DateTime.Now.ToString(),
+				                     Enum.GetName (typeof (Level), lvl),
+				                     msg);
+				log.WriteLine (msg, args);
+				log.Flush();
+			}
+		}
+	}
+
+	// This class provides a generic logging facility. By default all
+	// information is written to standard out and a log file, but other
+	// loggers are pluggable.
+	public static class Logger
+	{
+		private static Level log_level = Level.DEBUG;
+
+		static ILogger log_dev = new FileLogger ();
+
+		static bool muted = false;
+
+		public static Level LogLevel
+		{
+			get {
+				return log_level;
+			}
+			set {
+				log_level = value;
+			}
+		}
+
+		public static ILogger LogDevice
+		{
+			get {
+				return log_dev;
+			}
+			set {
+				log_dev = value;
+			}
+		}
+
+		public static void Debug (string msg, params object[] args)
+		{
+			Log (Level.DEBUG, msg, args);
+		}
+
+		public static void Info (string msg, params object[] args)
+		{
+			Log (Level.INFO, msg, args);
+		}
+
+		public static void Warn (string msg, params object[] args)
+		{
+			Log (Level.WARN, msg, args);
+		}
+
+		public static void Error (string msg, params object[] args)
+		{
+			Log (Level.ERROR, msg, args);
+		}
+
+		public static void Fatal (string msg, params object[] args)
+		{
+			Log (Level.FATAL, msg, args);
+		}
+
+		public static void Log (Level lvl, string msg, params object[] args)
+		{
+			if (!muted && lvl >= log_level)
+				log_dev.Log (lvl, msg, args);
+		}
+
+		// This is here to support the original logging, but it should be
+		// considered deprecated and old code that uses it should be upgraded to
+		// call one of the level specific log methods.
+		public static void Log (string msg, params object[] args)
+		{
+			Log (Level.DEBUG, msg, args);
+		}
+
+		public static void Mute ()
+		{
+			muted = true;
+		}
+
+		public static void Unmute ()
+		{
+			muted = false;
+		}
+	}
+}

Added: trunk/src/core/MistelixLib.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/MistelixLib.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,235 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+using Gdk;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using Mono.Unix;
+
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Core
+{
+	//
+	// Binding for libmisteix. The high level C video/audio access layer
+	// 
+	public class MistelixLib
+	{
+		[DllImport ("libmistelix")]
+		static extern int mistelix_slideshow_createstream (string filename, uint type, uint weight, uint height, uint framessec, uint totalframes);
+
+		[DllImport ("libmistelix")]
+		static extern int mistelix_slideshow_add_image (IntPtr bytes, uint len);
+
+		[DllImport ("libmistelix")]
+		static extern int mistelix_slideshow_add_imagefixed (IntPtr bytes, uint len, uint frames);
+
+		[DllImport ("libmistelix")]
+		static extern void mistelix_slideshow_add_audio (string filename);
+
+		[DllImport ("libmistelix")]
+		static extern uint mistelix_get_codecs_count ();
+
+		[DllImport ("libmistelix")]
+		static extern IntPtr mistelix_get_codecs (IntPtr [] codecs);
+
+		[DllImport ("libmistelix")]
+		static extern void mistelix_slideshow_close ();
+
+		[DllImport ("libmistelix")]
+		static extern void mistelix_launchtool (string app, string args, string in_file, string out_file, string err_file);
+
+		[DllImport ("libmistelix")]
+		static extern int mistelix_media_supported (string file, StringBuilder media);
+
+		[DllImport ("libmistelix")]	
+		static extern int mistelix_convert_media (string filein, string fileout);
+
+		[DllImport ("libmistelix")]	
+		static extern void mistelix_thumbnail_video (string filein, string fileout, int width, int height);
+
+
+		public MistelixLib ()
+		{
+		}
+
+		static public bool IsMediaSupported (string file, out string msg)
+		{
+			int r;
+			StringBuilder rslt = new StringBuilder (2048);
+
+			r = mistelix_media_supported (file, rslt);
+			Logger.Debug ("MistelixLib.IsMediaSupported for {0} is {1}", file, r);
+
+			switch (r) {
+			case 0: // Format supported
+				msg = string.Empty;
+				return true;
+			case 1: // Could not identify media
+				msg = String.Format (Catalog.GetString ("Could not identify media type for file '{0}'"), file);
+				return false;
+			case 2: // Format not supported 
+				msg = String.Format (Catalog.GetString ("The file '{0}' is encoded in an unsupported format"), file);
+				return false;
+			case 3: // Supported media but codec not found + codec name
+				msg = String.Format (Catalog.GetString ("The file '{0}' is encoded in a recognised format. However, you are missing the GStreamer plug-in '{1}' to decode it."), file, rslt);
+				return false;
+			default:
+				throw new Exception ("Unexpected result");
+			}
+		}
+	
+		static public bool ConvertMedia (string filein, string fileout)
+		{
+			int rslt = mistelix_convert_media (filein, fileout);
+
+			if (rslt == 0)
+				return true;
+			
+			return false;
+		}
+
+		static public void LaunchTool (string app, string args, string in_file, string out_file, string err_file)
+		{
+			mistelix_launchtool (app, args, in_file, out_file, err_file);
+		}
+
+		public int SlideShowCreateStream (string filename, ProjectType type, uint weight, uint height, uint framessec, uint totalframes)
+		{
+			return mistelix_slideshow_createstream (filename, (uint) type, weight, height, framessec, totalframes);
+		}
+		
+		public int SlideShowAddImage (SlideImage image)
+		{
+			IntPtr pixels = IntPtr.Zero;
+			int rslt = -1;
+
+			try
+			{
+				if (image.channels != 3)
+					throw new InvalidOperationException (String.Format ("mistelixvideosrc expects images in 24 bits (3 channels) not {0}", image.channels));
+
+				pixels = Marshal.AllocHGlobal (image.Pixels.Length);
+				Marshal.Copy (image.Pixels, 0, pixels, image.Pixels.Length);
+
+				rslt = mistelix_slideshow_add_image (pixels, (uint) image.Pixels.Length);
+				return rslt;
+			}
+
+			finally
+			{
+			 	Marshal.FreeHGlobal (pixels);
+			}
+		}
+
+		public int SlideShowAddImageFixed (SlideImage image, uint frames)
+		{
+			IntPtr pixels = IntPtr.Zero;
+			int rslt = -1;
+
+			try
+			{
+				if (image.channels != 3)
+					throw new InvalidOperationException (String.Format ("mistelixvideosrc expects images in 24 bits (3 channels) not {0}", image.channels));
+
+				pixels = Marshal.AllocHGlobal (image.Pixels.Length);
+				Marshal.Copy (image.Pixels, 0, pixels, image.Pixels.Length);
+	
+				rslt = mistelix_slideshow_add_imagefixed (pixels, (uint) image.Pixels.Length, frames);
+				return rslt;
+			}
+
+			finally
+			{
+			 	Marshal.FreeHGlobal (pixels);
+			}
+		}
+
+		public void SlideShowAddAudio (string file)
+		{
+			try
+			{
+				mistelix_slideshow_add_audio (file);
+			}
+
+			finally
+			{
+
+			}
+		}
+
+		static public List <string> GetCodecs ()
+		{
+			uint count;
+			IntPtr[] list;
+			string codec;
+			List <string> codecs = new List <string> ();
+
+			count = mistelix_get_codecs_count ();
+			Logger.Debug ("Gstreamer pluggins: {0}", count);
+			list = new IntPtr [count];
+			mistelix_get_codecs (list);
+
+			for (int i = 0; i < count; i++)
+			{
+				codec = Marshal.PtrToStringAuto (list[i]);
+				codecs.Add (codec);
+				Marshal.FreeHGlobal (list[i]);
+				//Logger.Debug ("Gstreamer pluggin {0}", codec);
+			}
+			return codecs;
+		}
+
+		public void SlideShowClose ()
+		{
+			mistelix_slideshow_close ();
+		}
+
+		static public Gdk.Pixbuf CreateThumbnail (string file, int width, int height)
+		{
+			string thumbnail_file = Path.Combine (Path.GetTempPath (), Path.GetTempFileName ());
+			Gdk.Pixbuf thumbnail;
+
+			Logger.Debug ("Mistelix.Lib.CreateThumbnail -> For file {0}", file); 
+
+			// Request a thumbnail honoring the original aspect ratio
+			mistelix_thumbnail_video (file, thumbnail_file, width, -1);
+			thumbnail = new Gdk.Pixbuf (thumbnail_file);
+		
+			// We use videoscale gstreamer element to resize videos honouring the aspect ratio
+			// however, does not work for all video types, then we do request a non-aspect ratio video
+			if (thumbnail.Width > width ||  thumbnail.Height >  height) 
+			{
+				thumbnail.Dispose ();
+				mistelix_thumbnail_video (file, thumbnail_file, width, height);
+				thumbnail = new Gdk.Pixbuf (thumbnail_file);
+			}
+			File.Delete (thumbnail_file);
+			return thumbnail;
+		}
+	}
+}

Added: trunk/src/core/NoneTransition.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/NoneTransition.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,65 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mistelix.DataModel;
+using Mono.Unix;
+
+// Default built-in transition
+namespace Mistelix.Transitions
+{
+	// This transition does nothing
+	public class None: ITransition
+	{
+		public string DisplayName {
+			get { return (Catalog.GetString ("<None>")); }
+		}
+
+		public string Name {
+			get { return ("none"); }
+		}
+
+		public SlideImage[] Effect (SlideImage o, SlideImage trg, int frames_per_sec, int sec)
+		{
+			int frames = frames_per_sec * sec;
+			SlideImage [] images = new SlideImage [frames];
+			SlideImage org = o;
+
+			for (int f = 0; f < frames - 1; f++)
+			{
+				images[f] = new SlideImage ();
+				images[f].CopyProperties (org);
+				images[f].Pixels = new byte [org.stride * org.height];	
+				Array.Copy (org.Pixels, images[f].Pixels, org.stride * org.height);
+			}
+
+			images[frames - 1] = new SlideImage ();
+			images[frames - 1].CopyProperties (org);
+			images[frames - 1].Pixels = new byte [org.stride * org.height];
+			Array.Copy (trg.Pixels, images[frames - 1].Pixels, trg.stride * trg.height);
+
+			return images;
+		}
+	}
+}
+

Added: trunk/src/core/Preferences.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/Preferences.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,264 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml;
+using System.Xml.Serialization;
+using System.Text;
+
+using Mistelix.DataModel;
+
+namespace Mistelix.Core
+{
+	public class Preferences
+	{
+		string file, config_path;
+		SerializableDictionary <string, string > properties;
+		const string element_item = "item";
+		const string element_key = "key";
+		const string element_value = "value";
+		const string element_collection = "collection";
+
+		public const string ProjectsDirectoryKey = "ProjectsDirectory";
+		public const string ImagesDirectoryKey = "ImagesDirectory";
+		public const string VideosDirectoryKey = "VideosDirectory";
+		public const string AudioDirectoryKey = "AudioDirectory";
+		public const string DefaultTransitionKey = "DefaultTransition";
+		public const string DefaultTextPositionKey = "DefaultTextPosition";
+		public const string DefaultDurationKey = "DefaultDuration";
+		public const string ThumbnailSizeKey = "ThumbnailSize";
+		public const string SafeAreaKey = "SafeArea";
+
+		public const string MainWindowMaximizedKey = "MainWindowMaximizedKey";
+		public const string MainWindowX = "MainWindowX";
+		public const string MainWindowY = "MainWindowY";
+		public const string MainWindowWidth = "MainWindowWidth";
+		public const string MainWindowHeight = "MainWindowHeight";
+
+	    	public class SerializableDictionary <TKey, TValue> : Dictionary <TKey, TValue>, IXmlSerializable
+		{
+			public System.Xml.Schema.XmlSchema GetSchema ()
+			{
+				return null;
+			}
+
+			public void ReadXml (System.Xml.XmlReader reader)
+			{
+				XmlSerializer key_serializer = new XmlSerializer (typeof (TKey));
+				XmlSerializer value_serializer = new XmlSerializer (typeof (TValue));
+		 		bool wasEmpty = reader.IsEmptyElement;
+
+			    	reader.Read ();
+
+				if (wasEmpty)
+					return;
+
+				reader.ReadStartElement (element_collection);
+				while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
+				{
+					reader.ReadStartElement (element_item);
+
+					reader.ReadStartElement (element_key);
+					TKey key = (TKey) key_serializer.Deserialize (reader);
+					reader.ReadEndElement ();
+
+					reader.ReadStartElement (element_value);
+					TValue value = (TValue) value_serializer.Deserialize (reader);
+					reader.ReadEndElement ();
+
+					this[key] = value; // already created in DefaultValues
+					reader.ReadEndElement ();
+
+					reader.MoveToContent ();
+				}
+				reader.ReadEndElement ();
+			}
+
+			public void WriteXml (System.Xml.XmlWriter writer)
+			{
+				XmlSerializer key_serializer = new XmlSerializer (typeof (TKey));
+				XmlSerializer value_serializer = new XmlSerializer (typeof (TValue));
+
+				writer.WriteStartElement (element_collection);
+				foreach (TKey key in this.Keys)
+				{
+					writer.WriteStartElement (element_item);
+					writer.WriteStartElement (element_key);
+
+					key_serializer.Serialize (writer, key);
+					writer.WriteEndElement ();
+					writer.WriteStartElement (element_value);
+
+					TValue value = this[key];
+					value_serializer.Serialize (writer, value);
+					writer.WriteEndElement ();
+					writer.WriteEndElement ();
+				}
+				writer.WriteEndElement ();
+			}
+	    	}
+
+		public Preferences ()
+		{
+			properties = new SerializableDictionary <string, string> ();
+			config_path = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
+			config_path = Path.Combine (config_path, Defines.APPNAME_LOWER);
+			file = Path.Combine (config_path, Defines.PREFERENCES_FILE);
+			Load ();
+		}
+
+		public void Save ()
+		{
+			try {
+				if (!Directory.Exists (config_path))
+					Directory.CreateDirectory (config_path);
+
+				XmlTextWriter writer = new XmlTextWriter (file, Encoding.UTF8);
+				writer.Formatting = Formatting.Indented;
+
+				properties.WriteXml (writer);
+				writer.Close ();
+			}		
+			catch (Exception e)
+			{
+				Logger.Error (String.Format ("Error loading saving {0}", e.Message));
+			}
+		}
+	
+		public int GetIntValue (string key)
+		{
+			return Int32.Parse (properties [key]);
+		}
+
+		public bool GetBoolValue (string key)
+		{
+			return Boolean.Parse (properties [key]);
+		}
+
+		public string GetStringValue (string key)
+		{
+			return  properties [key];
+		}
+
+		public void SetIntValue (string key, int value)
+		{
+			properties[key] = value.ToString ();
+		}
+
+		public void SetBoolValue (string key, bool value)
+		{
+			properties [key] = value.ToString ();
+		}
+
+		public void SetStringValue (string key, string value)
+		{
+			properties[key] = value;
+		}
+
+		void LoadDefaultValues ()
+		{
+			properties.Add (ProjectsDirectoryKey,
+				Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), Defines.APPNAME_LOWER));
+
+			properties.Add (ImagesDirectoryKey,
+				Environment.GetFolderPath (Environment.SpecialFolder.MyPictures));
+
+			properties.Add (VideosDirectoryKey,
+				GetDefaultVideoDirectory ());
+
+			properties.Add (AudioDirectoryKey,
+				Environment.GetFolderPath (Environment.SpecialFolder.MyMusic));
+
+			properties.Add (DefaultTextPositionKey, ((int)TextPosition.Bottom).ToString ());
+			properties.Add (DefaultTransitionKey, TransitionManager.None.Name);
+			properties.Add (ThumbnailSizeKey, "1" /* Medium */);
+			properties.Add (DefaultDurationKey, "3");
+			properties.Add (SafeAreaKey, false.ToString ());
+
+			properties.Add (MainWindowMaximizedKey, true.ToString ());
+
+			properties.Add (MainWindowX, "-1");
+			properties.Add (MainWindowY, "-1");
+			properties.Add (MainWindowWidth, "-1");
+			properties.Add (MainWindowHeight, "-1");
+		}
+
+		void Load ()
+		{
+			try {
+				LoadDefaultValues ();
+				XmlTextReader reader = new XmlTextReader (file);
+				properties.ReadXml (reader);
+				reader.Close ();
+			}
+			catch (Exception e)
+			{
+				Logger.Error (String.Format ("Error loading preferences {0}", e.Message));
+			}
+		}
+
+		// There is no SpecialFolder support for videos. We have to read the xdg configuration directly
+		static string GetDefaultVideoDirectory ()
+		{
+			string directory = null, line;
+			const string home = "$HOME/";
+			const string key = "XDG_VIDEOS_DIR";
+			string home_dir = Environment.GetEnvironmentVariable ("HOME");
+			string config_file;
+			string home_value;
+
+			try {
+				config_file = Path.Combine (home_dir, ".config/user-dirs.dirs");
+
+				using (StreamReader reader = new StreamReader (config_file))
+				{
+					while ((line = reader.ReadLine ()) != null) 
+					{
+						line = line.Trim ();
+						int pos = line.IndexOf ('=');
+				                if (pos > 8 && line.Substring (0, pos) == key) {
+							string path = line.Substring (pos + 1).Trim ('"');
+							bool relative = false;
+
+							if (path.StartsWith (home)) {
+								relative = true;
+								path = path.Substring (home.Length);
+							} else if (!path.StartsWith ("/"))
+								relative = true;
+
+			                    		directory = relative ? Path.Combine (home_dir, path) : path;
+							break;
+						}
+		                	}
+				}
+			}
+			catch (FileNotFoundException) { }
+
+			if (directory == null)
+				return Environment.GetFolderPath (Environment.SpecialFolder.Personal);
+			else
+				return directory;
+		}
+	}
+}

Added: trunk/src/core/SlideImage.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/SlideImage.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,280 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Text;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Xml.Serialization;
+using Gdk;
+using Pango;
+
+using Mistelix.Core;
+using Mistelix.Widgets;
+
+namespace Mistelix.DataModel
+{
+	//
+	// Describes an image that is part of a slideshow 
+	//
+	public class SlideImage : SlideShowProjectElement.Image
+    	{
+		[XmlIgnoreAttribute] public int width, height, stride, channels = 3;
+		[XmlIgnoreAttribute] public bool alpha = false;
+		[XmlIgnoreAttribute] byte[] pixels = null;
+		[XmlIgnoreAttribute] Project project;
+
+		public SlideImage ()
+		{
+			transition = 2; // Transition from slide to slide (effect duration)
+			time = Mistelix.Preferences.GetIntValue (Preferences.DefaultDurationKey);
+			effect = Mistelix.Preferences.GetStringValue (Preferences.DefaultTransitionKey);
+			position = (TextPosition) Mistelix.Preferences.GetIntValue (Preferences.DefaultTextPositionKey);
+		}
+
+		public SlideImage (string image) : this ()
+		{
+			this.image = image;
+		}
+
+		public SlideImage (string image, string title, int time, string effect) : this ()
+		{
+			if (effect == null)
+				throw new ArgumentNullException ("effect cannot be null");
+		
+			this.image = image;
+			this.title = title;
+			this.time = time;
+			this.effect = effect;
+		}
+		
+		// Used only for previewing the transition effect
+		public SlideImage (Cairo.ImageSurface img)
+		{
+			if (img.Format != Cairo.Format.Argb32)
+				throw new InvalidOperationException (String.Format ("SlideImage.SlideImage: unsupported format {0}", img.Format));
+
+			width = img.Width;
+			height = img.Height;
+			stride = img.Stride;
+			channels = 4;
+			alpha = true;
+			pixels = img.Data;
+		}
+		
+		// mistelixvideosrc expects images in 24 bits (3 channels)
+		public void FromImage (PixbufImageSurface img)
+		{
+			if (img.Format != Cairo.Format.Argb32 && img.Format != Cairo.Format.Rgb24)
+				throw new InvalidOperationException (String.Format ("SlideImage.FromCairo: unsupported format {0}", img.Format));
+
+			width = img.Width;
+			height = img.Height;
+			stride = img.Width * 3;
+			channels = 3;
+			alpha = false;
+			pixels = img.Get24bitsPixBuf ();
+		}
+		
+		void LoadPixBuffer (Gdk.Pixbuf buf)
+		{
+			int len;
+
+			width = buf.Width;
+			height = buf.Height;
+			stride = buf.Rowstride;
+			channels = buf.NChannels;
+			alpha = buf.HasAlpha;
+			len = stride * height;
+
+			pixels = new byte [len];
+			Marshal.Copy (buf.Pixels, pixels, 0, len);
+		}
+
+		[System.Xml.Serialization.XmlIgnoreAttribute]
+		public byte[] Pixels {
+			get {
+				if (pixels == null)
+					LoadImageFromFile ();
+
+				return pixels;
+			}
+			set {
+				pixels = value;
+			}
+		}
+
+		[System.Xml.Serialization.XmlIgnoreAttribute]
+		public Project Project {
+			set { project = value; }
+		}
+
+		// The list of images for a slideshow is kept on a list
+		// When generating the slideshow the pixels are allocated, however they are only 
+		// needed during the slideshow generation. Releasing the pixels helps to GC 
+		// to free the memory used
+		public void ReleasePixels ()
+		{
+			pixels = null;
+		}
+
+		void DrawImageLegend (Cairo.Context cr, string title, int x, int y, int width, int height)
+		{
+			const int marginx = 50; // Distance of the coloured box from the x margins (in safe area)
+			const int marginy = 50; // Distance of the coloured box from the y margins (in safe area)
+			const int textoffset_x = 5; // Offset were the text is drawn
+			const int textoffset_y = 5; // Offset were the text is drawn
+			int box_x, box_y, box_w, box_h;
+			int w, h;
+			int max_width;
+
+			if (title == null)
+				return;
+
+			using (Pango.Layout layout = Pango.CairoHelper.CreateLayout (cr))
+			{
+				layout.SingleParagraphMode = false;
+				max_width = width - ((marginx + textoffset_x) * 2);
+				layout.Width = (int) (max_width * Pango.Scale.PangoScale);
+				layout.FontDescription = FontDescription.FromString (project.Details.SlideshowsFontName);
+				layout.SetText (title);
+				layout.GetPixelSize (out w, out h);
+				w = w + textoffset_x * 2;
+
+				box_x = x + ((width - (marginx * 2) - w) /2);
+				box_x += marginx;
+				box_w = w;
+				box_h = y + h + textoffset_y * 2;
+
+				switch (position) {
+				case TextPosition.Top:
+					box_y = marginy;
+					break;
+				case TextPosition.Bottom:
+				default:
+					box_y = height - marginy - h;
+					break;					
+				}
+
+				// Background
+				cr.Color = project.Details.SlideshowsBackColor;
+				cr.Rectangle (box_x, box_y, box_w, box_h);
+				cr.Fill ();
+				cr.Stroke ();
+
+				cr.MoveTo (box_x + textoffset_x, box_y + textoffset_y);
+				cr.Color = project.Details.SlideshowsForeColor;
+				Pango.CairoHelper.ShowLayout (cr, layout);
+			}
+		}
+
+		void LoadImageFromFile ()
+		{
+			if (time == 0)
+				time = 3;
+
+			if (project == null)
+				throw new InvalidOperationException (String.Format ("SlideImage.CreateImage: need project defined (image {0})", image));
+
+			if (image == null)
+				throw new InvalidOperationException (String.Format ("SlideImage.CreateImage: no filename defined for image"));
+
+			Logger.Debug ("SlideImage.CreateImage {0}", image);
+
+			int max_w = project.Details.Width;    // max target width 
+			int max_h = project.Details.Height;   // max target height
+			double target_ratio = (double) max_w / (double) max_h;  // aspect ratio target 
+			int offset_x, offset_y, w, h;
+			double scale, original_ratio, corrected_ratio;
+			Gdk.Pixbuf raw_image, processed_image;
+
+			raw_image = new Gdk.Pixbuf (image);
+			processed_image = new Gdk.Pixbuf (Colorspace.Rgb, false, 8, max_w, max_h);
+			processed_image.Fill (0x00000000);
+
+			original_ratio = (double) raw_image.Width / (double) raw_image.Height;
+
+			// Image is larger that target resolution, we need to rescale
+			if (raw_image.Width > max_w || raw_image.Height > max_h) {
+				if (original_ratio < 1) { // If X is properly scaled (the smaller), Y will be too
+					if (original_ratio > target_ratio)
+						corrected_ratio = target_ratio / original_ratio;
+					else 
+						corrected_ratio = original_ratio / target_ratio;
+
+					scale = (double) max_w / (double) raw_image.Width;
+					h = (int) ((double) raw_image.Width * scale / original_ratio * corrected_ratio);
+					w = (int) ((double) raw_image.Width * scale * corrected_ratio);
+				} else {  // If Y is properly scaled (the smaller), X will be too (used path for NTSC and PAL resolutions)
+					if (original_ratio > target_ratio)
+						corrected_ratio = target_ratio / original_ratio;
+					else 
+						corrected_ratio = original_ratio / target_ratio;
+
+					scale = (double) max_h / (double) raw_image.Height;
+					h = (int) ((double) raw_image.Width * scale / original_ratio * corrected_ratio);
+					w = (int) ((double) raw_image.Width * scale * corrected_ratio);
+				}
+			} else { // No need to scale
+				w = raw_image.Width;
+				h = raw_image.Height;
+			}
+
+			if (w < max_w)
+				offset_x = (max_w -w) / 2;
+			else
+				offset_x = 0;
+
+			if (h < max_h)
+				offset_y = (max_h - h) / 2;
+			else
+				offset_y = 0;
+
+			raw_image.Scale (processed_image, offset_x, offset_y, w, h, offset_x, offset_y, (double) w / (double) raw_image.Width, (double)h /(double) raw_image.Height, InterpType.Hyper);
+
+			if (title != string.Empty) {
+				PixbufImageSurface pix = new PixbufImageSurface (processed_image);
+				Cairo.Context gr = new Cairo.Context (pix);
+				DrawImageLegend (gr, title, offset_x, offset_y,  w, h);
+				FromImage (pix);
+				((IDisposable)gr).Dispose ();
+				((IDisposable)pix).Dispose ();
+			} else
+				LoadPixBuffer (processed_image);
+
+			raw_image.Dispose ();
+			processed_image.Dispose ();
+		}
+
+		public void CopyProperties (SlideImage src)
+		{
+			// TODO: Missing SlideImage properties
+			width = src.width;
+			height = src.height;
+			stride = src.stride;
+			alpha = src.alpha;
+			channels = src.channels;
+		}
+	}
+}

Added: trunk/src/core/SlideShow.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/SlideShow.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,118 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+using Mistelix.Transitions;
+using Mistelix.Core;
+using Mistelix.DataModel;
+
+namespace Mistelix.Core
+{
+	//
+	// Container for a slideshow and all its images
+	//
+	public class SlideShow : SlideShowProjectElement
+	{
+		public SlideShow ()
+		{	
+
+		}
+
+		public string Generate (Project project, ProgressEventHandler progress)
+		{
+			SlideImage[] images_transition;
+			MistelixLib lib = new MistelixLib ();
+			int total_frames = 0;
+			int frames_sec = project.Details.FramesPerSecond;
+			ProgressEventArgs args = new ProgressEventArgs ();
+	
+			for (int i = 0; i < images.Count - 1; i++) 
+			{
+				total_frames += (frames_sec * images[i].time) + (images[i].transition * frames_sec);
+				((SlideImage) images[i]).Project = project;
+			}
+
+			((SlideImage) images[images.Count - 1]).Project = project;
+			total_frames += frames_sec * images[images.Count - 1].time;
+			args.Total = images.Count;
+
+			Logger.Debug ("SlideShow.GenerateMPEG -> Generating MPEG for " + images.Count + " images " + "total frames " + total_frames + " at " + filename);
+			
+			string outfile;
+			
+			if (filename == null)
+				outfile = GetOutputFile (project.Details.Type);
+			else
+				outfile = filename;
+			
+			lib.SlideShowCreateStream (project.FileToFullPath (outfile), project.Details.Type,
+				(uint) project.Details.Width, (uint) project.Details.Height, (uint) frames_sec, (uint) total_frames);
+
+			if (audiofile != null) {
+				Logger.Debug ("SlideShow.GenerateMPEG -> audiofile {0}", audiofile);
+				lib.SlideShowAddAudio (audiofile);
+			}
+
+			// TODO: Select the transition for the slide
+			ITransition transition;
+			Logger.Debug ("SlideShow.GenerateMPEG ->Images.Count {0}", images.Count);
+			
+			for (int i = 0;  i < images.Count - 1; i++) {
+
+				if (progress != null) {
+					args.Progress = args.Progress + 1;
+					progress (this, args);
+				}
+
+				Logger.Debug ("SlideShow.GenerateMPEG ->Send Fixed image {0}, time {1} (frames)", i, (uint) (frames_sec * images[i].time));
+
+				transition = TransitionManager.FromName (images[i].effect);
+				lib.SlideShowAddImageFixed (((SlideImage)images[i]), (uint) (frames_sec * images[i].time));
+		
+				// Transition between two images
+				Logger.Debug ("SlideShow.GenerateMPEG ->Generate transition for frames_sec {0} and time {1}", frames_sec, images[i].transition);
+				images_transition = transition.Effect (((SlideImage)images[i]), ((SlideImage)images[i + 1]), frames_sec, images[i].transition);
+				for (int j = 0; j < images_transition.Length; j++) {
+					Logger.Debug ("   Sending subimage {0}", j);
+					lib.SlideShowAddImage (images_transition [j]);
+				}
+				((SlideImage) images[i]).ReleasePixels ();
+			}
+
+			Logger.Debug ("SlideShow.GenerateMPEG ->Send Fixed image time {0} (frames)", (uint) (frames_sec * images[images.Count -1].time));
+			lib.SlideShowAddImageFixed (((SlideImage)images[images.Count - 1]), (uint) (frames_sec * images[images.Count -1].time));
+	
+			if (progress != null) {
+				args.Progress = args.Progress + 1;
+				progress (this, args);
+			}
+
+			// This a blocking call. It does not return until the pipeline sends and EOS
+			lib.SlideShowClose ();
+			Logger.Debug ("SlideShow.GenerateMPEG->Finished generation");
+			return project.FileToFullPath (outfile);
+		}			
+	}
+}
+

Added: trunk/src/core/SvgImage.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/SvgImage.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,139 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Unix;
+using System.IO;
+using System.Runtime.InteropServices;
+
+//
+// SVG image class based on rsvg library
+//
+public class SvgImage : IDisposable
+{
+	//lib rsvg2
+	[DllImport("rsvg-2")]
+	static extern void rsvg_handle_render_cairo (IntPtr Rsvghandle, IntPtr cairo_t);
+
+	[DllImport("rsvg-2")]
+	static extern IntPtr rsvg_handle_new_from_file (string file_name, out int error);
+
+	[DllImport("rsvg-2")]
+	static extern void rsvg_handle_free (IntPtr handle);
+
+	[DllImport("rsvg-2")]
+	static extern void rsvg_handle_get_dimensions (IntPtr handle, ref RsvgDimensionData dimension);
+
+	[DllImport("rsvg-2")]
+	static extern IntPtr rsvg_handle_new_from_data (byte[] data, int len, out int error);
+
+	[StructLayout(LayoutKind.Sequential)]
+	struct RsvgDimensionData
+	{
+	    	public int width;
+	    	public int height;
+	    	public double em;
+		public double ex;
+	}
+
+	RsvgDimensionData dimension;
+	IntPtr handle;
+
+	public SvgImage (System.Reflection.Assembly _assembly, string resource)
+	{
+		try {
+			byte[] array;
+			Stream stream;
+			int error = 0;
+
+			stream =  _assembly.GetManifestResourceStream (resource);
+			array = new byte [stream.Length];
+
+			stream.Read (array, 0, (int) stream.Length);
+			
+			handle = rsvg_handle_new_from_data (array, array.Length, out error);
+			rsvg_handle_get_dimensions (handle, ref dimension);
+		} 
+		finally
+		{
+			if (handle == IntPtr.Zero)
+				throw new System.IO.IOException ("Resource not found: " + resource);
+		}
+	}
+	
+	public SvgImage (string file)
+	{
+		int error = 0;
+		dimension = new RsvgDimensionData ();
+
+		try {
+			handle = rsvg_handle_new_from_file (file, out error);
+
+			if (handle != IntPtr.Zero)		
+				rsvg_handle_get_dimensions (handle, ref dimension);
+
+		}
+
+		finally
+		{
+			if (handle == IntPtr.Zero)
+				throw new System.IO.IOException ("File not found: " + file);
+
+		}
+	}
+
+	public int Width {
+		get { return dimension.width; }
+	}
+	
+	public int Height {
+		get { return dimension.height; }
+	}
+
+	~SvgImage ()
+	{
+		Dispose (false);
+	}
+
+	public void Dispose ()
+	{
+		Dispose (true);
+		System.GC.SuppressFinalize (this);
+	}
+
+	protected virtual void Dispose (bool disposing)
+	{
+		if (handle == IntPtr.Zero)
+			return;
+
+		rsvg_handle_free (handle);
+		handle = IntPtr.Zero;
+	}
+
+	public void RenderToCairo (IntPtr cairo_surface)
+	{
+		if (handle != IntPtr.Zero)
+			rsvg_handle_render_cairo (handle, cairo_surface);
+	}
+}
+

Added: trunk/src/core/ThemeManager.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/ThemeManager.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,76 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Addins;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Core
+{
+	// Manages all the available themes
+	public static class ThemeManager
+	{
+		static Theme [] themes;
+		static ThemeManager ()
+		{
+			Load ();
+		}
+
+		static public Theme[] List {
+			get {
+				return themes;
+			}
+		}
+
+		static public Theme FromName (string val) 
+		{
+			foreach (Theme theme in themes)
+			{
+				if (theme.Name.Equals (val))
+					return theme;
+			}
+
+			throw new ArgumentException ("ThemeManager.FromName: Name not found");
+		}
+
+		public static void Load ()
+		{
+			XmlStorage ps = new XmlStorage ();
+			ps.Load (Path.Combine (Defines.DATA_DIR, Defines.THEMES_FILE));
+			ps.Get (ref themes);
+		}
+	
+		public static void Save ()
+		{
+			XmlStorage ps = new XmlStorage ();
+			ps.New ("ThemeConfiguration");
+			ps.Add (themes);
+			ps.Save (Path.Combine (Defines.DATA_DIR, Defines.THEMES_FILE));
+		}
+	}
+}

Added: trunk/src/core/TheoraProjectBuilder.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/TheoraProjectBuilder.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,111 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using Mono.Unix;
+using System.IO;
+using System.Threading;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+using Mistelix.Backends;
+using Mistelix.Dialogs;
+
+namespace Mistelix.Core
+{
+	// Builds the OGG outputs
+	public class ProjectBuilderTheora: ProjectBuilder
+	{
+		public ProjectBuilderTheora (Project project, ProgressEventHandler total_handler, ProgressEventHandler task_handler)
+			: base (project, total_handler, task_handler)
+		{
+
+		}
+
+		public override void Create ()
+		{
+			DateTime start_time = DateTime.Now;
+			List <ProjectElement> elements = project.ElementsGenerate;
+			ProgressEventArgs progress = new ProgressEventArgs ();
+			ProgressEventArgs text = new ProgressEventArgs ();
+			int tasks = 0;
+
+			text.Text = Catalog.GetString ("Project building process started") + "\n";
+			total_handler (this, text);
+
+			try {
+				EnsureOutputDir (project.Details.OutputDir);
+			} 
+			catch (Exception e) {
+				text.Text = String.Format (Catalog.GetString ("Error creating output directory '{0}'") + "\n", e.Message);
+				total_handler (this, text);				
+				return;
+			}
+
+			// Count all the task to do
+			for (int i = 0; i < elements.Count; i++)
+			{
+				if (typeof (SlideShow) != elements[i].GetType ())
+					continue;
+	
+				tasks += ((SlideShow) elements[i]).images.Count;
+			}
+
+			total.Total = tasks;
+			total.Progress = 0;
+		
+			// Generate all the slideshows
+			SlideShow slideshow;			
+			for (int i = 0; i < elements.Count; i++)
+			{				
+				if (typeof (SlideShow) != elements[i].GetType ())
+					continue;
+
+				slideshow = (SlideShow) elements[i];
+				Logger.Debug ("ProjectBuilderTheora.Create -> Generating slide " + slideshow.Name);
+				Logger.Debug ("ProjectBuilderTheora.Create completed");
+
+				text.Text = String.Format (Catalog.GetString ("Generating slideshow '{0}'"), slideshow.Name) + "\n";
+				total_handler (this, text);
+
+				slideshow.Generate (project, OnProgressTaskLocal);	
+			}
+
+			TimeSpan time = DateTime.Now - start_time;
+			total.Text = Catalog.GetString (String.Format ("Completed. Time used: {0}", TimeSpanToStr (time))) + "\n";
+			total_handler (this, total);
+			Logger.Debug ("ProjectBuilderTheora.Create thread finished");
+		}
+
+		// Local progress tracking that fires two separate events
+		public void OnProgressTaskLocal (object sender, ProgressEventArgs e)
+		{	
+			task_handler (sender, e);
+			total.Progress = total.Progress + 1;
+			total_handler (this, total);
+		}
+	}
+}

Added: trunk/src/core/ThumbnailSizeManager.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/ThumbnailSizeManager.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,57 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Unix;
+
+using Mistelix.DataModel;
+
+namespace Mistelix.Core
+{
+	// Manages all thumbnails sizes
+	public static class ThumbnailSizeManager
+	{
+		static ThumbnailSize[] sizes;
+		static ThumbnailSizeManager ()
+		{
+			sizes = new ThumbnailSize [4];
+			sizes[0] = new ThumbnailSize (Catalog.GetString ("Small (64x64 pixels)"), 64, 64);
+			sizes[1] = new ThumbnailSize (Catalog.GetString ("Medium (96x96 pixels)"), 96, 96);
+			sizes[2] = new ThumbnailSize (Catalog.GetString ("Large (128x128 pixels)"), 128, 128);
+			sizes[3] = new ThumbnailSize (Catalog.GetString ("Very Large (192x192 pixels)"), 192, 192);
+		}
+
+		static public ThumbnailSize[] List {
+			get {
+				return sizes;
+			}
+		}
+
+		static public ThumbnailSize Current {
+			get {
+				int thumbnail = Mistelix.Preferences.GetIntValue (Preferences.ThumbnailSizeKey);
+				return sizes [thumbnail];
+			}
+		} 
+	}
+}

Added: trunk/src/core/TransitionManager.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/TransitionManager.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,76 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Addins;
+using Mistelix.Transitions;
+
+namespace Mistelix.Core
+{
+	// Manages all the available transitions
+	public static class TransitionManager
+	{
+		static None none;
+		static TransitionManager ()
+		{
+		}
+
+		static public ITransition None {
+			get {
+				if (none == null)
+					none = new None ();
+
+				return none;
+			}
+		}
+
+		// Get default none transition + the ones provides by pluggins
+		static public ITransition[] List {
+			get {
+				ITransition[] transitions;
+				int pos = 0;
+				ExtensionNodeList addins = AddinManager.GetExtensionNodes ("/Mistelix/SlideTransitions");
+				transitions = new ITransition [addins.Count + 1];
+	
+				transitions[pos++] = new None ();
+
+				foreach (TypeExtensionNode node in addins) {
+					transitions[pos++] =  (ITransition) node.CreateInstance ();
+				}
+
+				return transitions;
+			}
+		}
+
+		static public ITransition FromName (string val) 
+		{
+			foreach (ITransition transition in List)
+			{
+				if (transition.Name.Equals (val))
+					return transition;
+			}
+			Logger.Debug (String.Format ("TransitionManager.FromName -> transition {0} not found", val));
+			return None;
+		}
+	}
+}

Added: trunk/src/core/Video.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/Video.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,67 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gdk;
+using Mono.Addins;
+using System.Collections.Generic;
+
+using Mistelix.Transitions;
+using Mistelix.DataModel;
+using Mistelix.Widgets;
+
+namespace Mistelix.Core
+{
+	public class Video : VideoProjectElement
+	{
+		public Video ()
+		{
+		}
+
+		public Video (string filename) : base (filename)
+		{
+
+		}
+
+		public bool SupportedFormat (out string msg)
+		{
+			bool rslt;
+
+			rslt = MistelixLib.IsMediaSupported (filename, out msg);
+			Logger.Debug ("Video.SupportedFormat for {0} is {1}", filename, rslt);
+			return rslt;
+		}
+
+		public string Convert (Project project)
+		{
+			bool rslt;
+			string of = GetOutputFile (project.Details.Type);
+			string outfile =  project.FileToFullPath (of);
+
+			Logger.Debug ("Video.Convert for {0} to {1}", filename, outfile);
+			// TODO: If rslt != 0 throw an exception
+			rslt =  MistelixLib.ConvertMedia (filename, outfile);
+			return outfile;
+		}
+	}
+}

Added: trunk/src/core/XmlStorage.cs
==============================================================================
--- (empty file)
+++ trunk/src/core/XmlStorage.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,176 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Xml;
+using System.Xml.Serialization;
+using System.Collections.Generic;
+using System.Collections;
+
+using Mistelix.DataModel;
+
+
+namespace Mistelix.Core
+{
+	//
+	// Creates an XML to serialize objects
+	// 
+	// The XML has the following format
+	//
+	// <?xml version="1.0"?>
+	//  <rootelement>
+	//   <object1> </object1>
+	//   <object2> </object2>
+	//   ...
+	// </rootelement>   
+	//
+	//
+	public class XmlStorage
+	{
+		XmlDocument xml_document;
+
+		public XmlStorage ()
+		{
+			xml_document = new XmlDocument ();
+		}
+
+		public void New (string rootNode)
+		{
+			xml_document.LoadXml ("<" + rootNode + "/>");
+			XmlDeclaration xmldecl = xml_document.CreateXmlDeclaration ("1.0", null, null);
+			XmlElement root = xml_document.DocumentElement;
+			xml_document.InsertBefore (xmldecl, root);
+		}
+
+		public void Load (string file)
+		{
+			try {
+				xml_document.Load (file);
+			}
+			
+			catch (Exception e) {
+				Logger.Error (e.Message);
+			}
+		}
+
+		public void Save (string file)
+		{
+			xml_document.Save (file);
+		}
+
+		// Adds an element from the root document element
+		public void Add <T> (T item)
+		{
+			SetFromNode (item, xml_document.DocumentElement);
+		}
+
+		// Adds an element encapsulated in given node name
+		public void Add <T> (T item, string from_node)
+		{
+			Logger.Debug ("XmlStorage.Saving from node_name {0} {1}", item, from_node);
+			XmlNode new_node = xml_document.CreateElement (from_node);
+			XmlNode root = xml_document.DocumentElement;
+			root.AppendChild (new_node);
+			SetFromNode (item, new_node);
+		}
+
+		// Gets an element from the root document element		
+		public bool Get <T> (ref T item)
+		{
+			XmlNode root;
+			string typename;
+
+			if (xml_document.ChildNodes.Count < 2)
+				return false;
+
+			root = xml_document.ChildNodes [1]; // <root> element
+
+			typename = GetTypeNodeName <T> (item);
+		
+			foreach (XmlNode node in root.ChildNodes) 
+			{
+				if (typename.Equals (node.Name) == false)
+					continue;
+
+				GetFromNode <T> (root, ref item);
+				return true;
+			}
+			return false;
+		}
+	
+		public bool Get <T> (string from_node, ref T item)
+		{
+			XmlNode root;
+
+			Logger.Debug ("XmlStorage.Loading from node {0}", from_node);
+
+			if (xml_document.ChildNodes.Count < 2)
+				return false;
+
+			root = xml_document.ChildNodes [1]; // <root> element
+
+			foreach (XmlNode node in root.ChildNodes) 
+			{
+				if (from_node.Equals (node.Name) == false)
+					continue;
+
+				GetFromNode <T> (node, ref item);
+				return true;
+			}
+			return false;
+		}
+
+		void SetFromNode <T> (T item, XmlNode from_node)
+		{
+			XmlSerializer bf = new XmlSerializer (typeof (T));
+			StringWriter writer = new StringWriter ();
+			bf.Serialize (writer, item);
+			XmlDocumentFragment fragment = xml_document.CreateDocumentFragment ();
+			fragment.InnerXml = writer.ToString ();
+			writer.Close ();
+			from_node.AppendChild (fragment);
+		}
+		
+		// Obtains the node name used to serialize a item
+		string GetTypeNodeName <T> (T item)
+		{
+			XmlSerializer serializer = new XmlSerializer (typeof (T));
+			StringWriter writer = new StringWriter ();
+			serializer.Serialize (writer, item);
+			XmlDocumentFragment fragment = xml_document.CreateDocumentFragment ();
+			fragment.InnerXml = writer.ToString ();
+			writer.Close ();
+			return fragment.ChildNodes[0].Name;
+		}
+
+		bool GetFromNode <T> (XmlNode from_node, ref T item)
+		{
+			XmlSerializer serializer = new XmlSerializer (typeof (T));
+			StringReader reader = new StringReader (from_node.InnerXml);
+			item = (T) serializer.Deserialize (reader);
+			reader.Close ();
+			return true;
+		}
+	}
+}

Added: trunk/src/datamodel/AspectRatio.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/AspectRatio.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,34 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Unix;
+
+namespace Mistelix.DataModel
+{
+	public enum AspectRatio
+	{
+		FourByThree,	// 4x3
+		SixteenByNine,	// 16x9
+	}
+}

Added: trunk/src/datamodel/BackgroundTask.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/BackgroundTask.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,53 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.ComponentModel;
+
+using Mistelix;
+
+
+namespace Mistelix.DataModel
+{
+	// A tasks that 
+	public class BackgroundTask : BackgroundWorker
+	{
+		public BackgroundTask () {}
+
+		virtual public int Priority {
+			get { return 1; }
+		}
+
+        
+		/*public static void ProxyToMain (InvokeHandler handler)
+		{
+			Application.Invoke (handler);
+		}*/
+	}
+	
+}
+
+
+
+

Added: trunk/src/datamodel/BackgroundTaskCollection.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/BackgroundTaskCollection.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,111 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Mistelix.DataModel
+{
+	// A collection of tasks that Mistelix executes when it is idled
+	public class BackgroundTaskCollection : ICollection, IEnumerable
+	{
+		ArrayList list;
+
+		public BackgroundTaskCollection ()
+		{
+			list = new ArrayList ();
+		}
+
+		public int Count {
+			get { return list.Count; }
+		}
+
+		bool ICollection.IsSynchronized {
+			get { return false; }
+		}
+
+		object ICollection.SyncRoot {
+			get { return this; }
+		}
+
+		public BackgroundTask this [int index] {
+			get {return (BackgroundTask) list [index];}
+		}
+
+		public void Add (BackgroundTask item)
+		{
+			int range = list.Count;
+			int middle, cmp;
+			int left = 0;
+			int right = range-1;
+
+			// Adds items always in a sorted order
+			while (left <= right) {
+
+				middle = (left + right) >> 1;
+				cmp = Comparer.Default.Compare (item.Priority,
+					((BackgroundTask) list [middle]).Priority);
+
+				if (cmp == 0) {
+					break;
+				}
+
+				if (cmp >  0) {
+					left = middle + 1;
+				}
+				else {
+					right = middle - 1;
+				}
+			}
+
+			list.Insert (left, item);
+		}
+
+		public void CopyTo (Array array, int index)
+		{
+			list.CopyTo (array, index);
+		}
+
+		public IEnumerator GetEnumerator ()
+		{
+			return list.GetEnumerator ();
+		}
+
+		public BackgroundTask Peek ()
+		{
+			if (Count == 0)
+				return null;
+
+			return (BackgroundTask) list[0];
+		}
+
+		public void Remove (BackgroundTask item)
+		{
+			list.Remove (item);
+		}
+
+	}
+}
+
+

Added: trunk/src/datamodel/ButtonProjectElement.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ButtonProjectElement.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,104 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Xml.Serialization;
+
+using Mistelix.Core;
+
+namespace Mistelix.DataModel
+{
+	public enum ButtonShowAs
+	{
+		Thumbnail,
+		Text
+	}
+
+	// Describes a button within the authoring project
+	[XmlInclude (typeof (Button))]
+	public class ButtonProjectElement : ProjectElement
+	{
+		int x;
+		int y;
+		int width;
+		int height;
+		int linked_id; // Associated slide or video
+		string text;
+		ButtonShowAs showas;
+
+		public ButtonProjectElement ()
+		{
+			width = height = 80;
+			showas = ButtonShowAs.Thumbnail;
+		}
+	
+		public ButtonProjectElement (int x, int y, int linked_id) : this ()
+		{
+			this.x = x;
+			this.y = y;
+			this.linked_id = linked_id;
+		}
+
+		[XmlElementAttribute ("x")]
+		public int X {
+			get { return x;}
+			set { x = value;}
+		}
+
+		[XmlElementAttribute ("y")]
+		public int Y {
+			get { return y;}
+			set { y = value;}
+		}
+
+		[XmlElementAttribute ("width")]
+		public int Width {
+			get { return width;}
+			set { width = value;}
+		}
+
+		[XmlElementAttribute ("height")]
+		public int Height {
+			get { return height;}
+			set { height = value;}
+		}
+
+		[XmlElementAttribute ("linked_id")]
+		public int LinkedId {
+			get { return linked_id;}
+			set { linked_id = value;}
+		}
+
+		[XmlElementAttribute ("showas", DataType="int")]
+		public ButtonShowAs ShowAs {
+			get { return showas;}
+			set { showas = value;}
+		}
+
+		[XmlElementAttribute ("text")]
+		public string Text {
+			get { return text;}
+			set { text = value;}
+		}
+	}
+}

Added: trunk/src/datamodel/ITransition.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ITransition.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,45 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mistelix.DataModel;
+
+namespace Mistelix.Transitions
+{
+	//
+	// Interface that defines transitions between slideshows
+	//
+	public interface ITransition
+	{
+		SlideImage[] Effect (SlideImage o, SlideImage trg, int frames_per_sec, int sec);
+
+		string DisplayName {
+			get;
+		}
+
+		string Name {
+			get;
+		}
+	}
+}
+

Added: trunk/src/datamodel/IntList.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/IntList.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,61 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Text;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Mistelix.DataModel
+{
+	//
+	// Contains a list of ints exchanged during Drag and Drop operations
+	//
+	public class IntList : List <int> 
+    	{
+		public IntList ()
+		{
+
+		}
+
+		public void FromString (string str)
+		{
+			string [] items = str.Split (new string [] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries);
+			for (int i = 0; i < items.Length; i++)	
+				Add (Int32.Parse (items[i]));
+		}
+
+		public override string ToString () 
+		{
+			StringBuilder sb = new StringBuilder (Count * (Marshal.SizeOf (typeof(int)) + 1));
+
+			foreach (int n in this) {
+				sb.Append (n.ToString ());
+				sb.Append (Environment.NewLine);
+			}
+
+			return sb.ToString ();
+		}
+	}
+}

Added: trunk/src/datamodel/ObservableList.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ObservableList.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,91 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.InteropServices;
+
+namespace Mistelix.DataModel
+{
+	// This an ObservableList that fires events when it is modified
+	public class ObservableList <T> : IEnumerable <T>
+	{
+		public virtual event EventHandler CollectionChanged;
+		List <T> list;
+
+		public ObservableList ()
+		{
+			list = new List <T> ();
+		}
+
+		public int Count {
+			get { return list.Count; }
+		}
+
+		public T this [int index] {
+			get { return list [index]; }
+			set { 
+				list [index] = value;
+
+				if (CollectionChanged != null)
+					CollectionChanged (this, EventArgs.Empty);
+			}
+		}
+
+		public void Clear ()
+		{
+			list.Clear ();
+
+			if (CollectionChanged != null)
+				CollectionChanged (this, EventArgs.Empty);
+		}
+
+		public void Add (T item)
+		{
+			list.Add (item);
+
+			if (CollectionChanged != null)
+				CollectionChanged (this, EventArgs.Empty);
+		}
+
+		public void Remove (T item)
+		{
+			list.Remove (item);
+
+			if (CollectionChanged != null)
+				CollectionChanged (this, EventArgs.Empty);
+		}
+
+		IEnumerator <T> IEnumerable <T>.GetEnumerator ()
+		{
+			return list.GetEnumerator ();
+		}
+
+		IEnumerator IEnumerable.GetEnumerator ()
+		{
+			return list.GetEnumerator ();
+		}
+	}
+}

Added: trunk/src/datamodel/PathList.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/PathList.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,60 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Text;
+using System.Collections.Generic;
+
+namespace Mistelix.DataModel
+{
+	//
+	// Contains a list of paths exchanged during Drag and Drop operations
+	//
+	public class PathList : List <string> 
+    	{
+		public PathList ()
+		{
+
+		}
+
+		public void FromString (string str)
+		{
+			string [] items = str.Split (new string [] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries);
+			for (int i = 0; i < items.Length; i++)	
+				Add (items[i]);
+		}
+
+		public override string ToString () 
+		{
+			StringBuilder sb = new StringBuilder (Count * 128);
+
+			foreach (string s in this) {
+				sb.Append (s);
+				sb.Append (Environment.NewLine);
+			}
+
+			return sb.ToString ();
+		}
+	}
+}

Added: trunk/src/datamodel/ProgressEventArgs.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ProgressEventArgs.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,70 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+
+namespace Mistelix.DataModel
+{
+	public delegate void ProgressEventHandler (object sender, ProgressEventArgs e);
+
+	// Arguments to report progress in tasks
+	public sealed class ProgressEventArgs : EventArgs
+	{
+		double progress;
+		double total;
+		string text;
+
+		public ProgressEventArgs ()
+		{
+		}
+
+		public ProgressEventArgs (double progress)
+		{
+			this.progress = progress;
+		}
+
+		public ProgressEventArgs (double total, double progress, string text)
+		{
+			this.total = total;
+			this.progress = progress;
+			this.text = text;
+		}
+
+		public double Progress {
+			set { progress = value; }
+			get { return progress; }
+		}
+
+
+		public double Total {
+			set { total = value; }
+			get { return total; }
+		}
+
+		public string Text {
+			set { text = value; }
+			get { return text; }
+		}
+	}
+}

Added: trunk/src/datamodel/Project.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/Project.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,218 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+using Mono.Unix;
+using Gdk;
+
+using Mistelix;
+using Mistelix.Core;
+using Mistelix.Backends;
+
+namespace Mistelix.DataModel
+{
+	// Container for an authoring project and its elements
+	public class Project
+    	{
+		List <ProjectElement> elements;
+		ObservableList <ButtonProjectElement> buttons;
+		public ProjectDetails details;
+
+		public Project ()
+		{
+			// Default projects
+			details = new ProjectDetails ();
+			buttons = new ObservableList <ButtonProjectElement> ();
+			elements = new List <ProjectElement> ();
+		}
+
+		public List <ProjectElement> Elements {
+			get { return elements;}
+		}
+
+		public ObservableList <ButtonProjectElement> Buttons {
+			get { return buttons;}
+		}
+
+		public string FileToFullPath (string file)
+		{
+			return Path.Combine (details.OutputDir, file);
+		}
+
+		// TODO: Think how this relates to Visible elements and to be export to other formats & extensibility
+		// Returns a list of project elements that require processing (currently elements involving video)
+		public List <ProjectElement> ElementsGenerate {
+			get { 
+				List <ProjectElement> generate = new List <ProjectElement> ();
+				foreach (ProjectElement element in Elements)
+				{
+					if ((typeof (SlideShow) != element.GetType ()) &&
+						(typeof (Video) != element.GetType ()))
+						continue;
+
+					generate.Add (element);
+				}
+				return generate;
+			}
+		}
+
+		public ProjectDetails Details {
+			get { return details;}
+		}
+
+		public VisibleProjectElement ElementFromID (int id)
+		{
+			// This a linear search at the cost of O(N) but very few elements are expected
+			foreach (VisibleProjectElement elem in elements)
+			{
+				if (elem.id == id) 
+					return elem;
+			}
+
+			throw new ArgumentException ("VisibleProjectElement.ElementFromID: ID not found");
+		}
+
+		public void AddElement (VisibleProjectElement element)
+		{
+			// It is not necessary to reflect the ID in the object passed (passed by value)
+			element.id = details.next_id;
+			details.IncreaseElement ();
+			elements.Add (element);
+		}
+
+		public void RemoveElement (VisibleProjectElement element)
+		{
+			int id = element.id;
+
+			foreach (Button button in buttons)
+			{
+				if (button.LinkedId == id) {
+					Logger.Debug ("Deleting button {0}", button.LinkedId);
+					RemoveButton (button);
+					break;
+				}
+			}
+
+			Logger.Debug ("Deleting element {0}", element.id);
+			elements.Remove (element);
+		}
+
+
+		public void AddButton (ButtonProjectElement element)
+		{	
+			buttons.Add (element);
+		}
+
+		public void RemoveButton (ButtonProjectElement element)
+		{	
+			buttons.Remove (element);
+		}
+
+
+		void Clear ()
+		{
+			elements.Clear ();
+			buttons.Clear ();
+		}
+
+		public void Load (string file)
+		{
+			XmlStorage ps = new XmlStorage ();
+			List <VideoProjectElement> videos = new List <VideoProjectElement> ();
+			List <SlideShowProjectElement> slides = new List <SlideShowProjectElement> ();
+			List <ButtonProjectElement> bts = new List <ButtonProjectElement> ();
+
+			Logger.Debug ("Loading Project {0}", file);
+			ps.Load (file);
+
+			Clear ();
+
+			ps.Get <ProjectDetails> ("details", ref details);
+			ps.Get <List <ButtonProjectElement>> ("buttons", ref bts);
+			ps.Get <List <VideoProjectElement>> ("videos", ref videos);
+			ps.Get <List <SlideShowProjectElement>> ("slides", ref slides);
+
+			details.Filename = file; // After the details have been loaded
+
+			foreach (Video video in videos)
+				elements.Add (video);
+
+			foreach (SlideShow slide in slides)
+				elements.Add (slide);
+
+			foreach (Button button in bts)
+				buttons.Add (button);
+
+			Logger.Debug ("Project.Loaded {0} - {1} elements", Details.Filename, elements.Count);
+		}
+
+		public void Save (string file)
+		{
+			XmlStorage ps = new XmlStorage ();
+			ps.New ("project");
+			ps.Add (details, "details");
+			details.Filename = file;
+			
+			//
+			// Save elements in separate arrays classified by type
+			//
+			List <VideoProjectElement> videos = new List <VideoProjectElement> ();
+			List <SlideShowProjectElement> slides = new List <SlideShowProjectElement> ();
+			List <ButtonProjectElement> bts = new List <ButtonProjectElement> ();
+			
+			for (int i = 0; i < Elements.Count; i++)
+			{
+				if (typeof (Video) == Elements[i].GetType ()) {
+					videos.Add ((VideoProjectElement)Elements [i]);
+					continue;
+				}
+
+				if (typeof (SlideShow) == Elements[i].GetType ()) {
+					slides.Add ((SlideShowProjectElement) Elements [i]);
+					continue;
+				}
+
+				Logger.Debug ("Project.Save -> skipping {0}", Elements[i].GetType ()); 					
+			}
+		
+			foreach (Button button in Buttons)
+				bts.Add (button);
+
+			ps.Add (videos, "videos");
+			ps.Add (slides, "slides");
+			ps.Add (bts, "buttons");
+
+			Logger.Debug ("Saving {0}", Details.Filename);
+			ps.Save (Details.Filename);
+
+			for (int i = 0; i < Elements.Count; i++)
+				Logger.Debug ("{0}", Elements[i]);
+		}		
+	}
+}

Added: trunk/src/datamodel/ProjectBuilder.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ProjectBuilder.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,72 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using Mistelix.DataModel;
+using Mono.Unix;
+
+namespace Mistelix.DataModel
+{
+	//  Class that defines the methods to build a project
+	public abstract class ProjectBuilder
+	{
+		protected Project project;
+		protected ProgressEventHandler total_handler;
+		protected ProgressEventHandler task_handler;
+		protected ProgressEventArgs total;
+		
+		protected ProjectBuilder (Project project, ProgressEventHandler total_handler, ProgressEventHandler task_handler)
+		{
+			this.project = project;
+			this.total_handler = total_handler;
+			this.task_handler = task_handler;
+			total = new ProgressEventArgs ();
+		}
+
+		public abstract void Create ();
+
+		public static void EnsureOutputDir (string dir)
+		{
+			DirectoryInfo directory = new DirectoryInfo (dir);
+
+			if (directory.Exists)
+				return;
+
+			if (directory.Parent.Exists == false)
+				throw new DirectoryNotFoundException (Catalog.GetString ("Parent directory does not exists"));
+
+			Directory.CreateDirectory (dir);
+		}
+
+		static public string TimeSpanToStr (TimeSpan time)
+		{
+			string fmt = time.ToString ();
+			int i = fmt.IndexOf ('.');
+			if (i > 0 && fmt.Length - i > 2)
+				fmt = fmt.Substring (0, i);
+
+			return fmt;
+		}
+	}
+}

Added: trunk/src/datamodel/ProjectDetails.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ProjectDetails.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,209 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Xml.Serialization;
+
+using Mistelix.Core;
+
+namespace Mistelix.DataModel
+{	
+	public enum VideoFormat
+	{
+		PAL,
+		NTSC
+	}
+
+	public enum ProjectType
+	{
+		Theora,
+		DVD
+	}
+
+	// Contains the details of the project
+	public class ProjectDetails 
+	{
+		string filename;
+		string name;
+	 	VideoFormat format;
+		AspectRatio aspect;
+		int width;
+		int height;
+		string theme;
+		string output_dir;
+		public int next_id;
+		ProjectType type;
+		string buttons_fontname;
+		Cairo.Color buttons_back_color;
+		Cairo.Color buttons_fore_color;
+		string slideshows_fontname;
+		Cairo.Color slideshows_back_color;
+		Cairo.Color slideshows_fore_color;
+		int button_size;
+		string custom_background;
+
+		public ProjectDetails () 
+		{
+			buttons_back_color = new Cairo.Color (0.6, 0.6, 0.6);
+			buttons_fore_color = new Cairo.Color (1, 0, 0);
+			buttons_fontname = "sans 12";
+
+			slideshows_back_color = new Cairo.Color (0.6, 0.6, 0.6);
+			slideshows_fore_color = new Cairo.Color (1, 1, 1);
+			slideshows_fontname = "sans 12";
+		}
+
+		public void IncreaseElement () { next_id++; }
+
+		[XmlElementAttribute ("type", DataType="int")]
+		public ProjectType Type {
+			get { return type;}
+			set { type = value;}
+		}
+
+		[XmlElementAttribute ("format", DataType="int")]
+		public VideoFormat Format {
+			get { return format;}
+			set { format = value;}
+		}
+
+		[XmlElementAttribute ("aspect_ratio", DataType="int")]
+		public AspectRatio AspectRatio {
+			get { return aspect;}
+			set { aspect = value;}
+		}
+
+		[XmlElementAttribute ("name")]		
+		public string Name {
+			get { return name;}
+			set { name = value;}
+		}
+
+		[System.Xml.Serialization.XmlIgnoreAttribute]
+		public string Filename {
+			get { return filename;}
+			set { filename = value;}
+		}
+
+		[XmlElementAttribute ("width")]
+		public int Width {
+			get { return width;}
+			set { width = value;}
+		}
+
+		[XmlElementAttribute ("height")]
+		public int Height {
+			get { return height;}
+			set { height = value;}
+		}
+
+		[XmlElementAttribute ("theme")]
+		public string ThemeName {
+			get { return theme;}
+			set { theme = value;}
+		}
+
+		[XmlElementAttribute ("output_dir")]
+		public string OutputDir {
+			get { return output_dir;}
+			set { output_dir = value;}
+		}
+
+		[XmlElementAttribute ("buttons_fontname")]
+		public string ButtonsFontName {
+			get { return buttons_fontname;}
+			set { buttons_fontname = value;}
+		}
+
+		[XmlElementAttribute ("buttons_back_color")]
+		public Cairo.Color ButtonsBackColor {
+			get { return buttons_back_color;}
+			set { buttons_back_color = value;}
+		}
+
+		[XmlElementAttribute ("buttons_fore_color")]
+		public Cairo.Color ButtonsForeColor {
+			get { return buttons_fore_color;}
+			set { buttons_fore_color = value;}
+		}
+
+		[XmlElementAttribute ("slideshows_fontname")]
+		public string SlideshowsFontName {
+			get { return slideshows_fontname;}
+			set { slideshows_fontname = value;}
+		}
+
+		[XmlElementAttribute ("slideshows_back_color")]
+		public Cairo.Color SlideshowsBackColor {
+			get { return slideshows_back_color;}
+			set { slideshows_back_color = value;}
+		}
+
+		[XmlElementAttribute ("slideshows_fore_color")]
+		public Cairo.Color SlideshowsForeColor {
+			get { return slideshows_fore_color;}
+			set { slideshows_fore_color = value;}
+		}
+
+		[XmlElementAttribute ("button_thumbnailsize")]
+		public int ButtonThumbnailSize {
+			get { return button_size;}
+			set { button_size = value;}
+		}
+
+		[XmlElementAttribute ("custom_menu_background")]
+		public string CustomMenuBackground {
+			get { return custom_background;}
+			set { custom_background = value;}
+		}
+
+		public Theme Theme {
+			get {
+				if (theme == null)
+					return null;
+
+				return ThemeManager.FromName (theme);
+			}
+		}
+
+		public void SetResolution ()
+		{
+			if (format == VideoFormat.PAL) {
+				Width = 720;
+				Height = 576;
+			} else {
+				Width = 720;
+				Height = 480;
+			}
+		}
+
+		public int FramesPerSecond {
+			get {
+				if (format == VideoFormat.PAL)
+					return 25;
+		
+				return 30; // VideoFormat.NFTS
+			}
+		}
+	}
+}

Added: trunk/src/datamodel/ProjectElement.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ProjectElement.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,35 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Mistelix.DataModel
+{
+	// Describes an element within the authoring project
+	// We diferenciate between objects types using obj.GetType ()
+	public abstract class ProjectElement
+	{
+		public string name;
+		public bool visible; // If it is visible to the user as dragable project element
+	}
+}

Added: trunk/src/datamodel/SlideShowProjectElement.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/SlideShowProjectElement.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,98 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+using Mono.Unix;
+using Gdk;
+
+using Mistelix.Core;
+
+namespace Mistelix.DataModel
+{	
+	[XmlInclude(typeof(SlideShow))]
+	public abstract class SlideShowProjectElement : VisibleProjectElement
+	{
+		public string audiofile;
+		public List <Image> images;
+		
+		protected SlideShowProjectElement ()
+		{
+			images = new List <Image> ();
+		}
+
+		public SlideShowProjectElement (string filename)
+		{
+			this.filename = filename;
+		}
+
+		public override string Name {
+			get {
+				if (name != null)
+					return name;
+
+				// Translators: {0} is replaced by a numerical ID
+				return Catalog.GetString (String.Format ("Slideshow {0}", id));
+			}
+		}
+
+		public override Gdk.Pixbuf GetThumbnail (int width, int height)
+		{
+			if (width <= 0 || height <= 0)
+				throw new ArgumentException (String.Format ("SlideShowProjectElement->GetThumbnail. Width {0} and height {1} should be > 0", width, height));
+			
+			Gdk.Pixbuf im = new Gdk.Pixbuf (images[0].image);
+			int max = Math.Max (im.Width, im.Height);
+			Gdk.Pixbuf scaled = im.ScaleSimple (width * im.Width / max, height * im.Height / max, InterpType.Nearest);
+			im.Dispose ();
+			return scaled;
+		}
+
+		public override string GetOutputFile (ProjectType type) 
+		{
+			if (type == ProjectType.DVD)
+				return "slide" + id.ToString () + ".mpeg";
+			else 
+				return "slide" + id.ToString () + ".ogg";
+		
+		}
+	
+		[XmlInclude(typeof(SlideImage))]
+		public abstract class Image : ProjectElement
+		{
+			public string image;
+			public string title;
+			public int transition ; // Transition from slide to slide (effect duration)
+			public int time; // Time that the image is shown
+			public string effect; // Transition effect
+			
+			[XmlElementAttribute (DataType="int")]
+			public TextPosition position;
+						
+			protected Image () {}
+		}
+	}
+}

Added: trunk/src/datamodel/TextPosition.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/TextPosition.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,55 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Mono.Unix;
+
+namespace Mistelix.Core
+{
+	public enum TextPosition
+	{
+		Top,
+		Bottom,
+		Length
+	}
+
+	public static class TextPositionConverter
+	{
+		static TextPositionConverter () 
+		{
+
+		}
+
+		static public string FromEnum (TextPosition position)
+		{
+			switch (position) {
+			case TextPosition.Top:
+				return Catalog.GetString ("Top of the image (centered)");
+			case TextPosition.Bottom:
+				return Catalog.GetString ("Bottom of the image (centered)");
+			default:
+				throw new InvalidOperationException ("Invalid value");
+			}
+		}
+	}
+}

Added: trunk/src/datamodel/Theme.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/Theme.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,67 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Xml.Serialization;
+using System.Collections.Generic;
+
+namespace Mistelix.DataModel
+{
+	public class Theme
+	{
+		string name;
+		string menu_background;
+		string button_select;	// select in Spumux terminology
+		string button_highlight;
+
+		public Theme ()
+		{
+	
+		}
+
+		[XmlElementAttribute ("name")]
+		public string Name {
+			get { return name; }
+			set { name = value; }
+		}
+
+		[XmlElementAttribute ("menu_background")]
+		public string MenuBackground {
+			get { return menu_background; }
+			set { menu_background = value; }
+		}
+
+		[XmlElementAttribute ("button_select")]
+		public string ButtonSelect {
+			get { return button_select; }
+			set { button_select = value; }
+		}
+
+		[XmlElementAttribute ("button_highlight")]
+		public string ButtonHighlight {
+			get { return button_highlight; }
+			set { button_highlight = value; }
+		}
+	}
+}

Added: trunk/src/datamodel/ThumbnailSize.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/ThumbnailSize.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,54 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+
+namespace Mistelix.DataModel
+{
+	public struct ThumbnailSize
+	{
+		string name;
+		int width;
+		int height;
+
+		public ThumbnailSize (string name, int width, int height)
+		{
+			this.name = name;
+			this.width = width;
+			this.height = height;
+		}
+
+		public string Name {
+			get { return name; }
+		}
+
+		public int Width {
+			get { return width; }
+		}
+
+		public int Height {
+			get { return height; }
+		}
+	}
+}

Added: trunk/src/datamodel/VideoProjectElement.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/VideoProjectElement.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,67 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using Mono.Unix;
+using System.Xml.Serialization;
+
+using Mistelix.Core;
+
+namespace Mistelix.DataModel
+{
+	// Describes a video within the authoring project
+	[XmlInclude (typeof (Video))]
+	public class VideoProjectElement : VisibleProjectElement
+	{
+		public VideoProjectElement ()
+		{
+		}
+
+		public VideoProjectElement (string filename)
+		{
+			this.filename = filename;
+		}
+
+		public override string Name {
+			get {
+				if (name != null)
+					return name;
+
+				// Translators: {0} is replaced by a numerical ID
+				return Catalog.GetString (String.Format ("Video {0}", id));
+			}
+		}
+
+		public override string GetOutputFile (ProjectType type) 
+		{
+			return "video" + id.ToString () + ".mpeg";
+		}
+
+		public override Gdk.Pixbuf GetThumbnail (int width, int height)
+		{
+			return MistelixLib.CreateThumbnail (filename, 80, 80); // TODO: Hardcoded values
+		}
+	}
+}
+

Added: trunk/src/datamodel/VisibleProjectElement.cs
==============================================================================
--- (empty file)
+++ trunk/src/datamodel/VisibleProjectElement.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,49 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+using Mistelix.Core;
+
+namespace Mistelix.DataModel
+{
+	public abstract class VisibleProjectElement : ProjectElement
+	{
+		public string filename;
+		public int id;
+
+		public virtual string GetOutputFile (ProjectType type) 
+		{
+			return filename;
+		}
+
+		public abstract string Name {get;} // A name to be shown to the user
+		public abstract Gdk.Pixbuf GetThumbnail (int width, int height);
+		public Gdk.Pixbuf Thumbnail {
+			get { 
+				return GetThumbnail (ThumbnailSizeManager.Current.Width, 
+				                     ThumbnailSizeManager.Current.Height); 
+			}
+		}
+	}
+}

Added: trunk/src/dialogs/AboutDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/AboutDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,69 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using Gdk;
+using Mono.Unix;
+using System.Text;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+
+public class AboutDialog : Gtk.AboutDialog
+{
+	public AboutDialog () : base ()
+	{
+		string [] authors = new string [] {
+			"Jordi Mas i HernÃndez <jmas softcatala org>",
+		};
+
+		// Name of the people that translated the application
+		string translators = Catalog.GetString ("translator-credits");
+
+		if (translators == "translator-credits")
+			translators = null;
+
+		ProgramName = Defines.APPNAME;
+		Version = Defines.VERSION;
+		Authors = authors;
+	
+		Logo = LoadFromAssembly ("mistelix.svg");
+
+		Copyright = "Jordi Mas i Hernandez <jmas softcatala org>";
+		Comments = Catalog.GetString ("Mistelix is a DVD authoring application with also Theora slideshow creation capabilities.");
+		Website = "http://www.mistelix.org";;
+		WebsiteLabel = Catalog.GetString ("Mistelix web site");
+		TranslatorCredits = translators;
+		Response += delegate (object o, Gtk.ResponseArgs e) {Destroy ();};
+	}
+
+	static Pixbuf LoadFromAssembly (string resource)
+	{
+		try {
+			return new Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), resource);
+		} catch {
+			return null;
+		}
+	}
+}

Added: trunk/src/dialogs/AddSlideDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/AddSlideDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,468 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Glade;
+using Gtk;
+using Mono.Unix;
+using Cairo;
+using System.Collections;
+using System.Collections.Generic;
+using Mono.Addins;
+using System.Threading;
+using System.Timers;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Transitions;
+using Mistelix.Core;
+
+namespace Mistelix.Dialogs
+{
+	// UI interface to create new Slideshows
+	public class AddSlideDialog : GtkDialog
+	{
+		public enum ColumnsCombo // Column description within the transitions store
+		{	
+			Column_DisplayName,
+			Column_Data
+		}
+	
+		ImagesFileView file_view;
+		SlideShowImageView image_view;
+		ListStore transitions_combo, textposition_store;
+		SlideImage selected_image;
+		SlideShow slide;
+		Dictionary <string, Gdk.Pixbuf> thumbnail_cache;
+		TransitionPreview drawing_area;
+		bool edit_mode;
+
+		[Glade.Widget] Gtk.VBox left_vbox;
+		[Glade.Widget ("scrolledwindow_files")] Gtk.ScrolledWindow scrolledwin_files;
+		[Glade.Widget ("vertical_paned")] Gtk.HPaned vpaned;
+		[Glade.Widget ("vpaned_horizontal")] Gtk.VPaned hpaned;
+		[Glade.Widget ("scrolled_images")] Gtk.ScrolledWindow scrolled_images; // View the slide images
+		[Glade.Widget] Gtk.SpinButton duration_spin;
+		[Glade.Widget] Gtk.ComboBox transition_combo;
+		[Glade.Widget] Gtk.HBox ctrls_hbox;
+		[Glade.Widget] Gtk.Button up_button;
+		[Glade.Widget] Gtk.Button down_button;
+		[Glade.Widget] Gtk.VBox vbox_dir;
+		[Glade.Widget] Gtk.ComboBox textposition_combo;
+
+		// TODO: Since allows editing probably should be renamed to SlideDialog
+		public AddSlideDialog () : base ("addslide")		
+		{
+			image_view = new SlideShowImageView ();
+			image_view.ChangeEvent = new ShowImageSelectionEventHandler (OnChangeImage);
+			image_view.UpdatedElements = new ShowImageUpdatedElementsEventHandler (OnUpdatedImages);
+			scrolled_images.Add (image_view);
+			thumbnail_cache = new Dictionary <string, Gdk.Pixbuf> ();
+
+			up_button.Clicked += new EventHandler (OnButtonUp);
+			down_button.Clicked += new EventHandler (OnButtonDown);
+
+			file_view = new ImagesFileView ();
+			new DirectoryView (vbox_dir, new ChangeDirectoryEventHandler (OnDirectoryChanged),
+				Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey));
+
+			file_view.Cache = thumbnail_cache;
+			image_view.Cache = thumbnail_cache;
+			scrolledwin_files.Add (file_view);
+
+			drawing_area = new TransitionPreview ();
+			ctrls_hbox.Add (drawing_area);
+			drawing_area.Visible = true;
+
+			file_view.ShowAll ();
+			left_vbox.ShowAll ();
+			vpaned.Position = 500; // W (left)
+			hpaned.Position = 300; // H (right)
+
+			transitions_combo = new ListStore (typeof (string), typeof (string)); // DisplayName, Name
+			LoadTransitionsIntoCombo ();
+			transition_combo.Model = transitions_combo;
+
+			textposition_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
+			textposition_combo.Model = textposition_store;
+			LoadTextPositionsIntoCombo ();
+			
+			SetTransisitionToNone ();
+			ImageControlsSensitive (false);
+			OnUpdatedImages (this, EventArgs.Empty);
+
+			duration_spin.ValueChanged += new EventHandler (TimeValueChanged);
+		}
+
+		public SlideShow SlideShow {
+			get {
+				Logger.Debug ("AddSlideDialog.SlideShow");
+				if (slide != null && edit_mode == false)
+					return slide;
+
+				if (edit_mode == true) { // Reuse the same object, only store the images again
+					slide.images.Clear ();
+				} else {
+					slide = new SlideShow ();
+				}
+
+				TreeIter iter;
+				bool more;
+				SlideImage image;
+				more = image_view.Model.GetIterFirst (out iter);
+				
+				while (more)
+				{
+					image = (SlideImage) image_view.Model.GetValue (iter, SlideShowImageView.COL_OBJECT);
+					slide.images.Add (image);
+					more = image_view.Model.IterNext (ref iter);
+				}
+				return slide;
+			}
+			set {
+				slide = value;
+				image_view.LoadSlideShow (value);
+				edit_mode = true;
+			}
+		}
+
+		void OnDirectoryChanged (object sender, ChangeDirectoryEventArgs args)
+		{
+			file_view.OnDirChanged (args.Directory);
+		}
+
+		void OnButtonUp (object sender, EventArgs args)
+		{			
+			image_view.MoveUpSelectedElements ();
+		}
+
+		void OnButtonDown (object sender, EventArgs args)
+		{			
+			image_view.MoveDownSelectedElements ();
+		}
+
+		void ImageControlsSensitive (bool sensitive)
+		{
+			transition_combo.Sensitive = sensitive;
+			duration_spin.Sensitive = sensitive;
+		}
+
+		void SetTransisitionToNone ()
+		{
+			TreeIter iter;
+			transitions_combo.GetIterFirst (out iter);
+			transition_combo.SetActiveIter (iter);
+		}
+
+		void LoadTransitionsIntoCombo ()
+		{
+			ITransition[] transitions = TransitionManager.List;
+
+			foreach (ITransition transition in transitions) {
+				transitions_combo.AppendValues (transition.DisplayName, transition.Name);
+			}
+		}
+
+		void TimeValueChanged (object source, System.EventArgs args)
+		{
+			SpinButton spinner;
+			TreeSelection selection;
+			TreeIter iter;
+			TreeModel model;
+			SlideImage image;
+			TreePath[] paths;
+
+			spinner = source as SpinButton;
+			selection = (image_view as TreeView).Selection;
+	
+			// Establish new time value on the selected items
+			paths = selection.GetSelectedRows (out model);
+			foreach (TreePath path in paths)
+			{
+				model.GetIter (out iter, path);
+				image = (SlideImage) model.GetValue (iter, SlideShowImageView.COL_OBJECT);
+				image.time = spinner.ValueAsInt;
+			}
+		}
+
+		void OnSaveSlide (object sender, EventArgs args)
+		{
+			Dialog.Respond (ResponseType.Ok);
+		}
+
+		// This is a particular case since the Cancel button is not part of the standard dlg button bar
+		void OnCancel (object sender, EventArgs args)
+		{	
+			FreeResources ();
+			Dialog.Respond (ResponseType.Cancel);
+		}
+
+		void OnTransitionComboChanged (object sender, EventArgs args)
+		{
+			Logger.Debug ("OnTransitionComboChanged");
+
+			ComboBox combo = sender as ComboBox;
+			TreeIter iter;
+			TreeModel model;
+			SlideImage image;
+			string effect;
+			TreeSelection selection;
+			TreePath[] paths;
+
+			if (!combo.GetActiveIter (out iter))
+				return;
+			
+			// Establish new effect on the selected items
+			effect = (string) combo.Model.GetValue (iter, (int) ColumnsCombo.Column_Data);
+			selection = (image_view as TreeView).Selection;
+
+			paths = selection.GetSelectedRows (out model);
+			foreach (TreePath path in paths)
+			{
+				model.GetIter (out iter, path);
+				image = (SlideImage) model.GetValue (iter, SlideShowImageView.COL_OBJECT);
+				image.effect = effect;
+			}
+
+			drawing_area.UpdateTransitionType (effect);
+		}
+
+		void OnTextPositionComboChanged (object sender, EventArgs args)
+		{
+			Logger.Debug ("OnTextPositionComboChanged");
+
+			ComboBox combo = sender as ComboBox;
+			TreeIter iter;
+			TreeModel model;
+			SlideImage image;
+			TextPosition position;
+			TreeSelection selection;
+			TreePath[] paths;
+
+			if (!combo.GetActiveIter (out iter))
+				return;
+			
+			// Establish new text position on the selected items
+			position = (TextPosition) combo.Model.GetValue (iter, (int) ColumnsCombo.Column_Data);
+			selection = (image_view as TreeView).Selection;
+
+			paths = selection.GetSelectedRows (out model);
+			foreach (TreePath path in paths)
+			{
+				model.GetIter (out iter, path);
+				image = (SlideImage) model.GetValue (iter, SlideShowImageView.COL_OBJECT);
+				image.position = position;
+			}
+		}
+
+		// Selected image has changed. Generated from SlideShowImage. 
+		void OnChangeImage (object sender, ShowImageSelectionEventArgs args)
+		{
+			bool more;
+			TreeIter iter;
+			string effect;
+
+			Logger.Debug ("AddSlideDialog.OnChangeImage. Images {0}", args.images.Length);
+
+			if (args.images.Length != 1)
+				return;
+
+			selected_image = args.images [0]; // Take the first since all of them will be the same
+			ImageControlsSensitive (true);
+
+			duration_spin.Value = selected_image.time;
+			drawing_area.UpdateTransitionType (string.Empty);
+	
+			// Transition effect for this image
+			more = transitions_combo.GetIterFirst (out iter);
+			while (more)
+			{
+				effect = (string) transitions_combo.GetValue (iter, (int) ColumnsCombo.Column_Data);
+				if (selected_image.effect.Equals (effect)) {
+					transition_combo.SetActiveIter (iter);
+					break;
+				}
+				more = transitions_combo.IterNext (ref iter);
+			}
+		
+			if (more == false)
+				SetTransisitionToNone ();
+
+			// Text position effect for this image
+			TextPosition position;
+			more = textposition_store.GetIterFirst (out iter);
+			while (more)
+			{
+				position = (TextPosition) textposition_store.GetValue (iter, (int) ColumnsCombo.Column_Data);
+				if (selected_image.position == position) {
+					textposition_combo.SetActiveIter (iter);
+					return;
+				}
+				more = textposition_store.IterNext (ref iter);
+			}
+		}
+
+		// If there are at least two elements we enable the navigation buttons
+		void OnUpdatedImages (object sender, EventArgs args)
+		{
+			bool enable;
+			TreeIter iter;
+
+			enable = image_view.ListStore.GetIterFirst (out iter);
+
+			if (enable)
+				enable = image_view.ListStore.IterNext (ref iter);
+
+			up_button.Sensitive = enable;
+			down_button.Sensitive = enable;
+		}
+
+		public override void FreeResources ()
+		{
+			Dialog.Destroy ();
+			file_view.Dispose ();
+
+			foreach (KeyValuePair <string, Gdk.Pixbuf> kvp in thumbnail_cache)
+				kvp.Value.Dispose ();
+		}
+
+		void LoadTextPositionsIntoCombo ()
+		{
+			for (int i = 0;  i < (int) TextPosition.Length; i++) {
+				textposition_store.AppendValues (
+					TextPositionConverter.FromEnum ((TextPosition) i), i);
+			}
+		}
+	}
+
+	// Transition preview
+	public class TransitionPreview : DrawingArea 
+	{
+		Cairo.ImageSurface img_a;
+		Cairo.ImageSurface img_b;
+		SlideImage slide_a;
+		SlideImage slide_b;
+		SlideImage[] images_transition;
+		SlideImage img;
+		int idx;
+		System.Timers.Timer timer;
+
+		public TransitionPreview ()
+		{
+			idx = -1;
+			img_a = new Cairo.ImageSurface (Format.Argb32, 100, 100);
+			Cairo.Context gr = new Cairo.Context (img_a);
+
+			gr.MoveTo (10, 45);
+			gr.SetFontSize (50);
+			// Translators: Used as an example of how a transition effect looks like, transitioning from 'A' to 'B'
+			gr.ShowText (Catalog.GetString ("A"));
+			gr.Stroke ();
+			((IDisposable)gr).Dispose ();
+			
+			img_b = new Cairo.ImageSurface (Format.Argb32, 100, 100);
+			gr = new Cairo.Context (img_b);
+
+			gr.MoveTo (10, 45);
+			gr.SetFontSize (50);
+			// Translators: Used as an example of how a transition effect looks like, transitioning from 'A' to 'B'
+			gr.ShowText (Catalog.GetString ("B"));
+			gr.Stroke ();
+			((IDisposable)gr).Dispose ();
+
+			slide_a = new SlideImage (img_a);
+			slide_b = new SlideImage (img_b);
+
+			timer = new System.Timers.Timer ();
+			timer.Elapsed += TimerUpdater;
+		}
+
+		public void UpdateTransitionType (string type)
+		{
+			ITransition transition;
+
+			if (images_transition != null) {
+				for (int i = 0; i < images_transition.Length; i++)
+					images_transition[i].ReleasePixels ();
+			}
+
+			if (type == string.Empty) 
+				transition = TransitionManager.None;
+			else
+				transition = TransitionManager.FromName (type);
+
+			if (transition.GetType () == typeof (None)) {
+				timer.Enabled = false;
+				images_transition = null;
+			}
+			else {
+				timer.Enabled = true;
+				images_transition = transition.Effect (slide_a, slide_b, 25, 3);
+			}
+			QueueDraw ();
+		}
+
+		void TimerUpdater (object source, ElapsedEventArgs e)
+		{
+			Application.Invoke (delegate { QueueDraw (); });
+		}
+
+		protected override bool OnExposeEvent (Gdk.EventExpose args)
+		{
+			if (!IsRealized)
+				return false;
+
+			if (images_transition == null)
+				return base.OnExposeEvent(args);
+
+			byte[] pixels;
+
+			if (idx == -1) {
+				timer.Interval = 40;
+				timer.Enabled = true;
+			}
+
+			idx++;
+			img = images_transition[idx];
+			pixels = img.Pixels;
+			// TODO: To change to the right signature when the new Mono.Cairo is wide spread. Fixed in Mono.Cairo r120299
+			ImageSurface img_sur = new ImageSurface (ref pixels, Cairo.Format.Argb32, img.width, img.height, img.stride);
+
+			Cairo.Context cc = Gdk.CairoHelper.Create (args.Window);
+			cc.Save ();
+			cc.SetSourceSurface (img_sur, 0, 0);
+			cc.Paint ();
+			cc.Restore ();
+			img_sur.Destroy ();
+
+			if (idx >= images_transition.Length - 1) {
+				idx = -1;
+				timer.Interval = 3000;
+				timer.Enabled = true;
+			}
+			
+			((IDisposable)cc).Dispose();
+   			return base.OnExposeEvent(args);
+		}
+	}
+}

Added: trunk/src/dialogs/AddVideoDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/AddVideoDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,93 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Glade;
+using Gtk;
+using Mono.Unix;
+using System.Collections;
+using System.Collections.Generic;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Dialogs
+{
+	// UI interface to add new videos into the project
+	public class AddVideoDialog : GtkDialog
+	{
+		VideosFileView file_view;
+		[Glade.Widget ("scrolledwindow_files")] Gtk.ScrolledWindow scrolledwin_files;
+		[Glade.Widget ("vpaned_horizontal")] Gtk.VPaned hpaned;
+		[Glade.Widget] Gtk.VBox vbox_dir;
+		List <VideoProjectElement> videos;
+		
+		public AddVideoDialog () : base ("addvideo")
+		{
+			file_view = new VideosFileView ();
+			new DirectoryView (vbox_dir, new ChangeDirectoryEventHandler (OnDirectoryChanged),
+				Mistelix.Preferences.GetStringValue (Preferences.VideosDirectoryKey));
+
+			scrolledwin_files.Add (file_view);
+			videos = new List <VideoProjectElement> ();
+
+			file_view.ShowAll ();
+			hpaned.Position = 300; // H (right)
+		}
+
+		public List <VideoProjectElement> Videos {
+			get { return videos; }
+		}
+
+		void OnOK (object sender, EventArgs args)
+		{
+			string msg;
+			foreach (string file in file_view.SelectedFiles)
+			{
+				Video video = new Video (file);
+				if (video.SupportedFormat (out msg) == true) {
+					videos.Add (video);
+				}
+				else {
+					MessageDialog md = new MessageDialog (null,
+                                      	DialogFlags.Modal, MessageType.Warning, 
+                                      	ButtonsType.Ok, msg);
+
+					md.Run ();
+					md.Destroy ();
+				}
+			}
+		}
+
+		public override void FreeResources ()
+		{
+			file_view.Dispose ();
+		}
+
+		void OnDirectoryChanged (object sender, ChangeDirectoryEventArgs args)
+		{
+			file_view.OnDirChanged (args.Directory);
+		}
+	}
+}

Added: trunk/src/dialogs/BuildProjectDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/BuildProjectDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,116 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Glade;
+using Gtk;
+using Mono.Unix;
+using System.Collections;
+using System.Threading;
+using System.Collections.Generic;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+using Mistelix.Backends;
+
+namespace Mistelix.Dialogs
+{
+	// 
+	public class BuildProjectDialog : GtkDialog
+	{
+		Project project;
+		Thread thread;
+		readonly object sync = new object ();	
+
+		[Glade.Widget] Gtk.ProgressBar task_bar;
+		[Glade.Widget] Gtk.ProgressBar total_bar;
+		[Glade.Widget] Gtk.TextView status_text;
+		[Glade.Widget] Gtk.TextView textview;
+		[Glade.Widget] Gtk.Button generate;
+		[Glade.Widget] Gtk.Label totalprogress_label;
+		[Glade.Widget] Gtk.TextBuffer buffer;
+		Gdk.Color color;
+
+		public BuildProjectDialog (Project project) : base ("buildproject")
+		{
+			this.project = project;
+			buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ());
+			status_text.Buffer = buffer;
+	
+			color = totalprogress_label.Style.Background (StateType.Normal);
+			textview.ModifyBase (Gtk.StateType.Normal, color);
+		}	
+
+		public void OnProgressTotal (object sender, ProgressEventArgs e)
+		{
+			// Make sure that the call to GTK has been process before we return
+			Monitor.Enter (sync);
+			Application.Invoke (delegate {
+				Monitor.Enter (sync);
+				if (e.Text != null) {
+					buffer.Text += e.Text;
+				} else {
+					total_bar.DiscreteBlocks = (uint) e.Total;
+					total_bar.Fraction = e.Progress / e.Total;
+				}
+				Monitor.PulseAll (sync);
+				Monitor.Exit (sync);
+			});
+			Monitor.Wait (sync);
+			Monitor.Exit (sync);
+		}
+
+		public void OnProgressTask (object sender, ProgressEventArgs e)
+		{
+			Application.Invoke (delegate {
+				task_bar.DiscreteBlocks = (uint) e.Total;
+				task_bar.Fraction = e.Progress / e.Total;
+			} );
+		}
+
+		// This is a particular case since the Cancel button is not part of the standard dlg button bar
+		void OnCancel (object sender, EventArgs args)	
+		{
+			Dialog.Respond (ResponseType.Cancel);
+		}
+	
+		void OnGenerate (object sender, EventArgs args)
+		{
+			ProjectBuilder builder;
+
+			Logger.Debug ("BuildProjectDialog.OnGenerate");
+
+			generate.Sensitive = false;
+			
+			if (project.Details.Type == ProjectType.DVD)
+				builder = new DvdProjectBuilder (project, OnProgressTotal, OnProgressTask);
+			else
+				builder = new ProjectBuilderTheora (project, OnProgressTotal, OnProgressTask);
+
+			ThreadStart threadDelegate = new ThreadStart (builder.Create);
+			thread = new Thread (threadDelegate);
+			thread.Start ();
+		}
+	}
+}

Added: trunk/src/dialogs/ButtonPropertiesDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/ButtonPropertiesDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,101 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Glade;
+using Gtk;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Dialogs
+{
+	// Button properties dialog
+	public class ButtonPropertiesDialog : GtkDialog
+	{
+		Project project;
+		int button_id;
+		[Glade.Widget] Gtk.Entry element_entry;
+		[Glade.Widget] Gtk.RadioButton image_radio;
+		[Glade.Widget] Gtk.RadioButton text_radio;
+		[Glade.Widget] Gtk.Button ok_button;
+
+		public ButtonPropertiesDialog (Project project, int button_id) : base ("buttonproperties")
+		{
+			this.project = project;
+			this.button_id = button_id;
+
+			if (project.Buttons[button_id].ShowAs == ButtonShowAs.Thumbnail) {
+				image_radio.Active = true;
+				element_entry.Sensitive = false;
+			}
+			else {
+				text_radio.Active = true;
+				element_entry.Sensitive = true;
+			}
+
+			if (project.Buttons[button_id].Text != null)
+				element_entry.Text = project.Buttons[button_id].Text;
+
+			image_radio.Toggled += new EventHandler (OnCheckToggled);
+			element_entry.Changed += OnChangedText;
+		}
+
+		void OnChangedText (object sender, EventArgs args)
+		{
+			EnableOKButton ();
+		}
+
+		void EnableOKButton ()
+		{
+			bool enabled;
+
+			if (text_radio.Active == true) {
+				if (element_entry.Text.Length > 0)
+					enabled = true;
+				else
+					enabled = false;
+			} else
+				enabled = true;
+
+			ok_button.Sensitive = enabled;
+		}
+		
+		void OnOK (object sender, EventArgs args)
+		{
+			if (image_radio.Active)
+				project.Buttons[button_id].ShowAs = ButtonShowAs.Thumbnail;
+			else {
+				project.Buttons[button_id].ShowAs = ButtonShowAs.Text;
+				project.Buttons[button_id].Text = element_entry.Text;
+			}
+		}
+
+		void OnCheckToggled (object obj, EventArgs args)
+		{
+			element_entry.Sensitive = text_radio.Active;
+			EnableOKButton ();
+		}
+	}
+}

Added: trunk/src/dialogs/CheckDependenciesDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/CheckDependenciesDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,104 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using Glade;
+using Gtk;
+using Gdk;
+using Mono.Unix;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+
+using Mistelix.Core;
+using Mistelix.DataModel;
+
+namespace Mistelix.Dialogs
+{
+	// Check dependencies
+	public class CheckDependenciesDialog : GtkDialog
+	{		
+		[Glade.Widget] Gtk.VBox dependencies_vbox;
+		[Glade.Widget] Gtk.Label capabilities_label;
+		[Glade.Widget] Gtk.TreeView treeview;
+		[Glade.Widget] Gtk.TextView textview;
+
+		const int COL_STATUS = 0;
+		const int COL_DEPEN = 1;
+		const int COL_ACTION = 2;
+		ListStore store;
+		Dependencies dependencies;
+
+		public CheckDependenciesDialog (Project project) : base ("dependencies")
+		{
+
+		}
+
+		public Dependencies Dependencies {
+			set { dependencies = value; }
+		}
+
+		public override ResponseType Run ()
+		{
+			List <Dependencies.Dependency> status;
+			Gdk.Color color;
+			Pixbuf image;
+			const int icon_size = 16;
+
+			if (dependencies == null)
+				dependencies = new Dependencies ();
+
+			status = dependencies.Status;
+			
+			CellRendererText action_cell = new CellRendererText ();
+			action_cell.WrapWidth = 300;
+			action_cell.WrapMode = Pango.WrapMode.Word;
+
+			CellRendererPixbuf status_cell = new CellRendererPixbuf ();
+			status_cell.StockSize = (uint)Gtk.IconSize.Menu;
+
+			treeview.AppendColumn (Catalog.GetString ("Status"), status_cell, "pixbuf", COL_STATUS);
+			treeview.AppendColumn (Catalog.GetString ("Dependency"), new CellRendererText (), "text", COL_DEPEN);			
+			treeview.AppendColumn (Catalog.GetString ("Action"), action_cell, "text", COL_ACTION);
+
+			treeview.Model = store  = new ListStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));
+		
+			for (int row = 0; row < status.Count; row++)
+			{
+				if (status[row].Available)
+					image = Gtk.IconTheme.Default.LoadIcon ("gtk-yes", icon_size, (Gtk.IconLookupFlags) 0);
+				else
+					image = Gtk.IconTheme.Default.LoadIcon ("gtk-no", icon_size, (Gtk.IconLookupFlags) 0);
+
+				store.AppendValues (image, status[row].Component, status[row].Action);
+			}
+
+			capabilities_label.Text = dependencies.CapabilitiesSummary;
+			dependencies_vbox.ShowAll ();
+
+			color = capabilities_label.Style.Background (StateType.Normal);
+			textview.ModifyBase (Gtk.StateType.Normal, color);
+			return base.Run ();
+		}
+
+	}
+}

Added: trunk/src/dialogs/GtkDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/GtkDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,84 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Glade;
+using Gtk;
+using Mono.Unix;
+using System.Collections;
+
+namespace Mistelix.Dialogs
+{
+	// GTK.Dialog
+	//
+	// Catch the event OK from Glade to call OnOk 
+	//
+	public class GtkDialog
+	{
+		Glade.XML xml;
+		Gtk.Dialog dialog;
+		string dialog_name;
+
+		public GtkDialog (string dialog_name)
+		{
+			this.dialog_name = dialog_name;
+			xml = new Glade.XML (null, "mistelix.glade", dialog_name, "mistelix");
+			xml.Autoconnect (this);
+			Dialog.IconName = "mistelix";
+			dialog = null;
+		}
+
+		public virtual ResponseType Run ()
+		{
+			ResponseType response = (ResponseType) Dialog.Run ();
+			Destroy ();
+			return response;
+		}
+
+		public ResponseType RunNoDestroy ()
+		{
+			ResponseType response = (ResponseType) Dialog.Run ();
+			return response;
+		}
+
+		public Gtk.Dialog Dialog {
+			get {
+				if (dialog == null)
+					dialog = (Gtk.Dialog) xml.GetWidget (dialog_name);
+				
+				return dialog;
+			}
+		}
+
+		public void Destroy ()
+		{
+			Dialog.Destroy ();
+			FreeResources ();
+		}
+
+		// Free any resources allocated by this dialog box
+		virtual public void FreeResources ()
+		{
+		}
+	}
+}

Added: trunk/src/dialogs/NewProjectDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/NewProjectDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,147 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Glade;
+using Gtk;
+using Mono.Unix;
+using System.Collections;
+using System.IO;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Dialogs
+{
+	// New project dialog box
+	public class NewProjectDialog : GtkDialog
+	{
+		[Glade.Widget] Gtk.Entry output_dir;
+		[Glade.Widget] Gtk.Entry name;
+		[Glade.Widget] Gtk.RadioButton slideshows_radio;
+		[Glade.Widget] Gtk.RadioButton pal_radio;
+		[Glade.Widget] Gtk.RadioButton ntsc_radio;
+		[Glade.Widget] Gtk.RadioButton fourbythree_radio;
+		[Glade.Widget] Gtk.RadioButton sixteenbynine_radio;
+		[Glade.Widget] Gtk.Label vformat_label;
+		[Glade.Widget] Gtk.Label aratio_label;
+		Project project;
+		bool changed;
+
+		public NewProjectDialog () : base ("newproject")
+		{
+			// Translators: This is the default project name for a new project
+			name.Text = Catalog.GetString ("Project");
+			output_dir.Text = OutputDirFromName ();
+			name.Changed += OnChangedProjectName;
+			output_dir.Changed += OnChangedOutputDir;
+			changed = false;
+			slideshows_radio.Toggled += new EventHandler (OnProjectTypeToggled);
+			ProjectTypeSensitive ();
+		}
+
+		public Project NewProject { 
+			get { return project; }
+		}
+
+		void OnChangedProjectName (object sender, EventArgs args)
+		{
+			if (changed)
+				return;
+
+			output_dir.Text = OutputDirFromName ();
+			changed = false; /// Setting the text via .Text fires the Changed event
+		}
+
+		void OnChangedOutputDir (object sender, EventArgs args)
+		{
+			changed = true;
+		}
+
+		string OutputDirFromName ()
+		{
+			return Path.Combine (Mistelix.Preferences.GetStringValue (Preferences.ProjectsDirectoryKey), name.Text);
+		}
+
+		void OnOK (object sender, EventArgs args)
+		{
+			project = new Project ();
+			project.Details.OutputDir = output_dir.Text;
+			project.Details.Name = name.Text;
+
+			if (pal_radio.Active)
+				project.Details.Format = VideoFormat.PAL;
+			else
+				project.Details.Format = VideoFormat.NTSC;
+
+			if (slideshows_radio.Active)
+				project.Details.Type = ProjectType.Theora;
+			else
+				project.Details.Type = ProjectType.DVD;
+
+			if (fourbythree_radio.Active)
+				project.Details.AspectRatio = AspectRatio.FourByThree;
+			else
+				project.Details.AspectRatio = AspectRatio.SixteenByNine;
+
+			project.Details.SetResolution ();
+		}
+
+		void OnBrowse (object o, EventArgs args)
+		{
+			FileChooserDialog chooser_dialog = new FileChooserDialog (
+				Catalog.GetString ("Open Location") , null, FileChooserAction.SelectFolder);
+
+			chooser_dialog.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
+			chooser_dialog.AddButton (Stock.Cancel, ResponseType.Cancel);
+			chooser_dialog.AddButton (Stock.Open, ResponseType.Ok);
+			chooser_dialog.DefaultResponse = ResponseType.Ok;
+			chooser_dialog.LocalOnly = false;
+
+			if(chooser_dialog.Run () == (int) ResponseType.Ok) {
+				output_dir.Text = chooser_dialog.Filename;
+				changed = true;
+			}
+
+			chooser_dialog.Destroy ();
+		}
+
+		void ProjectTypeSensitive ()
+		{
+			bool active = slideshows_radio.Active == false; // DVD project
+
+			pal_radio.Sensitive = active;
+			ntsc_radio.Sensitive = active;
+			fourbythree_radio.Sensitive = active;
+			sixteenbynine_radio.Sensitive = active;
+			vformat_label.Sensitive = active;
+			aratio_label.Sensitive = active;
+		}
+
+		void OnProjectTypeToggled (object obj, EventArgs args)
+		{
+			ProjectTypeSensitive ();
+		}
+	}
+}

Added: trunk/src/dialogs/PreferencesDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/PreferencesDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,187 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Glade;
+using Gtk;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+using Mistelix.Transitions;
+
+namespace Mistelix.Dialogs
+{
+	// Application preferences dialog
+	public class PreferencesDialog : GtkDialog
+	{
+		public enum ColumnsCombo // Column description within the transitions store
+		{	
+			Column_DisplayName,
+			Column_Name
+		}
+
+		[Glade.Widget] Gtk.HBox projectsdir_hbox;
+		[Glade.Widget] Gtk.HBox videosdir_hbox;
+		[Glade.Widget] Gtk.HBox imagesdir_hbox;
+		[Glade.Widget] Gtk.HBox audiodir_hbox;
+		[Glade.Widget] Gtk.ComboBox thumbnail_combo;
+		[Glade.Widget] Gtk.ComboBox transition_combo;
+		[Glade.Widget] Gtk.ComboBox textposition_combo;
+		[Glade.Widget] Gtk.SpinButton duration_spin;
+
+		BrowseDirectory projectsdir, videosdir, imagesdir, audiodir;
+		ListStore transition_store, thumbnail_store, textposition_store;
+		bool needs_repaint;
+
+		public PreferencesDialog () : base ("preferences")
+		{
+			bool more;
+			TreeIter iter;
+			string effect, selected;
+
+			transition_store = new ListStore (typeof (string), typeof (string)); // DisplayName, Name
+			transition_combo.Model = transition_store;
+			LoadTransitionsIntoCombo ();
+
+			thumbnail_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
+			thumbnail_combo.Model = thumbnail_store;
+			LoadThumbnailsIntoCombo ();
+
+			textposition_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
+			textposition_combo.Model = textposition_store;
+			LoadTextPositionsIntoCombo ();
+			
+			projectsdir = new BrowseDirectory (projectsdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.ProjectsDirectoryKey));
+			videosdir = new BrowseDirectory (videosdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.VideosDirectoryKey));
+			imagesdir = new BrowseDirectory (imagesdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey));
+			audiodir = new BrowseDirectory (audiodir_hbox, Mistelix.Preferences.GetStringValue (Preferences.AudioDirectoryKey));
+
+			duration_spin.Value = Mistelix.Preferences.GetIntValue (Preferences.DefaultDurationKey);
+
+			// Default Transition effect
+			selected = Mistelix.Preferences.GetStringValue (Preferences.DefaultTransitionKey);
+			more = transition_store.GetIterFirst (out iter);
+			while (more)
+			{
+				effect = (string) transition_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
+				if (effect.Equals (selected)) {
+					transition_combo.SetActiveIter (iter);
+					break;
+				}
+				more = transition_store.IterNext (ref iter);
+			}
+
+			// Default thumbnail size
+			int thumbnail = Mistelix.Preferences.GetIntValue (Preferences.ThumbnailSizeKey);
+			int current;
+
+			more = thumbnail_store.GetIterFirst (out iter);
+			while (more)
+			{
+				current = (int) thumbnail_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
+				if (thumbnail == current) {
+					thumbnail_combo.SetActiveIter (iter);
+					break;
+				}
+				more = thumbnail_store.IterNext (ref iter);
+			}
+
+			// Default text position box
+			int position = Mistelix.Preferences.GetIntValue (Preferences.DefaultTextPositionKey);
+
+			more = textposition_store.GetIterFirst (out iter);
+			while (more)
+			{
+				current = (int) textposition_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
+				if (position == current) {
+					textposition_combo.SetActiveIter (iter);
+					break;
+				}
+				more = textposition_store.IterNext (ref iter);
+			}
+		}
+
+		// True when a change in the preferences requires to repaint the main frame of the application
+		public bool NeedsRepaint {
+			get { return needs_repaint; } 
+		}
+
+		void OnOK (object sender, EventArgs args)
+		{
+			TreeIter iter;
+
+			if (transition_combo.GetActiveIter (out iter)) {
+				string effect = (string) transition_combo.Model.GetValue (iter, (int) ColumnsCombo.Column_Name);
+				Mistelix.Preferences.SetStringValue (Preferences.DefaultTransitionKey, effect);
+			}
+
+			if (thumbnail_combo.GetActiveIter (out iter)) {
+				int size = (int) thumbnail_combo.Model.GetValue (iter, (int) ColumnsCombo.Column_Name);
+
+				if (size != Mistelix.Preferences.GetIntValue (Preferences.ThumbnailSizeKey)) {	
+					Mistelix.Preferences.SetIntValue (Preferences.ThumbnailSizeKey, size);
+					needs_repaint = true;
+				}
+			}
+
+			if (textposition_combo.GetActiveIter (out iter)) {
+				int position = (int) textposition_combo.Model.GetValue (iter, (int) ColumnsCombo.Column_Name);
+				Mistelix.Preferences.SetStringValue (Preferences.DefaultTextPositionKey, position.ToString ());
+			}
+
+			Mistelix.Preferences.SetIntValue (Preferences.DefaultDurationKey, (int) duration_spin.Value);
+			Mistelix.Preferences.SetStringValue (Preferences.ProjectsDirectoryKey, projectsdir.Directory);
+			Mistelix.Preferences.SetStringValue (Preferences.VideosDirectoryKey, videosdir.Directory);
+			Mistelix.Preferences.SetStringValue (Preferences.ImagesDirectoryKey, imagesdir.Directory);
+			Mistelix.Preferences.SetStringValue (Preferences.AudioDirectoryKey, audiodir.Directory);
+			Mistelix.Preferences.Save ();
+		}
+
+		void LoadTransitionsIntoCombo ()
+		{
+			ITransition[] transitions = TransitionManager.List;
+
+			foreach (ITransition transition in transitions) {
+				transition_store.AppendValues (transition.DisplayName, transition.Name);
+			}
+		}
+
+		void LoadThumbnailsIntoCombo ()
+		{
+			ThumbnailSize[] sizes = ThumbnailSizeManager.List;
+
+			for (int i = 0; i < sizes.Length; i++) {
+				thumbnail_store.AppendValues (sizes[i].Name, i);
+			}
+		}
+
+		void LoadTextPositionsIntoCombo ()
+		{
+			for (int i = 0;  i < (int) TextPosition.Length; i++) {
+				textposition_store.AppendValues (
+					TextPositionConverter.FromEnum ((TextPosition) i), i);
+			}
+		}
+	}
+}

Added: trunk/src/dialogs/ProjectPropertiesDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/ProjectPropertiesDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,188 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using Glade;
+using Gtk;
+using Mono.Unix;
+using System.Collections;
+using System.IO;
+
+using Mistelix.Widgets;
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Dialogs
+{
+	// Project properties dialog box
+	public class ProjectPropertiesDialog : GtkDialog
+	{
+		Project project;
+		ListStore thumbnail_store;
+		bool needs_repaint;
+		const int COLUMN_ID = 1;
+
+		[Glade.Widget] Gtk.Entry output_dir;
+		[Glade.Widget] Gtk.Entry name;
+		[Glade.Widget] Gtk.RadioButton pal_radio;
+		[Glade.Widget] Gtk.RadioButton ntsc_radio;
+		[Glade.Widget] FontButton fontbuttons_button;
+		[Glade.Widget] ColorButton backbuttons_button;
+		[Glade.Widget] ColorButton forebuttons_button;
+		[Glade.Widget] FontButton fontslides_button;
+		[Glade.Widget] ColorButton backslides_button;
+		[Glade.Widget] ColorButton foreslides_button;
+		[Glade.Widget] Gtk.RadioButton fourbythree_radio;
+		[Glade.Widget] Gtk.RadioButton sixteenbynine_radio;
+		[Glade.Widget] Gtk.Label type_label;
+		[Glade.Widget] Gtk.ComboBox thumbnail_combo;
+
+		public ProjectPropertiesDialog (Project project) : base ("projectproperties")
+		{
+			this.project = project;
+			name.Text = project.Details.Name;
+			output_dir.Text = project.Details.OutputDir;
+			fontbuttons_button.FontName = project.Details.ButtonsFontName;
+			forebuttons_button.Color = GtkUtils.CairoToGdkColor (project.Details.ButtonsForeColor);
+			backbuttons_button.Color = GtkUtils.CairoToGdkColor (project.Details.ButtonsBackColor);
+
+			fontslides_button.FontName = project.Details.SlideshowsFontName;
+			foreslides_button.Color = GtkUtils.CairoToGdkColor (project.Details.SlideshowsForeColor);
+			backslides_button.Color = GtkUtils.CairoToGdkColor (project.Details.SlideshowsBackColor);
+
+			pal_radio.Active = project.Details.Format == VideoFormat.PAL;
+			ntsc_radio.Active = project.Details.Format == VideoFormat.NTSC;
+	
+			fourbythree_radio.Active = project.Details.AspectRatio == AspectRatio.FourByThree;
+			sixteenbynine_radio.Active = project.Details.AspectRatio == AspectRatio.SixteenByNine;
+
+			if (project.Details.Type == ProjectType.Theora)
+				type_label.Text = Catalog.GetString ("Theora project (slideshows to video)");
+			else 
+				type_label.Text = Catalog.GetString ("DVD-Video project");
+
+			thumbnail_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
+			thumbnail_combo.Model = thumbnail_store;
+			LoadThumbnailsIntoCombo ();
+
+			// Default thumbnail size
+			TreeIter iter;		
+			int thumbnail = project.Details.ButtonThumbnailSize;
+			int current;
+			bool more;
+
+			more = thumbnail_store.GetIterFirst (out iter);
+			while (more)
+			{
+				current = (int) thumbnail_store.GetValue (iter, COLUMN_ID);
+				if (thumbnail == current) {
+					thumbnail_combo.SetActiveIter (iter);
+					break;
+				}
+				more = thumbnail_store.IterNext (ref iter);
+			}
+		}
+
+		public bool NeedsRepaint {
+			get { return needs_repaint; } 
+		}
+
+		void OnOK (object sender, EventArgs args)
+		{
+			TreeIter iter;
+			VideoFormat format;
+
+			project.Details.OutputDir = output_dir.Text;
+			project.Details.Name = name.Text;
+
+			if (project.Details.ButtonsFontName != fontbuttons_button.FontName) {
+				project.Details.ButtonsFontName = fontbuttons_button.FontName;
+				needs_repaint = true;
+			}
+
+			if (project.Details.ButtonsForeColor.Equals (GtkUtils.GdkToCairoColor (forebuttons_button.Color)) == false) {
+				project.Details.ButtonsForeColor = GtkUtils.GdkToCairoColor (forebuttons_button.Color);
+				needs_repaint = true;
+			}
+	
+			if (project.Details.ButtonsBackColor.Equals (GtkUtils.GdkToCairoColor (backbuttons_button.Color)) == false) {
+				project.Details.ButtonsBackColor = GtkUtils.GdkToCairoColor (backbuttons_button.Color);
+				needs_repaint = true;
+			}
+
+			project.Details.SlideshowsFontName = fontslides_button.FontName;
+			project.Details.SlideshowsForeColor = GtkUtils.GdkToCairoColor (foreslides_button.Color);
+			project.Details.SlideshowsBackColor = GtkUtils.GdkToCairoColor (backslides_button.Color);
+
+			if (pal_radio.Active)
+				format = VideoFormat.PAL;
+			else
+				format = VideoFormat.NTSC;
+
+			if (fourbythree_radio.Active)
+				project.Details.AspectRatio = AspectRatio.FourByThree;
+			else
+				project.Details.AspectRatio = AspectRatio.SixteenByNine;
+
+			if (format != project.Details.Format) {
+				project.Details.Format = format;
+				needs_repaint = true;
+			}
+
+			project.Details.SetResolution ();
+
+			if (thumbnail_combo.GetActiveIter (out iter)) {
+				int size = (int) thumbnail_combo.Model.GetValue (iter, COLUMN_ID);
+				if (size != project.Details.ButtonThumbnailSize) {
+					project.Details.ButtonThumbnailSize = size;
+					needs_repaint = true;
+				}
+			}
+		}
+
+		void OnBrowse (object o, EventArgs args)
+		{
+			FileChooserDialog chooser_dialog = new FileChooserDialog (
+				Catalog.GetString ("Open Location") , null, FileChooserAction.SelectFolder);
+
+			chooser_dialog.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
+			chooser_dialog.AddButton (Stock.Cancel, ResponseType.Cancel);
+			chooser_dialog.AddButton (Stock.Open, ResponseType.Ok);
+			chooser_dialog.DefaultResponse = ResponseType.Ok;
+			chooser_dialog.LocalOnly = false;
+
+			if(chooser_dialog.Run () == (int) ResponseType.Ok)
+				output_dir.Text = chooser_dialog.Filename;
+
+			chooser_dialog.Destroy ();
+		}
+
+		void LoadThumbnailsIntoCombo ()
+		{
+			ThumbnailSize[] sizes = ThumbnailSizeManager.List;
+
+			for (int i = 0; i < sizes.Length; i++) {
+				thumbnail_store.AppendValues (sizes[i].Name, i);
+			}
+		}
+	}
+}

Added: trunk/src/dialogs/ThemeSelectionDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/dialogs/ThemeSelectionDialog.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,330 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using Glade;
+using Gtk;
+using Gdk;
+using Mono.Unix;
+using System.Collections;
+using System.IO;
+
+using Mistelix.Core;
+using Mistelix.DataModel;
+using Mistelix.Widgets;
+using Mistelix.Backends;
+
+namespace Mistelix.Dialogs
+{	
+	// Browse themes dialog
+	public class ThemeSelectionDialog : GtkDialog
+	{
+		// Adds a text box + browse button into a given hbox parent configuring 
+		// the standard browsedirectory widget for the application
+		// TODO: Consider mixing with BrowseDirectory class
+		public class BrowseFile
+		{
+			public virtual event EventHandler FileSelectedChanged;
+
+			Entry dirname;
+			Gtk.Button browse;
+			string directory;
+
+			public BrowseFile (HBox parent, string directory)
+			{
+				dirname = new Entry ();
+				browse = new Gtk.Button (Catalog.GetString ("Browse..."));
+				this.directory = directory;
+				browse.Clicked += new EventHandler (OnBrowse);
+
+				parent.Add (dirname);
+				parent.Add (browse);
+
+				Gtk.Box.BoxChild box = (Gtk.Box.BoxChild) parent[browse];
+				box.Expand = false;
+				box.Fill = false;
+		    
+				parent.ShowAll ();
+			}
+
+			public string Filename {
+				get { return dirname.Text; }
+			}
+
+			void OnBrowse (object o, EventArgs args)
+			{
+				FileChooserDialog chooser_dialog = new FileChooserDialog (
+					Catalog.GetString ("Open Location") , null, FileChooserAction.Open);
+
+				Gtk.FileFilter filter = new Gtk.FileFilter ();
+				filter.AddPixbufFormats ();
+
+				chooser_dialog.Filter = filter;
+				chooser_dialog.SetCurrentFolder (directory);
+				chooser_dialog.AddButton (Stock.Cancel, ResponseType.Cancel);
+				chooser_dialog.AddButton (Stock.Open, ResponseType.Ok);
+				chooser_dialog.DefaultResponse = ResponseType.Ok;
+				chooser_dialog.LocalOnly = false;
+
+				if(chooser_dialog.Run () == (int) ResponseType.Ok) {
+					dirname.Text = chooser_dialog.Filename;
+		
+					if (FileSelectedChanged != null)
+						FileSelectedChanged (this, EventArgs.Empty);
+				}
+				chooser_dialog.Destroy ();
+			}
+		}
+
+		public class MenuBackgroundPreview : DrawingArea
+		{
+			Theme theme;
+			Gdk.Pixbuf background;
+			int width, height;
+			bool cached_image;
+			string custom_menubackground;
+
+			public MenuBackgroundPreview ()
+			{
+			}
+
+			public Theme Theme {
+				set { 
+					theme = value;
+					
+					if (custom_menubackground != null)
+						return;
+
+					cached_image = false;
+					QueueDraw ();
+				}
+			}
+
+			public string CustomMenuBackground {
+				set { 
+					custom_menubackground = value;
+					cached_image = false;
+					QueueDraw ();
+				}
+			}
+
+			protected override bool OnExposeEvent (Gdk.EventExpose args)
+			{
+				if (!IsRealized)
+					return false;
+
+				int w, h;
+				Gdk.Pixbuf im = null;
+				Cairo.Context cr = Gdk.CairoHelper.Create (args.Window);
+				args.Window.GetSize (out w, out h);
+
+				if (width != w || height != h)
+					cached_image = false;
+
+				if (cached_image == false) {
+					if (background != null) {
+						background.Dispose ();
+						background = null;
+					}
+
+					try {
+						if (custom_menubackground != null)
+							im = new Gdk.Pixbuf (custom_menubackground);
+					}
+					catch { }
+			
+					try {
+						if (im == null)
+							im = new Gdk.Pixbuf (System.IO.Path.Combine (Defines.DATA_DIR, theme.MenuBackground));
+
+						background = im.ScaleSimple (w, h, InterpType.Nearest);
+						im.Dispose ();
+					}
+					catch { }
+
+					if (background != null) { // Cached for a certain window size
+						cached_image = true;
+						width = w;
+						height = h;
+					}
+				}
+			
+				if (background != null) {
+					Gdk.CairoHelper.SetSourcePixbuf (cr, background, 0, 0);
+					cr.Paint ();
+				}
+
+				((IDisposable)cr).Dispose ();
+	   			return base.OnExposeEvent(args);
+			}
+		}
+		
+		public class ButtonPreview : DrawingArea
+		{
+			Project project;
+			string image_file;
+			bool cached_image;
+			int width, height;
+			Spumux spumux;
+			Cairo.ImageSurface image;
+
+			public ButtonPreview (Project project)
+			{
+				this.project = project;
+				spumux = new Spumux (project);
+			}
+
+			public string ImageFile {
+				set { 
+					image_file = value;					
+					cached_image = false;
+					QueueDraw ();
+				}
+			}
+
+			protected override bool OnExposeEvent (Gdk.EventExpose args)
+			{
+				if (!IsRealized)
+					return false;
+
+				int w, h;
+				Cairo.Context cr = Gdk.CairoHelper.Create (args.Window);
+				args.Window.GetSize (out w, out h);
+
+				if (width != w || height != h)
+					cached_image = false;
+
+				if (cached_image == false) {
+					image = new Cairo.ImageSurface (Cairo.Format.ARGB32, project.Details.Width, project.Details.Height);
+					Cairo.Context chight = new Cairo.Context (image);
+
+					spumux.DrawImageFromFile (chight,  image_file, 0,  h / 4, w / 2, h / 2);
+					cached_image = true;
+					((IDisposable)chight).Dispose ();
+				}
+			
+				if (image != null) {
+					cr.SetSourceSurface (image, 0, 0);
+					cr.Paint ();
+					cached_image = true;
+					width = w;
+					height = h;
+				}
+
+				((IDisposable)cr).Dispose ();
+	   			return base.OnExposeEvent(args);
+			}
+		}
+		
+		[Glade.Widget] Gtk.TreeView themes_tree;
+		[Glade.Widget] Gtk.HPaned hpaned;
+		[Glade.Widget] Gtk.VBox backpreview_box;
+		[Glade.Widget] Gtk.HBox file_hbox;
+		[Glade.Widget] Gtk.TextView textview;
+		[Glade.Widget] Gtk.Label author_label;
+		[Glade.Widget] Gtk.HBox selectbutton_box;
+		[Glade.Widget] Gtk.HBox highlightbutton_box;
+
+		ListStore store;
+		Project project;
+		Theme selected_theme;
+		Gdk.Color color;
+		BrowseFile browse_file;
+		MenuBackgroundPreview menu_drawing_area;
+		ButtonPreview highlightbutton_drawing_area;
+		ButtonPreview selectbutton_drawing_area;
+
+		const int COL_DISPLAY_NAME = 0;
+		const int COL_OBJECT = 1;
+
+		public ThemeSelectionDialog (Project project) : base ("themeselection")
+		{
+			this.project = project;
+			hpaned.Position = 200; // W (left)
+			selected_theme = null;
+			menu_drawing_area = new MenuBackgroundPreview ();
+			selectbutton_drawing_area = new ButtonPreview (project);
+			highlightbutton_drawing_area = new ButtonPreview (project);
+
+			browse_file = new BrowseFile (file_hbox, Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey));
+
+			color = author_label.Style.Background (StateType.Normal);
+			textview.ModifyBase (Gtk.StateType.Normal, color);
+			
+			PrepareTree ();
+			backpreview_box.Add (menu_drawing_area);
+			backpreview_box.ShowAll ();
+
+			highlightbutton_box.Add (highlightbutton_drawing_area);
+			highlightbutton_box.ShowAll ();
+
+			selectbutton_box.Add (selectbutton_drawing_area);
+			selectbutton_box.ShowAll ();
+
+			browse_file.FileSelectedChanged += delegate 
+			{
+				menu_drawing_area.CustomMenuBackground = browse_file.Filename;
+			};
+		}
+
+		void PrepareTree ()
+		{
+			themes_tree.AppendColumn (Catalog.GetString ("Name"), new CellRendererText (), "text", COL_DISPLAY_NAME);
+			// Name, object
+			themes_tree.Model = store = new ListStore (typeof (string), typeof (Theme));
+
+			TreePath path;
+			TreeIter iter;
+			
+			foreach (Theme theme in ThemeManager.List)
+				store.AppendValues (theme.Name, theme);
+				
+			store.GetIterFirst (out iter);
+			path = store.GetPath (iter);
+
+			themes_tree.CursorChanged += OnCursorChanged;
+			themes_tree.SetCursor (path, themes_tree.Columns[0], false);
+		}
+
+		void OnOK (object sender, EventArgs args)
+		{
+			Logger.Debug ("ThemeSelectionDialog.OnOK");
+			project.Details.ThemeName = selected_theme.Name;
+			project.Details.CustomMenuBackground = browse_file.Filename;
+		}
+
+		void OnCursorChanged (object obj,  EventArgs e)
+		{
+			TreeModel model;
+			TreeIter iter;
+			TreeSelection selection = (obj as TreeView).Selection;
+
+			if (selection.GetSelected (out model, out iter) == false)
+				return;
+
+			selected_theme = menu_drawing_area.Theme = (Theme) model.GetValue (iter, COL_OBJECT);
+			selectbutton_drawing_area.ImageFile = Path.Combine (Defines.DATA_DIR, selected_theme.ButtonSelect);
+			highlightbutton_drawing_area.ImageFile = Path.Combine (Defines.DATA_DIR, selected_theme.ButtonHighlight);
+			Logger.Debug ("Selected Theme {0}", selected_theme.Name);
+		}
+	}
+}

Added: trunk/src/mistelix.addin.xml
==============================================================================
--- (empty file)
+++ trunk/src/mistelix.addin.xml	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,12 @@
+<Addin namespace="Mistelix" id="Mistelix" version="0.10" isroot="true" compatVersion="0.10">
+
+	<Runtime>
+		<Import assembly="mistelix.exe" />
+	</Runtime>
+
+	<ExtensionPoint path="/Mistelix/SlideTransitions">
+		<ExtensionNode name="SlideTransitions" objectType="Mistelix.Transitions.ITransition" />
+	</ExtensionPoint>
+</Addin>
+
+

Added: trunk/src/mistelix.cs
==============================================================================
--- (empty file)
+++ trunk/src/mistelix.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,465 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using Gdk;
+using Gnome;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Collections.Generic;
+using System.Diagnostics;
+using Mono.Unix;
+using Mono.Addins;
+using Mono.Addins.Setup;
+
+using Mistelix.Widgets;
+using Mistelix.Dialogs;
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix
+{
+	//
+	// Mistelix main program class
+	//
+	class Mistelix : Program
+	{
+		[Glade.Widget ("mistelix")] Gtk.Window app_window;
+		[Glade.Widget ("vertical_paned")] Gtk.HPaned vpaned;
+		[Glade.Widget ("vpaned_horizontal")] Gtk.VPaned hpaned;
+		[Glade.Widget ("scrolledwindow_elements")] Gtk.ScrolledWindow scrolledwin_elements;
+		[Glade.Widget] Gtk.VBox left_vbox;
+
+		[Glade.Widget] Gtk.MenuItem save_project;
+		[Glade.Widget] Gtk.MenuItem save_as;
+		[Glade.Widget] Gtk.MenuItem build;
+		[Glade.Widget] Gtk.MenuItem theme_browser;
+		[Glade.Widget] Gtk.MenuItem project_properties;
+		[Glade.Widget] Gtk.Button videos_button;
+		[Glade.Widget] Gtk.Button slideshows_button;
+		[Glade.Widget] Gtk.CheckMenuItem safearea_menuitem;
+		[Glade.Widget] Gtk.MenuItem add_slideshow;
+		[Glade.Widget] Gtk.MenuItem add_videos;
+
+
+		AuthoringPaneView authoring_view;
+		Project project;
+		ProjectElementView element_view;
+		static string base_dir;
+		static Preferences preferences;
+		static bool debugging;
+
+		static Mistelix ()
+		{
+			base_dir = System.IO.Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), Defines.APPNAME_LOWER);
+			preferences = new Preferences ();
+		}
+
+		public Mistelix (string [] args, params object [] props)
+		: base ("mistelix", Defines.VERSION, Modules.UI,  args, props)
+		{
+			Application.Init ();
+			Logger.Info ("Mistelix " + Defines.VERSION + " starting");
+
+			Catalog.Init ("mistelix", Defines.GNOME_LOCALE_DIR);
+
+			Glade.XML gXML = new Glade.XML (null, "mistelix.glade", "mistelix", null);
+			gXML.Autoconnect (this);
+
+			// Mono addins
+			AddinManager.Initialize (base_dir);
+			AddinManager.Registry.Update (null);
+			SetupService setupService = new SetupService (AddinManager.Registry);
+
+			foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes ("/Mistelix/SlideTransitions")) {
+				Logger.Info ("Extension:" + node.CreateInstance ());
+			}
+
+			if (String.Compare (Environment.GetEnvironmentVariable ("MISTELIX_DEBUG"), "true", false) == 0) { 
+				debugging = true;
+			} else {
+				// Only INFO and ERROR when no debugging
+				Logger.LogLevel = Level.INFO;
+				Logger.LogDevice = new ConsoleLogger ();
+			}
+
+			OnProjectView ();
+
+			//project = authoring_view.Project = element_view.Project = new Project ();
+			//project.Load ("/home/jordi/dev/mistelix/projects/Project_TwoSlidesShows.mistelix");
+			//element_view.LoadElements ();
+			//authoring_view.UpdateTheme ();
+
+			if (preferences.GetBoolValue (Preferences.SafeAreaKey) == true)
+				safearea_menuitem.Active = true;
+
+			SensitiveToProjectContext ();
+			app_window.IconName = "mistelix";
+			vpaned.Position = 700; // W (left)
+			hpaned.Position = 30; // H (right), controls position of top "Project elements" button bar
+			LoadWindowPosition ();
+			app_window.ShowAll ();
+		}
+
+		public static Preferences Preferences {
+			get { return preferences; }
+		}
+
+		public static bool Debugging {
+			get { return debugging; }
+		}
+
+		// Options only available in a project context
+		void SensitiveToProjectContext ()
+		{
+			bool active = (project == null ? false : true);
+
+			save_project.Sensitive = active;
+			save_as.Sensitive = active;
+			safearea_menuitem.Sensitive = active;
+			build.Sensitive = active;
+			theme_browser.Sensitive = active;
+			videos_button.Sensitive = active;
+			slideshows_button.Sensitive = active;
+			project_properties.Sensitive = active;
+			add_slideshow.Sensitive = active;
+			add_videos.Sensitive = active;
+		}
+
+		void OnProjectView ()
+		{
+			authoring_view = new AuthoringPaneView (left_vbox, project);
+			
+			element_view = new ProjectElementView (project);
+			scrolledwin_elements.Add (element_view);
+		}
+
+		Gdk.Pixbuf GetIcon (string name)
+		{
+			return Gtk.IconTheme.Default.LoadIcon (name, 48, (Gtk.IconLookupFlags) 0);
+		}
+
+		public static void Main (string [] args) 
+		{
+			Mistelix gui = new Mistelix (args);
+
+			try {
+				SetProcessName (Defines.APPNAME_LOWER);
+			} catch {}
+
+			gui.Run ();
+		}
+
+		void OnAddVideos (object sender, EventArgs args)
+		{
+			AddVideoDialog dialog = new AddVideoDialog ();
+
+			if (dialog.Run () == ResponseType.Ok) {
+				foreach (VideoProjectElement video in dialog.Videos) {
+					project.AddElement (video);
+					element_view.AddElement (video);
+				}
+			}
+		}
+
+		void OnAddSlideShow (object sender, EventArgs args)
+		{
+			AddSlideDialog dialog = new AddSlideDialog ();
+
+			if (dialog.RunNoDestroy () == ResponseType.Ok && dialog.SlideShow.images.Count > 0) {
+				Logger.Debug ("OnSlideshowsButtonClicked.Ok");
+				project.AddElement (dialog.SlideShow);
+				element_view.AddElement (dialog.SlideShow);
+			}
+			dialog.Destroy ();
+		}
+
+		void OnPreferences (object sender, EventArgs args)
+		{
+			PreferencesDialog dialog = new PreferencesDialog ();
+			if (dialog.Run () != ResponseType.Ok)
+				return;
+
+			if (dialog.NeedsRepaint) {
+				element_view.LoadElements ();
+				authoring_view.UpdateTheme ();
+			}
+		}
+
+		void OnAbout (object sender, EventArgs args)
+		{
+			AboutDialog about = new AboutDialog ();
+			about.Run ();
+			about.Destroy ();
+		}
+
+		Pixbuf LoadFromAssembly (string resource)
+		{
+			try {
+				return new Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), resource);
+			} catch {
+				return null;
+			}
+		}
+		
+		void OnQuit (object sender, EventArgs args)
+		{
+			SaveWindowPosition ();
+			Quit ();	
+		}	
+
+		void OnDeleteWindow (object sender, DeleteEventArgs args)
+		{
+			SaveWindowPosition ();
+			Quit ();
+		}
+
+		void LoadWindowPosition ()
+		{
+			bool maximized;
+	
+			maximized = Preferences.GetBoolValue (Preferences.MainWindowMaximizedKey);
+
+			if (maximized) {
+				app_window.Maximize ();
+				return;
+			}
+
+			int x, y, width, height;
+
+			x = Preferences.GetIntValue (Preferences.MainWindowX);
+			y = Preferences.GetIntValue (Preferences.MainWindowY);
+			width = Preferences.GetIntValue (Preferences.MainWindowWidth);
+			height = Preferences.GetIntValue (Preferences.MainWindowHeight);
+
+			app_window.Unmaximize ();
+			app_window.Move (x, y);
+			app_window.Resize (width, height);
+		}
+
+		void SaveWindowPosition ()
+		{
+			bool maximized;
+
+			maximized = (app_window.GdkWindow.State & Gdk.WindowState.Maximized) > 0;
+			Preferences.SetBoolValue (Preferences.MainWindowMaximizedKey, maximized);
+
+			if (!maximized) {
+				int x, y, width, height;
+
+				app_window.GetPosition (out x, out y);
+				app_window.GetSize (out width, out height);
+
+				Preferences.SetIntValue (Preferences.MainWindowX, x);
+				Preferences.SetIntValue (Preferences.MainWindowY, y);
+				Preferences.SetIntValue (Preferences.MainWindowWidth, width);
+				Preferences.SetIntValue (Preferences.MainWindowHeight, height);
+			}
+
+			Preferences.Save ();
+		}
+
+		void OnManageExtensions (object sender, EventArgs args)
+		{			
+			Mono.Addins.Gui.AddinManagerWindow.Run (app_window);
+		}	
+
+		void OnBuildProject (object sender, EventArgs args)
+		{
+			Dependencies dependencies;
+			bool support;
+
+			dependencies = new Dependencies ();
+						
+			if (project.Details.Type == ProjectType.DVD)
+				support = dependencies.DvdSupport;
+			else
+				support = dependencies.TheoraSupport;
+			
+			if (support == false) {
+				CheckDependenciesDialog dependencies_dialog = new CheckDependenciesDialog (project);
+				dependencies_dialog.Dependencies = dependencies;
+				dependencies_dialog.Run ();
+				return;
+			}	
+
+			BuildProjectDialog build_dialog = new BuildProjectDialog (project);
+			build_dialog.Run ();
+		}
+
+		void OnNewProject (object sender, EventArgs args)
+		{	
+			NewProjectDialog dialog = new NewProjectDialog ();
+			if (dialog.Run () == ResponseType.Ok) {
+				project = authoring_view.Project = element_view.Project = dialog.NewProject;
+				SensitiveToProjectContext ();
+				element_view.LoadElements ();
+				app_window.QueueDraw ();
+			}
+		}
+
+		void OnThemeBrowser (object sender, EventArgs args)
+		{
+			ThemeSelectionDialog dialog = new ThemeSelectionDialog (project);
+			if (dialog.Run () == ResponseType.Ok) {
+				authoring_view.UpdateTheme ();
+			}
+		}
+
+		void OnOpenProject (object sender, EventArgs args)
+		{
+			ResponseType response;
+			string filename;
+			Project load_project;
+			FileFilter filter = new FileFilter ();
+			FileChooserDialog chooser_dialog = new FileChooserDialog (
+				Catalog.GetString ("Open Project") , null, FileChooserAction.Open);
+
+			chooser_dialog.SetCurrentFolder (Mistelix.Preferences.GetStringValue (Preferences.ProjectsDirectoryKey));
+			chooser_dialog.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
+			chooser_dialog.AddButton (Gtk.Stock.Open, ResponseType.Ok);
+			chooser_dialog.DefaultResponse = ResponseType.Ok;
+			chooser_dialog.LocalOnly = false;
+
+			filter.AddPattern (Defines.PROJECT_EXTENSION_FILTER);
+			filter.Name = Catalog.GetString ("Mistelix projects");
+			chooser_dialog.AddFilter (filter);
+
+			response = (ResponseType) chooser_dialog.Run ();
+			filename = chooser_dialog.Filename;
+			chooser_dialog.Destroy ();
+
+			if (response != ResponseType.Ok)
+				return;
+
+			try {
+				load_project = new Project ();
+				load_project.Load (filename);
+				project = authoring_view.Project = element_view.Project = load_project;
+				SensitiveToProjectContext ();
+				element_view.LoadElements ();
+				authoring_view.UpdateTheme ();
+				app_window.QueueDraw ();
+
+			} catch (Exception e) {
+				
+				String msg;
+				msg = String.Format (Catalog.GetString ("Error loading project '{0}'"), e.Message);
+				MessageDialog md = new MessageDialog (app_window,
+                                      	DialogFlags.Modal, MessageType.Warning, 
+                                      	ButtonsType.Ok, msg);
+
+				md.Run ();
+				md.Destroy ();
+			}
+		}
+
+		void OnSaveProject (object sender, EventArgs args)
+		{
+			Logger.Debug ("Mistelix.OnSaveProject {0}", project.Details.Filename);
+			if (project.Details.Filename != null) {
+				project.Save (project.Details.Filename);
+				return;
+			}
+
+			OnSaveAs (sender, args);
+		}
+
+		void OnSaveAs (object sender, EventArgs args)
+		{
+			FileChooserDialog chooser_dialog = new FileChooserDialog (
+				Catalog.GetString ("Save Project") , null, FileChooserAction.Save);
+
+			chooser_dialog.SetCurrentFolder (Mistelix.Preferences.GetStringValue (Preferences.ProjectsDirectoryKey));
+			chooser_dialog.CurrentName = project.Details.Name + Defines.PROJECT_EXTENSION;
+			chooser_dialog.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
+			chooser_dialog.AddButton (Gtk.Stock.Save, ResponseType.Ok);
+			chooser_dialog.DefaultResponse = ResponseType.Ok;
+			chooser_dialog.LocalOnly = true;
+
+			if(chooser_dialog.Run () == (int) ResponseType.Ok) {
+				Logger.Debug ("Mistelix.OnSaveProject {0}", chooser_dialog.Uri);
+				project.Save (chooser_dialog.Filename);
+			}
+
+			chooser_dialog.Destroy ();
+		}
+		
+		void OnViewSafeArea (object sender, EventArgs args)
+		{
+			authoring_view.ViewSafeArea = safearea_menuitem.Active;
+			preferences.SetBoolValue (Preferences.SafeAreaKey, safearea_menuitem.Active);
+			preferences.Save ();
+		}
+
+		void OnProjectProperties (object sender, EventArgs args)
+		{
+			ProjectPropertiesDialog dialog = new ProjectPropertiesDialog (project);
+
+			if (dialog.Run () != ResponseType.Ok)
+				return;
+
+			// Properties dlg can change default font, colours and menu thumbnails
+			if (dialog.NeedsRepaint) {
+				authoring_view.UpdateTheme ();
+				app_window.QueueDraw ();
+			}
+		}
+
+		void OnDocumentation (object sender, EventArgs args)
+		{
+			Process.Start ("http://www.mistelix.org/UserManual";);
+		}
+	
+		void OnCheckDependencies (object sender, EventArgs args)
+		{
+			CheckDependenciesDialog dialog = new CheckDependenciesDialog (project);
+			dialog.Run ();
+		}
+
+		[DllImport ("libc")] // Linux
+		private static extern int prctl (int option, byte [] arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);
+
+		[DllImport ("libc")] // BSD
+		private static extern void setproctitle (byte [] fmt, byte [] str_arg);
+
+		public static void SetProcessName (string name)
+		{
+			int platform = (int) Environment.OSVersion.Platform;		
+			if (platform != 4 && platform != 128)
+				return;
+
+			try {
+				if (prctl (15 /* PR_SET_NAME */, Encoding.ASCII.GetBytes (name + "\0"),
+					IntPtr.Zero, IntPtr.Zero, IntPtr.Zero) != 0) {
+					throw new ApplicationException ("Error setting process name: " + 
+						Mono.Unix.Native.Stdlib.GetLastError ());
+				}
+			} catch (EntryPointNotFoundException) {
+				setproctitle (Encoding.ASCII.GetBytes ("%s\0"), 
+					Encoding.ASCII.GetBytes (name + "\0"));
+			}
+		}
+	}
+}

Added: trunk/src/mistelix.glade
==============================================================================
--- (empty file)
+++ trunk/src/mistelix.glade	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,4417 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
+
+<glade-interface>
+
+<widget class="GtkWindow" id="mistelix">
+  <property name="visible">True</property>
+  <property name="title">Mistelix</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <signal name="delete_event" handler="OnDeleteWindow" last_modification_time="Tue, 11 Sep 2007 17:03:35 GMT"/>
+
+  <child>
+    <widget class="GtkVBox" id="vbox1">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+	<widget class="GtkMenuBar" id="menubar1">
+	  <property name="visible">True</property>
+	  <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
+	  <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="menuitem4">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_File</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem4_menu">
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="new_project1">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">New Project...</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnNewProject" last_modification_time="Sat, 11 Oct 2008 15:55:34 GMT"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image29">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-new</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="open_project">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Open Project...</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnOpenProject" last_modification_time="Sat, 11 Oct 2008 15:55:34 GMT"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image30">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-open</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="save_project">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_Save Project</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnSaveProject" last_modification_time="Sat, 11 Oct 2008 15:55:34 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="save_as">
+		      <property name="visible">True</property>
+		      <property name="label">gtk-save-as</property>
+		      <property name="use_stock">True</property>
+		      <signal name="activate" handler="OnSaveAs" last_modification_time="Sat, 11 Oct 2008 15:55:34 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkSeparatorMenuItem" id="separador1">
+		      <property name="visible">True</property>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="quit1">
+		      <property name="visible">True</property>
+		      <property name="label">gtk-quit</property>
+		      <property name="use_stock">True</property>
+		      <signal name="activate" handler="OnQuit" last_modification_time="Wed, 15 Oct 2008 18:12:31 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="menuitem5">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Edit</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem5_menu">
+
+		  <child>
+		    <widget class="GtkMenuItem" id="theme_browser">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Select DVD Menu Theme...</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnThemeBrowser" last_modification_time="Fri, 21 Nov 2008 09:13:28 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="preferences">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Preferences</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnPreferences" last_modification_time="Tue, 30 Dec 2008 11:22:17 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="manage_extensions">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Manage Extensions</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnManageExtensions" last_modification_time="Mon, 03 Nov 2008 21:19:13 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="menuitem6">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_View</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem6_menu">
+
+		  <child>
+		    <widget class="GtkCheckMenuItem" id="safearea_menuitem">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Show TV Safe Area</property>
+		      <property name="use_underline">True</property>
+		      <property name="active">False</property>
+		      <signal name="activate" handler="OnViewSafeArea" last_modification_time="Sat, 22 Nov 2008 17:08:04 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="dvd1">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Project</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="dvd1_menu">
+
+		  <child>
+		    <widget class="GtkMenuItem" id="add_slideshow">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Add Slideshow...</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnAddSlideShow" last_modification_time="Tue, 03 Feb 2009 14:20:41 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="add_videos">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Add Videos...</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnAddVideos" last_modification_time="Tue, 03 Feb 2009 14:20:41 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkSeparatorMenuItem" id="separador3">
+		      <property name="visible">True</property>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="project_properties">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Properties</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnProjectProperties" last_modification_time="Tue, 03 Feb 2009 14:23:44 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkSeparatorMenuItem" id="separador2">
+		      <property name="visible">True</property>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="build">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Build...</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnBuildProject" last_modification_time="Fri, 10 Oct 2008 18:38:09 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="menuitem7">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Help</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem7_menu">
+
+		  <child>
+		    <widget class="GtkMenuItem" id="dependencies_item">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Check Mistelix's dependencies requirements</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnCheckDependencies" last_modification_time="Sat, 28 Feb 2009 22:15:57 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="mistelix's_on-line_documentation1">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Mistelix's on-line documentation</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnDocumentation" last_modification_time="Sat, 28 Feb 2009 22:15:57 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="about1">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_About</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="OnAbout" last_modification_time="Thu, 30 Oct 2008 18:35:52 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHPaned" id="vertical_paned">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="position">0</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="left_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<placeholder/>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="shrink">True</property>
+	      <property name="resize">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="right_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVPaned" id="vpaned_horizontal">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="position">0</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox4">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkVBox" id="vbox6">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">0</property>
+
+			  <child>
+			    <widget class="GtkVBox" id="vbox7">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<widget class="GtkHBox" id="hbox1">
+				  <property name="visible">True</property>
+				  <property name="homogeneous">False</property>
+				  <property name="spacing">0</property>
+
+				  <child>
+				    <widget class="GtkLabel" id="label1">
+				      <property name="visible">True</property>
+				      <property name="label" translatable="yes">&lt;b&gt;Project elements&lt;/b&gt;</property>
+				      <property name="use_underline">False</property>
+				      <property name="use_markup">True</property>
+				      <property name="justify">GTK_JUSTIFY_LEFT</property>
+				      <property name="wrap">False</property>
+				      <property name="selectable">False</property>
+				      <property name="xalign">0.5</property>
+				      <property name="yalign">0.5</property>
+				      <property name="xpad">0</property>
+				      <property name="ypad">0</property>
+				      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				      <property name="width_chars">-1</property>
+				      <property name="single_line_mode">False</property>
+				      <property name="angle">0</property>
+				    </widget>
+				    <packing>
+				      <property name="padding">5</property>
+				      <property name="expand">False</property>
+				      <property name="fill">False</property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkButton" id="videos_button">
+				      <property name="visible">True</property>
+				      <property name="can_focus">True</property>
+				      <property name="label" translatable="yes">Add Videos</property>
+				      <property name="use_underline">True</property>
+				      <property name="relief">GTK_RELIEF_NORMAL</property>
+				      <property name="focus_on_click">True</property>
+				      <signal name="clicked" handler="OnAddVideos" last_modification_time="Sun, 05 Oct 2008 15:50:10 GMT"/>
+				    </widget>
+				    <packing>
+				      <property name="padding">20</property>
+				      <property name="expand">False</property>
+				      <property name="fill">False</property>
+				    </packing>
+				  </child>
+
+				  <child>
+				    <widget class="GtkButton" id="slideshows_button">
+				      <property name="visible">True</property>
+				      <property name="can_focus">True</property>
+				      <property name="label" translatable="yes">Add Slideshow</property>
+				      <property name="use_underline">True</property>
+				      <property name="relief">GTK_RELIEF_NORMAL</property>
+				      <property name="focus_on_click">True</property>
+				      <signal name="clicked" handler="OnAddSlideShow" last_modification_time="Sun, 05 Oct 2008 15:50:10 GMT"/>
+				    </widget>
+				    <packing>
+				      <property name="padding">0</property>
+				      <property name="expand">False</property>
+				      <property name="fill">False</property>
+				    </packing>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="shrink">True</property>
+		      <property name="resize">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="rightpaned_vbox">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkScrolledWindow" id="scrolledwindow_elements">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			  <property name="shadow_type">GTK_SHADOW_NONE</property>
+			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			  <child>
+			    <placeholder/>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="shrink">True</property>
+		      <property name="resize">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="shrink">True</property>
+	      <property name="resize">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="addslide">
+  <property name="width_request">800</property>
+  <property name="height_request">600</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Add Slideshow</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox1">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="hbuttonbox2">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHPaned" id="vertical_paned">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="position">0</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="left_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox16">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkScrolledWindow" id="scrolled_images">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		      <property name="shadow_type">GTK_SHADOW_NONE</property>
+		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox17">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkHBox" id="ctrls_hbox">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">0</property>
+
+			  <child>
+			    <widget class="GtkTable" id="table1">
+			      <property name="visible">True</property>
+			      <property name="n_rows">3</property>
+			      <property name="n_columns">3</property>
+			      <property name="homogeneous">False</property>
+			      <property name="row_spacing">0</property>
+			      <property name="column_spacing">0</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label6">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Duration (seconds):</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label7">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Transition type:</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkSpinButton" id="duration_spin">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="climb_rate">1</property>
+				  <property name="digits">0</property>
+				  <property name="numeric">False</property>
+				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+				  <property name="snap_to_ticks">False</property>
+				  <property name="wrap">False</property>
+				  <property name="adjustment">1 0 100 1 0 0</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkComboBox" id="transition_combo">
+				  <property name="visible">True</property>
+				  <property name="items" translatable="yes"></property>
+				  <property name="add_tearoffs">False</property>
+				  <property name="focus_on_click">True</property>
+				  <signal name="changed" handler="OnTransitionComboChanged" last_modification_time="Tue, 04 Nov 2008 16:20:20 GMT"/>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options">fill</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkButton" id="down_button">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label">gtk-go-down</property>
+				  <property name="use_stock">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">2</property>
+				  <property name="right_attach">3</property>
+				  <property name="top_attach">1</property>
+				  <property name="bottom_attach">2</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkButton" id="up_button">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label">gtk-go-up</property>
+				  <property name="use_stock">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">2</property>
+				  <property name="right_attach">3</property>
+				  <property name="top_attach">0</property>
+				  <property name="bottom_attach">1</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label36">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Text position:</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="left_attach">0</property>
+				  <property name="right_attach">1</property>
+				  <property name="top_attach">2</property>
+				  <property name="bottom_attach">3</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkComboBox" id="textposition_combo">
+				  <property name="visible">True</property>
+				  <property name="items" translatable="yes"></property>
+				  <property name="add_tearoffs">False</property>
+				  <property name="focus_on_click">True</property>
+				  <signal name="changed" handler="OnTextPositionComboChanged" last_modification_time="Tue, 04 Nov 2008 16:20:20 GMT"/>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">2</property>
+				  <property name="bottom_attach">3</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options">fill</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <placeholder/>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkHButtonBox" id="hbuttonbox4">
+			  <property name="visible">True</property>
+			  <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
+			  <property name="spacing">0</property>
+
+			  <child>
+			    <widget class="GtkButton" id="generate">
+			      <property name="visible">True</property>
+			      <property name="can_default">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <signal name="clicked" handler="OnSaveSlide" last_modification_time="Sun, 09 Nov 2008 14:14:34 GMT"/>
+
+			      <child>
+				<widget class="GtkAlignment" id="alignment1">
+				  <property name="visible">True</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xscale">0</property>
+				  <property name="yscale">0</property>
+				  <property name="top_padding">0</property>
+				  <property name="bottom_padding">0</property>
+				  <property name="left_padding">0</property>
+				  <property name="right_padding">0</property>
+
+				  <child>
+				    <widget class="GtkHBox" id="hbox6">
+				      <property name="visible">True</property>
+				      <property name="homogeneous">False</property>
+				      <property name="spacing">2</property>
+
+				      <child>
+					<widget class="GtkImage" id="image8">
+					  <property name="visible">True</property>
+					  <property name="stock">gtk-apply</property>
+					  <property name="icon_size">4</property>
+					  <property name="xalign">0.5</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+
+				      <child>
+					<widget class="GtkLabel" id="save">
+					  <property name="visible">True</property>
+					  <property name="label" translatable="yes">Save Slideshow</property>
+					  <property name="use_underline">True</property>
+					  <property name="use_markup">False</property>
+					  <property name="justify">GTK_JUSTIFY_LEFT</property>
+					  <property name="wrap">False</property>
+					  <property name="selectable">False</property>
+					  <property name="xalign">0.5</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+					  <property name="width_chars">-1</property>
+					  <property name="single_line_mode">False</property>
+					  <property name="angle">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+			      </child>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkButton" id="cancel">
+			      <property name="visible">True</property>
+			      <property name="can_default">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label">gtk-cancel</property>
+			      <property name="use_stock">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <signal name="clicked" handler="OnCancel" last_modification_time="Fri, 14 Nov 2008 15:59:46 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkButton" id="preview">
+			      <property name="visible">True</property>
+			      <property name="sensitive">False</property>
+			      <property name="can_default">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Preview</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="shrink">True</property>
+	      <property name="resize">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="right_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVPaned" id="vpaned_horizontal">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox_dir">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+
+		      <child>
+			<placeholder/>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="shrink">True</property>
+		      <property name="resize">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox5">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkScrolledWindow" id="scrolledwindow_files">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+			  <property name="shadow_type">GTK_SHADOW_NONE</property>
+			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			  <child>
+			    <placeholder/>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="shrink">True</property>
+		      <property name="resize">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="shrink">True</property>
+	      <property name="resize">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="addvideo">
+  <property name="width_request">800</property>
+  <property name="height_request">600</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Add Videos</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox1">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="hbuttonbox2">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="ok">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	      <signal name="clicked" handler="OnOK" last_modification_time="Fri, 31 Oct 2008 17:29:41 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="right_vbox">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkVPaned" id="vpaned_horizontal">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox_dir">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <placeholder/>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="shrink">True</property>
+		  <property name="resize">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox5">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkScrolledWindow" id="scrolledwindow_files">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		      <property name="shadow_type">GTK_SHADOW_NONE</property>
+		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="shrink">True</property>
+		  <property name="resize">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="newproject">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">New Mistelix project</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox2">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area1">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton1">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton1">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	      <signal name="clicked" handler="OnOK" last_modification_time="Tue, 11 Nov 2008 18:26:14 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox9">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox2">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox13">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label5">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;b&gt;Project Name&lt;/b&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkEntry" id="name">
+		      <property name="width_request">400</property>
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text" translatable="yes"></property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">â</property>
+		      <property name="activates_default">False</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox3">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox10">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label3">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;b&gt;Output Directory&lt;/b&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox4">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkEntry" id="output_dir">
+			  <property name="width_request">400</property>
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="editable">True</property>
+			  <property name="visibility">True</property>
+			  <property name="max_length">0</property>
+			  <property name="text" translatable="yes"></property>
+			  <property name="has_frame">True</property>
+			  <property name="invisible_char">â</property>
+			  <property name="activates_default">False</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkButton" id="button1">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Browse...</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <signal name="clicked" handler="OnBrowse" last_modification_time="Tue, 11 Nov 2008 17:29:13 GMT"/>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHButtonBox" id="hbuttonbox3">
+		  <property name="visible">True</property>
+		  <property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
+		  <property name="spacing">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox24">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label30">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Project type&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="slideshows_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Theora project (slideshows to video)</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="dvd_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">DVD-Video project</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">slideshows_radio</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox11">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="vformat_label">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Video Format&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox12">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="pal_radio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">PAL (Europe)</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="ntsc_radio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">NTSC</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">pal_radio</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox27">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="aratio_label">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Aspect Ratio&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="fourbythree_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">4:3 (TV)</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="sixteenbynine_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">16:9 (Widescreen)</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">fourbythree_radio</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="projectproperties">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Project Properties</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox2">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area1">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton1">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton1">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	      <signal name="clicked" handler="OnOK" last_modification_time="Tue, 11 Nov 2008 18:26:14 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox9">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox2">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox13">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label5">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;b&gt;Project Name&lt;/b&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkEntry" id="name">
+		      <property name="width_request">400</property>
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text" translatable="yes"></property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">â</property>
+		      <property name="activates_default">False</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox3">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox10">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label3">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;b&gt;Output Directory&lt;/b&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox4">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkEntry" id="output_dir">
+			  <property name="width_request">400</property>
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="editable">True</property>
+			  <property name="visibility">True</property>
+			  <property name="max_length">0</property>
+			  <property name="text" translatable="yes"></property>
+			  <property name="has_frame">True</property>
+			  <property name="invisible_char">â</property>
+			  <property name="activates_default">False</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkButton" id="button1">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Browse...</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <signal name="clicked" handler="OnBrowse" last_modification_time="Tue, 11 Nov 2008 17:29:13 GMT"/>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHButtonBox" id="hbuttonbox3">
+		  <property name="visible">True</property>
+		  <property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
+		  <property name="spacing">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox13">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label39">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Project Type:&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">5</property>
+		  <property name="ypad">5</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="type_label">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes"></property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox11">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label4">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Video Format&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox12">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="pal_radio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">PAL (Europe)</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="ntsc_radio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">NTSC</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">pal_radio</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox28">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label38">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Aspect Ratio&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="fourbythree_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">4:3 (TV)</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="sixteenbynine_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">16:9 (Widescreen)</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">fourbythree_radio</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="slide_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label32">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Slideshow Transitions Properties&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">5</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTable" id="properties_table">
+		  <property name="visible">True</property>
+		  <property name="n_rows">3</property>
+		  <property name="n_columns">2</property>
+		  <property name="homogeneous">False</property>
+		  <property name="row_spacing">0</property>
+		  <property name="column_spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label33">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Font</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label34">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Foreground color</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label35">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Background color</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkFontButton" id="fontslides_button">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="show_style">True</property>
+		      <property name="show_size">True</property>
+		      <property name="use_font">False</property>
+		      <property name="use_size">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkColorButton" id="foreslides_button">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="use_alpha">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkColorButton" id="backslides_button">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="use_alpha">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">5</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="buttons_vbox">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label32">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Menu Buttons Properties&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">5</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTable" id="properties_table">
+		  <property name="visible">True</property>
+		  <property name="n_rows">4</property>
+		  <property name="n_columns">2</property>
+		  <property name="homogeneous">False</property>
+		  <property name="row_spacing">0</property>
+		  <property name="column_spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label33">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Font</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label34">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Foreground color</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label35">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Background color</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkFontButton" id="fontbuttons_button">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="show_style">True</property>
+		      <property name="show_size">True</property>
+		      <property name="use_font">False</property>
+		      <property name="use_size">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkColorButton" id="forebuttons_button">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="use_alpha">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkColorButton" id="backbuttons_button">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="use_alpha">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label40">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Image thumbnail size</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkComboBox" id="thumbnail_combo">
+		      <property name="visible">True</property>
+		      <property name="items" translatable="yes"></property>
+		      <property name="add_tearoffs">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">5</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="buildproject">
+  <property name="width_request">450</property>
+  <property name="height_request">300</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Build Project</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox3">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area4">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox18">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox19">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkTextView" id="textview">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="editable">False</property>
+		  <property name="overwrite">False</property>
+		  <property name="accepts_tab">True</property>
+		  <property name="justification">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap_mode">GTK_WRAP_WORD</property>
+		  <property name="cursor_visible">False</property>
+		  <property name="pixels_above_lines">5</property>
+		  <property name="pixels_below_lines">5</property>
+		  <property name="pixels_inside_wrap">0</property>
+		  <property name="left_margin">0</property>
+		  <property name="right_margin">0</property>
+		  <property name="indent">0</property>
+		  <property name="text" translatable="yes">Welcome to the project building process. Press the 'Generate' button to start the project building process.</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTable" id="table2">
+		  <property name="visible">True</property>
+		  <property name="n_rows">2</property>
+		  <property name="n_columns">2</property>
+		  <property name="homogeneous">False</property>
+		  <property name="row_spacing">0</property>
+		  <property name="column_spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="totalprogress_label">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Total progress</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label12">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Task progress</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkProgressBar" id="total_bar">
+		      <property name="visible">True</property>
+		      <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
+		      <property name="fraction">0</property>
+		      <property name="pulse_step">0.10000000149</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkProgressBar" id="task_bar">
+		      <property name="visible">True</property>
+		      <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
+		      <property name="fraction">0</property>
+		      <property name="pulse_step">0.10000000149</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkScrolledWindow" id="scrolledwindow1">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+	      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+	      <property name="shadow_type">GTK_SHADOW_IN</property>
+	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+	      <child>
+		<widget class="GtkTextView" id="status_text">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="editable">False</property>
+		  <property name="overwrite">False</property>
+		  <property name="accepts_tab">True</property>
+		  <property name="justification">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap_mode">GTK_WRAP_NONE</property>
+		  <property name="cursor_visible">False</property>
+		  <property name="pixels_above_lines">0</property>
+		  <property name="pixels_below_lines">0</property>
+		  <property name="pixels_inside_wrap">0</property>
+		  <property name="left_margin">0</property>
+		  <property name="right_margin">0</property>
+		  <property name="indent">0</property>
+		  <property name="text" translatable="yes"></property>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHButtonBox" id="hbuttonbox">
+	      <property name="visible">True</property>
+	      <property name="layout_style">GTK_BUTTONBOX_END</property>
+	      <property name="spacing">5</property>
+
+	      <child>
+		<widget class="GtkButton" id="button2">
+		  <property name="visible">True</property>
+		  <property name="can_default">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label">gtk-close</property>
+		  <property name="use_stock">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <signal name="clicked" handler="OnCancel" last_modification_time="Sat, 06 Dec 2008 17:31:27 GMT"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkButton" id="generate">
+		  <property name="visible">True</property>
+		  <property name="can_default">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">_Generate</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <signal name="clicked" handler="OnGenerate" last_modification_time="Sat, 06 Dec 2008 17:28:30 GMT"/>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="preferences">
+  <property name="width_request">600</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Preferences</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox5">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area5">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton3">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton3">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	      <signal name="clicked" handler="OnOK" last_modification_time="Fri, 31 Oct 2008 17:29:41 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox20">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox21">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label13">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHBox" id="hbox7">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label15">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Thumbnails size</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkComboBox" id="thumbnail_combo">
+		      <property name="visible">True</property>
+		      <property name="items" translatable="yes"></property>
+		      <property name="add_tearoffs">False</property>
+		      <property name="focus_on_click">False</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox22">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label18">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Files and Directories&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTable" id="table3">
+		  <property name="visible">True</property>
+		  <property name="n_rows">4</property>
+		  <property name="n_columns">2</property>
+		  <property name="homogeneous">False</property>
+		  <property name="row_spacing">0</property>
+		  <property name="column_spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label19">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Default projects directory</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label24">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Default videos directory</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label25">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Default images directory</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label26">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Default audio directory</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">5</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="projectsdir_hbox">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+
+		      <child>
+			<placeholder/>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="videosdir_hbox">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+
+		      <child>
+			<placeholder/>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="imagesdir_hbox">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+
+		      <child>
+			<placeholder/>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="audiodir_hbox">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<placeholder/>
+		      </child>
+
+		      <child>
+			<placeholder/>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox12">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox23">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="label17">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">&lt;b&gt;Defaults for slideshows transitions&lt;/b&gt;</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkTable" id="table4">
+		      <property name="visible">True</property>
+		      <property name="n_rows">3</property>
+		      <property name="n_columns">2</property>
+		      <property name="homogeneous">False</property>
+		      <property name="row_spacing">0</property>
+		      <property name="column_spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label27">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Default transition effect</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">5</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label28">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Default time (seconds)</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">5</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
+			  <property name="top_attach">1</property>
+			  <property name="bottom_attach">2</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label29">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Default text position</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">5</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
+			  <property name="top_attach">2</property>
+			  <property name="bottom_attach">3</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="transition_combo">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes"></property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkSpinButton" id="duration_spin">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="climb_rate">1</property>
+			  <property name="digits">0</property>
+			  <property name="numeric">False</property>
+			  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+			  <property name="snap_to_ticks">False</property>
+			  <property name="wrap">False</property>
+			  <property name="adjustment">1 0 100 1 0 0</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">1</property>
+			  <property name="bottom_attach">2</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="textposition_combo">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes"></property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">2</property>
+			  <property name="bottom_attach">3</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="buttonproperties">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Button Properties</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox6">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area6">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton4">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="ok_button">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	      <signal name="clicked" handler="OnOK" last_modification_time="Tue, 11 Nov 2008 18:26:14 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox25">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox26">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label31">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Show button as&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">5</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="image_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Thumbnail image of the item</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="text_radio">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Text element</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">image_radio</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkEntry" id="element_entry">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="editable">True</property>
+		  <property name="visibility">True</property>
+		  <property name="max_length">0</property>
+		  <property name="text" translatable="yes"></property>
+		  <property name="has_frame">True</property>
+		  <property name="invisible_char">â</property>
+		  <property name="activates_default">False</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="dependencies">
+  <property name="width_request">500</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Check Mistelix dependencies requirements</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox7">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area7">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton4">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="has_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHBox" id="hbox14">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox15">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<widget class="GtkVBox" id="dependencies_vbox">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox30">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkTextView" id="textview">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="editable">False</property>
+			  <property name="overwrite">False</property>
+			  <property name="accepts_tab">True</property>
+			  <property name="justification">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap_mode">GTK_WRAP_WORD</property>
+			  <property name="cursor_visible">False</property>
+			  <property name="pixels_above_lines">5</property>
+			  <property name="pixels_below_lines">5</property>
+			  <property name="pixels_inside_wrap">0</property>
+			  <property name="left_margin">5</property>
+			  <property name="right_margin">5</property>
+			  <property name="indent">0</property>
+			  <property name="text" translatable="yes">Mistelix uses a set of external components. Their availability determines Mistelix's capabilities. The following list shows the level of support of your system for Mistelix and if there are actions required.</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkTreeView" id="treeview">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="headers_visible">True</property>
+			  <property name="rules_hint">False</property>
+			  <property name="reorderable">False</property>
+			  <property name="enable_search">True</property>
+			  <property name="fixed_height_mode">False</property>
+			  <property name="hover_selection">False</property>
+			  <property name="hover_expand">False</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="capabilities_label">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes"></property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">5</property>
+			  <property name="ypad">5</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="themeselection">
+  <property name="width_request">700</property>
+  <property name="height_request">500</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Select DVD Menu Theme</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox8">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area8">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton5">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton5">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	      <signal name="clicked" handler="OnOK" last_modification_time="Tue, 11 Nov 2008 18:26:14 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox31">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkTextView" id="textview">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="editable">False</property>
+	      <property name="overwrite">False</property>
+	      <property name="accepts_tab">True</property>
+	      <property name="justification">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap_mode">GTK_WRAP_WORD</property>
+	      <property name="cursor_visible">False</property>
+	      <property name="pixels_above_lines">5</property>
+	      <property name="pixels_below_lines">5</property>
+	      <property name="pixels_inside_wrap">0</property>
+	      <property name="left_margin">0</property>
+	      <property name="right_margin">0</property>
+	      <property name="indent">0</property>
+	      <property name="text" translatable="yes">Menu themes define how the main DVD menu look like. The default background image and the type of buttons. You have more information about themes at http://www.mistelix.org/Themes</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHPaned" id="hpaned">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="position">0</property>
+
+	      <child>
+		<widget class="GtkScrolledWindow" id="scrolledwindow2">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		  <property name="shadow_type">GTK_SHADOW_NONE</property>
+		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+		  <child>
+		    <widget class="GtkTreeView" id="themes_tree">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="headers_visible">True</property>
+		      <property name="rules_hint">False</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
+		      <property name="hover_selection">False</property>
+		      <property name="hover_expand">False</property>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="shrink">True</property>
+		  <property name="resize">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox33">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="details_box">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label43">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">&lt;b&gt;Description&lt;/b&gt;</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">5</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkTable" id="table5">
+			  <property name="visible">True</property>
+			  <property name="n_rows">2</property>
+			  <property name="n_columns">2</property>
+			  <property name="homogeneous">False</property>
+			  <property name="row_spacing">0</property>
+			  <property name="column_spacing">0</property>
+
+			  <child>
+			    <widget class="GtkLabel" id="label44">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Author:</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0</property>
+			      <property name="xpad">5</property>
+			      <property name="ypad">5</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="author_label">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes"></property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label46">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Description:</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0</property>
+			      <property name="xpad">5</property>
+			      <property name="ypad">5</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="description_label">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes"></property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0</property>
+			      <property name="xpad">5</property>
+			      <property name="ypad">5</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">True</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="preview_box">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label48">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">&lt;b&gt;Background&lt;/b&gt;</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">5</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkVBox" id="backpreview_box">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">0</property>
+
+			  <child>
+			    <placeholder/>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkHBox" id="hbox19">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">0</property>
+
+			  <child>
+			    <widget class="GtkLabel" id="label49">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Custom background:</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0</property>
+			      <property name="xpad">5</property>
+			      <property name="ypad">5</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkVBox" id="vbox38">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<widget class="GtkHBox" id="file_hbox">
+				  <property name="visible">True</property>
+				  <property name="homogeneous">False</property>
+				  <property name="spacing">0</property>
+
+				  <child>
+				    <placeholder/>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">True</property>
+				  <property name="fill">True</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkVBox" id="buttons_box">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkLabel" id="label50">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">&lt;b&gt;Button highlighting&lt;/b&gt;</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">5</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkTable" id="table6">
+			  <property name="visible">True</property>
+			  <property name="n_rows">2</property>
+			  <property name="n_columns">2</property>
+			  <property name="homogeneous">False</property>
+			  <property name="row_spacing">0</property>
+			  <property name="column_spacing">0</property>
+
+			  <child>
+			    <widget class="GtkLabel" id="label51">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Highlight button</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0</property>
+			      <property name="xpad">5</property>
+			      <property name="ypad">5</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label52">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Select button</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0</property>
+			      <property name="xpad">5</property>
+			      <property name="ypad">5</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkHBox" id="selectbutton_box">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<placeholder/>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="y_options">fill</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkHBox" id="highlightbutton_box">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<placeholder/>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options">fill</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="shrink">True</property>
+		  <property name="resize">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>

Added: trunk/src/mistelix.in
==============================================================================
--- (empty file)
+++ trunk/src/mistelix.in	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@ 
+
+export DYLD_LIBRARY_PATH=$libdir/mistelix/:$DYLD_LIBRARY_PATH
+export LD_LIBRARY_PATH=$libdir/mistelix/:$LD_LIBRARY_PATH
+export GST_PLUGIN_PATH=$libdir/mistelix/gstreamer/:$GST_PLUGIN_PATH
+
+MONO_EXE="$libdir/mistelix/mistelix.exe"
+ 
+for arg in $*; do
+    case "x--debug" in ("x${arg}")
+        MONO_OPTIONS="--debug${MONO_OPTIONS+:$MONO_OPTIONS}"
+    esac
+done
+
+exec -a mistelix mono $MONO_OPTIONS $MONO_EXE "$@"
+

Added: trunk/src/mono-addins-strings.xml
==============================================================================
--- (empty file)
+++ trunk/src/mono-addins-strings.xml	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,42 @@
+<!-- 
+	To localize Mono.Addins.Gui we should include the GUI strings in the application
+	See: http://groups.google.com/group/mono-addins/browse_thread/thread/b6c1d648c3493a65
+ -->
+<ui>
+<_string>Add-in Manager</_string>
+<_string>Additional extensions are required to perform this operation.</_string>
+<_string>The following add-ins will be installed:</_string>
+<_string><big><b>Add-in Manager</b></big></_string>
+<_string>The following add-ins are currently installed:</_string>
+<_string>_Install Add-ins...</_string>
+<_string>_Repositories...</_string>
+<_string>_Uninstall...</_string>
+<_string>Enable</_string>
+<_string>Disable</_string>
+<_string>Add-in</_string>
+<_string>Version</_string>
+<_string>Other</_string>
+<_string>Version:</_string>
+<_string>Author:</_string>
+<_string>Copyright:</_string>
+<_string>Add-in Dependencies:</_string>
+<_string><b>Select the add-ins to install and click on Next</b></_string>
+<_string>Show all packages</_string>
+<_string>Show new versions only</_string>
+<_string>Show updates only</_string>
+<_string>_Unselect All</_string>
+<_string>Select _All</_string>
+<_string>Add-in Installation</_string>
+<_string>Name</_string>
+<_string>Url</_string>
+<_string>Install from:</_string>
+<_string>Repository</_string>
+<_string>All registered repositories</_string>
+<_string>Register an on-line repository</_string>
+<_string>Select the location of the repository you want to register:</_string>
+<_string>Register a local repository</_string>
+<_string>Url:</_string>
+<_string>Browse...</_string>
+<_string>Path:</_string>
+</ui>
+

Added: trunk/src/widgets/AuthoringPaneView.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/AuthoringPaneView.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,332 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.IO;
+using System.Text;
+using Gtk;
+using Gdk;
+using Mono.Unix;
+
+using Mistelix.DataModel;
+using Mistelix.Core;
+using Mistelix.Widgets;
+using Mistelix.Dialogs;
+
+namespace Mistelix.Widgets
+{
+	//
+	// Contains all the logic for the project authoring view
+	//
+	public class AuthoringPaneView : DrawingArea
+	{	
+		static readonly TargetEntry [] tag_dest_target_table = new TargetEntry [] {
+					new TargetEntry ("application/x-mistelix-item", 0, (uint) 2)};
+
+		Project project;
+		DvdMenu menu;
+		bool safearea;
+		Core.Button moving_button;
+		int x_delta, y_delta, button, active_item;
+		
+		public AuthoringPaneView (Gtk.VBox parent, Project project)
+		{
+			Project = project;
+			active_item = -1;
+			DragDataReceived += new DragDataReceivedHandler (HandleTargetDragDataReceived);
+
+			EventBox eb = new EventBox (); // Provides a window for this windowless widget
+			parent.Add (eb);
+
+			eb.Add (this);
+			Gtk.Drag.DestSet (this, DestDefaults.All, tag_dest_target_table,
+					  DragAction.Copy | DragAction.Move);
+
+			eb.ButtonPressEvent += HandleButtonPress;
+			eb.ButtonReleaseEvent += HandleButtonRelease;
+			eb.MotionNotifyEvent += HandleMotionNotify;
+
+			UpdateTheme ();
+		}
+		
+		public Project Project {
+			set {
+				project = value;
+				if (menu != null)
+					menu.Dispose ();
+				
+				menu = new DvdMenu (project);
+
+				if (project != null)
+				{
+					project.Buttons.CollectionChanged += delegate 
+					{ 
+						Logger.Debug ("AuthoringPaneView.Project -> CollectionChanged");
+						QueueDraw ();
+					};
+				}
+			}
+		}
+
+		public bool ViewSafeArea {
+			set { 
+				safearea = value;
+				QueueDraw ();
+			}
+		}
+
+		public void UpdateTheme ()
+		{
+			menu.UpdateTheme ();
+			QueueDraw ();
+		}
+
+		// Processing of dropped files from the Project Element View is done here
+		void HandleTargetDragDataReceived (object sender, DragDataReceivedArgs args)
+		{
+			Logger.Debug ("AuthoringPaneView.HandleTargetDragDataReceived {0} {1}", args.X, args.Y);
+
+			IntList list = new IntList ();
+			list.FromString (System.Text.Encoding.UTF8.GetString (args.SelectionData.Data));
+			foreach (int item_id in list) {
+				Logger.Debug ("AuthoringPaneView.HandleTargetDragDataReceived.Item {0}", item_id);
+				project.AddButton (new Core.Button (args.X, args.Y, item_id));
+			}
+
+			args.RetVal = true;
+			Gtk.Drag.Finish (args.Context, true, false, args.Time);	
+			// QueueDraw fired by CollectionChanged
+		}
+
+		void DrawText (Gdk.Window window, Cairo.Context cr, string text)
+		{
+			bool theme;
+			Gdk.GC light;
+			const int marginx = 10;
+			int winWidth, winHeight, w, h;
+			window.GetSize (out winWidth, out winHeight);
+
+			if (project != null && project.Details.Theme != null) {
+				theme = true;
+			}
+			else
+				theme = false;
+
+			if (theme == true) {
+				if (winWidth > project.Details.Width)
+					winWidth = project.Details.Width;
+
+				if (winHeight > project.Details.Height)
+					winHeight = project.Details.Height;
+			}
+
+			Pango.Layout layout = new Pango.Layout (this.PangoContext);
+			layout.Width = winWidth * (int) Pango.Scale.PangoScale;
+			layout.SetMarkup (text);
+			layout.GetPixelSize (out w, out h);
+
+			if (theme) {
+				// TODO: We should force the ink colour too
+				cr.Color = new Cairo.Color (0, 0, 0, 0.7);
+				cr.Rectangle (((winWidth - w) /2) - marginx,  (winHeight / 2), w + marginx * 2, h * 2);
+				cr.Fill ();
+				cr.Stroke ();
+				light = Style.LightGC (StateType.Normal);
+			}
+
+			light = Style.DarkGC (StateType.Normal);
+			window.DrawLayout (light, (winWidth - w) /2, (winHeight / 2) + 4,  layout);
+			layout.Dispose ();
+		}		
+
+		protected override bool OnExposeEvent (Gdk.EventExpose args)
+		{
+			if (!IsRealized)
+				return false;
+
+			int width, height;	
+			Cairo.Context cr = Gdk.CairoHelper.Create (args.Window);
+			args.Window.GetSize (out width, out height);
+
+			cr.Color = new Cairo.Color (1, 1, 1, 1);
+			cr.Paint ();
+			cr.Stroke ();
+
+			menu.Draw (cr, moving_button);
+
+			if (project != null) {
+				if (project.Elements.Count == 0) {
+					DrawText (args.Window, cr, Catalog.GetString ("Use the 'Add Videos' or 'Add Slideshow' buttons to add new elements"));
+				}
+				else {
+					if (project.Buttons.Count == 0)
+						DrawText (args.Window, cr, Catalog.GetString ("Drag elements here to add them to the project"));
+				}
+			} else {
+				DrawText (args.Window, cr, Catalog.GetString ("Start a new project or load an existant one"));
+			}
+			
+			if (project != null && safearea) 
+			{	
+				// 95% of the area is safe
+				double w_area = project.Details.Width * 0.05;
+				double h_area = project.Details.Height * 0.05;
+
+				GtkUtils.DrawSelectionBox (cr, w_area / 2, h_area /2 , project.Details.Width - w_area, 
+				              	project.Details.Height - h_area);
+			}
+			
+			((IDisposable)cr).Dispose ();
+			return base.OnExposeEvent (args);
+		}
+
+		void HandleButtonPress (object o, ButtonPressEventArgs args)
+		{
+			Logger.Debug ("AuthoringPaneView.HandleButtonPress");
+
+			if (project == null)
+				return;
+
+			if (args.Event.Type == EventType.TwoButtonPress) {
+				DoubleClick (o, args);
+				return;
+			}
+
+			int x = (int) args.Event.X;
+			int y = (int) args.Event.Y;
+			int b = ButtonIDFromCoordinates (x, y);
+
+			if (b == -1)
+				return;
+
+			if (args.Event.Button == 3) {
+				active_item = b;
+				GtkMenu menu = new GtkMenu ();
+				menu.AddItem (Catalog.GetString ("Element properties"), OnShowElementProperties);
+				menu.AddItem (Catalog.GetString ("Delete element from project"), OnDeleteElement);
+				menu.Popup (args);
+			}
+
+			button = b;
+			x_delta = x >= project.Buttons[b].X ?  project.Buttons[b].X - x: x - project.Buttons[b].X;
+			y_delta = y >= project.Buttons[b].Y ?  project.Buttons[b].Y - y: y - project.Buttons[b].Y;
+			moving_button = new Core.Button (x + x_delta, y + y_delta, project.Buttons[b].LinkedId);
+			GdkWindow.Cursor = new Gdk.Cursor (Gdk.CursorType.Hand1);
+			QueueDraw ();
+			Logger.Debug ("AuthoringPaneView.HandleButtonPress. Button {0}", project.Buttons[b].LinkedId);
+		}
+
+		int ButtonIDFromCoordinates (int x, int y)
+		{
+			for (int b = 0; b < project.Buttons.Count; b++)
+			{
+				if ((x >= project.Buttons[b].X && x <= project.Buttons[b].X + project.Buttons[b].Width) &&
+					(y >= project.Buttons[b].Y && y <= project.Buttons[b].Y + project.Buttons[b].Height))
+					return b;
+			}
+			return -1;
+		}
+
+		void HandleMotionNotify (object o, MotionNotifyEventArgs args)
+		{
+			int x = (int) args.Event.X;
+			int y = (int) args.Event.Y;
+
+			if (moving_button == null || project == null || project.Buttons.Count <= 0)
+				return;
+
+			if (x + x_delta <  0 || y + y_delta < 0)
+				return;
+
+			if (x + x_delta + project.Buttons[button].Width > project.details.Width || y + y_delta + project.Buttons[button].Height > project.details.Height)
+				return;
+
+			moving_button.X = x + x_delta;
+			moving_button.Y = y + y_delta;
+			QueueDraw ();
+		}
+
+		void HandleButtonRelease (object o, ButtonReleaseEventArgs args)
+		{
+			int x = (int) args.Event.X;
+			int y = (int) args.Event.Y;
+
+			if (moving_button == null || project == null || project.Buttons.Count <= 0)
+				return;
+
+			Logger.Debug ("AuthoringPaneView.HandleButtonRelease");
+
+			if (x + x_delta <  0 || y + y_delta < 0)
+				return;
+
+			if (x + x_delta + project.Buttons[button].Width > project.Details.Width || y + y_delta + project.Buttons[button].Height > project.Details.Height)
+				return;
+
+			Logger.Debug ("AuthoringPaneView.HandleButtonRelease true");
+			GdkWindow.Cursor = null;
+			project.Buttons[button].X = (int) args.Event.X + x_delta;
+			project.Buttons[button].Y = (int) args.Event.Y + y_delta;
+			moving_button = null;
+			QueueDraw ();
+		}
+
+		void DoubleClick (object o, ButtonPressEventArgs args)
+                {
+			Logger.Debug ("AuthoringPaneView.DoubleClick");
+
+			if (project == null)
+				return;
+
+			int x = (int) args.Event.X;
+			int y = (int) args.Event.Y;
+			int b = ButtonIDFromCoordinates (x, y);
+			
+			if (b == -1)
+				return;
+			
+			ShowButtonProperties (b);
+		}
+
+		void ShowButtonProperties (int button)
+		{
+			ButtonPropertiesDialog dialog = new ButtonPropertiesDialog (project, button);
+			if (dialog.Run () == ResponseType.Ok) {
+				// Can change the button ShowAs
+				QueueDraw (); 
+			}
+		}
+
+		void OnShowElementProperties (object obj, EventArgs args)
+		{
+			Logger.Debug ("AuthoringPaneView.OnShowElementProperties");
+			ShowButtonProperties (active_item);
+		}
+
+		void OnDeleteElement (object obj, EventArgs args)
+		{
+			Logger.Debug ("AuthoringPaneView.OnDeleteElement");
+			project.Buttons.Remove (project.Buttons [active_item]);
+		}
+	}
+}

Added: trunk/src/widgets/BrowseDirectory.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/BrowseDirectory.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,77 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using Mono.Unix;
+
+namespace Mistelix.Widgets
+{
+		
+	// Adds a text box + browse button into a given hbox parent configuring 
+	// the standard browsedirectory widget for the application
+	public class BrowseDirectory
+	{
+		Entry dirname;
+		Button browse;
+
+		public BrowseDirectory (HBox parent, string directory)
+		{
+			dirname = new Entry ();
+			browse = new Button (Catalog.GetString ("Browse..."));
+			dirname.Text = directory;
+
+			browse.Clicked += new EventHandler (OnBrowse);
+
+			parent.Add (dirname);
+			parent.Add (browse);
+
+			Gtk.Box.BoxChild box = (Gtk.Box.BoxChild) parent[browse];
+			box.Expand = false;
+			box.Fill = false;
+            
+			parent.ShowAll ();
+		}
+
+		public string Directory {
+			get { return dirname.Text; }
+		}
+
+		void OnBrowse (object o, EventArgs args)
+		{
+			FileChooserDialog chooser_dialog = new FileChooserDialog (
+				Catalog.GetString ("Open Location") , null, FileChooserAction.SelectFolder);
+
+			chooser_dialog.SetCurrentFolder (dirname.Text);
+			chooser_dialog.AddButton (Stock.Cancel, ResponseType.Cancel);
+			chooser_dialog.AddButton (Stock.Open, ResponseType.Ok);
+			chooser_dialog.DefaultResponse = ResponseType.Ok;
+			chooser_dialog.LocalOnly = false;
+
+			if(chooser_dialog.Run () == (int) ResponseType.Ok)
+				dirname.Text = chooser_dialog.Filename;
+
+			chooser_dialog.Destroy ();
+		}
+	}
+}

Added: trunk/src/widgets/DirectoryView.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/DirectoryView.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,231 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+// Copyright (C) 2006 John Luke
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using Gtk;
+using System.IO;
+using Mono.Unix;
+
+using Mistelix.Core;
+
+namespace Mistelix.Widgets
+{
+	public delegate void ChangeDirectoryEventHandler (object sender, ChangeDirectoryEventArgs e);
+
+	public class ChangeDirectoryEventArgs: EventArgs 
+	{
+		string directory;
+
+		public ChangeDirectoryEventArgs (string directory)
+		{
+			this.directory = directory;
+		}
+
+		public string Directory {
+			get { return directory; }
+		}
+	}
+
+	class ToolbarEntry : ToolItem
+	{
+		Entry entry;
+		public event EventHandler Activated;
+
+		public ToolbarEntry () : base ()
+		{
+			entry = new Entry ();
+			entry.Activated += new EventHandler (OnActivated);
+			this.Add (entry);
+			entry.Show ();
+			this.ShowAll ();
+		}
+
+		void OnActivated (object sender, EventArgs a)
+		{
+			if (Activated != null)
+				Activated (this, EventArgs.Empty);
+		}
+
+		public string Text {
+			get { return entry.Text; }
+			set { entry.Text = value; }
+		}
+	}
+	//
+	// Displays directories into a treeview
+	//
+	public class DirectoryView
+	{
+		const int COL_PATH = 0;
+		const int COL_DISPLAY_NAME = 1;
+		const int COL_PIXBUF = 2;
+		const int COL_IS_DIRECTORY = 3;
+
+		DirectoryInfo current;
+		TreeStore tree_store;
+		private static Tooltips tips = new Tooltips ();
+		public ChangeDirectoryEventHandler DirectoryChanged;
+
+		Gtk.ScrolledWindow scrolledwindow;
+		ToolbarEntry entry;
+		Gtk.CellRendererText text_render;
+		Gtk.TreeView tv;
+		Gtk.ToolButton goUp, goHome;
+		Gdk.Pixbuf dir_icon;
+
+		public DirectoryView (VBox parent, ChangeDirectoryEventHandler ev, string directory)
+		{
+			parent.Spacing = 2;
+			scrolledwindow = new ScrolledWindow ();
+			scrolledwindow.VscrollbarPolicy = PolicyType.Automatic;
+			scrolledwindow.HscrollbarPolicy = PolicyType.Automatic;
+			dir_icon = Gtk.IconTheme.Default.LoadIcon ("gtk-directory", 16, (Gtk.IconLookupFlags) 0);
+
+			Toolbar toolbar = new Toolbar ();
+			toolbar.IconSize = IconSize.Menu;
+			toolbar.ToolbarStyle = Gtk.ToolbarStyle.Icons;
+
+			goUp = new ToolButton (Gtk.Stock.GoUp);
+			goUp.Clicked += new EventHandler (OnGoUpClicked);
+			goUp.SetTooltip (tips, Catalog.GetString ("Go up one level"), "Go up one level");
+			toolbar.Insert (goUp, -1);
+
+			goHome = new ToolButton (Gtk.Stock.Home);
+			goHome.Clicked += new EventHandler (OnGoHomeClicked);
+			goHome.SetTooltip (tips, Catalog.GetString ("Home"), "Home");
+			toolbar.Insert (goHome, -1);
+
+			entry = new ToolbarEntry ();
+			entry.Expand = true;
+			entry.Activated += new EventHandler (OnEntryActivated);
+			entry.SetTooltip (tips, Catalog.GetString ("Location"), "");
+			toolbar.Insert (entry, -1);
+			toolbar.ShowAll ();
+			parent.PackStart (toolbar, false, true, 0);
+
+			tv = new Gtk.TreeView ();
+			tv.RulesHint = true;
+
+			TreeViewColumn directorycolumn = new TreeViewColumn ();
+			directorycolumn.Title = Catalog.GetString ("Directories");
+			
+			CellRendererPixbuf pix_render = new CellRendererPixbuf ();
+			directorycolumn.PackStart (pix_render, false);
+			directorycolumn.AddAttribute (pix_render, "pixbuf", COL_PIXBUF);
+
+			text_render = new CellRendererText ();
+			directorycolumn.PackStart (text_render, false);
+			directorycolumn.AddAttribute (text_render, "text", COL_DISPLAY_NAME);
+			
+			tv.AppendColumn (directorycolumn);
+			scrolledwindow.Add (tv);
+			parent.Homogeneous = false;
+			parent.PackEnd (new HSeparator (), false, false, 0);
+			parent.PackEnd (scrolledwindow);
+			parent.ShowAll ();
+
+			tv.Model = tree_store = CreateTreeStore ();
+			DirectoryChanged = ev;
+			tv.RowActivated += OnRowActivate;
+
+			current = new DirectoryInfo (directory);
+			ProcessNewDirectory (current.FullName);
+		}
+
+		public string Current {
+			get { return current.FullName; }
+		}
+
+		TreeStore CreateTreeStore ()
+		{
+			// path, name, pixbuf, is_dir
+			TreeStore store = new TreeStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof (bool));
+			return store;
+		}
+		
+		void FillTreeStore ()
+		{
+			// first clear the store
+			tree_store.Clear ();
+
+			if (!current.Exists)
+				current = new DirectoryInfo ("/");
+
+			foreach (DirectoryInfo di in current.GetDirectories ())
+			{
+				if (di.Name.StartsWith ("."))
+					continue;
+ 
+				tree_store.AppendValues (di.FullName, di.Name,  dir_icon, true);
+			}
+		}
+		
+		void OnRowActivate (object o, RowActivatedArgs args)
+		{
+			TreeIter iter;
+			tree_store.GetIter (out iter, args.Path);
+			string path = (string) tree_store.GetValue (iter, COL_PATH);
+			bool isDir = (bool) tree_store.GetValue (iter, COL_IS_DIRECTORY);
+
+			if (!isDir)
+				return;
+
+			ProcessNewDirectory (path);
+		}
+
+		void OnGoHomeClicked (object o, EventArgs args)
+		{
+			ProcessNewDirectory (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
+		}
+
+		void OnGoUpClicked (object o, EventArgs args)
+		{
+			ProcessNewDirectory (current.Parent.FullName);
+		}
+
+		void ProcessNewDirectory (string path)
+		{
+			current = new DirectoryInfo (path);
+			FillTreeStore ();
+
+			if (DirectoryChanged != null)
+				DirectoryChanged (this, new ChangeDirectoryEventArgs (path));
+
+			goUp.Sensitive = (current.Parent != null);
+			entry.Text = current.FullName;
+		}
+
+		void OnEntryActivated (object sender, EventArgs args)
+		{
+			try {
+				string text = entry.Text.Trim ();
+				if (Directory.Exists (text)) {
+					ProcessNewDirectory (text);
+					return;
+				}
+			} catch (Exception) {}
+		}
+	}
+}

Added: trunk/src/widgets/FileView.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/FileView.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,167 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using System.IO;
+using System.Text;
+using Gdk;
+using Mistelix.DataModel;
+using System.ComponentModel;
+using System.Collections.Generic;
+
+using Mistelix.Core;
+
+namespace Mistelix.Widgets
+{
+	//
+	// This is a generic fileview used later derived for image and video preview
+	//
+	public class FileView : IconView, IDisposable
+	{
+		virtual public void OnDirChanged (string new_dir) {}
+		virtual public bool IsValidExtesion (string filename) {return false;}
+		virtual public void DoWork (object sender, DoWorkEventArgs e) {}
+		
+		protected ListStore store;
+		protected BackgroundWorker thumbnailing;
+
+		protected Pixbuf def_image;
+		protected DirectoryInfo parent = new DirectoryInfo ("/");
+
+		protected const int COL_PATH = 0;
+		protected const int COL_DISPLAY_NAME = 1;
+		protected const int COL_PIXBUF = 2;
+		protected const int COL_IS_DIRECTORY = 3;
+
+		protected int thumbnail_height;
+		protected int thumbnail_width;
+		protected Dictionary <string, Gdk.Pixbuf> thumbnail_cache;
+			
+		protected FileView ()
+		{
+			store = CreateStore ();
+			LoadElements ();
+			SelectionMode = SelectionMode.Multiple;
+
+			TextColumn = COL_DISPLAY_NAME;
+			PixbufColumn = COL_PIXBUF;
+
+			thumbnail_height = ThumbnailSizeManager.Current.Height;
+			thumbnail_width = ThumbnailSizeManager.Current.Width;
+
+			def_image = Gtk.IconTheme.Default.LoadIcon ("gtk-new", thumbnail_width, (Gtk.IconLookupFlags) 0);
+			Model = store;
+		}
+
+		~FileView ()
+		{
+			Dispose (false);
+		}
+
+		public Dictionary <string, Gdk.Pixbuf> Cache {
+			set { thumbnail_cache = value; }
+		}
+
+		public List <string> SelectedFiles {
+			get {
+				List <string> files = new List <string> ();
+				
+				TreeIter iter;
+				TreePath[] items = SelectedItems;
+
+				for (int i = 0; i < items.Length; i++)
+				{			
+					store.GetIter (out iter, items [i]); 
+					files.Add ((string) store.GetValue (iter, 0));
+				}
+				return files;
+			}
+		}
+
+		ListStore CreateStore ()
+		{
+			// path, name, pixbuf, is_dir
+			ListStore store = new ListStore (typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof (bool));
+			return store;
+		}
+
+		public override void Dispose ()
+		{
+			Dispose (true);
+			System.GC.SuppressFinalize (this);
+		}
+
+		protected virtual void Dispose (bool disposing)
+		{
+			Logger.Debug ("Fileview.Disposing");
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				Gdk.Pixbuf im = (Gdk.Pixbuf) store.GetValue (iter, 2);
+				im.Dispose ();
+
+				return false;
+			});
+
+			thumbnailing.Dispose ();
+		}
+
+		public void LoadElements ()
+		{
+			Logger.Debug ("FileView.LoadElements");
+	
+			// Now go through the directory and extract all the file information
+			if (!parent.Exists)
+				return;
+
+			// first clear the store
+			store.Clear ();
+
+			if (thumbnailing != null)
+				thumbnailing.Dispose ();
+
+			if (thumbnail_cache != null) {
+				lock (thumbnail_cache) {
+					foreach (KeyValuePair <string, Gdk.Pixbuf> kvp in thumbnail_cache)
+						kvp.Value.Dispose ();
+
+					thumbnail_cache.Clear ();
+				}
+			}
+
+			thumbnailing = new BackgroundWorker ();
+			thumbnailing.DoWork += new DoWorkEventHandler (DoWork);
+
+			// TODO: Optimize for directories with images videos
+			foreach (FileInfo di in parent.GetFiles ())
+			{
+				if (di.Name.StartsWith (".") || IsValidExtesion (di.Name) == false)
+					continue;
+
+				store.AppendValues (di.FullName, di.Name, def_image, true);
+			}
+
+			thumbnailing.RunWorkerAsync (store);
+		}
+	}
+}

Added: trunk/src/widgets/GtkMenu.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/GtkMenu.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,55 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+
+namespace Mistelix.Widgets
+{
+	// Extended GTKMenu functionality
+	public class GtkMenu : Gtk.Menu
+	{			
+		public GtkMenu ()
+		{
+		}
+
+		public void AddItem (string label, EventHandler ev)
+		{
+			Gtk.MenuItem item = new Gtk.MenuItem (label);
+			Append (item);
+
+			if (ev != null)
+				item.Activated += ev;
+
+			item.Show ();
+		}
+
+		public void Popup (ButtonPressEventArgs args)
+		{
+			if (args != null)
+				Popup (null, null, null, args.Event.Button, args.Event.Time);
+			else
+				Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
+		}
+	}
+}

Added: trunk/src/widgets/GtkUtils.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/GtkUtils.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,58 @@
+//
+// Copyright (C) 2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+
+namespace Mistelix.Widgets
+{
+	// General GTK toolbox class
+	public static class GtkUtils
+	{			
+		static public void DrawSelectionBox (Cairo.Context cr, double x, double y, double width, double height)
+		{
+			double[] dashes = {10.0,  /* ink */
+				   10.0,  /* skip */
+				   10.0,  /* ink */
+				   10.0   /* skip*/
+			};
+
+			cr.Save ();
+			cr.Color = new Cairo.Color (0.9, 0.9, 0.9, 1);
+			cr.SetDash (dashes, 0);
+			cr.Rectangle (x, y, width, height);
+			cr.Stroke ();	
+			cr.Restore ();
+		}
+
+		public static Cairo.Color GdkToCairoColor (Gdk.Color color)
+		{
+			return new Cairo.Color (color.Red / 65535.0, color.Green / 65535.0, color.Blue / 65535.0);
+		}
+
+		public static Gdk.Color CairoToGdkColor (Cairo.Color color)
+		{
+			return new Gdk.Color ((byte) (color.R * 65535), (byte) (color.G * 65535), (byte) (color.B * 65535));
+		}
+	}
+}

Added: trunk/src/widgets/ImagesFileView.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/ImagesFileView.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,146 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using System.IO;
+using System.Text;
+using Gdk;
+using Mistelix.DataModel;
+using System.ComponentModel;
+
+using Mistelix.Core;
+
+namespace Mistelix.Widgets
+{
+	//
+	// Displays image files into an IconView. Drag source.
+	//
+	public class ImagesFileView : FileView
+	{
+		private static TargetEntry [] tag_target_table = new TargetEntry [] {
+			new TargetEntry ("application/x-mistelix-img", 0, (uint) 2),
+		};
+	
+		public ImagesFileView ()
+		{
+			// Drag
+			DragBegin += HandleDragBegin;
+			DragEnd += HandleDragEnd;
+			DragDataGet += HandleDragDataGet;
+			// File view as drag source 
+			Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
+				tag_target_table, DragAction.Copy | DragAction.Move);
+		}
+
+		void HandleDragDataGet (object sender, DragDataGetArgs args)
+		{
+			Logger.Debug ("FileView.HandleDragDataGet sender {0}, args {1}", sender, args.Info);
+
+			string file;
+			TreeIter iter;
+			TreePath[] items = SelectedItems;
+			PathList list = new PathList ();
+			
+			for (int i = 0; i < items.Length; i++)
+			{			
+				store.GetIter (out iter, items [i]); 
+				file = (string) store.GetValue (iter, 0);
+				Logger.Debug ("FileView.HandleDragDataGet dropped {0}", file);
+				list.Add (file);
+			}
+
+			switch (args.Info) {
+			case 2: {				
+
+				Byte [] data = Encoding.UTF8.GetBytes (list.ToString ());
+				Atom [] targets = args.Context.Targets;
+				args.SelectionData.Set (targets[0], 2, data);
+				Logger.Debug ("FileView.HandleDragDataGet data.Length {0}", data.Length);
+				return;
+			}
+			default:
+				Logger.Debug ("FileView.HandleDragDataGet Drop cancelled");
+				break;
+			}
+
+			args.RetVal = true;
+		}
+
+
+		void HandleDragBegin (object sender, DragBeginArgs args)
+		{
+			Logger.Debug ("HandleDragBegin");
+		}
+
+		void HandleDragEnd (object sender, DragEndArgs args)
+		{
+			args.RetVal = true;
+		}
+
+		public override void OnDirChanged (string new_dir)
+		{
+			parent = new DirectoryInfo (new_dir);
+			LoadElements ();
+		}
+
+		public override bool IsValidExtesion (string filename)
+		{
+			filename = filename.ToLower ();
+			if (filename.EndsWith (".jpeg"))
+				return true;
+
+			if (filename.EndsWith (".jpg"))
+				return true;
+
+			if (filename.EndsWith (".png"))
+				return true;
+
+			return false;
+		}
+
+		public override void DoWork (object sender, DoWorkEventArgs e)
+        	{   
+			ListStore store = (ListStore) e.Argument;
+			
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				string file = (string) store.GetValue (iter, 0);
+				Gdk.Pixbuf im = new Gdk.Pixbuf (file);
+				int max = Math.Max (im.Width, im.Height);
+				Gdk.Pixbuf scaled = im.ScaleSimple (thumbnail_width * im.Width / max, thumbnail_height * im.Height / max, InterpType.Nearest);
+
+				Application.Invoke (delegate {
+						store.SetValue (iter, 2, scaled);
+					} );
+				
+				lock (thumbnail_cache) {
+					thumbnail_cache[file] = scaled;
+				}
+
+				im.Dispose ();
+				return false;
+			});
+		}
+	}
+}

Added: trunk/src/widgets/PixbufImageSurface.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/PixbufImageSurface.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,199 @@
+//
+// Copyright (C) 2008 Aaron Bockover, abockover novell com
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+using Cairo;
+
+namespace Mistelix.Widgets
+{
+	public class PixbufImageSurface : ImageSurface, IDisposable
+	{
+		private delegate void cairo_destroy_func_t (IntPtr userdata);
+
+		private static bool is_le = BitConverter.IsLittleEndian;
+		private static int user_data_key = 0;
+		private static cairo_destroy_func_t destroy_func;
+		       
+		private static void DestroyPixelData (IntPtr data)
+		{
+			Marshal.FreeHGlobal (data);
+		}
+
+		static PixbufImageSurface ()
+		{
+		    	destroy_func = new cairo_destroy_func_t (DestroyPixelData);
+		}
+
+		private IntPtr data;
+
+		public PixbufImageSurface (Gdk.Pixbuf pixbuf) : this (pixbuf, false)
+		{
+		}
+
+		public PixbufImageSurface (Gdk.Pixbuf pixbuf, bool disposePixbuf) : this (disposePixbuf ? pixbuf : null, 
+		    pixbuf.Width, pixbuf.Height, pixbuf.NChannels, pixbuf.Rowstride, pixbuf.Pixels)
+		{
+		}
+
+		// This ctor is to avoid multiple queries against the GdkPixbuf for width/height
+		private PixbufImageSurface (Gdk.Pixbuf pixbuf, int width, int height, int channels, int rowstride, IntPtr pixels) 
+		    : this (pixbuf, Marshal.AllocHGlobal (width * height * 4), width, height, channels, rowstride, pixels)
+		{
+		}
+
+		private PixbufImageSurface (Gdk.Pixbuf pixbuf, IntPtr data, int width, int height, int channels, int rowstride, IntPtr pixels) 
+		    : base (data, channels == 3 ? Format.Rgb24 : Format.Argb32, width, height, width * 4)
+		{
+			this.data = data;
+
+			CreateSurface (width, height, channels, rowstride, pixels);
+			SetDestroyFunc ();
+
+			if (pixbuf != null && pixbuf.Handle != IntPtr.Zero) {
+				pixbuf.Dispose ();
+			}
+		}
+
+		// Converts from Cairo 32-bits to GTK 24 bits (3 channels)
+		public byte[] Get24bitsPixBuf ()
+		{
+			bool is_le = BitConverter.IsLittleEndian;
+			int pos_cairo = 0;
+			int pos_gdk = 0;
+			byte [] cairo_pixels;
+			byte [] pixels;
+			int width, height;
+			const int channels = 3;
+
+			width = Width;
+			height = Height;
+			pixels = new byte [height * Width * channels];
+			cairo_pixels = Data;
+
+			for (int h = 0; h < height; h++) 
+			{
+				for (int i = 0; i < width; i++)
+				{
+					if (is_le) {
+						pixels[pos_gdk + 2] = cairo_pixels[pos_cairo + 0];
+					   	pixels[pos_gdk + 1] = cairo_pixels[pos_cairo + 1];
+					   	pixels[pos_gdk + 0] = cairo_pixels[pos_cairo + 2];
+					} else {
+					   	pixels[pos_gdk + 0] = cairo_pixels[pos_cairo + 1];
+					   	pixels[pos_gdk + 1] = cairo_pixels[pos_cairo + 2];
+					   	pixels[pos_gdk + 2] = cairo_pixels[pos_cairo + 3];
+					}
+
+					pos_gdk += channels;
+					pos_cairo += 4;
+				}
+			}
+			return pixels;
+		}
+
+		private unsafe void CreateSurface (int width, int height, int channels, int gdk_rowstride, IntPtr pixels)
+		{
+		    byte *gdk_pixels = (byte *)pixels;
+		    byte *cairo_pixels = (byte *)data;
+		    
+		    for (int i = height; i > 0; i--) {
+			byte *p = gdk_pixels;
+			byte *q = cairo_pixels;
+		
+			if (channels == 3) {
+			    byte *end = p + 3 * width;
+			    while (p < end) {
+				if (is_le) {
+				    q[0] = p[2];
+				    q[1] = p[1];
+				    q[2] = p[0];
+				} else {
+				    q[1] = p[0];
+				    q[2] = p[1];
+				    q[3] = p[2];
+				}
+			    
+				p += 3;
+				q += 4;
+			    }
+			} else {
+			    byte *end = p + 4 * width;
+			    while (p < end) {
+				if (is_le) {
+				    q[0] = Mult (p[2], p[3]);
+				    q[1] = Mult (p[1], p[3]);
+				    q[2] = Mult (p[0], p[3]);
+				    q[3] = p[3];
+				} else {
+				    q[0] = p[3];
+				    q[1] = Mult (p[0], p[3]);
+				    q[2] = Mult (p[1], p[3]);
+				    q[3] = Mult (p[2], p[3]);
+				}
+				
+				p += 4;
+				q += 4;
+			    }
+			}
+		
+			gdk_pixels += gdk_rowstride;
+			cairo_pixels += 4 * width;
+		    }
+		}
+
+		private static byte Mult (byte c, byte a)
+		{
+			int t = c * a + 0x7f; 
+			return (byte)(((t >> 8) + t) >> 8);
+		}
+
+		public void Render (Cairo.Context cr, int x, int y)
+		{
+			cr.Save ();
+			cr.SetSourceSurface (this, x, y);
+			cr.Paint ();
+			cr.Restore ();			
+		}
+
+		[DllImport ("libcairo.so.2")]
+		private static extern Cairo.Status cairo_surface_set_user_data (IntPtr surface, 
+		    ref int key, IntPtr userdata, cairo_destroy_func_t destroy);
+
+		private void SetDestroyFunc ()
+		{
+			try {
+				Status status = cairo_surface_set_user_data (Handle, ref user_data_key, data, destroy_func);
+				if (status != Status.Success) {
+				    throw new ApplicationException (String.Format (
+					"cairo_surface_set_user_data returned {0}", status));
+				}
+			} catch (Exception e) {
+				Console.Error.WriteLine (e);	
+			}
+		}
+	}
+}	
+

Added: trunk/src/widgets/ProjectElementView.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/ProjectElementView.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,361 @@
+//
+// Copyright (C) 2008-2009 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using System.IO;
+using System.Text;
+using Gdk;
+using System.ComponentModel;
+using System.Collections.Generic;
+using Mono.Unix;
+
+using Mistelix.DataModel;
+using Mistelix.Core;
+using Mistelix.Dialogs;
+
+namespace Mistelix.Widgets
+{
+	//
+	// Displays the project elements that we can drag into the authoring view
+	//
+	public class ProjectElementView : IconView, IDisposable
+	{
+		const int COL_ELEMENT = 0;
+		const int COL_DISPLAY_NAME = 1;
+		const int COL_PIXBUF = 2;
+
+		ListStore store;
+		Gtk.Image image;
+		Project project;
+		BackgroundWorker thumbnailing;
+		Pixbuf def_image;
+
+		private static TargetEntry [] tag_target_table = new TargetEntry [] {
+			new TargetEntry ("application/x-mistelix-item", 0, (uint) 2),
+		};
+	
+		public ProjectElementView (Project project)
+		{
+			this.project = project;
+			// TODO: Only one element dropped?
+			SelectionMode = SelectionMode.Multiple;
+			store = CreateStore ();
+			LoadElements ();
+			TextColumn = COL_DISPLAY_NAME;
+			PixbufColumn = COL_PIXBUF;
+
+			// Drag
+			DragBegin += HandleDragBegin;
+			DragEnd += HandleDragEnd;
+			DragDataGet += HandleDragDataGet;
+			// Project element view as drag source 
+			Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
+				tag_target_table, DragAction.Copy | DragAction.Move);
+
+			Model = store;
+
+			def_image = Gtk.IconTheme.Default.LoadIcon ("gtk-new", 
+				ThumbnailSizeManager.Current.Width, (Gtk.IconLookupFlags) 0);
+			ItemActivated += new ItemActivatedHandler (OnItemActivated);
+			ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
+			KeyPressEvent += OnKeyPressed;
+		}
+
+		public Project Project {
+			get { return project; }
+			set { project = value;}
+		}
+
+		~ProjectElementView ()
+		{
+			Dispose (false);
+		}
+
+		public override void Dispose ()
+		{
+			Dispose (true);
+			System.GC.SuppressFinalize (this);
+		}
+
+		protected virtual void Dispose (bool disposing)
+		{
+			Logger.Debug ("ProjectElementView.Disposing");
+			ClearElements ();
+			def_image.Dispose ();
+			thumbnailing.Dispose ();
+		}
+
+		void HandleDragDataGet (object sender, DragDataGetArgs args)
+		{
+			Logger.Debug ("ProjectElementView.HandleDragDataGet sender {0}, args {1}", sender, args.Info);
+
+			TreeIter iter;
+			TreePath[] items = SelectedItems;
+			IntList list = new IntList ();
+			VisibleProjectElement element;
+			
+			for (int i = 0; i < items.Length; i++)
+			{			
+				store.GetIter (out iter, items [i]); 
+				element = (VisibleProjectElement) store.GetValue (iter, COL_ELEMENT);
+				list.Add (element.id);
+			}
+
+			switch (args.Info) {
+			case 2: {				
+
+				Byte [] data = Encoding.UTF8.GetBytes (list.ToString ());
+				Atom [] targets = args.Context.Targets;
+				args.SelectionData.Set (targets[0], 3, data);
+				return;
+			}
+			default:
+				Logger.Debug ("Drop cancelled");
+				break;
+			}
+			args.RetVal = true;
+		}
+
+		void HandleDragBegin (object sender, DragBeginArgs args)
+		{
+			Logger.Debug("HandleDragBegin");
+		}
+
+		void HandleDragEnd (object sender, DragEndArgs args)
+		{
+			args.RetVal = true;
+		}
+
+		ListStore CreateStore ()
+		{
+			// TODO: Instead of storing the fullname as the first element we should store an indexer to the project element (see also the last element)
+			ListStore store = new ListStore (typeof (VisibleProjectElement), typeof (string), typeof (Gdk.Pixbuf));
+			return store;
+		}
+
+		static void DoWork (object sender, DoWorkEventArgs e)
+        	{
+			ListStore store = (ListStore) e.Argument;
+
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				VisibleProjectElement element = (VisibleProjectElement) store.GetValue (iter, COL_ELEMENT);
+				Gdk.Pixbuf im;
+
+				try {
+					im = element.Thumbnail;
+				}
+				catch {
+					return false;
+				}
+				
+				Application.Invoke (delegate {
+						store.SetValue (iter, 2, im);
+					} );
+
+				return false;
+			});
+		}
+
+		void ClearElements ()
+		{
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				Gdk.Pixbuf im = (Gdk.Pixbuf) store.GetValue (iter, COL_PIXBUF);
+				im.Dispose ();
+
+				return false;
+			});
+			store.Clear ();
+		}
+
+		public void UpdateElement (ProjectElement element)
+		{
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				ProjectElement stored;
+				stored = (ProjectElement) store.GetValue (iter, COL_ELEMENT);
+				if (stored !=  element)
+					return false;
+
+				store.SetValue (iter, COL_ELEMENT, element);
+				store.SetValue (iter, COL_PIXBUF, GetThumbnail (element));
+				return true;
+			});
+		}
+
+		Gdk.Pixbuf GetThumbnail (ProjectElement element)
+		{
+			Gdk.Pixbuf thumbnail;
+
+			try {
+				VisibleProjectElement visible = (VisibleProjectElement) element;
+				thumbnail = visible.Thumbnail;
+			}
+			catch {
+				thumbnail = def_image;
+			}
+
+			return thumbnail;
+		}
+
+		public void AddElement (VisibleProjectElement element)
+		{
+			store.AppendValues (element, element.Name, GetThumbnail (element));
+		}
+
+		public void LoadElements ()
+		{
+			ClearElements ();
+
+			if (project == null)
+				return;
+
+			if (thumbnailing != null)
+				thumbnailing.Dispose ();
+
+			thumbnailing = new BackgroundWorker ();
+			thumbnailing.DoWork += new DoWorkEventHandler (DoWork);
+			VisibleProjectElement element;
+
+			for (int i = 0; i < project.Elements.Count; i++)
+			{
+				element = (VisibleProjectElement) project.Elements[i];
+				if (element == null) {
+					Logger.Debug ("ProjectElementView.FillStore. Ignoring {0}", project.Elements[i]);
+					continue;
+				}
+
+				store.AppendValues (element, element.Name, def_image);	
+			}
+			Logger.Debug ("ProjectElementView.FillStore. Elements {0}", project.Elements.Count);
+			thumbnailing.RunWorkerAsync (store);
+		}
+
+		void OnItemActivated (object sender, ItemActivatedArgs args)
+                {
+			TreeIter iter;
+			VisibleProjectElement current;
+                        store.GetIter (out iter, args.Path);
+
+			current = (VisibleProjectElement) store.GetValue (iter, COL_ELEMENT);
+			ItemActivate (current);
+		}
+
+		void ItemActivate (VisibleProjectElement current)
+		{
+			if (current.GetType () != typeof (SlideShow))
+				return;
+
+			AddSlideDialog dialog = new AddSlideDialog ();
+			dialog.SlideShow = (SlideShow) current;
+
+			if (dialog.RunNoDestroy () == ResponseType.Ok) {
+				for (int i = 0; i < project.Elements.Count; i++)
+				{
+					if (current == project.Elements[i]) {
+						project.Elements[i] = dialog.SlideShow;
+						UpdateElement (project.Elements[i]);
+						break;
+					}
+				}
+			}
+			dialog.Destroy ();
+		}
+
+		[GLib.ConnectBefore]
+		void OnButtonPressed (object o, ButtonPressEventArgs args)
+		{
+			GtkMenu menu;
+
+			if (args.Event.Button != 3)
+				return;
+
+			menu = new GtkMenu ();
+			menu.AddItem (Catalog.GetString ("Open element"), OnOpenElement);
+			menu.AddItem (Catalog.GetString ("Delete element from project"), OnDeleteElements);
+			menu.Popup (args);
+			args.RetVal = true;
+		}
+
+		protected override bool OnExposeEvent (Gdk.EventExpose args)
+		{
+			if (project == null || project.Elements.Count > 0) 
+				return base.OnExposeEvent (args);
+			
+			// See: http://www.mail-archive.com/mono-list lists ximian com/msg26065.html
+			using (Cairo.Context cr = Gdk.CairoHelper.Create (args.Window))
+			{
+				int winWidth, winHeight, w, h;
+				args.Window.GetSize (out winWidth, out winHeight);
+
+				Pango.Layout layout = new Pango.Layout (this.PangoContext);
+				layout.Width = winWidth * (int) Pango.Scale.PangoScale;			
+				layout.SetMarkup (Catalog.GetString ("Once the project has elements you can use the contextual menu to work with them"));
+				layout.GetPixelSize (out w, out h);
+
+				Gdk.GC light = Style.DarkGC (StateType.Normal);
+				args.Window.DrawLayout (light, (winWidth - w) /2, winHeight / 2,  layout);
+				layout.Dispose ();
+			}
+			return true;
+		}
+
+		void OnOpenElement (object obj, EventArgs e)
+		{
+			TreePath[] items = SelectedItems;
+
+			if (items.Length <= 0)
+				return;
+			
+			ActivateItem (items[0]);
+		}
+
+		void OnDeleteElements (object obj, EventArgs e)
+		{
+			TreeIter iter;
+			TreePath[] items = SelectedItems;
+			VisibleProjectElement item;
+
+			Logger.Debug ("ProjectElementView.OnDeleteElement {0} items", items.Length);
+
+			for (int i = 0; i < items.Length; i++)
+			{			
+				store.GetIter (out iter, items [i]); 	
+				item = (VisibleProjectElement) store.GetValue (iter, COL_ELEMENT);
+				project.RemoveElement (item);
+				store.Remove (ref iter);
+			}
+		}
+
+		[GLib.ConnectBefore()]
+		void OnKeyPressed (object sender, Gtk.KeyPressEventArgs args)
+		{
+			if (args.Event.Key == Gdk.Key.Delete) {
+				args.RetVal = true;
+				OnDeleteElements (sender, EventArgs.Empty);
+			}
+		}
+	}
+}

Added: trunk/src/widgets/SlideShowImageView.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/SlideShowImageView.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,520 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Gdk;
+using Cairo;
+using Mono.Unix;
+
+using Mistelix.DataModel;
+using Mistelix.Core;
+
+namespace Mistelix.Widgets
+{
+	public delegate void ShowImageSelectionEventHandler (object sender, ShowImageSelectionEventArgs e);
+
+	public class ShowImageSelectionEventArgs: EventArgs
+	{
+		public SlideImage[] images;
+
+		public ShowImageSelectionEventArgs (SlideImage[] images)
+		{
+			this.images = images;
+		}
+	}
+
+	public delegate void ShowImageUpdatedElementsEventHandler (object sender, EventArgs e);
+
+	//
+	// Displays the images selected by the user when creating a slideshow. Drop target.
+	//
+	public class SlideShowImageView : TreeView, IDisposable
+	{
+		enum  ImageSortType
+		{
+			FileName_Ascending,
+			FileName_Descending,
+			Date_Ascending,
+			Date_Descending
+		}
+
+		ListStore store;
+		Gtk.Image image;
+		BackgroundWorker thumbnailing;
+		Pixbuf def_image;
+		int cnt = 1;
+		bool paint_control = false;
+		readonly int thumbnail_height;
+		readonly int thumbnail_width;
+		readonly string notitle;
+		Dictionary <string, Gdk.Pixbuf> thumbnail_cache;
+		ImageSortType sort_type;
+
+		public const int COL_INDEX = 0;
+		public const int COL_PIXBUF = 1;
+		public const int COL_DESCRIPTION = 2;
+		public const int COL_OBJECT = 3;
+
+		static TargetEntry [] tag_dest_target_table = new TargetEntry [] {
+					new TargetEntry ("application/x-mistelix-img", 0, (uint) 2)};
+
+		public ShowImageSelectionEventHandler 		ChangeEvent;
+		public ShowImageUpdatedElementsEventHandler	UpdatedElements;
+
+		public SlideShowImageView ()
+		{
+			Model = store = CreateStore ();
+
+			notitle = Catalog.GetString ("<No title>");
+	
+			thumbnail_height = ThumbnailSizeManager.Current.Height;
+			thumbnail_width = ThumbnailSizeManager.Current.Width;
+
+			store.SetSortFunc (0, new Gtk.TreeIterCompareFunc (ImageSortFunc));
+			Selection.Mode = SelectionMode.Multiple;
+			DragDrop += new DragDropHandler (HandleTargetDragDrop);
+			DragDataReceived += new DragDataReceivedHandler (HandleTargetDragDataReceived);
+			Gtk.Drag.DestSet (this, DestDefaults.All, tag_dest_target_table,
+					  DragAction.Copy | DragAction.Move );
+
+			CursorChanged += OnCursorChanged;
+			def_image = Gtk.IconTheme.Default.LoadIcon ("gtk-new", thumbnail_width, (Gtk.IconLookupFlags) 0);
+			thumbnailing = new BackgroundWorker ();
+			thumbnailing.DoWork += new DoWorkEventHandler (DoWork);
+			ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
+			KeyPressEvent += OnKeyPressed;
+		}
+
+		~SlideShowImageView ()
+		{
+			Dispose (false);
+		}
+
+		public Dictionary <string, Gdk.Pixbuf> Cache {
+			set { thumbnail_cache = value; }
+		}
+
+		public override void Dispose ()
+		{
+			Dispose (true);
+			System.GC.SuppressFinalize (this);
+		}
+
+		protected virtual void Dispose (bool disposing)
+		{
+			Logger.Debug ("SlideShowImageView.Disposing");
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				Gdk.Pixbuf im = (Gdk.Pixbuf) store.GetValue (iter, COL_PIXBUF);
+				im.Dispose ();
+
+				return false;
+			});
+
+			thumbnailing.Dispose ();
+		}
+
+		public ListStore ListStore {
+			get { return store; }
+		}
+
+		public void LoadSlideShow (SlideShow slideshow)
+		{
+			Logger.Debug ("SlideShowImageView.LoadSlideShow. Loaded: " + slideshow.images.Count);
+			CreateColumns ();
+			paint_control = true;
+			foreach (SlideShow.Image image in slideshow.images) 
+			{
+				FileInfo fi = new FileInfo (image.image);
+				store.AppendValues (cnt.ToString (), def_image, 
+					image.title == null ? notitle : image.title,
+					image);
+				cnt++;
+			}
+
+			thumbnailing.RunWorkerAsync (store);
+			UpdateButtonSensitivity ();
+		}
+
+		void CreateColumns ()
+		{
+			CellRendererText title_cell = new CellRendererText ();
+			title_cell.Editable = true;
+			title_cell.Edited += OnDescriptionCellEdited;
+
+			AppendColumn (Catalog.GetString ("#"), new CellRendererText (), "text", COL_INDEX);
+			AppendColumn (Catalog.GetString ("Image"), new CellRendererPixbuf (), "pixbuf", COL_PIXBUF);
+			AppendColumn (Catalog.GetString ("Description"), title_cell, "text", COL_DESCRIPTION);
+		}
+
+		void OnDescriptionCellEdited (object o, EditedArgs args)
+		{
+			TreeIter iter;
+			SlideImage image;
+
+			store.GetIter (out iter, new Gtk.TreePath (args.Path));
+			image = (SlideImage) store.GetValue (iter, COL_OBJECT);
+
+			if (String.Compare (notitle, args.NewText) != 0) 
+			{
+				if (args.NewText.Length == 0) { // Title has been clean up
+					image.title = null;
+					store.SetValue (iter, COL_DESCRIPTION, notitle);
+				}
+				else {
+					image.title = args.NewText;
+					store.SetValue (iter, COL_DESCRIPTION, image.title);
+				}
+			}
+		}
+
+		void HandleTargetDragDrop (object sender, DragDropArgs args)
+		{
+			args.RetVal = false;
+		}
+
+		void HandleDragEnd (object sender, DragEndArgs args)
+		{
+			args.RetVal = true;
+		}
+
+		// Processing of dropped files from the FileView is done here
+		void HandleTargetDragDataReceived (object sender, DragDataReceivedArgs args)
+		{
+			Logger.Debug ("ImageView.HandleTargetDragDataReceived");
+
+			if (paint_control == false) {
+				CreateColumns ();
+				paint_control = true;
+			}			
+
+			PathList list = new PathList ();
+			list.FromString (System.Text.Encoding.UTF8.GetString (args.SelectionData.Data));
+			foreach (string file in list)
+				LoadFile (file);
+
+			args.RetVal = true;
+			UpdateButtonSensitivity ();
+			Gtk.Drag.Finish (args.Context, true, false, args.Time);
+			thumbnailing.RunWorkerAsync (store);
+		}
+
+		// Adds a new dropped file into the view
+		void LoadFile (string file)
+		{
+			FileInfo fi = new FileInfo (file);
+			store.AppendValues (cnt.ToString (), def_image, notitle,
+				new SlideImage (fi.FullName));
+			cnt++;
+		}
+
+		void HandleDropBegin (object sender, DragBeginArgs a)
+		{
+			a.RetVal = true;
+		}
+
+		ListStore CreateStore ()
+		{
+			// Image number, image pixbuf, object 
+			return new ListStore (typeof (string), typeof (Gdk.Pixbuf), typeof (string), typeof (SlideImage));
+		}
+
+		protected override void OnSizeAllocated (Gdk.Rectangle allocation)
+		{
+			// While showing the text we should redraw to center it again to new dimensions
+			if (paint_control == false)
+				QueueDraw ();
+
+			base.OnSizeAllocated (allocation);
+		}
+
+		protected override bool OnExposeEvent (Gdk.EventExpose args)
+		{
+			if (paint_control == true) 
+				return base.OnExposeEvent (args);
+			
+			// See: http://www.mail-archive.com/mono-list lists ximian com/msg26065.html
+			using (Cairo.Context cr = Gdk.CairoHelper.Create (args.Window))
+			{
+				int winWidth, winHeight, w, h;
+				args.Window.GetSize (out winWidth, out winHeight);
+
+				Pango.Layout layout = new Pango.Layout (this.PangoContext);
+				layout.Width = winWidth * (int) Pango.Scale.PangoScale;
+				layout.SetMarkup (Catalog.GetString ("Drag your images here to add them to the slideshow. You can also use the contextual menu to sort the images."));
+				layout.GetPixelSize (out w, out h);
+
+				Gdk.GC light = Style.DarkGC (StateType.Normal);
+				args.Window.DrawLayout (light, (winWidth - w) /2, winHeight / 2,  layout);
+				layout.Dispose ();
+			}
+			return true;
+		}
+
+		void OnCursorChanged (object obj, EventArgs e)
+		{
+			TreeSelection selection = (obj as TreeView).Selection;
+			TreeModel model;
+			TreeIter iter;
+			TreePath[] paths;
+			SlideImage[] images;
+
+			paths = selection.GetSelectedRows (out model);
+			images = new SlideImage [paths.Length];
+
+			for (int i = 0; i < paths.Length; i++)
+			{
+				model.GetIter (out iter, paths [i]);
+				images[i] = (SlideImage) store.GetValue (iter, COL_OBJECT);
+			}
+
+			if (ChangeEvent != null)
+				ChangeEvent (this, new ShowImageSelectionEventArgs (images));
+		}
+
+		// TODO: Only new dragged elements should be loaded
+		public void DoWork (object sender, DoWorkEventArgs e)
+        	{   
+			Logger.Debug ("SlideShowImageView.Dowork start");
+			ListStore store = (ListStore) e.Argument;
+			
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				SlideImage image = (SlideImage) store.GetValue (iter, COL_OBJECT);
+				string filename = image.image;
+				Gdk.Pixbuf scaled;
+
+				try {
+					lock (thumbnail_cache) {
+						scaled = thumbnail_cache [filename];
+					}
+				}
+				catch {
+					scaled = null;
+				}
+
+				if (scaled == null) {
+					Logger.Debug ("file->{0}", filename);
+					Gdk.Pixbuf im = new Gdk.Pixbuf (filename);
+					int max = Math.Max (im.Width, im.Height);
+					scaled = im.ScaleSimple (thumbnail_width * im.Width / max, thumbnail_height * im.Height / max, InterpType.Nearest);
+					im.Dispose ();
+				}
+
+				Application.Invoke (delegate {
+						store.SetValue (iter, COL_PIXBUF, scaled);
+					} );
+				
+				return false;
+			});
+
+			Logger.Debug ("SlideShowImageView.Dowork  end");
+		}
+
+		public void MoveUpSelectedElements ()
+		{			
+			TreeIter prev = TreeIter.Zero, first, iter;
+			TreePath[] paths;
+			bool more;
+			
+			paths = Selection.GetSelectedRows ();
+
+			if (paths.Length == 0)
+				return;
+
+			store.GetIter (out first, paths [0]);
+			more = store.GetIterFirst (out iter);
+
+			while (more) // Search for previous element to the first selected
+			{
+				if (iter.Equals (first))
+					break;
+
+				prev = iter;
+				more = store.IterNext (ref iter);
+			}
+
+			if (prev.Equals (TreeIter.Zero))
+				return;
+
+			foreach (TreePath path in paths)
+			{
+				store.GetIter (out iter, path);
+				//image = (SlideImage) model.GetValue (iter, SlideShowImageView.COL_OBJECT);
+				//image.time = spinner.ValueAsInt;
+				store.Swap (prev, iter);
+			}
+		}
+
+		public void MoveDownSelectedElements ()
+		{			
+			TreeIter next = TreeIter.Zero, last, iter;
+			TreePath[] paths;
+			bool more;
+			
+			paths = Selection.GetSelectedRows ();
+
+			if (paths.Length == 0)
+				return;
+
+			store.GetIter (out last, paths [paths.Length - 1]);
+			more = store.GetIterFirst (out iter);
+
+			while (more) // Search for next element to the first selected
+			{
+				if (iter.Equals (last)) {
+					more = store.IterNext (ref iter);
+					if (more)
+						next = iter;
+					break;
+				}
+				more = store.IterNext (ref iter);
+			}
+
+			if (next.Equals (TreeIter.Zero))
+				return;
+
+			for (int i = paths.Length - 1; i >= 0; i--)
+			{
+				store.GetIter (out iter, paths[i]);
+				store.Swap (next, iter);
+			}
+		}
+
+		[GLib.ConnectBefore]
+		void OnButtonPressed (object o, ButtonPressEventArgs args)
+		{
+			GtkMenu menu;
+
+			if (args.Event.Button != 3)
+				return;
+
+			menu = new GtkMenu ();
+
+			menu.AddItem (Catalog.GetString ("Sort by filename (Ascending)"), OnSortAscendingbyName);
+			menu.AddItem (Catalog.GetString ("Sort by filename (Descending)"), OnSortDescendingbyName);
+			menu.AddItem (Catalog.GetString ("Sort by date on disc (Ascending)"), OnSortAscendingbyDate);
+			menu.AddItem (Catalog.GetString ("Sort by date on disc (Descending)"), OnSortDescendingbyDate);
+			menu.AddItem (Catalog.GetString ("Remove selected images"), OnRemoveSelectedImage);
+			menu.AddItem (Catalog.GetString ("Remove all images"), OnRemoveImages);
+
+			menu.Popup (args);
+			args.RetVal = true;
+		}
+
+		void OnRemoveSelectedImage (object obj, EventArgs e)
+		{
+			TreeIter iter;
+			TreePath[] paths;
+			
+			paths = Selection.GetSelectedRows ();
+
+			if (paths.Length == 0)
+				return;
+
+			for (int i = paths.Length - 1; i >= 0; i--)
+			{
+				store.GetIter (out iter, paths[i]);
+				store.Remove (ref iter);
+			}
+			UpdateButtonSensitivity ();
+		}
+
+		void OnRemoveImages (object obj, EventArgs e)
+		{
+			store.Clear ();
+			UpdateButtonSensitivity ();
+		}
+
+		void OnSortAscendingbyDate (object obj, EventArgs e)
+		{
+			sort_type = ImageSortType.Date_Ascending;
+			store.SetSortColumnId (0, SortType.Ascending);
+		}
+
+		void OnSortDescendingbyDate (object obj, EventArgs e)
+		{
+			sort_type = ImageSortType.Date_Descending;
+			store.SetSortColumnId (0, SortType.Descending);			
+		}
+	
+		void OnSortAscendingbyName (object obj, EventArgs e)
+		{
+			sort_type = ImageSortType.FileName_Ascending;
+			store.SetSortColumnId (0, SortType.Ascending);
+		}
+
+		void OnSortDescendingbyName (object obj, EventArgs e)
+		{
+			sort_type = ImageSortType.FileName_Descending;
+			store.SetSortColumnId (0, SortType.Descending);			
+		}
+
+		// Sorts the images in the view following the option selected in the contextual menu
+		int ImageSortFunc (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
+		{
+			SlideImage slide_a, slide_b;
+			FileInfo file_a, file_b;
+
+			slide_a = (SlideImage) model.GetValue (a, SlideShowImageView.COL_OBJECT);
+			slide_b = (SlideImage) model.GetValue (b, SlideShowImageView.COL_OBJECT);
+
+			if (slide_a == null || slide_b == null)
+				return 0;
+
+			file_a = new FileInfo (slide_a.image);
+			file_b = new FileInfo (slide_b.image);
+
+			switch (sort_type) {
+			case ImageSortType.FileName_Ascending:
+			case ImageSortType.FileName_Descending:
+				return String.Compare (file_a.Name, file_b.Name);
+			case ImageSortType.Date_Ascending:
+			case ImageSortType.Date_Descending:
+				return DateTime.Compare (file_a.CreationTime, file_b.CreationTime);
+			default:
+				return 0;
+			}
+		}
+
+		void UpdateButtonSensitivity ()
+		{
+			if (UpdatedElements != null)
+				UpdatedElements (this, EventArgs.Empty);
+		}
+
+		[GLib.ConnectBefore()]
+		void OnKeyPressed (object sender, Gtk.KeyPressEventArgs args)
+		{
+			if (args.Event.Key == Gdk.Key.Delete) {
+				args.RetVal = true;
+				OnRemoveSelectedImage (sender, EventArgs.Empty);
+			}
+		}
+	}
+}

Added: trunk/src/widgets/VideosFileView.cs
==============================================================================
--- (empty file)
+++ trunk/src/widgets/VideosFileView.cs	Wed Mar 18 14:33:32 2009
@@ -0,0 +1,98 @@
+//
+// Copyright (C) 2008 Jordi Mas i Hernandez, jmas softcatala org
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using System.IO;
+using System.Text;
+using Gdk;
+using Mistelix.DataModel;
+using System.ComponentModel;
+
+using Mistelix.Core;
+
+namespace Mistelix.Widgets
+{
+	//
+	// Displays videos files into an IconView. No drag and drop involved
+	//
+	public class VideosFileView : FileView
+	{
+		public VideosFileView ()
+		{
+		}
+
+		public override void OnDirChanged (string new_dir)
+		{
+			parent = new DirectoryInfo (new_dir);
+			LoadElements ();
+		}
+
+		public override bool IsValidExtesion (string filename)
+		{
+			filename = filename.ToLower ();
+
+			if (filename.EndsWith (".mpeg"))
+				return true;
+
+			if (filename.EndsWith (".mpg"))
+				return true;
+
+			if (filename.EndsWith (".avi"))
+				return true;
+
+			if (filename.EndsWith (".wmv"))
+				return true;
+
+			return false;
+		}
+
+		public override void DoWork (object sender, DoWorkEventArgs e)
+        	{   
+			ListStore store = (ListStore) e.Argument;
+			Logger.Debug ("VideosFileView.Dowork start");
+			store.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter)  
+			{
+				string file = (string) store.GetValue (iter, 0);
+				Gdk.Pixbuf im;
+			
+				try {
+					im = MistelixLib.CreateThumbnail (file, thumbnail_width, thumbnail_height);
+				}
+			
+				catch {
+					return false;
+				}
+				
+				Application.Invoke (delegate {
+						store.SetValue (iter, 2, im);
+					} );
+
+				return false;
+			});
+
+			Logger.Debug ("VideosFileView.Dowork end");
+		}
+
+	}
+}



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