[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11739: default to kde4-gnash if gtk
From: |
Rob Savoye |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11739: default to kde4-gnash if gtk-gnash doesn't exist. |
Date: |
Fri, 01 Jan 2010 09:58:35 -0700 |
User-agent: |
Bazaar (2.0.2) |
------------------------------------------------------------
revno: 11739
author: John Wimer <address@hidden>
committer: Rob Savoye <address@hidden>
branch nick: trunk
timestamp: Fri 2010-01-01 09:58:35 -0700
message:
default to kde4-gnash if gtk-gnash doesn't exist.
modified:
configure.ac
plugin/plugin.cpp
plugin/plugin.h
=== modified file 'configure.ac'
--- a/configure.ac 2009-12-16 00:09:04 +0000
+++ b/configure.ac 2010-01-01 16:58:35 +0000
@@ -1384,18 +1384,20 @@
*) AC_MSG_ERROR([bad value ${enableval} for --disable-kparts4 option]) ;;
esac],build_kparts4=$build_kde4)
-dnl ----------------------------------------------------
-dnl Add NPAPI support, if specified or GTK gui is built
-dnl ----------------------------------------------------
+dnl -----------------------------------------------------------
+dnl Add NPAPI support, if specified or GTK or KDE4 gui is built
+dnl -----------------------------------------------------------
AC_ARG_ENABLE(npapi,
- AC_HELP_STRING([--disable-npapi], [Disable NPAPI plugin build (default:
enabled if gtk gui is)]),
+ AC_HELP_STRING([--disable-npapi], [Disable NPAPI plugin build (default:
enabled if gtk or kde4 gui is)]),
[case "${enableval}" in
yes) npapi=yes ;;
no) npapi=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for disable-npapi option]) ;;
esac],
- npapi=$build_gtk
+ if test x$build_gtk = xyes -o x$build_kde4 = xyes; then
+ npapi=yes
+ fi
)
dnl -----------------------------------------------------------------
@@ -1868,8 +1870,10 @@
AM_CONDITIONAL(HAVE_GLIB, [ test x$has_glib = xyes ])
-if test x$build_gtk = xno -a x$npapi = xyes; then
- AC_MSG_WARN(["Enabled NPAPI plugin, but you aren't building a GTK based
GUI!"])
+if test x$build_gtk = xno -o x$build_kde4 = xno; then
+ if test x$npapi =xyes; then
+ AC_MSG_WARN(["Enabled NPAPI plugin, but it's not supported by the selected
GUI"])
+ fi
fi
if test x$windows = xyes -a x$npapi = xyes; then
@@ -1881,6 +1885,11 @@
fi
fi
+dnl Need GLIB for NPAPI plugin
+if test x$npapi = xyes; then
+ GNASH_PATH_GLIB
+fi
+
dnl if kde isn't installed, even if it's specified, don't try to build
dnl the KPARTS plugin, which is KDE based.
if test x$has_kde3 = xno -a x$build_kparts3 = xyes; then
=== modified file 'plugin/plugin.cpp'
--- a/plugin/plugin.cpp 2009-12-16 00:09:04 +0000
+++ b/plugin/plugin.cpp 2010-01-01 16:58:35 +0000
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
Foundation, Inc.
//
// 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
@@ -1108,17 +1108,47 @@
nsPluginInstance::startProc(Window win)
{
std::string procname;
+ bool process_found = false;
+ struct stat procstats;
+
char *gnash_env = std::getenv("GNASH_PLAYER");
+
#ifdef GNASH_XPI_PLUGIN
if (getHome(procname) >= 0)
- ;
+ process_found = true;
else
#endif // def GNASH_XPI_PLUGIN
- if (gnash_env == NULL) {
- procname = GNASHBINDIR;
- procname += "/gtk-gnash";
- } else {
+ if (gnash_env)
+ {
procname = gnash_env;
+ process_found = (0 == stat(procname.c_str(), &procstats));
+ if (!process_found)
+ {
+#ifdef GNASH_PLUGIN_DEBUG
+ std::cout << "Invalid path to gnash executable: " <<
+ procname << std::endl;
+#endif
+ return;
+ }
+ }
+
+ if (!process_found)
+ {
+ procname = GNASHBINDIR "/gtk-gnash";
+ process_found = (0 == stat(procname.c_str(), &procstats));
+ }
+ if (!process_found)
+ {
+ procname = GNASHBINDIR "/kde4-gnash";
+ process_found = (0 == stat(procname.c_str(), &procstats));
+ }
+
+ if (!process_found)
+ {
+#ifdef GNASH_PLUGIN_DEBUG
+ std::cout << "Unable to find Gnash in " GNASHBINDIR << std::endl;
+#endif
+ return;
}
const char* pageurl = getCurrentPageURL();
@@ -1129,17 +1159,6 @@
#endif
}
- struct stat procstats;
-
- // See if the file actually exists, otherwise we can't spawn it
- if (stat(procname.c_str(), &procstats) == -1) {
-#ifdef GNASH_PLUGIN_DEBUG
- std::cout << "Invalid path to standalone executable: " <<
- procname << std::endl;
-#endif
- return;
- }
-
dumpCookies();
// 0 For reading, 1 for writing.
=== modified file 'plugin/plugin.h'
--- a/plugin/plugin.h 2009-02-25 22:33:03 +0000
+++ b/plugin/plugin.h 2010-01-01 16:58:35 +0000
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
Foundation, Inc.
//
// 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
@@ -43,6 +43,8 @@
#include <X11/cursorfont.h>
#ifdef HAVE_GTK2
#include <gtk/gtk.h>
+#else
+#include <glib.h>
#endif
#include <string>
#include <map>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11739: default to kde4-gnash if gtk-gnash doesn't exist.,
Rob Savoye <=