gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1341-ged9576f
Date: Tue, 13 Dec 2011 16:12:42 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  ed9576fad17bbd263d4255cf9da67543d78087d6 (commit)
      from  8e87210a292a8b263d367c2a1b82f9f3b10ed86f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=ed9576fad17bbd263d4255cf9da67543d78087d6


commit ed9576fad17bbd263d4255cf9da67543d78087d6
Author: Sandro Santilli <address@hidden>
Date:   Mon Aug 22 15:07:10 2011 +0200

    Provide a thumbnailer for SWF files and GNOME desktop config for it.
    
    Tested with nautilus 2.30.1, Should work with any version up to 2.32.

diff --git a/NEWS b/NEWS
index d61ca09..56bc764 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Improvements since 0.8.9 release are:
  * Fix parsing of lossless 16bit bitmaps, fixing support for movies
    generated by the evil TechSmit Camtasia tool (#34625).
  * Improved double buffering support for AGG in a framebuffer.
+ * Thumbnailer for SWF files and GNOME2 desktop config for it.
 
 Gnash 0.8.9
 2011/03/19
diff --git a/configure.ac b/configure.ac
index 88b13da..377a4b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2856,6 +2856,36 @@ if test x"$BOOST_LIBS" != x; then
   fi
 fi
 
+dnl ========= Check for GConf
+
+AC_MSG_CHECKING([whether GConf support is requested])
+AC_ARG_WITH([gconf],
+  [AS_HELP_STRING([--without-gconf],
+          [Disable the use of gconf])],
+  [],
+  [case "${host}" in
+    *-cygwin* | *-mingw* | *-pw32*) with_gconf=no ;;
+    *) with_gconf=yes ;;
+   esac])
+AC_MSG_RESULT([$with_gconf])
+
+AM_CONDITIONAL([WITH_GCONF],[test "$with_gconf" = "yes"])
+
+if test "$with_gconf" = "yes"; then
+   PKG_CHECK_MODULES([GCONF],[gconf-2.0])
+   AC_DEFINE([WITH_GCONF],[1],[Define if GConf support is enabled])
+
+   AM_GCONF_SOURCE_2
+
+   AC_PATH_PROG([GCONFTOOL], [gconftool-2], [false])
+   if test "$GCONFTOOL" = "false"; then
+      AC_MSG_ERROR([gconftool-2 executable not found in your path - should be 
installed with GConf])
+   fi
+else
+   AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],false)
+fi
+
+
 CYGNAL_PATHS
 
 SUPPORTED_GUIS=
diff --git a/desktop/Makefile.am b/desktop/Makefile.am
index f51f849..6284294 100644
--- a/desktop/Makefile.am
+++ b/desktop/Makefile.am
@@ -1,3 +1,20 @@
+# 
+#   Copyright (C) 2010, 2011 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
+# the Free Software Foundation; either version 3 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# 
+
 desktopdir = $(datadir)/applications
 desktop_DATA =
 
@@ -13,7 +30,9 @@ EXTRA_DIST = gnash-splash.swf \
              gnash.desktop \
              klash.desktop \
              gnash-gtk-launcher.in \
-             gnash-qt-launcher.in
+             gnash-qt-launcher.in \
+             gnash-thumbnailer.in \
+             gnash.schemas.in
 
 if BUILD_GTK_GUI
 desktop_DATA += gnash.desktop
@@ -27,6 +46,22 @@ icons32_DATA += ../packaging/klash.xpm
 bin_SCRIPTS  += gnash-qt-launcher
 endif
 
+if BUILD_DUMP_GUI
+sysconf_DATA = gnashthumbnailrc
+desktop_DATA += gnash.schemas
+bin_SCRIPTS += gnash-thumbnailer
+endif
+
+gnash.schemas: gnash.schemas.in
+       sed -e 's#@@BINDIR@@#$(bindir)#g' $(srcdir)/gnash.schemas.in > $@
+
+gnash-thumbnailer: gnash-thumbnailer.in
+       sed -e 's#@@BINDIR@@#$(bindir)#g;s#@@SYSCONFDIR@@#$(sysconfdir)#g' 
$(srcdir)/gnash-thumbnailer.in > $@
+       chmod +x $@
+
+gnashthumbnailrc: gnashthumbnailrc.in
+       cp $(srcdir)/address@hidden $@
+
 validate-gnash-desktop: gnash.desktop
        ( dfvalidate=`which desktop-file-validate`; \
          if test x$$dfvalidate != x && test -x $$dfvalidate; then \
@@ -43,4 +78,20 @@ validate-klash-desktop: klash.desktop
              echo "Can't find desktop-file-validate to validate $<; proceed 
with fingers crossed..."; \
           fi )
 
-install-data-hook: validate-gnash-desktop validate-klash-desktop
+install-data-hook: validate-gnash-desktop validate-klash-desktop 
install-schemas
+
+uninstall-hook: uninstall-schemas
+
+install-schemas: 
+if BUILD_DUMP_GUI
+if GCONF_SCHEMAS_INSTALL
+       GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) 
--makefile-install-rule gnash.schemas
+endif
+endif
+
+uninstall-schemas: 
+if GCONF_SCHEMAS_INSTALL
+       GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) 
--makefile-uninstall-rule gnash.schemas
+endif
+
+CLEANFILES = gnash.schemas gnash-thumbnailer gnashthumbnailrc
diff --git a/desktop/README b/desktop/README
new file mode 100644
index 0000000..d34a5ef
--- /dev/null
+++ b/desktop/README
@@ -0,0 +1,23 @@
+= Thumbnailer =
+
+Thumbnailers are Nautilus specific
+
+Up to 2.32 (Ubuntu 10.04 has 2.30.1) gconftool --makefile-install-rule
+and --makefile-uninstall-rule have to be used
+
+From 2.32 up .thumbnailer files in /usr/share/thumbnailers
+
+16:18 < Company> strk: the thumbnailer stuff was changed for 3.0 afaik
+16:18 < Company> strk: 332:http://git.gnome.org/browse/evince/tree/thumbnailer
+                 is probably a good example of the new way to do a thumbnailer
+16:19 < Company> strk: and
+333:http://git.gnome.org/browse/evince/tree/thumbnailer?h=gnome-2-32 for the
+                 old way
+
+
+When producing thumbnails gnash should prevent any security issue
+so forbid loading of _any_ resource, forbid using shared memory
+(LocalConnection), forbid writing SharedObjects.
+To reduce load, a short AS execution timeout should also be used.
+All of the above can be done using a custom gnashrc, to be installed
+somewhere (/etc/gnashthumbnailerrc?)
diff --git a/desktop/gnash-thumbnailer.in b/desktop/gnash-thumbnailer.in
new file mode 100644
index 0000000..7969a33
--- /dev/null
+++ b/desktop/gnash-thumbnailer.in
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+#
+# gnash-thumbnailer :  script to produce thumbnails for SWF files
+#
+#   Copyright (C) 2011 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
+# the Free Software Foundation; either version 3 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+
+test -n "$2" || {
+    echo "Usage: $0 <input> <output> [<pixels>]" >&2
+    exit 1
+}
+
+in=$1 && shift
+out=$1 && shift 
+test -n "$1" && size=$1 && shift || size=128
+
+player=@@BINDIR@@/dump-gnash
+
+#echo ${in} ${out} ${size} 
+
+# TODO: 
+#  - security:
+#    - forbid loads
+#    - forbid using shared memory (LocalConnection)
+#    - forbid writing SharedObjects
+#    - reduce AS timeouts
+#  - correctness:
+#    - use size !
+#
+export GNASHRC=${GNASHRC}:@@SYSCONFDIR@@/gnashthumbnailrc
+${player} --screenshot last --screenshot-file ${out} ${in} \
+    --max-advances=100 --timeout=100 --width=${size} --height=${size} \
+    -r1 \
+    > /dev/null 2>&1
diff --git a/desktop/gnash.schemas.in b/desktop/gnash.schemas.in
new file mode 100644
index 0000000..3ae7c86
--- /dev/null
+++ b/desktop/gnash.schemas.in
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<gconfschemafile>
+  <schemalist>
+    <schema>
+      <key>/schemas/desktop/gnome/thumbnailers/address@hidden/command</key>
+      <applyto>/desktop/gnome/thumbnailers/address@hidden/command</applyto>
+      <type>string</type>
+      <default>@@BINDIR@@/gnash-thumbnailer %u %o %s</default>
+      <locale name="C">
+        <short>Thumbnail command for SWF files</short>
+        <long>
+          Set this key to the command used to create thumbnails for
+          SWF files.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/desktop/gnome/thumbnailers/address@hidden/enable</key>
+      <applyto>/desktop/gnome/thumbnailers/address@hidden/enable</applyto>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>Whether to thumbnail SWF files</short>
+        <long>
+          If set to true, then SWF files will be thumbnailed.
+        </long>
+      </locale>
+    </schema>
+
+  </schemalist>
+</gconfschemafile>
diff --git a/desktop/gnashthumbnailrc.in b/desktop/gnashthumbnailrc.in
new file mode 100644
index 0000000..a688500
--- /dev/null
+++ b/desktop/gnashthumbnailrc.in
@@ -0,0 +1,23 @@
+###########################################################
+#
+# This file will be used as a config file by the gnash thumbnailer 
+#
+# Focus here is on security concerns: we'll forbid load of any 
+# external resource, writing shared objects and using shared memory.
+# 
+###########################################################
+
+# SECURITY: don't load anything !
+# TODO: gui/Player still adds the input file dir to sandboxes,
+# we should forbid that too !
+set localSandboxPath /dev/null
+set whitelist /dev/null
+
+# SECURITY: don't write SharedObjects
+set SOLReadOnly true
+
+# SECURITY: disable local connection
+set LocalConnection off
+
+# SECURITY: disable extensions
+set enableExtensions off
diff --git a/macros/gconf-2.m4 b/macros/gconf-2.m4
new file mode 100644
index 0000000..4a0936e
--- /dev/null
+++ b/macros/gconf-2.m4
@@ -0,0 +1,44 @@
+dnl AM_GCONF_SOURCE_2
+dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install 
schemas
+dnl  (i.e. pass to gconftool-2
+dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
+dnl  you should install foo.schemas files
+dnl
+
+AC_DEFUN([AM_GCONF_SOURCE_2],
+[
+  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
+    GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
+  else
+    GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
+  fi
+
+  AC_ARG_WITH([gconf-source],
+             AC_HELP_STRING([--with-gconf-source=sourceaddress],
+                            [Config database for installing schema files.]),
+             [GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
+
+  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
+  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema 
installation])
+
+  if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
+    GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
+  fi
+
+  AC_ARG_WITH([gconf-schema-file-dir],
+             AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
+                            [Directory for installing schema files.]),
+             [GCONF_SCHEMA_FILE_DIR="$withval"],)
+
+  AC_SUBST(GCONF_SCHEMA_FILE_DIR)
+  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema 
files])
+
+  AC_ARG_ENABLE(schemas-install,
+       AC_HELP_STRING([--disable-schemas-install],
+                      [Disable the schemas installation]),
+     [case ${enableval} in
+       yes|no) ;;
+       *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) 
;;
+      esac])
+  AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != 
no])
+])

-----------------------------------------------------------------------

Summary of changes:
 NEWS                         |    1 +
 configure.ac                 |   30 +++++++++++++++++++++++
 desktop/Makefile.am          |   55 ++++++++++++++++++++++++++++++++++++++++-
 desktop/README               |   23 +++++++++++++++++
 desktop/gnash-thumbnailer.in |   50 ++++++++++++++++++++++++++++++++++++++
 desktop/gnash.schemas.in     |   32 ++++++++++++++++++++++++
 desktop/gnashthumbnailrc.in  |   23 +++++++++++++++++
 macros/gconf-2.m4            |   44 +++++++++++++++++++++++++++++++++
 8 files changed, 256 insertions(+), 2 deletions(-)
 create mode 100644 desktop/README
 create mode 100644 desktop/gnash-thumbnailer.in
 create mode 100644 desktop/gnash.schemas.in
 create mode 100644 desktop/gnashthumbnailrc.in
 create mode 100644 macros/gconf-2.m4


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]