Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 0cb8305ac4f99b44dd7de7d2b9919d77 > files > 1

gluezilla-1.2.6.1-2.10mdv2008.1.src.rpm

--- gluezilla-1.2.6.1/configure.ac
+++ gluezilla-1.2.6.1/configure.ac
@@ -58,7 +58,7 @@ if test -z $mozilla_nss; then
 fi
 
 AC_MSG_CHECKING(Mozilla XPCOM pkg-config module name)
-mozilla_xpcom_pcs="xpcom mozilla-xpcom firefox-xpcom xulrunner-xpcom"
+mozilla_xpcom_pcs="xpcom mozilla-xpcom firefox-xpcom xulrunner-xpcom libxul-embedding-unstable"
 for pc in $mozilla_xpcom_pcs; do
 	if $PKG_CONFIG --exists $pc; then
 		AC_MSG_RESULT($pc)
@@ -121,6 +121,9 @@ AC_SUBST(XPFLAGS)
 
 XPCOM_PKGS="$mozilla_xpcom"
 NSPR_PKGS="$mozilla_nspr"
+dnl Yeah, just assume, we know this is building for xulrunner 1.9
+XUL_VERSION=3
+
 
 if test "x${local}" != xno ; then
 	GLUEZILLA_CFLAGS=`pkg-config --cflags gtk+-2.0 $NSPR_PKGS`
@@ -131,7 +134,8 @@ if test "x${local}" != xno ; then
 	GLUEZILLA_LIBS="${GLUEZILLA_LIBS} -L../build/lib"
 else
 	GLUEZILLA_CFLAGS=`pkg-config --cflags gtk+-2.0 $XPCOM_PKGS`
-	GLUEZILLA_LIBS=`pkg-config --libs gtk+-2.0 $NSPR_PKGS`
+	GLUEZILLA_CFLAGS="$GLUEZILLA_CFLAGS -I`pkg-config --variable=includedir $XPCOM_PKGS`"
+	GLUEZILLA_LIBS=`pkg-config --libs gtk+-2.0 $NSPR_PKGS $XPCOM_PKGS`
 	XULLIBDIR=`pkg-config --variable=libdir $XPCOM_PKGS`
 	GLUEZILLA_LIBS="${GLUEZILLA_LIBS} -L${XULLIBDIR}"
 fi
@@ -139,7 +143,7 @@ fi
 if test "x${optimize}" == xno ; then
 	GLUEZILLA_CFLAGS="-DDEBUG -DFORCE_PR_LOG ${GLUEZILLA_CFLAGS}"
 fi
-GLUEZILLA_CFLAGS="-DXPCOM_GLUE -fno-rtti ${GLUEZILLA_CFLAGS}"
+GLUEZILLA_CFLAGS="-DXUL_VERSION=${XUL_VERSION} -DXPCOM_GLUE -fno-rtti ${GLUEZILLA_CFLAGS}"
 GLUEZILLA_LIBS="${GLUEZILLA_LIBS} -lxpcomglue"
 
 
--- gluezilla-1.2.6.1/src/BrowserWindow.cpp
+++ gluezilla-1.2.6.1/src/BrowserWindow.cpp
@@ -63,7 +63,7 @@ BrowserWindow::Create ( Handle * hwnd, PRInt32 width, PRInt32 height)
 	if ( ! webBrowser )
 		return NS_ERROR_FAILURE;
 
-    (void)webBrowser->SetContainerWindow( NS_STATIC_CAST( nsIWebBrowserChrome*, this ) );
+    (void)webBrowser->SetContainerWindow( static_cast< nsIWebBrowserChrome*> ( this ) );
 
     nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface( webBrowser );
     dsti->SetItemType( nsIDocShellTreeItem::typeContentWrapper );
@@ -72,7 +72,7 @@ BrowserWindow::Create ( Handle * hwnd, PRInt32 width, PRInt32 height)
 	sessionHistory = do_CreateInstance(NS_SHISTORY_CONTRACTID);
 	webNav->SetSessionHistory(sessionHistory);
 
-    nsCOMPtr<nsIWindowCreator> windowCreator (NS_STATIC_CAST(nsIWindowCreator *, this));
+    nsCOMPtr<nsIWindowCreator> windowCreator (static_cast< nsIWindowCreator *> (this));
 
     // Attach it via the watcher service
     nsCOMPtr<nsIWindowWatcher> watcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
@@ -108,7 +108,7 @@ BrowserWindow::Create ( Handle * hwnd, PRInt32 width, PRInt32 height)
 	result = baseWindow->InitWindow( hwnd, nsnull,  0, 0, width, height );
     result = baseWindow->Create();
 
-    nsCOMPtr< nsIWebProgressListener > listener( NS_STATIC_CAST( nsIWebProgressListener*, this ) );
+    nsCOMPtr< nsIWebProgressListener > listener( static_cast< nsIWebProgressListener*> ( this ) );
     nsCOMPtr< nsIWeakReference > thisListener( NS_GetWeakReference( listener ) );
     (void)webBrowser->AddWebBrowserListener( thisListener, NS_GET_IID( nsIWebProgressListener ) );
 
@@ -447,7 +447,7 @@ BrowserWindow::CreateChromeWindow(
 	//if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)
 	//	this->isChrome = PR_TRUE;
 
-	*_retval = NS_STATIC_CAST(nsIWebBrowserChrome *, this);
+	*_retval = static_cast<nsIWebBrowserChrome *> (this);
 	
 	if (*_retval) {
 		NS_ADDREF(*_retval);
@@ -475,13 +475,13 @@ BrowserWindow::CreateChromeWindow(
 	// realized before that can happen.
 	gtk_widget_realize(GTK_WIDGET(newEmbed));
 	
-	Widget *newOwner = NS_STATIC_CAST(Widget *, newEmbed->data);
+	Widget *newOwner = static_cast<Widget *> (newEmbed->data);
 	
 	// set the chrome flag on the new window if it's a chrome open
 //	if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)
 //		newOwner->mIsChrome = PR_TRUE;
 	
-	*_retval = NS_STATIC_CAST(nsIWebBrowserChrome *, this);
+	*_retval = static_cast<nsIWebBrowserChrome *> (this);
 	
 	if (*_retval) {
 		NS_ADDREF(*_retval);
@@ -795,7 +795,7 @@ BrowserWindow::SetTitle(const PRUnichar * aTitle)
 NS_IMETHODIMP 
 BrowserWindow::GetSiteWindow(void * *aSiteWindow)
 {
-  *aSiteWindow = NS_STATIC_CAST(void *, owner->getHandle());
+  *aSiteWindow = static_cast<void *> (owner->getHandle());
   return NS_OK;
 }
 
--- gluezilla-1.2.6.1/src/LocationProvider.cpp
+++ gluezilla-1.2.6.1/src/LocationProvider.cpp
@@ -182,12 +182,14 @@ char const * GetAvailableRuntime ()
 	if (*runtimePath)
 		return runtimePath;
 
+#if XUL_VERSION == 2
 	const char* xpcomLocation = GRE_GetXPCOMPath();
 	if (xpcomLocation)
 	{
 		strcpy(runtimePath, xpcomLocation);
 		return runtimePath;
 	}
+#endif
 
 	static const GREVersionRange version = {
 	"1.8", PR_TRUE,
--- gluezilla-1.2.6.1/src/Widget.cpp
+++ gluezilla-1.2.6.1/src/Widget.cpp
@@ -135,6 +135,7 @@ Widget::Load (CallbackBin *events)
 
 		//XRE_InitEmbedding(gre, app, nsnull, nsnull, 0); 
 
+#if XUL_VERSION == 2
 		nsCOMPtr<nsIAppShell> appShell;
 		appShell = do_CreateInstance(kAppShellCID);
 		if (!appShell) {
@@ -145,6 +146,7 @@ Widget::Load (CallbackBin *events)
 		NS_ADDREF(this->appShell);
 		this->appShell->Create(0, nsnull);
 		this->appShell->Spinup();
+#endif
 
 	}
 	this->events = events;
@@ -158,13 +160,20 @@ Widget::Shutdown ()
 	widgetCount--;
 
 	if (widgetCount == 0) {
+#if XUL_VERSION == 2
 		if (appShell) {
 			// Shutdown the appshell service.
 			this->appShell->Spindown();
 			NS_RELEASE(this->appShell);
 			this->appShell = 0;
 		}
+#endif
+#if XUL_VERSION > 2
+		XPCOMGlueShutdown ();
+#else
 		GRE_Shutdown();
+#endif
+
 		#ifdef NS_UNIX
 		g_idle_add (gtk_shutdown, NULL);
 		#endif