[Goodies-commits] r3005 - in ristretto/trunk: . src
Stephan Arts
stephan at xfce.org
Sun Aug 19 14:39:16 CEST 2007
Author: stephan
Date: 2007-08-19 12:39:15 +0000 (Sun, 19 Aug 2007)
New Revision: 3005
Modified:
ristretto/trunk/INSTALL
ristretto/trunk/aclocal.m4
ristretto/trunk/depcomp
ristretto/trunk/install-sh
ristretto/trunk/missing
ristretto/trunk/mkinstalldirs
ristretto/trunk/src/main.c
ristretto/trunk/src/navigator.c
ristretto/trunk/src/navigator.h
ristretto/trunk/src/thumbnail_viewer.c
Log:
moved around some code
Modified: ristretto/trunk/INSTALL
===================================================================
--- ristretto/trunk/INSTALL 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/INSTALL 2007-08-19 12:39:15 UTC (rev 3005)
@@ -1,8 +1,8 @@
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@@ -10,10 +10,7 @@
Basic Installation
==================
-Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -26,9 +23,9 @@
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. Caching is
+the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
-cache files.
+cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
@@ -38,17 +35,20 @@
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
- Running `configure' might take a while. While running, it prints
- some messages telling which features it is checking for.
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -78,7 +78,7 @@
by setting variables in the command line or in the environment. Here
is an example:
- ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
@@ -87,15 +87,17 @@
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you can use GNU `make'. `cd' to the
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory. After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
Installation Names
==================
@@ -188,12 +190,12 @@
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
+overridden in the site shell script). Here is a another example:
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug. Until the bug is fixed you can use this workaround:
+ /bin/bash ./configure CONFIG_SHELL=/bin/bash
- CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
Modified: ristretto/trunk/aclocal.m4
===================================================================
--- ristretto/trunk/aclocal.m4 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/aclocal.m4 2007-08-19 12:39:15 UTC (rev 3005)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 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.
@@ -11,11 +11,6 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_fatal([this file was generated for autoconf 2.61.
-You have another version of autoconf. If you want to use that,
-you should regenerate the build system entirely.], [63])])
-
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
#
@@ -465,7 +460,7 @@
esac
if test -n "$1"; then
- AC_MSG_CHECKING([for intltool >= $1])
+ AC_MSG_CHECKING(for intltool >= $1)
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
@@ -546,10 +541,8 @@
# 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]])],
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
[DATADIRNAME=share],
[case $host in
*-*-solaris*)
@@ -657,7 +650,7 @@
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
-# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+# 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,
@@ -667,29 +660,14 @@
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# 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.10])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+ [AM_AUTOMAKE_VERSION([1.9.6])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@@ -746,14 +724,14 @@
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# 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 8
+# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -762,10 +740,8 @@
[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])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
@@ -779,14 +755,15 @@
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+
+# 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 9
+# 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,
@@ -814,7 +791,6 @@
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], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
@@ -880,7 +856,6 @@
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/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
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
@@ -933,8 +908,7 @@
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
@@ -959,9 +933,8 @@
# 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.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
@@ -1020,8 +993,8 @@
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 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,
@@ -1044,20 +1017,16 @@
# 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.60])dnl
+[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
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
+# 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
@@ -1077,9 +1046,6 @@
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
@@ -1115,10 +1081,6 @@
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
])
@@ -1154,7 +1116,7 @@
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@@ -1261,14 +1223,14 @@
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# 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 5
+# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -1284,7 +1246,6 @@
# 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
-AC_REQUIRE_AUX_FILE([missing])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
@@ -1295,7 +1256,7 @@
fi
])
-# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 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,
@@ -1303,23 +1264,60 @@
# AM_PROG_MKDIR_P
# ---------------
-# Check for `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],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
+[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 -*-
@@ -1431,21 +1429,9 @@
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006 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_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Modified: ristretto/trunk/depcomp
===================================================================
--- ristretto/trunk/depcomp 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/depcomp 2007-08-19 12:39:15 UTC (rev 3005)
@@ -1,10 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2006-10-15.18
+scriptversion=2005-07-09.11
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 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
@@ -92,20 +91,7 @@
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
@@ -290,46 +276,6 @@
rm -f "$tmpdepfile"
;;
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add `dependent.h:' lines.
- sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -342,13 +288,13 @@
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
- # static library. This mechanism is used in libtool 1.4 series to
+ # static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in $dir.libs/$base.o.d and
+ # compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
Modified: ristretto/trunk/install-sh
===================================================================
--- ristretto/trunk/install-sh 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/install-sh 2007-08-19 12:39:15 UTC (rev 3005)
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2006-10-14.15
+scriptversion=2005-05-14.22
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,24 +39,15 @@
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch.
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
-nl='
-'
-IFS=" "" $nl"
-
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
+# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
@@ -67,13 +58,7 @@
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-posix_glob=
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chmodcmd=$chmodprog
+chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
@@ -110,7 +95,7 @@
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
-while test $# -ne 0; do
+while test -n "$1"; do
case $1 in
-c) shift
continue;;
@@ -126,15 +111,9 @@
--help) echo "$usage"; exit $?;;
- -m) mode=$2
+ -m) chmodcmd="$chmodprog $2"
shift
shift
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
continue;;
-o) chowncmd="$chownprog $2"
@@ -157,33 +136,25 @@
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
esac
done
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dstarg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
- shift # fnord
- fi
- shift # arg
- dstarg=$arg
- done
-fi
-
-if test $# -eq 0; then
+if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
@@ -193,33 +164,6 @@
exit 0
fi
-if test -z "$dir_arg"; then
- trap '(exit $?); exit' 1 2 13 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
for src
do
# Protect names starting with `-'.
@@ -229,11 +173,15 @@
if test -n "$dir_arg"; then
dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
+ src=
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
@@ -260,188 +208,53 @@
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
+ dst=$dst/`basename "$src"`
fi
fi
- obsolete_mkdir_used=false
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+ # Make sure that the destination directory exists.
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+ pathcomp=
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix=/ ;;
- -*) prefix=./ ;;
- *) prefix= ;;
- esac
-
- case $posix_glob in
- '')
- if (set -f) 2>/dev/null; then
- posix_glob=true
- else
- posix_glob=false
- fi ;;
- esac
-
- oIFS=$IFS
- IFS=/
- $posix_glob && set -f
- set fnord $dstdir
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
shift
- $posix_glob && set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test -z "$d" && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
fi
- fi
+ pathcomp=$pathcomp/
+ done
fi
if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
else
+ dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
@@ -449,9 +262,10 @@
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+ trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+ $doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -462,10 +276,10 @@
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
@@ -477,12 +291,11 @@
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
- if test -f "$dst"; then
- $doit $rmcmd -f "$dst" 2>/dev/null \
- || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
- && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
- echo "$0: cannot unlink or rename $dst" >&2
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
@@ -491,14 +304,17 @@
} &&
# Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
- } || exit 1
-
- trap '' 0
- fi
+ }
+ fi || { (exit 1); exit 1; }
done
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit 0
+}
+
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
Modified: ristretto/trunk/missing
===================================================================
--- ristretto/trunk/missing 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/missing 2007-08-19 12:39:15 UTC (rev 3005)
@@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2006-05-10.23
+scriptversion=2005-06-08.21
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
@@ -33,8 +33,6 @@
fi
run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -46,7 +44,7 @@
msg="missing on your system"
-case $1 in
+case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -79,7 +77,6 @@
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
- autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -109,7 +106,7 @@
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
-case $1 in
+case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
@@ -138,7 +135,7 @@
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
-case $1 in
+case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -167,7 +164,7 @@
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case $f in
+ case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -195,8 +192,8 @@
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
@@ -217,25 +214,25 @@
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
+ if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
- case $LASTARG in
+ case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
+ if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
+ if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if test ! -f y.tab.h; then
+ if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
- if test ! -f y.tab.c; then
+ if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
@@ -247,18 +244,18 @@
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if test $# -ne 1; then
+ if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
- case $LASTARG in
+ case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
+ if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if test ! -f lex.yy.c; then
+ if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
@@ -270,9 +267,11 @@
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
@@ -290,17 +289,11 @@
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
@@ -324,13 +317,13 @@
fi
firstarg="$1"
if shift; then
- case $firstarg in
+ case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case $firstarg in
+ case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
Modified: ristretto/trunk/mkinstalldirs
===================================================================
--- ristretto/trunk/mkinstalldirs 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/mkinstalldirs 2007-08-19 12:39:15 UTC (rev 3005)
@@ -1,7 +1,7 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-scriptversion=2006-05-11.19
+scriptversion=2005-06-29.22
# Original author: Noah Friedman <friedman at prep.ai.mit.edu>
# Created: 1993-05-16
@@ -11,9 +11,6 @@
# bugs to <bug-automake at gnu.org> or send patches to
# <automake-patches at gnu.org>.
-nl='
-'
-IFS=" "" $nl"
errstatus=0
dirmode=
Modified: ristretto/trunk/src/main.c
===================================================================
--- ristretto/trunk/src/main.c 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/src/main.c 2007-08-19 12:39:15 UTC (rev 3005)
@@ -240,9 +240,7 @@
gtk_widget_set_size_request(window, 400, 300);
- rstto_navigator_set_path(navigator, path, TRUE);
-
gtk_container_add(GTK_CONTAINER(s_window), viewer);
gtk_toolbar_set_orientation(GTK_TOOLBAR(image_tool_bar), GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start(GTK_BOX(main_hbox), image_tool_bar, FALSE, TRUE, 0);
@@ -357,8 +355,6 @@
ThunarVfsPath *path = thunar_vfs_path_new(filename, NULL);
- rstto_navigator_set_path(navigator, path, FALSE);
-
thunar_vfs_path_unref(path);
}
@@ -381,14 +377,24 @@
gint response = gtk_dialog_run(GTK_DIALOG(dialog));
if(response == GTK_RESPONSE_OK)
{
- const gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+ const gchar *dir_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+ GDir *dir = g_dir_open(dir_name, 0, NULL);
+ if (dir)
+ {
+ const gchar *filename = g_dir_read_name(dir);
+ while (filename)
+ {
+ ThunarVfsPath *path = thunar_vfs_path_new(filename, NULL);
+ if (path)
+ {
+ ThunarVfsInfo *info = thunar_vfs_info_new_for_path(path, NULL);
+ RsttoNavigatorEntry *entry = rstto_navigator_entry_new(info);
+ rstto_navigator_add (navigator, entry);
+ }
+ filename = g_dir_read_name(dir);
+ }
+ }
- ThunarVfsPath *path = thunar_vfs_path_new(filename, NULL);
-
- rstto_navigator_set_path(navigator, path, TRUE);
-
- thunar_vfs_path_unref(path);
-
}
gtk_widget_destroy(dialog);
@@ -428,25 +434,25 @@
static void
cb_rstto_first(GtkToolItem *item, RsttoNavigator *navigator)
{
- rstto_navigator_first(navigator);
+ rstto_navigator_jump_first(navigator);
}
static void
cb_rstto_last(GtkToolItem *item, RsttoNavigator *navigator)
{
- rstto_navigator_last(navigator);
+ rstto_navigator_jump_last(navigator);
}
static void
cb_rstto_forward(GtkToolItem *item, RsttoNavigator *navigator)
{
- rstto_navigator_forward(navigator);
+ rstto_navigator_jump_forward(navigator);
}
static void
cb_rstto_previous(GtkToolItem *item, RsttoNavigator *navigator)
{
- rstto_navigator_back(navigator);
+ rstto_navigator_jump_back(navigator);
}
static void
@@ -534,16 +540,16 @@
gtk_window_fullscreen(window);
break;
case GDK_Home:
- rstto_navigator_first(navigator);
+ rstto_navigator_jump_first(navigator);
break;
case GDK_End:
- rstto_navigator_last(navigator);
+ rstto_navigator_jump_last(navigator);
break;
case GDK_Page_Down:
- rstto_navigator_forward(navigator);
+ rstto_navigator_jump_forward(navigator);
break;
case GDK_Page_Up:
- rstto_navigator_back(navigator);
+ rstto_navigator_jump_back(navigator);
break;
}
}
@@ -612,7 +618,7 @@
break;
}
- rstto_navigator_set_entry_rotation(navigator, entry, rotation);
+ //rstto_navigator_set_entry_rotation(navigator, entry, rotation);
}
static void
@@ -636,5 +642,5 @@
break;
}
- rstto_navigator_set_entry_rotation(navigator, entry, rotation);
+ //rstto_navigator_set_entry_rotation(navigator, entry, rotation);
}
Modified: ristretto/trunk/src/navigator.c
===================================================================
--- ristretto/trunk/src/navigator.c 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/src/navigator.c 2007-08-19 12:39:15 UTC (rev 3005)
@@ -36,6 +36,9 @@
static GObjectClass *parent_class = NULL;
+static gint
+rstto_navigator_entry_name_compare_func(RsttoNavigatorEntry *a, RsttoNavigatorEntry *b);
+
enum
{
RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED = 0,
@@ -48,12 +51,9 @@
GdkPixbufRotation rotation;
gboolean h_flipped;
gboolean v_flipped;
+ GdkPixbuf *preview;
};
-RsttoNavigatorEntry *
-_rstto_navigator_entry_new (ThunarVfsInfo *info);
-static void
-_rstto_navigator_entry_free(RsttoNavigatorEntry *nav_entry);
static gint rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_COUNT];
@@ -86,7 +86,7 @@
static void
rstto_navigator_init(RsttoNavigator *viewer)
{
-
+ viewer->compare_func = (GCompareFunc)rstto_navigator_entry_name_compare_func;
}
static void
@@ -136,197 +136,23 @@
}
static gint
-rstto_navigator_entry_compare_func(RsttoNavigatorEntry *a, RsttoNavigatorEntry *b)
+rstto_navigator_entry_name_compare_func(RsttoNavigatorEntry *a, RsttoNavigatorEntry *b)
{
return g_strcasecmp(a->info->display_name, b->info->display_name);
}
void
-rstto_navigator_set_path(RsttoNavigator *navigator, ThunarVfsPath *path, gboolean index_path)
+rstto_navigator_jump_first (RsttoNavigator *navigator)
{
- if(navigator->path)
- {
- thunar_vfs_path_unref(navigator->path);
- navigator->path = NULL;
- }
-
- if(navigator->file_list)
- {
- g_list_foreach(navigator->file_list, (GFunc)_rstto_navigator_entry_free, NULL);
- navigator->file_list = NULL;
- navigator->file_iter = NULL;
- }
-
- if(path)
- {
- ThunarVfsInfo *info = thunar_vfs_info_new_for_path(path, NULL);
- if(info)
- {
- if(strcmp(thunar_vfs_mime_info_get_name(info->mime_info), "inode/directory"))
- {
- navigator->path = thunar_vfs_path_get_parent(path);
- }
- else
- {
- thunar_vfs_path_ref(path);
- navigator->path = path;
- }
- thunar_vfs_info_unref(info);
- info = NULL;
- }
- else
- {
- navigator->path = thunar_vfs_path_get_parent(path);
- }
-
- gchar *dir_name = thunar_vfs_path_dup_string(navigator->path);
-
- GDir *dir = g_dir_open(dir_name, 0, NULL);
- const gchar *filename = g_dir_read_name(dir);
- while(filename)
- {
- ThunarVfsPath *file_path = thunar_vfs_path_relative(navigator->path, filename);
- ThunarVfsInfo *file_info = thunar_vfs_info_new_for_path(file_path, NULL);
- if(file_info)
- {
- gchar *file_media = thunar_vfs_mime_info_get_media(file_info->mime_info);
- if(!strcmp(file_media, "image"))
- {
- if(thunar_vfs_path_equal(path, file_path))
- {
- RsttoNavigatorEntry *nav_entry = _rstto_navigator_entry_new(file_info);
-
- navigator->file_list = g_list_prepend(navigator->file_list, nav_entry);
- navigator->file_iter = navigator->file_list;
- }
- else
- {
- if(index_path)
- {
- RsttoNavigatorEntry *nav_entry = _rstto_navigator_entry_new(file_info);
- navigator->file_list = g_list_prepend(navigator->file_list, nav_entry);
- }
- }
- }
- else
- {
- thunar_vfs_info_unref(file_info);
- }
- g_free(file_media);
- }
-
- thunar_vfs_path_unref(file_path);
- filename = g_dir_read_name(dir);
- }
- g_free(dir_name);
-
- navigator->file_list = g_list_sort(navigator->file_list, (GCompareFunc)rstto_navigator_entry_compare_func);
-
- if(!navigator->file_iter)
- {
- navigator->file_iter = navigator->file_list;
- }
- }
-
- if(navigator->file_iter)
- {
- gchar *filename = thunar_vfs_path_dup_string(((ThunarVfsInfo *)((RsttoNavigatorEntry *)navigator->file_iter->data)->info)->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- RsttoNavigatorEntry *entry = navigator->file_iter->data;
- GdkPixbuf *new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
-
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
-
- g_free(filename);
- g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
- }
-}
-
-void
-rstto_navigator_first (RsttoNavigator *navigator)
-{
navigator->file_iter = g_list_first(navigator->file_list);
-
if(navigator->file_iter)
{
- ThunarVfsInfo *info = rstto_navigator_entry_get_info(((RsttoNavigatorEntry *)navigator->file_iter->data));
- gchar *filename = thunar_vfs_path_dup_string(info->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- RsttoNavigatorEntry *entry = navigator->file_iter->data;
- GdkPixbuf *new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- {
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
- rstto_picture_viewer_set_scale(navigator->viewer, 1);
- }
-
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
-
- g_free(filename);
g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
}
}
void
-rstto_navigator_forward (RsttoNavigator *navigator)
+rstto_navigator_jump_forward (RsttoNavigator *navigator)
{
if(navigator->file_iter)
@@ -336,54 +162,12 @@
if(navigator->file_iter)
{
- ThunarVfsInfo *info = rstto_navigator_entry_get_info(((RsttoNavigatorEntry *)navigator->file_iter->data));
- gchar *filename = thunar_vfs_path_dup_string(info->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- RsttoNavigatorEntry *entry = navigator->file_iter->data;
- GdkPixbuf *new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- {
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
- rstto_picture_viewer_set_scale(navigator->viewer, 1);
- }
-
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
-
- g_free(filename);
g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
}
}
void
-rstto_navigator_back (RsttoNavigator *navigator)
+rstto_navigator_jump_back (RsttoNavigator *navigator)
{
if(navigator->file_iter)
navigator->file_iter = g_list_previous(navigator->file_iter);
@@ -392,101 +176,17 @@
if(navigator->file_iter)
{
- ThunarVfsInfo *info = rstto_navigator_entry_get_info(((RsttoNavigatorEntry *)navigator->file_iter->data));
- gchar *filename = thunar_vfs_path_dup_string(info->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- RsttoNavigatorEntry *entry = navigator->file_iter->data;
- GdkPixbuf *new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- {
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
- rstto_picture_viewer_set_scale(navigator->viewer, 1);
- }
-
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
-
- g_free(filename);
g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
}
}
void
-rstto_navigator_last (RsttoNavigator *navigator)
+rstto_navigator_jump_last (RsttoNavigator *navigator)
{
navigator->file_iter = g_list_last(navigator->file_list);
if(navigator->file_iter)
{
- ThunarVfsInfo *info = rstto_navigator_entry_get_info(((RsttoNavigatorEntry *)navigator->file_iter->data));
- gchar *filename = thunar_vfs_path_dup_string(info->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- RsttoNavigatorEntry *entry = navigator->file_iter->data;
- GdkPixbuf *new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- {
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
- rstto_picture_viewer_set_scale(navigator->viewer, 1);
- }
-
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
-
- g_free(filename);
g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
}
}
@@ -538,63 +238,49 @@
}
void
+rstto_navigator_add (RsttoNavigator *navigator, RsttoNavigatorEntry *entry)
+{
+ navigator->file_list = g_list_insert_sorted(navigator->file_list, entry, navigator->compare_func);
+}
+
+void
rstto_navigator_set_file (RsttoNavigator *navigator, gint n)
{
- GdkPixbuf *new_pixbuf;
navigator->file_iter = g_list_nth(navigator->file_list, n);
if(navigator->file_iter)
{
- ThunarVfsInfo *info = rstto_navigator_entry_get_info(((RsttoNavigatorEntry *)navigator->file_iter->data));
- gchar *filename = thunar_vfs_path_dup_string(info->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- RsttoNavigatorEntry *entry = navigator->file_iter->data;
- if (entry->rotation)
- {
- new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- {
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
- rstto_picture_viewer_set_scale(navigator->viewer, 1);
- }
+ g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
+ }
+}
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
+static gboolean
+cb_rstto_navigator_running(RsttoNavigator *navigator)
+{
+ if(navigator->running)
+ {
+ rstto_navigator_jump_forward(navigator);
+ }
+ else
+ navigator->id = 0;
+ return navigator->running;
+}
- g_free(filename);
- g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
+void
+rstto_navigator_flip_entry(RsttoNavigator *navigator, RsttoNavigatorEntry *entry, gboolean horizontal)
+{
+ if (horizontal)
+ {
+ entry->h_flipped = !entry->h_flipped;
}
+ else
+ {
+ entry->v_flipped = !entry->v_flipped;
+ }
}
+
RsttoNavigatorEntry *
-_rstto_navigator_entry_new (ThunarVfsInfo *info)
+rstto_navigator_entry_new (ThunarVfsInfo *info)
{
RsttoNavigatorEntry *entry = NULL;
gchar *filename = thunar_vfs_path_dup_string(info->path);
@@ -631,130 +317,9 @@
}
void
-rstto_navigator_flip_entry(RsttoNavigator *navigator, RsttoNavigatorEntry *entry, gboolean horizontal)
+rstto_navigator_entry_free(RsttoNavigatorEntry *nav_entry)
{
- if (horizontal)
- {
- entry->h_flipped = !entry->h_flipped;
- }
- else
- {
- entry->v_flipped = !entry->v_flipped;
- }
-
- if(entry == navigator->file_iter->data)
- {
- ThunarVfsInfo *info = rstto_navigator_entry_get_info(((RsttoNavigatorEntry *)navigator->file_iter->data));
- gchar *filename = thunar_vfs_path_dup_string(info->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- GdkPixbuf *new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- {
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
- rstto_picture_viewer_set_scale(navigator->viewer, 1);
- }
-
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
-
- g_free(filename);
- g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
- }
-}
-
-void
-rstto_navigator_set_entry_rotation (RsttoNavigator *navigator, RsttoNavigatorEntry *entry, GdkPixbufRotation rotation)
-{
- entry->rotation = rotation;
- if(entry == navigator->file_iter->data)
- {
- ThunarVfsInfo *info = rstto_navigator_entry_get_info(((RsttoNavigatorEntry *)navigator->file_iter->data));
- gchar *filename = thunar_vfs_path_dup_string(info->path);
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename , NULL);
- if(pixbuf)
- {
- GdkPixbuf *new_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, entry->rotation);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- if(entry->v_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, FALSE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- if(entry->h_flipped)
- {
- new_pixbuf = gdk_pixbuf_flip(pixbuf, TRUE);
- if(new_pixbuf)
- {
- g_object_unref(pixbuf);
- pixbuf = new_pixbuf;
- }
- }
- }
- if(!pixbuf)
- {
- pixbuf = gtk_icon_theme_load_icon(navigator->icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 0, NULL);
- rstto_picture_viewer_set_scale(navigator->viewer, 1);
- }
-
- rstto_picture_viewer_set_pixbuf(navigator->viewer, pixbuf);
- if(pixbuf)
- gdk_pixbuf_unref(pixbuf);
-
- g_free(filename);
- g_signal_emit(G_OBJECT(navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_FILE_CHANGED], 0, NULL);
- }
-}
-
-static void
-_rstto_navigator_entry_free(RsttoNavigatorEntry *nav_entry)
-{
thunar_vfs_info_unref(nav_entry->info);
g_free(nav_entry);
}
-static gboolean
-cb_rstto_navigator_running(RsttoNavigator *navigator)
-{
- if(navigator->running)
- {
- rstto_navigator_forward(navigator);
- }
- else
- navigator->id = 0;
- return navigator->running;
-}
Modified: ristretto/trunk/src/navigator.h
===================================================================
--- ristretto/trunk/src/navigator.h 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/src/navigator.h 2007-08-19 12:39:15 UTC (rev 3005)
@@ -53,6 +53,7 @@
GList *file_iter;
gboolean running;
gint id;
+ GCompareFunc compare_func;
};
typedef struct _RsttoNavigatorClass RsttoNavigatorClass;
@@ -66,13 +67,10 @@
RsttoNavigator *
rstto_navigator_new (RsttoPictureViewer *viewer);
-void rstto_navigator_set_path (RsttoNavigator *navigator,
- ThunarVfsPath *path,
- gboolean index_path);
-void rstto_navigator_first (RsttoNavigator *navigator);
-void rstto_navigator_forward (RsttoNavigator *navigator);
-void rstto_navigator_back (RsttoNavigator *navigator);
-void rstto_navigator_last (RsttoNavigator *navigator);
+void rstto_navigator_jump_first (RsttoNavigator *navigator);
+void rstto_navigator_jump_forward (RsttoNavigator *navigator);
+void rstto_navigator_jump_back (RsttoNavigator *navigator);
+void rstto_navigator_jump_last (RsttoNavigator *navigator);
void rstto_navigator_set_running (RsttoNavigator *navigator,
gboolean running);
@@ -82,22 +80,25 @@
gint
rstto_navigator_get_position(RsttoNavigator *navigator);
+void
+rstto_navigator_add (RsttoNavigator *navigator, RsttoNavigatorEntry *entry);
gint
rstto_navigator_get_n_files (RsttoNavigator *navigator);
RsttoNavigatorEntry *
rstto_navigator_get_nth_file (RsttoNavigator *navigator, gint n);
-
void
rstto_navigator_set_file (RsttoNavigator *navigator, gint n);
+void
+rstto_navigator_set_entry_rotation (RsttoNavigator *navigator, RsttoNavigatorEntry *entry, GdkPixbufRotation rotation);
-
+RsttoNavigatorEntry *
+rstto_navigator_entry_new (ThunarVfsInfo *info);
+void
+rstto_navigator_entry_free(RsttoNavigatorEntry *nav_entry);
GdkPixbuf *
rstto_navigator_entry_get_thumbnail (RsttoNavigatorEntry *entry);
ThunarVfsInfo *
rstto_navigator_entry_get_info (RsttoNavigatorEntry *entry);
-
-void
-rstto_navigator_set_entry_rotation (RsttoNavigator *navigator, RsttoNavigatorEntry *entry, GdkPixbufRotation rotation);
GdkPixbufRotation
rstto_navigator_entry_get_rotation (RsttoNavigatorEntry *entry);
gboolean
Modified: ristretto/trunk/src/thumbnail_viewer.c
===================================================================
--- ristretto/trunk/src/thumbnail_viewer.c 2007-08-18 06:33:27 UTC (rev 3004)
+++ ristretto/trunk/src/thumbnail_viewer.c 2007-08-19 12:39:15 UTC (rev 3005)
@@ -74,7 +74,6 @@
rstto_thumbnail_viewer_paint(RsttoThumbnailViewer *viewer);
static GtkWidgetClass *parent_class = NULL;
-static gint cache_size = 10;
static void
cb_rstto_thumbnailer_nav_file_changed(RsttoNavigator *nav, RsttoThumbnailViewer *viewer);
@@ -261,6 +260,8 @@
{
case GTK_ORIENTATION_HORIZONTAL:
end = widget->allocation.width / viewer->priv->dimension + begin;
+ if (end > rstto_navigator_get_n_files(viewer->priv->navigator))
+ end = rstto_navigator_get_n_files(viewer->priv->navigator);
if (widget->allocation.width > (end - begin) * viewer->priv->dimension)
{
gdk_window_clear_area(widget->window,
@@ -272,6 +273,8 @@
break;
case GTK_ORIENTATION_VERTICAL:
end = widget->allocation.height / viewer->priv->dimension + begin;
+ if (end > rstto_navigator_get_n_files(viewer->priv->navigator))
+ end = rstto_navigator_get_n_files(viewer->priv->navigator);
if (widget->allocation.height > (end - begin) * viewer->priv->dimension)
{
gdk_window_clear_area(widget->window,
@@ -285,11 +288,11 @@
GdkPixmap *pixmap = NULL;
/* Cleanup_cache */
- for (i = viewer->priv->cache->begin; i < begin-cache_size; i++)
+ for (i = viewer->priv->cache->begin; i < begin; i++)
{
rstto_thumbnail_viewer_cache_remove(viewer->priv->cache, i);
}
- for (i = end + cache_size; i < viewer->priv->cache->end; i++)
+ for (i = end; i < viewer->priv->cache->end; i++)
{
rstto_thumbnail_viewer_cache_remove(viewer->priv->cache, i);
}
@@ -579,35 +582,52 @@
cache->end = nr;
cache->pixmaps = g_slist_prepend(cache->pixmaps, pixbuf);
+ return TRUE;
}
else
{
- /* This is the hard part */
- cache->pixmaps = g_slist_insert(cache->pixmaps, pixbuf, nr - cache->begin);
- if (nr < cache->begin)
+ if (nr == cache->begin-1)
+ {
+ cache->pixmaps = g_slist_prepend(cache->pixmaps, pixbuf);
cache->begin--;
- else
+ return TRUE;
+ }
+ if (nr == cache->end+1)
+ {
+ cache->pixmaps = g_slist_append(cache->pixmaps, pixbuf);
cache->end++;
+ return TRUE;
+ }
}
- return TRUE;
+ g_print("aargh: %d\n", nr);
+ return FALSE;
}
static gboolean
rstto_thumbnail_viewer_cache_remove (RsttoThumbnailViewerCache *cache, gint nr)
{
- if ((nr == cache->begin) || (nr == cache->end))
+ g_return_val_if_fail(nr >= 0, FALSE);
+ if (nr == cache->begin)
{
- GdkPixbuf *pixbuf = g_slist_nth_data(cache->pixmaps, nr - cache->begin);
- if (pixbuf)
+ g_object_unref(cache->pixmaps->data);
+ cache->pixmaps = g_slist_delete_link(cache->pixmaps, cache->pixmaps);
+ cache->begin++;
+ }
+ else
+ {
+ if (nr == cache->end)
{
- g_object_unref(pixbuf);
- cache->pixmaps = g_slist_remove(cache->pixmaps, pixbuf);
- if (nr == cache->begin)
- cache->begin++;
- else
- cache->end--;
+ GSList *element = g_slist_last(cache->pixmaps);
+ g_object_unref(cache->pixmaps->data);
+ cache->pixmaps = g_slist_delete_link(cache->pixmaps, element);
+ cache->end--;
}
}
+ if (!g_slist_length(cache->pixmaps))
+ {
+ cache->begin = -1;
+ cache->end = -1;
+ }
return TRUE;
}
More information about the Goodies-commits
mailing list