--- totem-2.18.2/browser-plugin/totemPlugin.h	2007-03-26 02:50:03.000000000 +0200
+++ totem-2.18.2-new/browser-plugin/totemPlugin.h	2007-10-31 16:30:31.000000000 +0100
@@ -33,6 +33,9 @@
 #include "totemStringGlue.h"
 #endif
 
+#define NS_STATIC_CAST(__type, __ptr) static_cast< __type >(__ptr)
+#define NS_REINTERPRET_CAST(__type, __expr) reinterpret_cast< __type >(__expr)
+
 #if defined(TOTEM_COMPLEX_PLUGIN) && defined(HAVE_NSTARRAY_H)
 #include <nsTArray.h>
 #endif /* TOTEM_COMPLEX_PLUGIN */
--- totem-2.18.2/configure.in	2007-05-16 17:33:09.000000000 +0200
+++ totem-2.18.2-new/configure.in	2007-10-31 16:30:38.000000000 +0100
@@ -323,12 +323,12 @@
 	if test -z "$with_gecko"; then
 		dnl Autodetect gecko
 		for g in $GECKOS; do
-			if $PKG_CONFIG --exists $g-xpcom; then
+			if $PKG_CONFIG --exists libxul; then
 				gecko=$g
 				break;
 			fi
 		done
-	elif ! $PKG_CONFIG --exists $gecko-xpcom; then
+	elif ! $PKG_CONFIG --exists libxul; then
 		AC_MSG_ERROR([Gecko "$gecko" not found])
 	fi
 
@@ -368,8 +368,7 @@
 # separate vars
 if test "$enable_browser_plugins" = "yes" ; then
 	PKG_CHECK_MODULES([MOZILLA_NOT_LINKED],
-		[$MOZILLA-xpcom >= $MOZILLA_VERSION_MIN \
-		 $MOZILLA-plugin],,
+		[libxul],,
                 [enable_browser_plugins=no])
 fi
 # Check for other required modules, and merge CFLAGS, but not link
@@ -408,24 +407,27 @@
 
 # Sets some variables, and check for xpidl
 if test "$enable_browser_plugins" = "yes" ; then
-	MOZILLA_PREFIX="`$PKG_CONFIG $MOZILLA-xpcom --variable=prefix`"
-	MOZILLA_LIBDIR="`$PKG_CONFIG $MOZILLA-xpcom --variable=libdir`"
-	MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA-xpcom`"
-	MOZILLA_XPCOM_CFLAGS="-I`$PKG_CONFIG --variable=includedir $MOZILLA-xpcom`"
+	LIBXUL_SDK_DIR=`$PKG_CONFIG --variable=sdkdir libxul`
+	MOZILLA_PREFIX="`$PKG_CONFIG libxul --variable=prefix`"
+	MOZILLA_LIBDIR="`$PKG_CONFIG libxul --variable=libdir`"
+	MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir libxul`"
+	MOZILLA_XPCOM_CFLAGS="`$PKG_CONFIG --cflags --define-variable=includetype=unstable libxul`"
+	MOZILLA_LIBS="`$PKG_CONFIG --libs libxul`"
 	MOZILLA_PLUGINDIR="${MOZILLA_PLUGINDIR:-$MOZILLA_LIBDIR}"
 
-	AC_PATH_PROG([MOZILLA_XPIDL], [xpidl], [no], [$MOZILLA_LIBDIR:$PATH])
+	AC_PATH_PROG([MOZILLA_XPIDL], [xpidl], [no], [$LIBXUL_SDK_DIR/bin:$PATH])
 	if test "x$MOZILLA_XPIDL" = "xno"; then
 		AC_MSG_ERROR([xpidl compiler not found])
 	fi
 
-	AC_PATH_PROG([MOZILLA_XPT_LINK],[xpt_link],[no],[$MOZILLA_LIBDIR:$PATH])
+	AC_PATH_PROG([MOZILLA_XPT_LINK],[xpt_link],[no],[$LIBXUL_SDK_DIR/bin:$PATH])
 	if test "$MOZILLA_XPT_LINK" = "no"; then
 		AC_MSG_ERROR([xpt_link not found])
 	fi
 
 	AC_SUBST([MOZILLA_PREFIX])
 	AC_SUBST([MOZILLA_LIBDIR])
+	AC_SUBST([MOZILLA_LIBS])
 	AC_SUBST([MOZILLA_XPCOM_CFLAGS])
 	AC_SUBST([MOZILLA_INCLUDE_ROOT])
 	AC_ARG_VAR([MOZILLA_PLUGINDIR],[Where to install the plugin to])
@@ -434,15 +436,7 @@
 # Search for the idl include directory
 if test "$enable_browser_plugins" = "yes" ; then
 	dnl This only works on gecko 1.8
-	MOZILLA_IDLDIR="`$PKG_CONFIG --variable=idldir $MOZILLA-xpcom`"
-	dnl Fallback for older versions
-	if test "x$MOZILLA_IDLDIR" = "x"; then
-		MOZILLA_IDLDIR="`echo $MOZILLA_LIBDIR | sed -e s!lib!share/idl!`"
-	fi
-	dnl Some distributions (Gentoo) have it in unusual places
-	if test "x$MOZILLA_IDLDIR" = "x"; then
-		MOZILLA_IDLDIR="$MOZILLA_INCLUDE_ROOT/idl"
-	fi
+	MOZILLA_IDLDIR="`$PKG_CONFIG --variable=idldir libxul`/stable"
 
 	AC_SUBST([MOZILLA_IDLDIR])
 fi
@@ -515,32 +509,6 @@
 	fi
 fi
 
-# check for some additional xpcom headers and for string compatibility
-
-if test "$enable_browser_plugins" = "yes"; then
-	AC_LANG_PUSH([C++])
-	__SAVE_CPPFLAGS=$CPPFLAGS
-	CPPFLAGS="$CPPFLAGS $MOZILLA_NOT_LINKED_CFLAGS -I$MOZILLA_INCLUDE_ROOT/xpcom"
-
-	AC_CHECK_HEADERS([nsTArray.h])
-
-	AC_MSG_CHECKING([whether we need string glue])
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-				#include <mozilla-config.h>
-				#include <nsStringAPI.h>
-		],[
-				nsDependentCString test("Test");
-		])],[need_string_glue=no],[need_string_glue=yes])
-	AC_MSG_RESULT([$need_string_glue])
-
-	CPPFLAGS=$__SAVE_CPPFLAGS
-	AC_LANG_POP([C++])
-
-	if test "$need_string_glue" = "yes"; then
-		AC_DEFINE([NEED_STRING_GLUE],[1],[Define if we need string glue])
-	fi
-fi
-
 # check which plugins to enable
 
 if test "$enable_browser_plugins" = "yes"; then
